Avoid some multi error handling
This commit is contained in:
parent
c7a42e4497
commit
ba729daf54
3 changed files with 20 additions and 17 deletions
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Reference in a new issue