mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
parent
0b69148c84
commit
0ec06f0ac5
@ -1189,6 +1189,8 @@ class CommandTree(Generic[ClientT]):
|
||||
if ctx_menu.on_error is not None:
|
||||
await ctx_menu.on_error(interaction, e)
|
||||
await self.on_error(interaction, e)
|
||||
else:
|
||||
self.client.dispatch('app_command_completion', interaction, ctx_menu)
|
||||
|
||||
async def interaction_check(self, interaction: Interaction, /) -> bool:
|
||||
"""|coro|
|
||||
@ -1237,3 +1239,5 @@ class CommandTree(Generic[ClientT]):
|
||||
except AppCommandError as e:
|
||||
await command._invoke_error_handlers(interaction, e)
|
||||
await self.on_error(interaction, e)
|
||||
else:
|
||||
self.client.dispatch('app_command_completion', interaction, command)
|
||||
|
12
docs/api.rst
12
docs/api.rst
@ -215,6 +215,18 @@ App Commands
|
||||
:param payload: The raw event payload data.
|
||||
:type payload: :class:`RawAppCommandPermissionsUpdateEvent`
|
||||
|
||||
.. function:: on_app_command_completion(interaction, command)
|
||||
|
||||
Called when a :class:`app_commands.Command` or :class:`app_commands.ContextMenu` has
|
||||
successfully completed without error.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
:param interaction: The interaction of the command.
|
||||
:type interaction: :class:`Interaction`
|
||||
:param command: The command that completed successfully
|
||||
:type command: Union[:class:`app_commands.Command`, :class:`app_commands.ContextMenu`]
|
||||
|
||||
AutoMod
|
||||
~~~~~~~~
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user