Skip to content

Commit

Permalink
Merge pull request #75 from Tibo-Ulens/hotfix
Browse files Browse the repository at this point in the history
Properly map and handle command errors
  • Loading branch information
Tibo-Ulens authored Feb 5, 2024
2 parents ee65846 + da021ea commit de8d5cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bot/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,15 @@ async def cog_app_command_error(self, ia: Interaction, error: AppCommandError):
await ia.followup.send(content=event.user_msg, ephemeral=True)

async def cog_command_error(self, ctx: Context, error: CommandError):
event = self.app_error_to_event(ctx, error)
event = self.error_to_event(ctx, error)

if event.error:
logger.error(traceback.format_exc())
self.bot.logger.error(event)
self.bot.discord_logger.error(event, guild=ctx.guild)
else:
self.bot.discord_logger.warning(event, guild=ctx.guild)

self.bot.discord_logger.warning(event, guild=ctx.guild)
await ctx.reply(event.user_msg, ephemeral=True)


Expand Down

0 comments on commit de8d5cb

Please sign in to comment.