MegaHAL: do add_global_handler in the right place, actually do remove_global_handler
This commit is contained in:
parent
36fcbde267
commit
07be2f3a85
|
@ -37,10 +37,17 @@ class MegaHAL(Module):
|
|||
|
||||
Module.__init__(self, irc, config, server)
|
||||
|
||||
mh_python.initbrain()
|
||||
|
||||
def register_handlers(self, server):
|
||||
"""Handle pubmsg/privmsg, so we can learn only from IRC events."""
|
||||
|
||||
self.server.add_global_handler('pubmsg', self.learn_from_irc_event)
|
||||
self.server.add_global_handler('privmsg', self.learn_from_irc_event)
|
||||
|
||||
mh_python.initbrain()
|
||||
def unregister_handlers(self):
|
||||
self.server.remove_global_handler('pubmsg', self.learn_from_irc_event)
|
||||
self.server.remove_global_handler('privmsg', self.learn_from_irc_event)
|
||||
|
||||
def save(self):
|
||||
"""Sync the megahal brain."""
|
||||
|
|
Loading…
Reference in New Issue