boobot: irc 5.0+ compatibility

It should still work with older versions
This commit is contained in:
Laurent Bachelier 2013-04-13 23:14:57 +02:00
commit 58a37c3bfb

View file

@ -105,7 +105,11 @@ class TestBot(SingleServerIRCBot):
self.connection.privmsg(self.channel, msg)
def on_pubmsg(self, c, event):
text = ' '.join(event.arguments())
# irclib 5.0 compatibility
if callable(event.arguments):
text = ' '.join(event.arguments())
else:
text = ' '.join(event.arguments)
for m in re.findall('([\w\d_\-]+@\w+)', text):
id, backend_name = m.split('@', 1)
if backend_name in self.weboob.backend_instances: