From e58f0da006122c3e8909ad4a4727c4b88207e40b Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 10 May 2016 03:47:41 +0200 Subject: Monitor the NICK messages, to detect if we changed our NICK --- alternativ_nick.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/alternativ_nick.py b/alternativ_nick.py index e7d6a26..61dc43d 100644 --- a/alternativ_nick.py +++ b/alternativ_nick.py @@ -70,6 +70,15 @@ nickname_in_use.event = '433' nickname_in_use.thread = False +def nick_change(phenny, input): + # Monitor the NICK changes to detect, if we change our nick. + if input.nick == phenny.nick: + _set_nick(phenny, input) + print >> sys.stderr, ("Changed nick to: %s" % phenny.nick) +nick_change.rule = r'(.*)' +nick_change.event = 'NICK' + + def connected(phenny, input): # The '001' event is the first message after establishing the connection # and providing a valid NICK and USER. If we used an alternativ nick, we -- cgit v1.2.3-1-g7c22