From 5a4e8b900a645eb2b1cfc14fecd6be6de2906f23 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Thu, 5 Jan 2023 13:27:20 +0530 Subject: [PATCH] Fix cog load, unload and reload commands not showing comamnd output --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 17976a8c..6490dbd1 100644 --- a/main.py +++ b/main.py @@ -323,8 +323,8 @@ async def load(ctx: ApplicationContext, cog: str): if ctx.author.id != 738290097170153472: return await ctx.respond("You can't use this command!", ephemeral=True) try: client.load_extension(f"cogs.{cog}") - await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully loaded."), color=discord.Color.green()) - except: await ctx.respond(embed=discord.Embed(description=f"{cog} cog not found."), color=discord.Color.red()) + await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully loaded.", color=discord.Color.green())) + except Exception as e: await ctx.respond(embed=discord.Embed(description=f"{cog} failed to load: {e}", color=discord.Color.red())) @cogs.command( name="disable", @@ -335,7 +335,7 @@ async def disable(ctx: ApplicationContext, cog: str): if ctx.author.id != 738290097170153472: return await ctx.respond("You can't use this command!", ephemeral=True) try: client.unload_extension(f"cogs.{cog}") - await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully disabled."), color=discord.Color.green()) + await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully disabled.", color=discord.Color.green())) except: await ctx.respond(embed=discord.Embed(description=f"{cog} cog not found."), color=discord.Color.red()) @cogs.command( @@ -347,8 +347,8 @@ async def reload(ctx: ApplicationContext, cog: str): if ctx.author.id != 738290097170153472: return await ctx.respond("You can't use this command!", ephemeral=True) try: client.reload_extension(f"cogs.{cog}") - await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully reloaded."), color=discord.Color.green()) - except: await ctx.respond(embed=discord.Embed(description=f"{cog} cog not found."), color=discord.Color.red()) + await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully reloaded.", color=discord.Color.green())) + except: await ctx.respond(embed=discord.Embed(description=f"{cog} cog not found.", color=discord.Color.red())) # AFK System Commands afk_system = client.create_group("afk", "Commands for interacting with the built-in AFK system.")