From 3abe6bd10d0bcbf83d1848a291e9e8664c8b99b4 Mon Sep 17 00:00:00 2001 From: SimolZimol <70102430+SimolZimol@users.noreply.github.com> Date: Sun, 26 Oct 2025 01:15:16 +0200 Subject: [PATCH] modified: app.py --- app.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index c6667c5..6818972 100644 --- a/app.py +++ b/app.py @@ -189,6 +189,8 @@ def is_owner(): async def reload_bot(ctx): """Reloads the bot and syncs slash commands (Owner only)""" try: + print(f"🔄 Reload command started by {ctx.author} (ID: {ctx.author.id})") + # Send initial message embed = discord.Embed( title="🔄 Bot Reload", @@ -196,9 +198,12 @@ async def reload_bot(ctx): color=discord.Color.yellow() ) message = await ctx.send(embed=embed) + print("📤 Initial reload message sent") # Sync slash commands + print("🔄 Starting command sync...") synced = await bot.tree.sync() + print(f"✅ Synced {len(synced)} commands successfully") # Update embed with success embed = discord.Embed( @@ -211,11 +216,16 @@ async def reload_bot(ctx): embed.set_footer(text=f"Reloaded by {ctx.author}", icon_url=ctx.author.avatar.url if ctx.author.avatar else None) await message.edit(embed=embed) + print("✅ Reload completed successfully") except Exception as e: + print(f"❌ Reload failed with error: {type(e).__name__}: {e}") + import traceback + traceback.print_exc() + embed = discord.Embed( title="❌ Reload Failed", - description=f"Error during reload: {str(e)}", + description=f"**Error Type:** {type(e).__name__}\n**Error:** {str(e)[:1500]}", color=discord.Color.red() ) await ctx.send(embed=embed) @@ -541,8 +551,16 @@ async def on_command_error(ctx, error): elif isinstance(error, commands.BadArgument): await ctx.send("❌ Invalid argument!") else: - print(f"Unknown error: {error}") - await ctx.send("❌ An unknown error occurred!") + # Log detailed error information + print(f"❌ Unknown error in command '{ctx.command}': {type(error).__name__}: {error}") + import traceback + traceback.print_exc() + + # Send detailed error to user if owner + if ctx.author.id == OWNER_ID: + await ctx.send(f"❌ **Error Details (Owner only):**\n```python\n{type(error).__name__}: {str(error)[:1800]}\n```") + else: + await ctx.send("❌ An unknown error occurred!") async def main(): """Main function to start the bot"""