1
0
Fork 0
mirror of synced 2024-06-15 17:14:34 +12:00

Added a bit more information on errors

This commit is contained in:
Phxntxm 2016-08-06 07:16:49 -05:00
parent 0998e85950
commit 6004664bf1

3
bot.py
View file

@ -89,8 +89,9 @@ async def on_command_error(error, ctx):
.format(round(m), round(s))
await bot.send_message(ctx.message.channel, fmt)
elif not isinstance(error, commands.CommandNotFound):
now = datetime.datetime.now()
with open("/home/phxntx5/public_html/Bonfire/error_log", 'a') as f:
print('In {0.command.qualified_name}:'.format(ctx), file=f)
print('In server '{0.message.server}' command '{0.command.qualified_name}' on {1} :'.format(ctx,str(now)), file=f)
traceback.print_tb(error.original.__traceback__, file=f)
print('{0.__class__.__name__}: {0}'.format(error.original), file=f)