def load(self, *, cog_name: str):
"""Loads a module
Example: load mod"""
module = cog_name.strip()
if "modules." not in module:
module = "modules." + module
try:
self._load_cog(module)
except CogNotFoundError:
await ctx.send("That cog could not be found.")
except CogLoadError as e:
logger.exception(e)
traceback.print_exc()
await ctx.send("There was an issue loading the cog. Check"
" your console or logs for more information.")
except Exception as e:
logger.exception(e)
traceback.print_exc()
await ctx.send('Cog was found and possibly loaded but '
'something went wrong. Check your console '
'or logs for more information.')
else:
set_cog(module, True)
await self.disable_commands()
await ctx.send("The cog has been loaded.")
评论列表
文章目录