Skip to content

Commit

Permalink
docs: fix references to ApplicationCommandSyncFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Oct 18, 2022
1 parent 4fb08ff commit 1ea43ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 7 additions & 0 deletions disnake/ext/commands/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ class InteractionBot(InteractionBotBase, disnake.Client):
Parameters
----------
command_sync: :class:`.ext.commands.ApplicationCommandSyncFlags`
The command sync flags that you want to enable for the session. This is a way of
controlling when and how application commands will be synced with the API.
If not given, automatic command synchronization is enabled by default.
.. versionadded:: 2.7
sync_commands: :class:`bool`
Whether to enable automatic synchronization of application commands in your code.
Defaults to ``True``, which means that commands in API are automatically synced
Expand Down
15 changes: 9 additions & 6 deletions docs/ext/commands/slash_commands.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. SPDX-License-Identifier: MIT
.. currentmodule:: disnake.ext.commands
.. currentmodule:: disnake

.. _ext_commands_slash_commands:

Expand Down Expand Up @@ -40,9 +40,12 @@ This code sample shows how to set the registration to be local:
For global registration, don't specify this parameter.

Another useful parameter is ``sync_commands_debug``. If set to ``True``, you receive debug messages related to the
app command registration by default, without having to change the log level of any loggers
(see the documentation on :class:`Bot <ext.commands.Bot>` for more info).
In order to configure specific properties about command sync, we have a configuration
class which may be passed to the Bot, :class:`~.ext.commands.ApplicationCommandSyncFlags`.

Setting :attr:`ApplicationCommandSyncFlags.sync_commands_debug <.ext.commands.ApplicationCommandSyncFlags.sync_commands_debug>` to ``True``, will print debug messages related to the
app command registration to the console, without having to change the log level of any loggers.

This is useful if you want to figure out some registration details:

.. code-block:: python3
Expand All @@ -58,8 +61,8 @@ This is useful if you want to figure out some registration details:
command_sync=command_sync,
)
If you want to disable the automatic registration, set :attr:`ApplicationCommandSyncFlags.sync_commands`
to ``False``, or use the classmethod :meth:`none() <ApplicationCommandSyncFlags.none>`
If you want to disable the automatic registration, set :attr:`ApplicationCommandSyncFlags.sync_commands <.ext.commands.ApplicationCommandSyncFlags.sync_commands>`
to ``False``, or use the classmethod :meth:`none() <.ext.commands.ApplicationCommandSyncFlags.none>`

.. code-block:: python3
Expand Down

0 comments on commit 1ea43ac

Please sign in to comment.