From 477bb2e0130401d52ed01bdb797c75347e0b186e Mon Sep 17 00:00:00 2001 From: DerpDays <34582078+DerpDays@users.noreply.github.com> Date: Sun, 14 Oct 2018 22:15:38 +0100 Subject: I believe this fixes the flake8 issues --- bot/cogs/error_handler.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'bot/cogs/error_handler.py') 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( -- cgit v1.2.3