Skip to content

Commit 79aba9b

Browse files
committed
fix: wrong data tipe
1 parent bb4251a commit 79aba9b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ async def leaderboard_global(interaction: discord.Interaction):
215215

216216
for guild_stats in data['stats'].values():
217217
for user_id, stats in guild_stats.items():
218-
if user_id not in global_stats:
219-
global_stats[user_id] = 0
220-
global_stats[user_id] += stats['count_69']
218+
if isinstance(stats, dict) and 'count_69' in stats:
219+
if user_id not in global_stats:
220+
global_stats[user_id] = 0
221+
global_stats[user_id] += stats['count_69']
221222

222223
leaderboard = sorted(global_stats.items(), key=lambda x: x[1], reverse=True)
223224
embed = discord.Embed(title="Classement global des utilisateurs avec le plus de 69", color=discord.Color.gold())

0 commit comments

Comments
 (0)