Skip to content

Commit 1ace799

Browse files
fix ignoring of commandnotfound
1 parent 8d1ae3a commit 1ace799

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cogs/error_handler.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ async def on_application_command_error(
2525
if isinstance(error, errors.CheckFailure):
2626
return
2727

28-
# ignore command not found errors
29-
if isinstance(error, commands.errors.CommandNotFound):
30-
return
31-
3228
# handle every other error
3329
error_logger.error(
3430
f"An error occurred in {ctx.channel.name} by {ctx.author.display_name}",
@@ -49,6 +45,14 @@ async def on_application_command_error(
4945

5046
await ctx.respond(DEFAULT_ERROR_MESSAGE, ephemeral=True)
5147

48+
@commands.Cog.listener()
49+
async def on_command_error(
50+
self, ctx: commands.Context, error: commands.CommandError
51+
):
52+
# ignore command not found errors
53+
if isinstance(error, commands.errors.CommandNotFound):
54+
return
55+
5256
# BUG: Actually test this, make it wave InteractionResponded error:
5357
@commands.Cog.listener()
5458
async def on_interaction_error(

0 commit comments

Comments
 (0)