Skip to content
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
10 changes: 8 additions & 2 deletions techsupport_bot/commands/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ async def load_extension(self, ctx, *, extension_name: str):
ctx (discord.ext.Context): the context object for the message
extension_name (str): the name of the extension
"""
await ctx.bot.load_extension(f"extensions.{extension_name}")
try:
await ctx.bot.load_extension(f"functions.{extension_name}")
except (ModuleNotFoundError, commands.errors.ExtensionNotFound):
await ctx.bot.load_extension(f"commands.{extension_name}")
await auxiliary.send_confirm_embed(
message="I've loaded that extension", channel=ctx.channel
)
Expand All @@ -114,7 +117,10 @@ async def unload_extension(self, ctx, *, extension_name: str):
ctx (discord.ext.Context): the context object for the message
extension_name (str): the name of the extension
"""
await ctx.bot.unload_extension(f"extensions.{extension_name}")
try:
await ctx.bot.unload_extension(f"functions.{extension_name}")
except commands.errors.ExtensionNotLoaded:
await ctx.bot.unload_extension(f"commands.{extension_name}")
await auxiliary.send_confirm_embed(
message="I've unloaded that extension", channel=ctx.channel
)
Expand Down