From d2611ca61528e9425bd36468b01452435372a04b Mon Sep 17 00:00:00 2001 From: franzo Date: Sat, 8 Oct 2022 14:10:40 +0200 Subject: [PATCH] fix: adding a non-existing game to the .last command output --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 7eb5d2d..9e12452 100755 --- a/bot.py +++ b/bot.py @@ -41,14 +41,14 @@ class Server(BaseServer): else: game = " ".join(line.params[1].split(" ")[1:]).lower() ping = "" - user = line.source.split('!')[0] - global lastPlayed - lastPlayed = game + user = line.source.split('!')[0] if game not in match_players[self.name + '-' + chan]: await self.send(build("PRIVMSG", [chan, "ERROR: no players in "+ game])) else: matches = match_players[self.name + '-' + chan][game] others = list(set(matches) - set([user])) # don't ping the user who .matched + global lastPlayed + lastPlayed = game if len(others) > 0: for player in others: