From dd680bcf72a85ce64f4581c19f6ad82289eb92e9 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Sep 2011 18:14:40 +0200 Subject: //Reaktor/IRC nickname: increment suffix Append or increment the bot's nickname suffix integer in order to connect to servers that already have users with the same nickname. --- IRC/asybot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IRC/asybot.py b/IRC/asybot.py index 6e9df1d..6a37daf 100755 --- a/IRC/asybot.py +++ b/IRC/asybot.py @@ -69,6 +69,14 @@ class asybot(asychat): elif command == 'PRIVMSG': self.on_privmsg(prefix, command, params, rest) + 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() + # reset alarm alarm(self.alarm_timeout) -- cgit v1.2.3