Skip to content

Commit 109de84

Browse files
committed
feat(docs): Removed note for 1-hour delay on registration of global commands, as this is no longer present in backend v2
feat(docs) fixed some note boxes
1 parent cd7e014 commit 109de84

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

discord/client.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,15 @@ class Client:
229229
.. versionadded:: 1.3
230230
231231
sync_commands: :class:`bool`
232-
Whether to sync application-commands on startup, default ``False``.
232+
Whether to sync application-commands on startup, default :obj:`False`.
233233
234234
This will register global and guild application-commands(slash-, user- and message-commands)
235235
that are not registered yet, update changes and remove application-commands that could not be found
236-
in the code anymore if :attr:`delete_not_existing_commands` is set to ``True`` what it is by default.
237-
238-
.. note::
239-
It can take up to an hour until updates on global application-commands are available
240-
in all guilds the bot is in due to global caching on discords side.
241-
For testing purposes it is recommended to use guild-only commands because they are available immediately.
236+
in the code anymore if :attr:`delete_not_existing_commands` is set to :obj:`True` what it is by default.
242237
243238
delete_not_existing_commands: :class:`bool`
244-
Whether to remove global and guild-only application-commands that are not in the code anymore, default ``True``.
239+
Whether to remove global and guild-only application-commands that are not in the code anymore, default :obj:`True`
240+
`.
245241
246242
Attributes
247243
-----------
@@ -1158,16 +1154,12 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
11581154
A decorator that registers a raw_button_click event that checks on execution if the ``custom_id's`` are the same;
11591155
if so, the decorated function is called.
11601156
1161-
The function this is attached to must take the same parameters as a
1162-
:func:`on_raw_button_click` event.
1163-
11641157
.. important::
1165-
The function decorated must be a coroutine, if not, :exc:`TypeError` is raised.
1158+
The function this is attached to must take the same parameters as a
1159+
:func:`~discord.on_raw_button_click` event.
11661160
1167-
.. note::
1168-
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1169-
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1170-
Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
1161+
.. warning::
1162+
The func must be a coroutine, if not, :exc:`TypeError` is raised.
11711163
11721164
Parameters
11731165
----------
@@ -1176,6 +1168,10 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
11761168
or you want to give the function a different name then the custom_id use this one to set the custom_id.
11771169
You can also specify a regex and if the custom_id matches it, the function will be executed.
11781170
1171+
.. note::
1172+
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1173+
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1174+
Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
11791175
11801176
Example
11811177
-------
@@ -1225,11 +1221,12 @@ def on_select(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
12251221
"""
12261222
A decorator with which you can assign a function to a specific :class:`~discord.SelectMenu` (or its custom_id).
12271223
1228-
The function this is attached to must take the same parameters as a
1229-
:func:`on_raw_selection_select` event.
1230-
12311224
.. important::
1232-
The decorated function must be a coroutine, if not, :exc:`TypeError` is raised.
1225+
The function this is attached to must take the same parameters as a
1226+
:func:`~discord.on_raw_selection_select` event.
1227+
1228+
.. warning::
1229+
The func must be a coroutine, if not, :exc:`TypeError` is raised.
12331230
12341231
Parameters
12351232
-----------
@@ -1238,6 +1235,10 @@ def on_select(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
12381235
or you want to give the function a different name then the custom_id use this one to set the custom_id.
12391236
You can also specify a regex and if the custom_id matches it, the function will be executed.
12401237
1238+
.. note::
1239+
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1240+
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1241+
Otherwise, something like 'choose_your_gender later' will let the function bee invoked too.
12411242
12421243
Example
12431244
-------
@@ -1287,11 +1288,13 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
12871288
A decorator that registers an :func:`on_modal_submit` event that checks on execution if the ``custom_id's`` are the same;
12881289
if so, the decorated function is called.
12891290
1290-
The function this is attached to must take the same parameters as a
1291-
:func`on_modal_submit` event.
1292-
12931291
.. important::
1294-
The decorated function must be a coroutine, if not, :exc:`TypeError` is raised.
1292+
The function this is attached to must take the same parameters as a
1293+
:func:`~discord.on_modal_submit` event.
1294+
1295+
.. warning::
1296+
The func must be a coroutine, if not, :exc:`TypeError` is raised.
1297+
12951298
12961299
Parameters
12971300
----------
@@ -1300,6 +1303,11 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
13001303
or you want to give the function a different name then the custom_id use this one to set the custom_id.
13011304
You can also specify a regex and if the custom_id matches it, the function will be executed.
13021305
1306+
.. note::
1307+
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1308+
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1309+
Otherwise, something like 'suggestions_modal_submit_private' will let the function bee invoked too.
1310+
13031311
Example
13041312
-------
13051313
.. code-block:: python

discord/ext/commands/bot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,10 +1332,6 @@ class Bot(BotBase, discord.Client):
13321332
that are not registered yet, update changes and remove application-commands that could not be found
13331333
in the code anymore if :attr:`delete_not_existing_commands` is set to ``True`` what it is by default.
13341334
1335-
.. note::
1336-
It can take up to an hour until updates on global application-commands are available
1337-
in all guilds the bot is in due to global caching on discords side.
1338-
For testing purposes it is recommended to use guild-only commands because they are available immediately.
13391335
delete_not_existing_commands: :class:`bool`
13401336
Whether to remove global and guild-only application-commands that are not in the code anymore, default ``True``.
13411337
sync_commands_on_cog_reload: :class:`bool`

0 commit comments

Comments
 (0)