From 6faea43c99cf2c92fce372d668a47c37539f0296 Mon Sep 17 00:00:00 2001 From: Gnome Date: Wed, 1 Sep 2021 14:44:24 +0100 Subject: [PATCH] Add docs for added params --- discord/ext/commands/bot.py | 14 ++++++++++++++ discord/ext/commands/core.py | 14 ++++++++++++++ docs/whats_new.rst | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 230996ef..d901586e 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -1228,6 +1228,20 @@ class Bot(BotBase, discord.Client): the ``command_prefix`` is set to ``!``. Defaults to ``False``. .. versionadded:: 1.7 + message_commands: Optional[:class:`bool`] + Whether to process commands based on messages. + + Can be overwritten per command in the command decorators or when making + a :class:`Command` object via the ``message_command`` parameter + + .. versionadded:: 2.0 + slash_commands: Optional[:class:`bool`] + Whether to upload and process slash commands. + + Can be overwritten per command in the command decorators or when making + a :class:`Command` object via the ``slash_command`` parameter + + .. versionadded:: 2.0 """ async def setup(self): if not self.slash_commands: diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 876967cc..098c9440 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -292,11 +292,25 @@ class Command(_BaseCommand, Generic[CogT, P, T]): extras: :class:`dict` A dict of user provided extras to attach to the Command. + .. versionadded:: 2.0 + .. note:: This object may be copied by the library. + message_command: Optional[:class:`bool`] + Whether to process this command based on messages. + + This overwrites the global ``message_commands`` parameter of :class:`.Bot`. .. versionadded:: 2.0 + + slash_command: Optional[:class:`bool`] + Whether to upload and process this command as a slash command. + + This overwrites the global ``slash_commands`` parameter of :class:`.Bot`. + + .. versionadded:: 2.0 + """ __original_kwargs__: Dict[str, Any] diff --git a/docs/whats_new.rst b/docs/whats_new.rst index bdbf1d75..bc283d22 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -43,7 +43,7 @@ Breaking Changes - :attr:`GroupChannel.owner` is now Optional - ``edit`` methods now only accept None if it actually means something (e.g. clearing it) - ``timeout`` parameter for ``ui.View.__init__`` is now keyword only -- When an interaction has already been responded and another one is sent, :exc:`InteractionResponded`is now raised. +- When an interaction has already been responded and another one is sent, :exc:`InteractionResponded` is now raised. - Discord's API only allows a single :attr:`interaction.response`. - Separate :func:`on_member_update` and :func:`on_presence_update` - The new event :func:`on_presence_update` is now called when status/activity is changed.