fix: adding a non-existing game to the .last command output

This commit is contained in:
franzo 2022-10-08 14:10:40 +02:00
parent 19ffa45c38
commit d2611ca615
1 changed files with 3 additions and 3 deletions

6
bot.py
View File

@ -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: