Fix encodage
This commit is contained in:
parent
71a1222e5e
commit
e88d6245d0
1 changed files with 15 additions and 15 deletions
|
|
@ -3,7 +3,7 @@ import discord
|
|||
from discord.ext import commands
|
||||
from config import AUTHORIZED_CHANNEL_ID, BOSS_CONFIG
|
||||
from utils.helpers import format_damage_display, format_date_only
|
||||
from utils.pb_handler import db_manager # Assurez-vous que db_manager est initialisé correctement
|
||||
from utils.pb_handler import db_manager # Assurez-vous que db_manager est initialisé correctement
|
||||
|
||||
class MyStats(commands.Cog):
|
||||
"""Cog pour afficher tous les PB d'un utilisateur"""
|
||||
|
|
@ -13,7 +13,7 @@ class MyStats(commands.Cog):
|
|||
|
||||
@commands.command(name="mystats")
|
||||
async def mystats(self, ctx, target_user: str = None):
|
||||
"""Affiche tous les PB d'un utilisateur avec les nouvelles difficultés"""
|
||||
"""Affiche tous les PB d'un utilisateur avec les nouvelles difficultés"""
|
||||
if ctx.channel.id != AUTHORIZED_CHANNEL_ID:
|
||||
return
|
||||
|
||||
|
|
@ -22,15 +22,15 @@ class MyStats(commands.Cog):
|
|||
user_data = db_manager.get_user_all_pbs(username)
|
||||
|
||||
if not user_data:
|
||||
await ctx.send(f"⌠No data found for **{username}**.")
|
||||
await ctx.send(f"❌ No data found for **{username}**.")
|
||||
return
|
||||
|
||||
embed = discord.Embed(
|
||||
title=f"📊 {ctx.author.display_name}'s Complete Stats",
|
||||
title=f"📊 {ctx.author.display_name}'s Complete Stats",
|
||||
color=0x00bfff
|
||||
)
|
||||
|
||||
# Hydra - toutes les difficultés
|
||||
# Hydra - toutes les difficultés
|
||||
hydra_stats = []
|
||||
for difficulty in BOSS_CONFIG['hydra']['difficulties']:
|
||||
pb_key = f'pb_hydra_{difficulty}'
|
||||
|
|
@ -39,13 +39,13 @@ class MyStats(commands.Cog):
|
|||
if pb_key in user_data and user_data[pb_key] > 0:
|
||||
pb_value = user_data[pb_key]
|
||||
pb_date = user_data.get(date_key)
|
||||
date_text = f" • {format_date_only(pb_date)}" if pb_date else ""
|
||||
date_text = f" • {format_date_only(pb_date)}" if pb_date else ""
|
||||
hydra_stats.append(f"**{difficulty.title()}:** {format_damage_display(pb_value)}{date_text}")
|
||||
|
||||
hydra_text = "\n".join(hydra_stats) if hydra_stats else "No records"
|
||||
embed.add_field(name="ðŸ—¡ï¸ Hydra PBs", value=hydra_text, inline=False)
|
||||
embed.add_field(name="⚔️ Hydra PBs", value=hydra_text, inline=False)
|
||||
|
||||
# Chimera - toutes les difficultés
|
||||
# Chimera - toutes les difficultés
|
||||
chimera_stats = []
|
||||
for difficulty in BOSS_CONFIG['chimera']['difficulties']:
|
||||
pb_key = f'pb_chimera_{difficulty}'
|
||||
|
|
@ -54,12 +54,12 @@ class MyStats(commands.Cog):
|
|||
if pb_key in user_data and user_data[pb_key] > 0:
|
||||
pb_value = user_data[pb_key]
|
||||
pb_date = user_data.get(date_key)
|
||||
date_text = f" • {format_date_only(pb_date)}" if pb_date else ""
|
||||
date_text = f" • {format_date_only(pb_date)}" if pb_date else ""
|
||||
display_name = "Ultra Nightmare" if difficulty == "ultra" else difficulty.title()
|
||||
chimera_stats.append(f"**{display_name}:** {format_damage_display(pb_value)}{date_text}")
|
||||
|
||||
chimera_text = "\n".join(chimera_stats) if chimera_stats else "No records"
|
||||
embed.add_field(name="ðŸ›¡ï¸ Chimera PBs", value=chimera_text, inline=False)
|
||||
embed.add_field(name="🛡️ Chimera PBs", value=chimera_text, inline=False)
|
||||
|
||||
# CvC
|
||||
cvc_pb = user_data.get('pb_cvc', 0)
|
||||
|
|
@ -68,19 +68,19 @@ class MyStats(commands.Cog):
|
|||
if cvc_pb > 0 and cvc_date:
|
||||
formatted_date = format_date_only(cvc_date)
|
||||
if formatted_date:
|
||||
cvc_text += f" • {formatted_date}"
|
||||
embed.add_field(name="âš”ï¸ CvC PB", value=cvc_text, inline=False)
|
||||
cvc_text += f" • {formatted_date}"
|
||||
embed.add_field(name="🗡️ CvC PB", value=cvc_text, inline=False)
|
||||
|
||||
# Total combiné
|
||||
# Total combiné
|
||||
total_damage = sum(user_data.get(f'pb_hydra_{d}', 0) for d in BOSS_CONFIG['hydra']['difficulties'])
|
||||
total_damage += sum(user_data.get(f'pb_chimera_{d}', 0) for d in BOSS_CONFIG['chimera']['difficulties'])
|
||||
total_damage += user_data.get('pb_cvc', 0)
|
||||
embed.add_field(name="💯 Total Combined Damage", value=f"**{format_damage_display(total_damage)}**", inline=False)
|
||||
embed.add_field(name="💯 Total Combined Damage", value=f"**{format_damage_display(total_damage)}**", inline=False)
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
except Exception as e:
|
||||
await ctx.send(f"⌠Error: {e}")
|
||||
await ctx.send(f"❌ Error: {e}")
|
||||
|
||||
async def setup(bot):
|
||||
await bot.add_cog(MyStats(bot))
|
||||
|
|
|
|||
Loading…
Reference in a new issue