Additional checks on keyword matches to prevent errors when no part message is specified

This commit is contained in:
Mark Veidemanis 2018-03-14 20:20:53 +00:00
parent d168d69732
commit 369ddbe939
2 changed files with 4 additions and 7 deletions

View File

@ -1,7 +0,0 @@
{
"Keywords": [
"example",
"s"
],
"KeywordsExcept": {}
}

View File

@ -35,6 +35,8 @@ def sendMaster(data):
main.connections[i].send(data) main.connections[i].send(data)
def isKeyword(msg): def isKeyword(msg):
if msg == None:
return
message = msg.lower() message = msg.lower()
messageDuplicate = message messageDuplicate = message
toUndo = False toUndo = False
@ -67,6 +69,8 @@ def isKeyword(msg):
return [message, uniqueNum, totalNum] return [message, uniqueNum, totalNum]
def actKeyword(user, channel, message, nickname, actType, name): def actKeyword(user, channel, message, nickname, actType, name):
if message == None:
return
toSend = isKeyword(message) toSend = isKeyword(message)
if name == main.config["Master"][0] and channel == main.config["Master"][1]: if name == main.config["Master"][0] and channel == main.config["Master"][1]:
pass pass