From 529f1fc0129d8d458181463ebc8bc76e35ea499b Mon Sep 17 00:00:00 2001 From: si0972 <7110194+si0972@users.noreply.github.com> Date: Sun, 26 May 2019 00:08:57 +0200 Subject: [PATCH] Fixed logging of errors maybe --- bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 96a7f98..b2ee807 100644 --- a/bot.py +++ b/bot.py @@ -78,20 +78,21 @@ class Bot(commands.Bot): if isinstance(err, commands.CommandInvokeError): self.logger.debug("Error running command: %s\n Traceback: %s" - % (ctx.command, traceback.format_exception(err.__traceback__))) + % (ctx.command, err)) pass elif isinstance(err, commands.NoPrivateMessage): self.logger.debug("Error running command: %s\n Traceback: %s" - % (ctx.command, traceback.format_exception(err.__traceback__))) + % (ctx.command, err)) await ctx.send('That command is not available in DMs') elif isinstance(err, commands.CommandOnCooldown): - await ctx.send(f"{ctx.message.author.mention} Command is on cooldown. Try again in `{err.retry_after:.1f}` seconds.") + await ctx.send(f"{ctx.message.author.mention} Command is on cooldown. " + f"Try again in `{err.retry_after:.1f}` seconds.") elif isinstance(err, commands.CheckFailure): self.logger.debug("Error running command: %s\n Traceback: %s" - % (ctx.command, traceback.format_exception(err.__traceback__))) + % (ctx.command, err)) pass elif isinstance(err, commands.CommandNotFound):