Answer the question
In order to leave comments, you need to log in
How to check if cog is loaded via extension?
How to check if cog is loaded via extension? And check if it's loaded?
To issue by type: cog - on / off
Fragment reload:
bot.unload_extension(f"cogs.{extension}")
bot.load_extension(f"cogs.{extension}")
print("File " + str(extension) + " reload")
Answer the question
In order to leave comments, you need to log in
In this case, you can use try except to check for errors
try:
bot.unload_extension(f"cogs.{extension}")
bot.load_extension(f"cogs.{extension}")
print("File " + str(extension) + " reload")
except Exception as e:
exc = '{}: {}'.format(type(e).__name__, e)
print(exc)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question