Skip to content

Commit

Permalink
Fixed a bug in the client and in the bot. Both were preventing custom…
Browse files Browse the repository at this point in the history
… listeners in their own special ways.
  • Loading branch information
Evan Fosmark committed Dec 19, 2010
1 parent 0302f92 commit c5fda2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ircutils/bot.py
Expand Up @@ -36,8 +36,8 @@ def register_listener(self, event_name, listener):
"""
self.events.register_listener(event_name, listener)
handler_name = "on_{0}".format(event_name)
if hasattr(self, event_name):
handler = getattr(self, event_name).__func__
if hasattr(self, handler_name):
handler = getattr(self, handler_name).__func__
self.events[handler_name].add_handler(handler)


Expand Down
2 changes: 1 addition & 1 deletion ircutils/client.py
Expand Up @@ -74,7 +74,7 @@ def _register_default_listeners(self):

# Custom listeners
for name in self.custom_listeners:
self.events.register_listener(name, self.custom_listeners[name]())
self.events.register_listener(name, self.custom_listeners[name])


def _add_built_in_handlers(self):
Expand Down

0 comments on commit c5fda2d

Please sign in to comment.