Fix AiAe.exe willing to break stuff

This commit is contained in:
Giuseppe Guerra 2017-12-08 13:08:54 +01:00
parent 90cd4634fd
commit 050c1d5fe8
1 changed files with 8 additions and 2 deletions

View File

@ -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."