Add error handler support for context menus

This commit is contained in:
Rapptz
2022-03-21 03:56:28 -04:00
parent 97fe07edb2
commit f7c664e3e2
2 changed files with 32 additions and 1 deletions

View File

@ -963,6 +963,8 @@ class CommandTree(Generic[ClientT]):
try:
await ctx_menu._invoke(interaction, value)
except AppCommandError as e:
if ctx_menu.on_error is not None:
await ctx_menu.on_error(interaction, e)
await self.on_error(interaction, ctx_menu, e)
async def call(self, interaction: Interaction) -> None: