put MegaHAL module load in __init__, which is now being implemented here
obviously, we need to call Module.__init__ as well, and as a nice side effect, doing all of this lets us not need to do the on_connect nonsense, which was the wrong thing to do anyway
This commit is contained in:
parent
52b740a52c
commit
05f1ce325a
|
@ -27,22 +27,13 @@ from Module import Module
|
|||
class MegaHAL(Module):
|
||||
"""Have an annoying, dumb, and hilarious chatterbot on IRC."""
|
||||
|
||||
def register_handlers(self, server):
|
||||
server.add_global_handler('welcome', self.on_connect)
|
||||
server.add_global_handler('pubmsg', self.on_pubmsg)
|
||||
server.add_global_handler('privmsg', self.on_privmsg)
|
||||
|
||||
def unregister_handlers(self):
|
||||
self.server.remove_global_handler('welcome', self.on_connect)
|
||||
self.server.remove_global_handler('pubmsg', self.on_pubmsg)
|
||||
self.server.remove_global_handler('privmsg', self.on_privmsg)
|
||||
|
||||
def on_connect(self, connection, event):
|
||||
def __init__(self, config, server, modlist):
|
||||
"""
|
||||
Upon connecting, open the MegaHAL brain and get ready for doing actual stuff.
|
||||
Upon creation, open the MegaHAL brain and get ready for doing actual stuff.
|
||||
"""
|
||||
|
||||
self.megahal = megahal.MegaHAL()
|
||||
Module.__init__(self, config, server, modlist)
|
||||
|
||||
def reload(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||
"""Broken. Don't do anything."""
|
||||
|
|
Loading…
Reference in New Issue