From 79aba9b10b22f4e139edf33d9ccd00fafee9dcf2 Mon Sep 17 00:00:00 2001 From: Plexi09 Date: Sat, 4 Jan 2025 20:53:26 +0100 Subject: [PATCH] fix: wrong data tipe --- bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 3fe373f..5e23e25 100644 --- a/bot.py +++ b/bot.py @@ -215,9 +215,10 @@ async def leaderboard_global(interaction: discord.Interaction): for guild_stats in data['stats'].values(): for user_id, stats in guild_stats.items(): - if user_id not in global_stats: - global_stats[user_id] = 0 - global_stats[user_id] += stats['count_69'] + if isinstance(stats, dict) and 'count_69' in stats: + if user_id not in global_stats: + global_stats[user_id] = 0 + global_stats[user_id] += stats['count_69'] leaderboard = sorted(global_stats.items(), key=lambda x: x[1], reverse=True) embed = discord.Embed(title="Classement global des utilisateurs avec le plus de 69", color=discord.Color.gold())