diff options
| author | lassulus <lassulus@googlemail.com> | 2014-01-22 03:02:55 +0100 | 
|---|---|---|
| committer | lassulus <lassulus@googlemail.com> | 2014-01-22 03:02:55 +0100 | 
| commit | 3ca518888e9e72f80984dccb8afb1bde31a547dd (patch) | |
| tree | 3c118e639e2a3c2d63ab911516accc49074912eb | |
| parent | 224433f4b7bffd545f5b74c6a041262487d0f335 (diff) | |
news/ircasy: handle kick correctly
| -rw-r--r-- | Reaktor/IRC/ircasy.py | 13 | ||||
| -rw-r--r-- | news/newsbot.py | 2 | 
2 files changed, 11 insertions, 4 deletions
| diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py index 7821305f..e32179bb 100644 --- a/Reaktor/IRC/ircasy.py +++ b/Reaktor/IRC/ircasy.py @@ -107,6 +107,9 @@ class asybot(asychat):      elif command == 'INVITE':        self.on_invite(prefix, command, params, rest) +    elif command == 'KICK': +      self.on_kick(prefix, command, params, rest) +      elif command == '433':        # ERR_NICKNAMEINUSE, retry with another name        _, nickname, int, _ = split('^.*[^0-9]([0-9]+)$', self.nickname) \ @@ -158,11 +161,15 @@ class asybot(asychat):    def ME(self, target, text):      self.PRIVMSG(target, ('ACTION ' + text + '')) -  def on_privmsg(self, prefix, command, params, rest): -    pass -    def on_welcome(self, prefix, command, params, rest):      self.push('JOIN %s' % ','.join(self.channels)) +  def on_kick(self, prefix, command, params, rest): +    for chan in params: +      self.channels.remove(chan) + +  def on_privmsg(self, prefix, command, params, rest): +    pass +    def on_invite(self, prefix, command, params, rest):      pass diff --git a/news/newsbot.py b/news/newsbot.py index 54a2e7d2..f1ab9ce5 100644 --- a/news/newsbot.py +++ b/news/newsbot.py @@ -231,7 +231,7 @@ F.close()  for line in lines:      line = line.strip('\n')      linear = line.split('|') -    bot = RssBot(linear[1], linear[0], init_channels + linear[2].split(), url_shortener=url_shortener) +    bot = RssBot(linear[1], linear[0], linear[2].split(), url_shortener=url_shortener)      bot.start_rss()      bots[linear[0]] = bot | 
