From e51a7c671d0b3a023c93cd2369a450fad6f8be70 Mon Sep 17 00:00:00 2001 From: Haku Date: Tue, 25 May 2021 09:10:13 -0400 Subject: [PATCH] possibly fixed task error --- founderlessnotify/__init__.py | 5 +++-- founderlessnotify/founderlessnotify.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/founderlessnotify/__init__.py b/founderlessnotify/__init__.py index 504f9ff..53ee51d 100644 --- a/founderlessnotify/__init__.py +++ b/founderlessnotify/__init__.py @@ -1,7 +1,8 @@ from .founderlessnotify import FounderlessNotify +from redbot.core.bot import Red -def setup(bot): +def setup(bot: Red): cog = FounderlessNotify(bot) bot.add_cog(cog) - + bot.loop.create_task(cog.bg_loop()) diff --git a/founderlessnotify/founderlessnotify.py b/founderlessnotify/founderlessnotify.py index 7831e30..0e7f888 100644 --- a/founderlessnotify/founderlessnotify.py +++ b/founderlessnotify/founderlessnotify.py @@ -58,11 +58,9 @@ class FounderlessNotify(commands.Cog): self.config = Config.get_conf(self, identifier=82732344, force_registration=True) default_global_settings = {'update_time': 0, 'previous_founderless': [], 'notify_channel': 0} self.config.register_global(**default_global_settings) - self.bg_loop_task = asyncio.create_task(self.bg_loop()) def cog_unload(self): - if self.bg_loop_task: - self.bg_loop_task.cancel() + pass @commands.command() @checks.is_owner()