Remove public CommandTree.call method and make it private

This commit is contained in:
Rapptz
2022-08-12 10:57:05 -04:00
parent e269904b26
commit a9025ca3d1
2 changed files with 6 additions and 28 deletions

View File

@ -1075,7 +1075,7 @@ class CommandTree(Generic[ClientT]):
def _from_interaction(self, interaction: Interaction) -> None:
async def wrapper():
try:
await self.call(interaction)
await self._call(interaction)
except AppCommandError as e:
await self._dispatch_error(interaction, e)
@ -1191,29 +1191,7 @@ class CommandTree(Generic[ClientT]):
"""
return True
async def call(self, interaction: Interaction) -> None:
"""|coro|
Given an :class:`~discord.Interaction`, calls the matching
application command that's being invoked.
This is usually called automatically by the library.
Parameters
-----------
interaction: :class:`~discord.Interaction`
The interaction to dispatch from.
Raises
--------
CommandNotFound
The application command referred to could not be found.
CommandSignatureMismatch
The interaction data referred to a parameter that was not found in the
application command definition.
AppCommandError
An error occurred while calling the command.
"""
async def _call(self, interaction: Interaction) -> None:
if not await self.interaction_check(interaction):
return