From 050c1d5fe8c48903170691ffe22ea050f84135df Mon Sep 17 00:00:00 2001 From: Giuseppe Guerra Date: Fri, 8 Dec 2017 13:08:54 +0100 Subject: [PATCH] Fix AiAe.exe willing to break stuff --- constants/fokabotCommands.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/constants/fokabotCommands.py b/constants/fokabotCommands.py index fc6c5a1..4228db2 100644 --- a/constants/fokabotCommands.py +++ b/constants/fokabotCommands.py @@ -81,14 +81,20 @@ def roll(fro, chan, message): # return random.choice(["yes", "no", "maybe"]) def alert(fro, chan, message): - glob.streams.broadcast("main", serverPackets.notification(' '.join(message[:]))) + msg = ' '.join(message[:]) + if not msg.strip(): + return False + glob.streams.broadcast("main", serverPackets.notification(msg)) return False def alertUser(fro, chan, message): target = message[0].lower() targetToken = glob.tokens.getTokenFromUsername(userUtils.safeUsername(target), safe=True) if targetToken is not None: - targetToken.enqueue(serverPackets.notification(' '.join(message[1:]))) + msg = ' '.join(message[1:]) + if not msg.strip(): + return False + targetToken.enqueue(serverPackets.notification(msg)) return False else: return "User offline."