From 244b11db7d6fdbbaf58253bda4d5b39b595ffcb9 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Wed, 24 Dec 2014 10:26:59 +0000 Subject: [PATCH] Handle QUIT (quits all channels) Also fix part log wording --- tipbot.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tipbot.py b/tipbot.py index b45349b..08e920b 100644 --- a/tipbot.py +++ b/tipbot.py @@ -954,13 +954,24 @@ while True: elif action == 'PART': nick = GetNick(who) - log_info('%s joined the channel' % nick) + log_info('%s left the channel' % nick) if not nick in userstable[chan]: - log_warn('%s parted, but was not in %s' % (nick, chan)) + log_warn('%s left, but was not in %s' % (nick, chan)) else: userstable[chan].remove(nick) log_log("New list of users in %s: %s" % (chan, str(userstable[chan]))) + elif action == 'QUIT': + nick = GetNick(who) + log_info('%s quit' % nick) + removed_list = "" + for chan in userstable: + log_log("Checking in %s" % chan) + if nick in userstable[chan]: + removed_list = removed_list + " " + chan + userstable[chan].remove(nick) + log_log("New list of users in %s: %s" % (chan, str(userstable[chan]))) + elif action == 'NICK': nick = GetNick(who) new_nick = text