Skip to content

Commit 696bf5f

Browse files
committed
Fixed sorting in /stats global
1 parent 637d2cc commit 696bf5f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,8 @@ async def serverstats(self, interaction: discord.Interaction) -> None:
11931193
)
11941194
for guild_id, users in guild_data.items() if guild_id in guild_ids_bot_is_in
11951195
]
1196-
sorted_server_stats = sorted(server_stats, key=lambda x: (x[3], x[2], x[1]), reverse=True)[:10]
1196+
# Sort by high score, then percent correct, then total counts
1197+
sorted_server_stats = sorted(server_stats, key=lambda x: (x[1], x[3], x[2]), reverse=True)[:10]
11971198
full_text = "\n".join(
11981199
f"**{i+1}. {discord.utils.get(bot.guilds, id=guild_id).name}**Highest count: {highest_count}, total: {total_counts} ({percent_correct}% correct), current: {current_count}"
11991200
for i, (guild_id, highest_count, total_counts, percent_correct, current_count) in enumerate(sorted_server_stats)

0 commit comments

Comments
 (0)