1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-16 02:39:01 +00:00

Add missing decorator signs for interaction documentation

This commit is contained in:
Puncher 2022-08-22 00:25:31 +02:00 committed by GitHub
parent 507975e56d
commit 354d4bace4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 3 deletions
discord/app_commands
docs/interactions

@ -1908,7 +1908,7 @@ class Group:
auto_locale_strings: bool = True,
extras: Dict[Any, Any] = MISSING,
) -> Callable[[CommandCallback[GroupT, P, T]], Command[GroupT, P, T]]:
"""Creates an application command under this group.
"""A decorator that creates an application command from a regular function under this group.
Parameters
------------

@ -842,7 +842,7 @@ class CommandTree(Generic[ClientT]):
auto_locale_strings: bool = True,
extras: Dict[Any, Any] = MISSING,
) -> Callable[[CommandCallback[Group, P, T]], Command[Group, P, T]]:
"""Creates an application command directly under this tree.
"""A decorator that creates an application command from a regular function directly under this tree.
Parameters
------------
@ -911,7 +911,7 @@ class CommandTree(Generic[ClientT]):
auto_locale_strings: bool = True,
extras: Dict[Any, Any] = MISSING,
) -> Callable[[ContextMenuCallback], ContextMenu]:
"""Creates an application command context menu from a regular function directly under this tree.
"""A decorator that creates an application command context menu from a regular function directly under this tree.
This function must have a signature of :class:`~discord.Interaction` as its first parameter
and taking either a :class:`~discord.Member`, :class:`~discord.User`, or :class:`~discord.Message`,

@ -472,6 +472,16 @@ CommandTree
.. autoclass:: discord.app_commands.CommandTree
:members:
:exclude-members: error, command, context_menu
.. automethod:: CommandTree.command(*, name=..., description=..., nsfw=False, guild=..., guilds=..., auto_locale_strings=True, extras=...)
:decorator:
.. automethod:: CommandTree.context_menu(*, name=..., nsfw=False, guild=..., guilds=..., auto_locale_strings=True, extras=...)
:decorator:
.. automethod:: CommandTree.error(coro)
:decorator:
Commands
~~~~~~~~~
@ -483,6 +493,13 @@ Command
.. autoclass:: discord.app_commands.Command
:members:
:exclude-members: error, autocomplete
.. automethod:: Command.autocomplete(name)
:decorator:
.. automethod:: Command.error(coro)
:decorator:
Parameter
++++++++++
@ -499,6 +516,10 @@ ContextMenu
.. autoclass:: discord.app_commands.ContextMenu
:members:
:exclude-members: error
.. automethod:: ContextMenu.error(coro)
:decorator:
Group
++++++
@ -507,6 +528,13 @@ Group
.. autoclass:: discord.app_commands.Group
:members:
:exclude-members: error, command
.. automethod:: Group.command(*, name=..., description=..., nsfw=False, auto_locale_strings=True, extras=...)
:decorator:
.. automethod:: Group.error(coro)
:decorator:
Decorators
~~~~~~~~~~~