mirror of
https://github.com/GaMeNu/HFCNotificator.git
synced 2024-11-16 15:24:51 +02:00
v2.2.6: fix: I think I finally fixed issue #7 ???
This commit is contained in:
parent
f532f97e65
commit
ea85e3ca58
@ -148,8 +148,10 @@ class Notificator(commands.Cog):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
notf = Notificator(bot, handler)
|
notf = Notificator(bot, handler)
|
||||||
|
print(bot.cogs)
|
||||||
if bot.get_cog('Notificator') is None:
|
if bot.get_cog('Notificator') is None:
|
||||||
await bot.add_cog(notf)
|
await bot.add_cog(notf)
|
||||||
|
print(bot.cogs)
|
||||||
return notf
|
return notf
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
@ -226,6 +228,8 @@ class Notificator(commands.Cog):
|
|||||||
current_time = time.time()
|
current_time = time.time()
|
||||||
delta = round(current_time - self.last_loop_run_time, 3)
|
delta = round(current_time - self.last_loop_run_time, 3)
|
||||||
|
|
||||||
|
print(delta)
|
||||||
|
|
||||||
if delta < EXPECTED_LOOP_DELTA_MIN:
|
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.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()
|
self.check_for_updates.stop()
|
||||||
|
4
main.py
4
main.py
@ -44,11 +44,11 @@ async def on_ready():
|
|||||||
errlogging.generate_errlog_folder()
|
errlogging.generate_errlog_folder()
|
||||||
loggers.generate_logging_folder()
|
loggers.generate_logging_folder()
|
||||||
|
|
||||||
|
if bot.get_cog('Notificator') is None:
|
||||||
await Notificator.setup(bot, handler)
|
await Notificator.setup(bot, handler)
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_resume():
|
async def on_resumed():
|
||||||
if bot.get_cog('Notificator') is None:
|
if bot.get_cog('Notificator') is None:
|
||||||
await Notificator.setup(bot, handler)
|
await Notificator.setup(bot, handler)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user