Compare commits
2 commits
1a37ec8838
...
e364f354b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e364f354b0 | ||
|
|
314483e4f5 |
4 changed files with 20 additions and 8 deletions
|
|
@ -12,21 +12,33 @@ class MyStats(commands.Cog):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command(name="mystats")
|
@commands.command(name="mystats")
|
||||||
async def mystats(self, ctx, target_user: str = None):
|
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:
|
if ctx.channel.id != AUTHORIZED_CHANNEL_ID:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
username = target_user if target_user else ctx.author.id
|
if target_user:
|
||||||
user_data = db_manager.get_user_all_pbs(username)
|
matches = db_manager.find_user_by_name(target_user)
|
||||||
|
if not matches:
|
||||||
|
await ctx.send(f"❌ No data found for **{target_user}**.")
|
||||||
|
return
|
||||||
|
if len(matches) > 1:
|
||||||
|
await ctx.send(f"⚠️ Multiple users found for **{target_user}**. Please be more specific.")
|
||||||
|
return
|
||||||
|
user_id, display_name = matches[0]
|
||||||
|
else:
|
||||||
|
user_id = ctx.author.id
|
||||||
|
display_name = ctx.author.display_name
|
||||||
|
|
||||||
|
user_data = db_manager.get_user_all_pbs(user_id)
|
||||||
|
|
||||||
if not user_data:
|
if not user_data:
|
||||||
await ctx.send(f"❌ No data found for **{ctx.author.display_name}**.")
|
await ctx.send(f"❌ No data found for **{display_name}**.")
|
||||||
return
|
return
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=f"📊 {ctx.author.display_name}'s Complete Stats",
|
title=f"📊 {display_name}'s Complete Stats",
|
||||||
color=0x00bfff
|
color=0x00bfff
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class Pbchimera(commands.Cog):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command(name="pbchimera")
|
@commands.command(name="pbchimera")
|
||||||
async def pbchimera(self, ctx, arg1: str = None, arg2: str = None):
|
async def pbchimera(self, ctx, arg1: str = None, *, arg2: str = None):
|
||||||
"""Commande !pbchimera avec gestion des difficultés"""
|
"""Commande !pbchimera avec gestion des difficultés"""
|
||||||
await handle_pb_command(ctx, 'chimera', arg1, arg2)
|
await handle_pb_command(ctx, 'chimera', arg1, arg2)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class Pbcvc(commands.Cog):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command(name="pbcvc")
|
@commands.command(name="pbcvc")
|
||||||
async def pbcvc(self, ctx, target_user: str = None):
|
async def pbcvc(self, ctx, *, target_user: str = None):
|
||||||
"""Commande !pbcvc"""
|
"""Commande !pbcvc"""
|
||||||
await handle_pb_command(ctx, 'cvc', target_user)
|
await handle_pb_command(ctx, 'cvc', target_user)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class Pbhydra(commands.Cog):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command(name="pbhydra")
|
@commands.command(name="pbhydra")
|
||||||
async def pbhydra(self, ctx, arg1: str = None, arg2: str = None):
|
async def pbhydra(self, ctx, arg1: str = None, *, arg2: str = None):
|
||||||
"""Commande !pbhydra avec gestion des difficultés"""
|
"""Commande !pbhydra avec gestion des difficultés"""
|
||||||
await handle_pb_command(ctx, 'hydra', arg1, arg2)
|
await handle_pb_command(ctx, 'hydra', arg1, arg2)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue