diff --git a/bot.py b/bot.py index 6b92de5..1de4b96 100755 --- a/bot.py +++ b/bot.py @@ -75,13 +75,17 @@ class Server(BaseServer): elif line.params[1].startswith(".list"): user = line.source.split('!')[0] if len(line.params[1].split(" ")) < 2: - await self.send(build("PRIVMSG", [chan, "list: " + str(list(match_players[self.name + '-' + chan].keys()))])) + games = sorted(match_players[self.name + '-' + chan].keys()) + while len(games): + await self.send(build("PRIVMSG", [chan, "list: " + ', '.join(games[:20])])) + del games[:20] else: game = " ".join(line.params[1].split(" ")[1:]).lower() if game not in match_players[self.name + '-' + chan]: 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(".del"): user = line.source.split('!')[0] if len(line.params[1].split(" ")) < 2: