add: .last cmd which prints the last game played
This commit is contained in:
parent
b616edd808
commit
89d5a4f9c3
6
bot.py
6
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]:
|
||||
|
|
Loading…
Reference in New Issue