From 0e1cd216818f0408511e8ddea0ce30c7f1d055ac Mon Sep 17 00:00:00 2001 From: flifloo Date: Thu, 28 May 2020 17:27:35 +0200 Subject: [PATCH] Fix reminder loop close --- extensions/reminders.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/reminders.py b/extensions/reminders.py index f35c514..4c87439 100644 --- a/extensions/reminders.py +++ b/extensions/reminders.py @@ -115,6 +115,9 @@ class Reminders(commands.Cog): await ctx.send("An error occurred !") raise error + def cog_unload(self): + self.reminders_loop.stop() + def setup(bot): logger.info(f"Loading...") @@ -131,7 +134,6 @@ def setup(bot): def teardown(bot): logger.info(f"Unloading...") try: - bot.get_cog("Reminders").reminders_loop.stop() bot.remove_cog("Reminders") except Exception as e: logger.error(f"Error unloading: {e}")