Skip to content

Commit

Permalink
fix: wrong data tipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Plexi09 committed Jan 4, 2025
1 parent bb4251a commit 79aba9b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 79aba9b

Please sign in to comment.