From f84a05aec5471f1badb5aa8f6e45a76b9ab4ad20 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 15 Jul 2018 23:54:27 +0100 Subject: [PATCH] check if a channel is in attempted_join before attempting rejoin --- IRCLineHandler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IRCLineHandler.py b/IRCLineHandler.py index e5299ba1..de0fb134 100644 --- a/IRCLineHandler.py +++ b/IRCLineHandler.py @@ -1,5 +1,4 @@ import re, threading - import Utils RE_PREFIXES = re.compile(r"\bPREFIX=\((\w+)\)(\W+)(?:\b|$)") @@ -336,9 +335,10 @@ def handle_433(data): @handler(description="we need a registered nickname for this channel", default_event=True) def handle_477(data): - bot.add_timer("rejoin", 5, channel_name=data.args[1], - key=data.server.attempted_join[data.args[1].lower()], - server_id=data.server.id) + if data.args[1].lower() in data.server.attempted_join: + bot.add_timer("rejoin", 5, channel_name=data.args[1], + key=data.server.attempted_join[data.args[1].lower()], + server_id=data.server.id) @handler(description="someone's been kicked from a channel") def handle_KICK(data):