From 89d5a4f9c39398a17cd5b41657575a4b30454142 Mon Sep 17 00:00:00 2001 From: franzo Date: Thu, 6 Oct 2022 00:06:06 +0200 Subject: [PATCH] add: .last cmd which prints the last game played --- bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 8a4f018..aaa21d1 100755 --- a/bot.py +++ b/bot.py @@ -87,7 +87,10 @@ class Server(BaseServer): update_file(self.name + '-' + chan) await self.send(build("PRIVMSG", [chan, "Added " + user + " to the " + game + " match list."])) - elif line.params[1].startswith(".list"): + elif line.params[1].startswith(".last"): + await self.send(build("PRIVMSG", [chan, "Last game played: " + lastPlayed])) + + elif line.params[1].startswith(".list"): user = line.source.split('!')[0] if len(line.params[1].split(" ")) < 2: games = sorted(match_players[self.name + '-' + chan].keys()) @@ -100,6 +103,7 @@ class Server(BaseServer): await self.send(build("PRIVMSG", [chan, "ERROR: no players in " + game + " list."])) else: await self.send(build("PRIVMSG", [chan, game + " players: " + str(['_' + e for e in match_players[self.name + '-' + chan][game]])])) + elif line.params[1].startswith(".remove"): channel = self.channels[line.params[0].lstrip("@")].name if channel in admins[self.name]: