aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-07-15 23:54:27 +0100
committerGravatar jesopo2018-07-15 23:54:27 +0100
commitf84a05aec5471f1badb5aa8f6e45a76b9ab4ad20 (patch)
tree2cd7da53736b4d7b480736f3f9348d2760d3ccc1
parentmove priority constants to root of EventManager namespace (diff)
check if a channel is in attempted_join before attempting rejoin
-rw-r--r--IRCLineHandler.py8
1 files 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):