@@ -229,19 +229,15 @@ class Client:
229
229
.. versionadded:: 1.3
230
230
231
231
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`.
233
233
234
234
This will register global and guild application-commands(slash-, user- and message-commands)
235
235
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.
242
237
243
238
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
+ `.
245
241
246
242
Attributes
247
243
-----------
@@ -1158,16 +1154,12 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
1158
1154
A decorator that registers a raw_button_click event that checks on execution if the ``custom_id's`` are the same;
1159
1155
if so, the decorated function is called.
1160
1156
1161
- The function this is attached to must take the same parameters as a
1162
- :func:`on_raw_button_click` event.
1163
-
1164
1157
.. 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.
1166
1160
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.
1171
1163
1172
1164
Parameters
1173
1165
----------
@@ -1176,6 +1168,10 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
1176
1168
or you want to give the function a different name then the custom_id use this one to set the custom_id.
1177
1169
You can also specify a regex and if the custom_id matches it, the function will be executed.
1178
1170
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.
1179
1175
1180
1176
Example
1181
1177
-------
@@ -1225,11 +1221,12 @@ def on_select(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
1225
1221
"""
1226
1222
A decorator with which you can assign a function to a specific :class:`~discord.SelectMenu` (or its custom_id).
1227
1223
1228
- The function this is attached to must take the same parameters as a
1229
- :func:`on_raw_selection_select` event.
1230
-
1231
1224
.. 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.
1233
1230
1234
1231
Parameters
1235
1232
-----------
@@ -1238,6 +1235,10 @@ def on_select(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
1238
1235
or you want to give the function a different name then the custom_id use this one to set the custom_id.
1239
1236
You can also specify a regex and if the custom_id matches it, the function will be executed.
1240
1237
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.
1241
1242
1242
1243
Example
1243
1244
-------
@@ -1287,11 +1288,13 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
1287
1288
A decorator that registers an :func:`on_modal_submit` event that checks on execution if the ``custom_id's`` are the same;
1288
1289
if so, the decorated function is called.
1289
1290
1290
- The function this is attached to must take the same parameters as a
1291
- :func`on_modal_submit` event.
1292
-
1293
1291
.. 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
+
1295
1298
1296
1299
Parameters
1297
1300
----------
@@ -1300,6 +1303,11 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
1300
1303
or you want to give the function a different name then the custom_id use this one to set the custom_id.
1301
1304
You can also specify a regex and if the custom_id matches it, the function will be executed.
1302
1305
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
+
1303
1311
Example
1304
1312
-------
1305
1313
.. code-block:: python
0 commit comments