diff options
author | lassulus <lassulus@googlemail.com> | 2014-02-22 17:08:27 +0100 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2014-02-22 17:08:27 +0100 |
commit | 2ba92b76ead263489683400aa4864bdaa7138872 (patch) | |
tree | e7101754ff2c88da5a809d8d615e3901c577a960 | |
parent | e9366655847cead28e6999a7d24083d010a832b4 (diff) |
reaktor: ircasy abstraction
-rw-r--r-- | IRC/ircasy.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/IRC/ircasy.py b/IRC/ircasy.py index 150498d..fd261ae 100644 --- a/IRC/ircasy.py +++ b/IRC/ircasy.py @@ -112,11 +112,7 @@ class asybot(asychat): elif command == '433': # ERR_NICKNAMEINUSE, retry with another name - _, nickname, int, _ = split('^.*[^0-9]([0-9]+)$', self.nickname) \ - if search('[0-9]$', self.nickname) \ - else ['', self.nickname, 0, ''] - self.nickname = nickname + str(int + 1) - self.handle_connect() + self.on_nickinuse(prefix, command, params, rest) elif command == '376': self.on_welcome(prefix, command, params, rest) @@ -175,3 +171,10 @@ class asybot(asychat): def on_invite(self, prefix, command, params, rest): pass + + def on_nickinuse(self, prefix, command, params, rest): + _, nickname, int, _ = split('^.*[^0-9]([0-9]+)$', self.nickname) \ + if search('[0-9]$', self.nickname) \ + else ['', self.nickname, 0, ''] + self.nickname = nickname + str(int + 1) + self.handle_connect() |