@@ -339,8 +339,7 @@ def on_click(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) ->
339
339
[Awaitable [Any ]], Awaitable [Any ]
340
340
]:
341
341
"""
342
- A decorator that registers a raw_button_click event that checks on execution if the ``custom_id's`` are the same;
343
- if so, the :func:`func` is called.
342
+ A decorator with wich you can assign a function to a specific :class:`~discord.Button` (or its custom_id).
344
343
345
344
.. important::
346
345
The function this is attached to must take the same parameters as a
@@ -356,10 +355,11 @@ def on_click(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) ->
356
355
or you want to give the function a different name then the custom_id use this one to set the custom_id.
357
356
You can also specify a regex and if the custom_id matches it, the function will be executed.
358
357
359
- .. note::
360
- As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
361
- of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
362
- Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
358
+ .. note::
359
+ As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
360
+ put ``^`` in front and ``$`` at the end
361
+ of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
362
+ Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
363
363
364
364
Example
365
365
-------
@@ -402,7 +402,7 @@ def on_select(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
402
402
[Awaitable [Any ]], Awaitable [Any ]
403
403
]:
404
404
"""
405
- A decorator with which you can assign a function to a specific :class:`~SelectMenu` (or its custom_id).
405
+ A decorator with which you can assign a function to a specific :class:`~discord. SelectMenu` (or its custom_id).
406
406
407
407
.. important::
408
408
The function this is attached to must take the same parameters as a
@@ -414,14 +414,15 @@ def on_select(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
414
414
Parameters
415
415
-----------
416
416
custom_id: Optional[Union[Pattern[AnyStr], AnyStr]]
417
- If the :attr:`custom_id` of the :class:`discord.SelectMenu` could not use as a function name,
417
+ If the :attr:`custom_id` of the :class:`~ discord.SelectMenu` could not use as a function name,
418
418
or you want to give the function a different name then the custom_id use this one to set the custom_id.
419
419
You can also specify a regex and if the custom_id matches it, the function will be executed.
420
420
421
- .. note::
422
- As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
423
- of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
424
- Otherwise, something like 'choose_your_gender later' will let the function bee invoked too.
421
+ .. note::
422
+ As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
423
+ put ``^`` in front and ``$`` at the end
424
+ of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
425
+ Otherwise, something like 'choose_your_gender later' will let the function bee invoked too.
425
426
426
427
Example
427
428
-------
@@ -468,8 +469,7 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
468
469
[Awaitable [Any ]], Awaitable [Any ]
469
470
]:
470
471
"""
471
- A decorator that registers an :attr:`on_modal_submit` event that checks on execution if the ``custom_id's`` are the same;
472
- if so, the :func:`func` is called.
472
+ A decorator with wich you can assign a function to a specific :class:`~discord.Modal` (or its custom_id).
473
473
474
474
.. important::
475
475
The function this is attached to must take the same parameters as a
@@ -481,14 +481,15 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
481
481
Parameters
482
482
----------
483
483
custom_id: Optional[Union[Pattern[AnyStr], AnyStr]]
484
- If the :attr:`custom_id` of the :class:`discord.Modal` could not use as a function name,
484
+ If the :attr:`custom_id` of the :class:`~ discord.Modal` could not use as a function name,
485
485
or you want to give the function a different name then the custom_id use this one to set the custom_id.
486
486
You can also specify a regex and if the custom_id matches it, the function will be executed.
487
487
488
- .. note::
489
- As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
490
- of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
491
- Otherwise, something like 'suggestions_modal_submit_private' will let the function bee invoked too.
488
+ .. note::
489
+ As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
490
+ put ``^`` in front and ``$`` at the end
491
+ of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
492
+ Otherwise, something like 'suggestions_modal_submit_private' will let the function bee invoked too.
492
493
493
494
Example
494
495
-------
0 commit comments