Adam Jack wrote:
> I've been tinkering with an IRC plug-in for Gump3 that allows it to interact
> with an IRC channel.
Whoah! Cool! Is this up and working on any of our servers atm? Can we
fix up a cronjob somewhere to enable this?
(...)
> Let me know your thoughts on this.
I like.
Have only looked at the code real briefly. Looks nice. One thing I
noticed...
# What is the request?
+ if cmd == 'version':
+ c.notice(peer_nick,'%s:%s' % (GUMPBOT_NAME, GUMPBOT_VERSION))
+ elif cmd =='help':
+ c.notice(peer_nick,'help,disconnect,die,stats,dcc,version')
+ elif cmd == "disconnect":
+ self.disconnect()
+ elif cmd == "die":
+ self.die()
+ elif cmd == "stats":
...doesn't scale if we want to do a whole lot of this (which I'm not too
sure of). The next step up would be some kind of a table, probably...
# pseudocode which probably won't compile
CMDS = {'version': handle_version_cmd,
'help': handle_help_cmd
# ...
}
# ...
self.peer_nick = nm_to_n(e.source())
if CMDS.has_key(cmd):
command_function = CMDS.get(cmd)
command_function(bot=self)
else:
self.connection.notice(self.peer_nick, "Not understood: " + cmd)
If we don't want to flexibilize, it's great to see how little code we
need to make this work. Maybe we could have even less code on the
push-messages side of things by having logging configured to go to a
channel in some way...no idea if functionality exists for that. But
that's basically design-ahead-of-need, for now this is nice.
The other top-of-head idea is that its nice to have a "persistent" bot,
e.g. one that we can actually tell to fire up a gump run (or stop one,
or list active ones). That would probably require an out-of-process
server and some kind of remote procedure calls??
(...)
The final obvious thought is it will take time to figure out the
interactions and/or notifications that we would want on IRC, but it
would be nice to note how to do it and how easy it is to add commands.
cheers & gnight/morning,
LSD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]