Automatically unload trivia when it's already loaded

pull/26/head
bobloy 6 years ago
parent 8935303f41
commit 5220e703e5

@ -1,5 +1,13 @@
from redbot.core.bot import Red
from .audiotrivia import AudioTrivia
def setup(bot):
async def setup(bot: Red):
if bot.get_cog("Trivia"):
print("Trivia is already loaded, attempting to unload it first")
bot.remove_cog("Trivia")
await bot.remove_loaded_package("trivia")
bot.unload_extension("trivia")
bot.add_cog(AudioTrivia(bot))

Loading…
Cancel
Save