aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/error_handler.py
diff options
context:
space:
mode:
authorGravatar DerpDays <[email protected]>2018-10-14 22:15:38 +0100
committerGravatar GitHub <[email protected]>2018-10-14 22:15:38 +0100
commit477bb2e0130401d52ed01bdb797c75347e0b186e (patch)
tree97acb71c1911ac524021fffb8246f227c460af44 /bot/cogs/error_handler.py
parentIgnore that last commit lol (diff)
I believe this fixes the flake8 issues
Diffstat (limited to 'bot/cogs/error_handler.py')
-rw-r--r--bot/cogs/error_handler.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/bot/cogs/error_handler.py b/bot/cogs/error_handler.py
index 268ed35a..72ce5f59 100644
--- a/bot/cogs/error_handler.py
+++ b/bot/cogs/error_handler.py
@@ -1,6 +1,4 @@
-import discord
from discord.ext import commands
-import asyncio
import sys
import traceback
import math
@@ -9,6 +7,7 @@ import math
class CommandErrorHandler:
def __init__(self, bot):
self.bot = bot
+
async def on_command_error(self, ctx, error):
if hasattr(ctx.command, 'on_error'):
return
@@ -23,19 +22,16 @@ class CommandErrorHandler:
if isinstance(error, commands.CommandOnCooldown):
return await ctx.send(
"This command is on cooldown," +
- "please retry in {}s.".format(math.ceil(error.retry_after))
+ " please retry in {}s.".format(math.ceil(error.retry_after))
)
if isinstance(error, commands.DisabledCommand):
return await ctx.send(
":no_entry: This command has been disabled."
)
if isinstance(error, commands.NoPrivateMessage):
- try:
- return await ctx.author.send(
- ":no_entry: This command can only be used inside a server."
- )
- except:
- pass
+ return await ctx.author.send(
+ ":no_entry: This command can only be used inside a server."
+ )
if isinstance(error, commands.BadArgument):
if ctx.command.qualified_name == 'tag list':
return await ctx.send(