boobot: irc 5.0+ compatibility
It should still work with older versions
This commit is contained in:
parent
ec4f934fee
commit
58a37c3bfb
1 changed files with 5 additions and 1 deletions
|
|
@ -105,7 +105,11 @@ class TestBot(SingleServerIRCBot):
|
||||||
self.connection.privmsg(self.channel, msg)
|
self.connection.privmsg(self.channel, msg)
|
||||||
|
|
||||||
def on_pubmsg(self, c, event):
|
def on_pubmsg(self, c, event):
|
||||||
|
# irclib 5.0 compatibility
|
||||||
|
if callable(event.arguments):
|
||||||
text = ' '.join(event.arguments())
|
text = ' '.join(event.arguments())
|
||||||
|
else:
|
||||||
|
text = ' '.join(event.arguments)
|
||||||
for m in re.findall('([\w\d_\-]+@\w+)', text):
|
for m in re.findall('([\w\d_\-]+@\w+)', text):
|
||||||
id, backend_name = m.split('@', 1)
|
id, backend_name = m.split('@', 1)
|
||||||
if backend_name in self.weboob.backend_instances:
|
if backend_name in self.weboob.backend_instances:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue