Skip to content

Commit

Permalink
More compact midnight leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jnalanko committed Feb 2, 2025
1 parent dc7c840 commit ddc13c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@ async def midnight_winners_command(self, ctx):
lines = []
lines.append("**Midnight Winners**")
pairs = [(total_wins[user_id], user_id) for user_id in total_wins]
entries = []
for i, (wins, user_id) in enumerate(sorted(pairs)[::-1]): # In descending order
nick = get_nick(user_id, guild=ctx.guild)
counts = [(trophy, prizes[user_id][trophy]) for trophy in prizes[user_id].keys()] # Pairs (trophy, count)
lines.append("**{}**. **{}**: {}".format(i+1, nick, midnight.format_trophy_counts(counts)))
entries.append("**{}**. **{}**: {}".format(i+1, nick, midnight.format_trophy_counts(counts)))
lines.append(", ".join(entries))
await ctx.respond("\n".join(lines))

async def process_message(self, message):
Expand Down

0 comments on commit ddc13c7

Please sign in to comment.