mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-14 09:50:03 +00:00
Fix CommandTree.on_error not triggering if interaction_check raises
This commit is contained in:
parent
6327402730
commit
59677c6738
@ -1078,9 +1078,10 @@ class CommandTree(Generic[ClientT]):
|
|||||||
async def _dispatch_error(self, interaction: Interaction, error: AppCommandError, /) -> None:
|
async def _dispatch_error(self, interaction: Interaction, error: AppCommandError, /) -> None:
|
||||||
command = interaction.command
|
command = interaction.command
|
||||||
interaction.command_failed = True
|
interaction.command_failed = True
|
||||||
|
try:
|
||||||
if isinstance(command, Command):
|
if isinstance(command, Command):
|
||||||
await command._invoke_error_handlers(interaction, error)
|
await command._invoke_error_handlers(interaction, error)
|
||||||
else:
|
finally:
|
||||||
await self.on_error(interaction, error)
|
await self.on_error(interaction, error)
|
||||||
|
|
||||||
def _from_interaction(self, interaction: Interaction) -> None:
|
def _from_interaction(self, interaction: Interaction) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user