Skip to content

Commit

Permalink
Merge pull request #16 from probablyjassin:fix/command-not-found
Browse files Browse the repository at this point in the history
fix ignoring of commandnotfound
  • Loading branch information
probablyjassin authored Nov 2, 2024
2 parents 8d1ae3a + 1ace799 commit 1f3c487
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cogs/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ async def on_application_command_error(
if isinstance(error, errors.CheckFailure):
return

# ignore command not found errors
if isinstance(error, commands.errors.CommandNotFound):
return

# handle every other error
error_logger.error(
f"An error occurred in {ctx.channel.name} by {ctx.author.display_name}",
Expand All @@ -49,6 +45,14 @@ async def on_application_command_error(

await ctx.respond(DEFAULT_ERROR_MESSAGE, ephemeral=True)

@commands.Cog.listener()
async def on_command_error(
self, ctx: commands.Context, error: commands.CommandError
):
# ignore command not found errors
if isinstance(error, commands.errors.CommandNotFound):
return

# BUG: Actually test this, make it wave InteractionResponded error:
@commands.Cog.listener()
async def on_interaction_error(
Expand Down

0 comments on commit 1f3c487

Please sign in to comment.