Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,24 @@ async def load(ctx: ApplicationContext, cog: str):
try:
client.load_extension(f"cogs.{cog}")
await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully loaded.", color=discord.Color.green()))
except Exception as e:
await ctx.respond(
except discord.errors.ExtensionNotFound:
return await ctx.respond(
embed=discord.Embed(
title=f"{cog} failed to load",
description="Cog does not exist.",
color=discord.Color.red()
)
)
except discord.errors.ExtensionAlreadyLoaded:
return await ctx.respond(
embed=discord.Embed(
title=f"{cog} failed to load",
description=f"```{type(e).__name__}: {e}```",
description="Cog does not exist.",
color=discord.Color.red()
)
)


@cogs.command(
name="disable",
description="Disables a cog."
Expand All @@ -228,15 +237,17 @@ async def disable(ctx: ApplicationContext, cog: str):
try:
client.unload_extension(f"cogs.{cog}")
await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully disabled.", color=discord.Color.green()))
except Exception as e:
await ctx.respond(
except discord.errors.ExtensionNotFound:
return await ctx.respond(
embed=discord.Embed(
title=f"{cog} failed to disable",
description=f"```{type(e).__name__}: {e}```",
description="Cog does not exist.",
color=discord.Color.red()
)
)



@cogs.command(
name="reload",
description="Reloads a cog."
Expand All @@ -247,15 +258,16 @@ async def reload(ctx: ApplicationContext, cog: str):
try:
client.reload_extension(f"cogs.{cog}")
await ctx.respond(embed=discord.Embed(description=f"{cog} cog successfully reloaded.", color=discord.Color.green()))
except Exception as e:
await ctx.respond(
except discord.errors.ExtensionNotFound:
return await ctx.respond(
embed=discord.Embed(
title=f"{cog} failed to reload",
description=f"```{type(e).__name__}: {e}```",
description="Cog does not exist.",
color=discord.Color.red()
)
)


# Initialization
active_cogs = [
"economy",
Expand Down