Skip to content

Commit 151685a

Browse files
committed
fix(docs): fixed some external references
1 parent 2696b9c commit 151685a

File tree

2 files changed

+37
-36
lines changed

2 files changed

+37
-36
lines changed

discord/client.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,7 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
11491149
[Awaitable[Any]], Awaitable[Any]
11501150
]:
11511151
"""
1152-
1153-
A decorator that registers a raw_button_click event that checks on execution if the ``custom_id's`` are the same;
1154-
if so, the decorated function is called.
1152+
A decorator with wich you can assign a function to a specific :class:`~discord.Button` (or its custom_id).
11551153
11561154
.. important::
11571155
The function this is attached to must take the same parameters as a
@@ -1167,10 +1165,11 @@ def on_click(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
11671165
or you want to give the function a different name then the custom_id use this one to set the custom_id.
11681166
You can also specify a regex and if the custom_id matches it, the function will be executed.
11691167
1170-
.. note::
1171-
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1172-
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1173-
Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
1168+
.. note::
1169+
As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
1170+
put ``^`` in front and ``$`` at the end
1171+
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1172+
Otherwise, something like 'cool blue Button is blue' will let the function bee invoked too.
11741173
11751174
Example
11761175
-------
@@ -1234,10 +1233,11 @@ def on_select(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
12341233
or you want to give the function a different name then the custom_id use this one to set the custom_id.
12351234
You can also specify a regex and if the custom_id matches it, the function will be executed.
12361235
1237-
.. note::
1238-
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1239-
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1240-
Otherwise, something like 'choose_your_gender later' will let the function bee invoked too.
1236+
.. note::
1237+
As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
1238+
put ``^`` in front and ``$`` at the end
1239+
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1240+
Otherwise, something like 'choose_your_gender later' will let the function bee invoked too.
12411241
12421242
Example
12431243
-------
@@ -1284,8 +1284,7 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
12841284
[Awaitable[Any]], Awaitable[Any]
12851285
]:
12861286
"""
1287-
A decorator that registers an :func:`on_modal_submit` event that checks on execution if the ``custom_id's`` are the same;
1288-
if so, the decorated function is called.
1287+
A decorator with wich you can assign a function to a specific :class:`~discord.Modal` (or its custom_id).
12891288
12901289
.. important::
12911290
The function this is attached to must take the same parameters as a
@@ -1302,10 +1301,11 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
13021301
or you want to give the function a different name then the custom_id use this one to set the custom_id.
13031302
You can also specify a regex and if the custom_id matches it, the function will be executed.
13041303
1305-
.. note::
1306-
As the :attr:`custom_id` is converted to a :class:`re.Pattern` put ``^`` in front and ``$`` at the end
1307-
of the :attr:`custom_id` if you want that the custom_id must exactly match the specified value.
1308-
Otherwise, something like 'suggestions_modal_submit_private' will let the function bee invoked too.
1304+
.. note::
1305+
As the :attr:`custom_id` is converted to a `Pattern <https://docs.python.org/3.9/library/re.html#re-objects>`_
1306+
put ``^`` in front and ``$`` at the end of the :attr:`custom_id` if you want that the custom_id must
1307+
exactly match the specified value.
1308+
Otherwise, something like 'suggestions_modal_submit_private' will let the function bee invoked too.
13091309
13101310
Example
13111311
-------

discord/ext/commands/cog.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ def on_click(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) ->
339339
[Awaitable[Any]], Awaitable[Any]
340340
]:
341341
"""
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).
344343
345344
.. important::
346345
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) ->
356355
or you want to give the function a different name then the custom_id use this one to set the custom_id.
357356
You can also specify a regex and if the custom_id matches it, the function will be executed.
358357
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.
363363
364364
Example
365365
-------
@@ -402,7 +402,7 @@ def on_select(cls, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None) -
402402
[Awaitable[Any]], Awaitable[Any]
403403
]:
404404
"""
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).
406406
407407
.. important::
408408
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) -
414414
Parameters
415415
-----------
416416
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,
418418
or you want to give the function a different name then the custom_id use this one to set the custom_id.
419419
You can also specify a regex and if the custom_id matches it, the function will be executed.
420420
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.
425426
426427
Example
427428
-------
@@ -468,8 +469,7 @@ def on_submit(self, custom_id: Optional[Union[Pattern[AnyStr], AnyStr]] = None)
468469
[Awaitable[Any]], Awaitable[Any]
469470
]:
470471
"""
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).
473473
474474
.. important::
475475
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)
481481
Parameters
482482
----------
483483
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,
485485
or you want to give the function a different name then the custom_id use this one to set the custom_id.
486486
You can also specify a regex and if the custom_id matches it, the function will be executed.
487487
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.
492493
493494
Example
494495
-------

0 commit comments

Comments
 (0)