From 8d1697f735e29628cf18f5896718b96301cb2d04 Mon Sep 17 00:00:00 2001 From: Alex Parella Date: Sun, 14 Sep 2014 22:08:58 -0700 Subject: [PATCH] Update newcomer list when a newcomer changes name before being greeted --- bot.py | 6 ++++++ nicks.csv | 2 ++ 2 files changed, 8 insertions(+) diff --git a/bot.py b/bot.py index e31abb8..0637c71 100644 --- a/bot.py +++ b/bot.py @@ -130,6 +130,12 @@ def message_response(bot, ircmsg, actor, ircsock): if ircmsg.find("JOIN " + channel) != -1 and actor != botnick: if actor.replace("_", "") not in bot.known_nicks and (i.nick for i in bot.newcomers): # And they're new NewComer(actor, bot) + + # if someone changes their nick while still in newcomers update that nick + if ircmsg.find("NICK :") != -1 and actor != botnick: + for i in bot.newcomers: # if that person was in the newlist + if i.nick == actor: + i.nick = ircmsg.split(":")[2] # update to new nick # If someone parts or quits the #channel... if ircmsg.find("PART " + channel) != -1 or ircmsg.find("QUIT") != -1: diff --git a/nicks.csv b/nicks.csv index 08b6b5b..0e56c9e 100644 --- a/nicks.csv +++ b/nicks.csv @@ -71,3 +71,5 @@ gitcommits sassyapril MaraJade achock +aaparella +abcqfiojqw