diff options
author | 2018-10-30 17:34:44 +0000 | |
---|---|---|
committer | 2018-10-30 17:34:44 +0000 | |
commit | 80bd798be84c819542756f425632110a8dc4708e (patch) | |
tree | a3949f1143d886545e8958a896dc9fdc0dc6e4b2 /bot/cogs | |
parent | Made the local imports come before the external ones (diff) |
Litterally got no idea why it failed checks last time
Diffstat (limited to 'bot/cogs')
-rw-r--r-- | bot/cogs/error_handler.py | 10 |
1 files changed, 6 insertions, 4 deletions
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}' " +
|