From 80bd798be84c819542756f425632110a8dc4708e Mon Sep 17 00:00:00 2001 From: DerpDays <34582078+DerpDays@users.noreply.github.com> Date: Tue, 30 Oct 2018 17:34:44 +0000 Subject: Litterally got no idea why it failed checks last time --- bot/cogs/error_handler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bot/cogs/error_handler.py') diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py index 91bbf2e8..9f0da2e0 100644 --- a/bot/cogs/error_handler.py +++ b/bot/cogs/error_handler.py @@ -6,23 +6,25 @@ from discord.ext import commands class CommandErrorHandler: + """A error handler for the PythonDiscord server!""" + def __init__(self, bot): self.bot = bot async def on_command_error(self, ctx, error): + """Activates when a command opens an error""" + if hasattr(ctx.command, 'on_error'): - logging.debug( + return logging.debug( "A command error occured but " + "the command had it's own error handler" ) - return error = getattr(error, 'original', error) if isinstance(error, commands.CommandNotFound): - logging.debug( + return logging.debug( f"{ctx.author} called '{ctx.message.content}' " + "but no command was found" ) - return if isinstance(error, commands.UserInputError): logging.debug( f"{ctx.author} called the command '{ctx.command}' " + -- cgit v1.2.3