Skip to content

Commit 81dfa98

Browse files
authored
docs: add missing attributes to UserCommand and MessageCommand (#2494)
1 parent 63da813 commit 81dfa98

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

discord/commands/core.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,17 @@ class UserCommand(ContextMenuCommand):
17301730
The coroutine that is executed when the command is called.
17311731
guild_ids: Optional[List[:class:`int`]]
17321732
The ids of the guilds where this command will be registered.
1733-
cog: Optional[:class:`.Cog`]
1733+
guild_only: :class:`bool`
1734+
Whether the command should only be usable inside a guild.
1735+
1736+
.. deprecated:: 2.6
1737+
Use the ``contexts`` parameter instead.
1738+
nsfw: :class:`bool`
1739+
Whether the command should be restricted to 18+ channels and users.
1740+
Apps intending to be listed in the App Directory cannot have NSFW commands.
1741+
default_member_permissions: :class:`~discord.Permissions`
1742+
The default permissions a member needs to be able to run the command.
1743+
cog: Optional[:class:`Cog`]
17341744
The cog that this command belongs to. ``None`` if there isn't one.
17351745
checks: List[Callable[[:class:`.ApplicationContext`], :class:`bool`]]
17361746
A list of predicates that verifies if the command could be executed
@@ -1739,6 +1749,16 @@ class UserCommand(ContextMenuCommand):
17391749
:exc:`.ApplicationCommandError` should be used. Note that if the checks fail then
17401750
:exc:`.CheckFailure` exception is raised to the :func:`.on_application_command_error`
17411751
event.
1752+
cooldown: Optional[:class:`~discord.ext.commands.Cooldown`]
1753+
The cooldown applied when the command is invoked. ``None`` if the command
1754+
doesn't have a cooldown.
1755+
name_localizations: Dict[:class:`str`, :class:`str`]
1756+
The name localizations for this command. The values of this should be ``"locale": "name"``. See
1757+
`here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
1758+
integration_types: Set[:class:`IntegrationType`]
1759+
The installation contexts where this command is available. Unapplicable for guild commands.
1760+
contexts: Set[:class:`InteractionContextType`]
1761+
The interaction contexts where this command is available. Unapplicable for guild commands.
17421762
"""
17431763

17441764
type = 2
@@ -1829,7 +1849,17 @@ class MessageCommand(ContextMenuCommand):
18291849
The coroutine that is executed when the command is called.
18301850
guild_ids: Optional[List[:class:`int`]]
18311851
The ids of the guilds where this command will be registered.
1832-
cog: Optional[:class:`.Cog`]
1852+
guild_only: :class:`bool`
1853+
Whether the command should only be usable inside a guild.
1854+
1855+
.. deprecated:: 2.6
1856+
Use the ``contexts`` parameter instead.
1857+
nsfw: :class:`bool`
1858+
Whether the command should be restricted to 18+ channels and users.
1859+
Apps intending to be listed in the App Directory cannot have NSFW commands.
1860+
default_member_permissions: :class:`~discord.Permissions`
1861+
The default permissions a member needs to be able to run the command.
1862+
cog: Optional[:class:`Cog`]
18331863
The cog that this command belongs to. ``None`` if there isn't one.
18341864
checks: List[Callable[[:class:`.ApplicationContext`], :class:`bool`]]
18351865
A list of predicates that verifies if the command could be executed
@@ -1838,6 +1868,16 @@ class MessageCommand(ContextMenuCommand):
18381868
:exc:`.ApplicationCommandError` should be used. Note that if the checks fail then
18391869
:exc:`.CheckFailure` exception is raised to the :func:`.on_application_command_error`
18401870
event.
1871+
cooldown: Optional[:class:`~discord.ext.commands.Cooldown`]
1872+
The cooldown applied when the command is invoked. ``None`` if the command
1873+
doesn't have a cooldown.
1874+
name_localizations: Dict[:class:`str`, :class:`str`]
1875+
The name localizations for this command. The values of this should be ``"locale": "name"``. See
1876+
`here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
1877+
integration_types: Set[:class:`IntegrationType`]
1878+
The installation contexts where this command is available. Unapplicable for guild commands.
1879+
contexts: Set[:class:`InteractionContextType`]
1880+
The interaction contexts where this command is available. Unapplicable for guild commands.
18411881
"""
18421882

18431883
type = 3

0 commit comments

Comments
 (0)