From f7728b2d1e28260bf00d4426615344bc1bf3b1b0 Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 8 Dec 2017 21:47:49 -0500 Subject: [PATCH] Hopefully implemented correct version of on_ready catching --- src/misc/checks.py | 1 + src/run.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/misc/checks.py b/src/misc/checks.py index fda1f2b..06d1038 100644 --- a/src/misc/checks.py +++ b/src/misc/checks.py @@ -11,6 +11,7 @@ from discord.ext.commands import errors as errext from utils import utils as u owner_id = u.config['owner_id'] +ready = False def is_owner(): diff --git a/src/run.py b/src/run.py index 3682398..d9b6960 100644 --- a/src/run.py +++ b/src/run.py @@ -69,7 +69,7 @@ async def test(ctx): @bot.event async def on_ready(): - if not bot.is_ready(): + if not checks.ready: from cogs import booru, info, management, owner, tools for cog in (tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), management.Administration(bot), info.Info(bot), booru.MsG(bot)): @@ -98,6 +98,8 @@ async def on_ready(): u.temp['startup'] = () u.dump(u.temp, 'temp/temp.pkl') + checks.ready = True + @bot.event async def on_message(message): @@ -111,6 +113,8 @@ async def on_message(message): @bot.event async def on_error(error, *args, **kwargs): + print(bot.is_closed()) + print(bot.is_ready()) print('\n! ! ! ! !\nE R R O R : {}\n! ! ! ! !\n'.format(error), file=sys.stderr) tb.print_exc() await bot.get_user(u.config['owner_id']).send('**ERROR** \N{WARNING SIGN}\n```\n{}```'.format(error))