Don't crash if the part message is null
This commit is contained in:
parent
f34ddab6fc
commit
22bd0d3ac6
17
core/bot.py
17
core/bot.py
|
@ -175,14 +175,15 @@ class IRCBot(IRCClient):
|
|||
castDup["type"] = "self"
|
||||
castDup["name"] = self.name
|
||||
if not cast["target"].lower() == self.nickname.lower(): # modes has been set on us directly
|
||||
self.event(**castDup) # don't tell anyone else
|
||||
self.event(**castDup) # don't tell anyone else
|
||||
if "message" in cast.keys() and not cast["type"] == "query": # Don't highlight queries
|
||||
if self.nickname.lower() in cast["message"].lower():
|
||||
castDup = deepcopy(cast)
|
||||
castDup["mtype"] = cast["type"]
|
||||
castDup["type"] = "highlight"
|
||||
castDup["name"] = self.name
|
||||
self.event(**castDup)
|
||||
if not cast["message"] == None:
|
||||
if self.nickname.lower() in cast["message"].lower():
|
||||
castDup = deepcopy(cast)
|
||||
castDup["mtype"] = cast["type"]
|
||||
castDup["type"] = "highlight"
|
||||
castDup["name"] = self.name
|
||||
self.event(**castDup)
|
||||
|
||||
if not "name" in cast.keys():
|
||||
cast["name"] = self.net
|
||||
|
@ -380,8 +381,8 @@ class IRCBot(IRCClient):
|
|||
if not channel in self.channels:
|
||||
self.channels.append(channel)
|
||||
self.names(channel).addCallback(self.got_names)
|
||||
self.who(channel).addCallback(self.got_who)
|
||||
if main.config["Toggles"]["Who"]:
|
||||
self.who(channel).addCallback(self.got_who)
|
||||
lc = LoopingCall(self.who, channel)
|
||||
self._getWho[channel] = lc
|
||||
intrange = main.config["Tweaks"]["Delays"]["WhoRange"]
|
||||
|
|
Loading…
Reference in New Issue