Skip to content

Commit

Permalink
update handler
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Dec 12, 2024
1 parent f5a0839 commit ccb5d4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions exceptions/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ def __init__(self, bot: CustomClient):

@commands.Cog.listener()
async def on_slash_command_error(self, ctx: disnake.ApplicationCommandInteraction, error):
await self.error_handler(ctx, error)

@commands.Cog.listener()
async def on_message_command_error(self, ctx: disnake.ApplicationCommandInteraction, error):
await self.error_handler(ctx, error)

async def error_handler(self, ctx: disnake.ApplicationCommandInteraction | disnake.MessageCommandInteraction, error):
if isinstance(error, disnake.ext.commands.ConversionError):
error = error.original

Expand Down Expand Up @@ -261,5 +268,6 @@ async def on_slash_command_error(self, ctx: disnake.ApplicationCommandInteractio
await ctx.send(embed=embed)



def setup(bot: CustomClient):
bot.add_cog(ExceptionHandler(bot))

0 comments on commit ccb5d4e

Please sign in to comment.