From ea85e3ca588d5dc0b95083d9c7feeb942ce2e782 Mon Sep 17 00:00:00 2001 From: GaMeNu <98153342+GaMeNu@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:20:17 +0200 Subject: [PATCH] v2.2.6: fix: I think I finally fixed issue #7 ??? --- cog_notificator.py | 4 ++++ main.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cog_notificator.py b/cog_notificator.py index cbe1054..010ff43 100644 --- a/cog_notificator.py +++ b/cog_notificator.py @@ -148,8 +148,10 @@ class Notificator(commands.Cog): """ notf = Notificator(bot, handler) + print(bot.cogs) if bot.get_cog('Notificator') is None: await bot.add_cog(notf) + print(bot.cogs) return notf @commands.Cog.listener() @@ -226,6 +228,8 @@ class Notificator(commands.Cog): current_time = time.time() delta = round(current_time - self.last_loop_run_time, 3) + print(delta) + if delta < EXPECTED_LOOP_DELTA_MIN: self.log.warning(f'Loop is running too quickly! Expected delta > {EXPECTED_LOOP_DELTA_MIN}s, but got {delta}s. Restarting...') self.check_for_updates.stop() diff --git a/main.py b/main.py index 2021840..d9a4af5 100644 --- a/main.py +++ b/main.py @@ -44,11 +44,11 @@ async def on_ready(): errlogging.generate_errlog_folder() loggers.generate_logging_folder() - await Notificator.setup(bot, handler) - + if bot.get_cog('Notificator') is None: + await Notificator.setup(bot, handler) @bot.event -async def on_resume(): +async def on_resumed(): if bot.get_cog('Notificator') is None: await Notificator.setup(bot, handler)