1
0
Fork 0

Avoid some multi error handling

This commit is contained in:
Ethanell 2020-04-08 18:32:56 +02:00
parent c7a42e4497
commit ba729daf54
3 changed files with 20 additions and 17 deletions

View file

@ -55,6 +55,7 @@ class Extension(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error):
if ctx.invoked_with == extension_name:
if isinstance(error, NotOwner):
await ctx.message.add_reaction("\u274C")
elif isinstance(error, CommandNotFound):

View file

@ -71,6 +71,7 @@ class Purge(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error):
if ctx.invoked_with == extension_name:
if isinstance(error, CommandNotFound):
await ctx.message.add_reaction("\u2753")
else:

View file

@ -165,6 +165,7 @@ class Speak(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error):
if ctx.invoked_with == extension_name:
if isinstance(error, CommandNotFound):
await ctx.message.add_reaction("\u2753")
else: