mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Hopefully implemented correct version of on_ready catching
This commit is contained in:
parent
d41c7d0f06
commit
f7728b2d1e
2 changed files with 6 additions and 1 deletions
|
@ -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():
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue