Skip to content

Commit 4b614f0

Browse files
authored
Updatet Docs
1 parent 02a496a commit 4b614f0

17 files changed

+440
-169
lines changed
12.4 KB
Binary file not shown.
2.05 KB
Binary file not shown.

docs/_build/doctrees/index.doctree

6.76 KB
Binary file not shown.
3.84 KB
Binary file not shown.

docs/_build/html/_sources/components.rst.txt

Lines changed: 109 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,109 +6,160 @@
66
Components
77
==========
88

9+
.. _buttoncolor:
10+
11+
:class:`discord.ButtonColor`
12+
============================
13+
* ``blurple`` = 1
14+
* ``grey`` = 2
15+
* ``green`` = 3
16+
* ``red`` = 4
17+
* ``grey_url`` (navigates to an URL) = 5
18+
19+
.. _actionrow:
20+
921
:class:`discord.ActionRow(*args, **kwargs)`
10-
___________________________________________
22+
===========================================
1123

1224
Represents an ``ActionRow``-Part for the components of an :class:`discord.Message`
1325

26+
.. note::
27+
28+
You could use an :class:`list` instead of this but you dont have the functions and oarameters of this class then.
29+
30+
.. _actionrow-attributes:
31+
1432
Attributes
1533
----------
1634

17-
* :attr:`*args`: [Union[:class:`Button`, :class:`SelectionMenu`]]
18-
An array of :class:`Button`/s and/or :class:`SelectionMenu`/s.
35+
* :attr:`*args`: [Union[:class:`Button`, :class:`SelectionMenu`]]
36+
An array of :class:`Button`/s and/or :class:`SelectionMenu`/s.
1937

20-
* :attr:`force`: Optional[Bool]
21-
When set to ``True`` an Empty :class:`ActionRow` will be ignored
38+
.. _actionrow-force:
2239

23-
.. note::
24-
For more information about ActionRow's visit the `Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#actionrow>`_.
40+
* :attr:`force`: Optional[Bool]
41+
When set to ``True`` an Empty :class:`ActionRow` will be ignored
42+
43+
.. note::
44+
For more information about ActionRow's visit the `Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#actionrow>`_.
45+
46+
.. _actionrow-methodes:
2547

2648
Methodes
2749
--------
50+
.. _actionrow-sendable:
51+
52+
:meth:`sendable` -> Dict
53+
Makes the :class:`ActionRow` sendable to discord.
2854

29-
:meth:`sendable`: Dict
30-
Makes the :class:`ActionRow` sendable to discord.
55+
.. _actionrow-disable_all_buttons:
3156

32-
:meth:`disable_all_buttons()`
33-
Disable all objects's of type :class:`discord.Button` in this :class:`ActionRow`.
57+
:meth:`disable_all_buttons()`
58+
Disable all objects's of type :class:`discord.Button` in this :class:`ActionRow`.
59+
60+
:return: :class:`discord.ActionRow`
3461

35-
:return: :class:`discord.ActionRow`
62+
.. _actionrow-disable_all_buttons_if:
3663

37-
:meth:`disable_all_buttons_if(check: Union[Bool, Callable], **kwargs)`
38-
Disable all :class:`discord.Button` in this :class:`ActionRow` if the passed :attr:`check` ``True``.
64+
:meth:`disable_all_buttons_if(check: Union[Bool, Callable], **kwargs)`
65+
Disable all :class:`discord.Button` in this :class:`ActionRow` if the passed :attr:`check` ``True``.
3966

40-
**Parameters**
67+
**Parameters**
4168

42-
* :attr:`check`: Union[Bool, Callable]
43-
could be an :class:`bool` or usually any :obj:`Callable` that returns an :class:`bool`
44-
45-
* :attr:`**kwargs`
46-
:obj:`kwargs` that should passed in to the :attr:`check` if it is an :obj:`Callable`
69+
* :attr:`check`: Union[Bool, Callable]
70+
could be an :class:`bool` or usually any :obj:`Callable` that returns an :class:`bool`
71+
72+
* :attr:`**kwargs`
73+
:obj:`kwargs` that should passed in to the :attr:`check` if it is an :obj:`Callable`
4774

48-
:return: :class:`ActionRow`
75+
:return: :class:`ActionRow`
76+
77+
.. _button:
4978

5079
:class:`discord.Button(**kwargs)`
51-
_________________________________
80+
=================================
5281

5382
Represents an ``Discord-Button``
5483

5584
.. note::
5685
For more information Discord-Button's visit the `Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#buttons>`_.
57-
86+
87+
.. _button-attributes:
88+
5889
Attributes
5990
----------
6091

61-
:attr:`label`: :class:`str`
62-
The Text displayed in discord on the Button. Maximal lenght is 80 Chars.
63-
:attr:`custom_id`: Union[:class:`str`, :class:`int`]
64-
The custom_id discord send us when a User press the Button. The max. lenght of this is 100.
65-
:attr:`style`: Union[:class:`ButtonColor`, :class:`ButtonStyle`, Any[1, 2, 3, 4, 5]]
66-
The Style of the Button.
92+
.. _button-label:
6793

68-
.. note::
69-
To get more infos about the styles wisit
70-
`the Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#buttons-button-styles>`_.
94+
:attr:`label`: :class:`str`
95+
The Text displayed in discord on the Button. Maximal lenght is 80 Chars.
96+
97+
.. _button-custom_id:
7198

72-
:attr:`emoji`: Optional[Union[:class:`discord.PartialEmoji`, :class:`discord.Emoji`, :class:`str`]]
73-
The Emoji that will be displayed on the left side of the Button.
74-
:attr:`url`: Optional[:class:`str`]
75-
The url the Button includes
99+
:attr:`custom_id`: Union[:class:`str`, :class:`int`]
100+
The custom_id discord send us when a User press the Button. The max. lenght of this is 100.
101+
102+
.. _button-style:
76103

77-
.. note::
78-
if you set this, the :attr:`style` will automaticly set to :class:`ButtonStyle.Link_Button`
104+
:attr:`style`: Union[:class:`ButtonColor`, :class:`ButtonStyle`, Any[1, 2, 3, 4, 5]]
105+
The Style of the Button.
79106

80-
.. warning::
81-
82-
You cant pass an :attr:`custom_id` and a :attr:`url` beacuse discord dont send anything when clicking on an ``URL-Button`` so it dont accept both; :attr:`url`/ButtonStyle.Link_Button and :attr:`custom_id`!
107+
.. note::
108+
To get more infos about the styles wisit
109+
`the Discord-API Documentation <https://discord.com/developers/docs/interactions/message-components#buttons-button-styles>`_.
83110

84-
:attr:`disabled`: :class:`Bool`
85-
Whether the Button is disabled; defauld False.
111+
.. _button-emoji:
86112

113+
:attr:`emoji`: Optional[Union[:class:`discord.PartialEmoji`, :class:`discord.Emoji`, :class:`str`]]
114+
The Emoji that will be displayed on the left side of the Button.
115+
116+
.. _button-url:
117+
118+
:attr:`url`: Optional[:class:`str`]
119+
The URL the Button links too.
120+
121+
.. note::
122+
if you set this, the :attr:`style` will automaticly set to :class:`ButtonStyle.Link_Button`
123+
124+
.. warning::
125+
126+
You cant pass an :attr:`custom_id` and a :attr:`url` beacuse discord dont send anything when clicking on an ``URL-Button`` so it dont accept both; :attr:`url`/ButtonStyle.Link_Button and :attr:`custom_id`!
127+
128+
.. _button-disabled:
129+
130+
:attr:`disabled`: :class:`Bool`
131+
Whether the Button is disabled; defauld False.
132+
133+
.. _button-methodes:
87134

88135
Methodes
89136
--------
90137

91-
:meth:`disable_if`
92-
Disable the :class:`Button` if the passed :attr:`check` returns ``True``.
138+
.. _button-disable_if:
93139

94-
* :attr:`check`: typing.Union[bool, typing.Callable]
95-
Could be an :class:`bool` or usually any :class:`Callable` that returns an :class:`bool`
140+
:meth:`disable_if`
141+
142+
Disable the :class:`Button` if the passed :attr:`check` returns ``True``.
143+
* :attr:`check`: typing.Union[bool, typing.Callable]
144+
Could be an :class:`bool` or usually any :class:`Callable` that returns an :class:`bool`
145+
* :attr:`**kwargs`: Any[SupportsIndex]
146+
Arguments that should passed in to the :attr:`check` if it is an :class:`Callable`
96147

97-
* :attr:`**kwargs`: Any[SupportsIndex]
98-
Arguments that should passed in to the :attr:`check` if it is an :class:`Callable`
148+
:return: :class:`discord.Button`
149+
150+
.. _button-set_color_if:
99151

100-
:return: :class:`discord.Button`
152+
:meth:`set_color_if`
101153

102-
:meth:`set_color_if`
103-
Sets the Color(Style) of an :class:`discord.Button` to the provided :attr:`color` if the passed :attr:`check` returns ``True``.
104-
105-
* :attr:`check`: could be an :class:`bool` or usaly any :obj:`Callable` that returns an :class:`bool`
154+
Sets the Color(Style) of an :class:`discord.Button` to the provided :attr:`color` if the passed :attr:`check` returns ``True``.
155+
156+
* :attr:`check`: could be an :class:`bool` or usaly any :obj:`Callable` that returns an :class:`bool`
157+
158+
* :attr:`color`: the Color(Style) that should set if the :attr:`check` returns ``True``
106159

107-
* :attr:`color`: the Color(Style) that should set if the :attr:`check` returns ``True``
108-
109-
* :attr:`**kwargs`: ``kwargs`` that should passed in to the :attr:`check` if it is an :class:`Callable`
160+
* :attr:`**kwargs`: ``kwargs`` that should passed in to the :attr:`check` if it is an :class:`Callable`
110161

111-
:return: :class:`discord.Button`
162+
:return: :class:`discord.Button`
112163

113164
.. toctree::
114165
:maxdepth: 3

docs/_build/html/_sources/index.rst.txt

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@
66
Welcome to discord.py-message-component's documentation!
77
=========================================================
88

9+
.. image:: https://cdn.discordapp.com/attachments/852872100073963532/854711446767796286/discord.py-message-components.png
10+
:target: https://pypi.org/project/discord.py-message-components
11+
:alt: Name of the project
12+
13+
.. image:: https://discord.com/api/guilds/852871920411475968/embed.png
14+
:target: https://discord.gg/sb69muSqsg
15+
:alt: Discord Server Invite
16+
17+
.. image:: https://img.shields.io/pypi/v/discord.py-message-components.svg
18+
:target: https://pypi.python.org/pypi/discord.py-message-components
19+
:alt: PyPI version info
20+
21+
.. image:: https://img.shields.io/pypi/pyversions/discord.py-message-components.svg
22+
:target: https://pypi.python.org/pypi/discord.py-message-components
23+
:alt: PyPI supported Python versions
24+
25+
.. image:: https://static.pepy.tech/personalized-badge/discord-py-message-components?period=total&units=international_system&left_color=grey&right_color=green&left_text=Downloads
26+
:target: https://pepy.tech/project/discord.py-message-components
27+
:alt: Total downloads for the project
28+
29+
.. image:: https://readthedocs.org/projects/discordpy-message-components/badge/?version=latest
30+
:target: https://discordpy-message-components.readthedocs.io/en/latest/
31+
:alt: Documentation Status
32+
33+
The Original `discord.py <https://pypi.org/project/discord.py>`_ Library made by `Rapptz <https://github.com/Rapptz>`_ with implementation of the `Discord-Message-Components <https://discord.com/developers/docs/interactions/message-components>`_ by `mccoderpy <https://github.com/mccoderpy/>`_
34+
35+
- `read the docs <https://discordpy-message-components.readthedocs.io/en/latest/>`_
36+
937
Installing:
1038
___________
1139

@@ -115,9 +143,9 @@ respond to an button when he pressed by a user
115143
client.run('Your Bot-Token')
116144
117145
.. note::
118-
You could set the Paramerter ``hidden`` in the respond to True, to make the Message ephemeral.
119-
120-
Wisit `discord.Interaction.respond <./interaction.html#respond>`_ to get more information about the :meth:`respond`.
146+
147+
You could set the parameter :attr:`hidden` in the respond to ``True`` to make the message ephemeral.
148+
Visit `discord.Interaction.respond <./interaction.html#interaction-respond>`_ for more information about :meth:`respond()`.
121149

122150

123151
.. toctree::

docs/_build/html/_sources/interaction.rst.txt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Interaction
77
===========
88

9+
:ref:`Hallo <interaction-respond>`
10+
911
:class:`discord.Interaction`
1012
____________________________
1113

@@ -20,9 +22,14 @@ Represents an interaction createt in discord like click an :class:`discord.Butto
2022
Attributes
2123
----------
2224

25+
.. _interaction-author:
26+
2327
:attr:`author`: :class:`discord.abc.User`
2428
A :class:`Member` that invoked the interaction. If :attr:`channel` is a
2529
private channel or the user has left the guild, then it is a :class:`User` instead.
30+
31+
.. _interaction-message:
32+
2633
:attr:`message`: :class:`discord.Message`
2734
The message the component was attachet to.
2835
This will be equal to ``None`` if the :attr:`component_type` is ``None`` or the message the component is attached to is ``emphemberal``.
@@ -31,12 +38,20 @@ Attributes
3138
In this version, this parameter should alwasys be an object of type :class:`discord.Message`
3239
(or ``None`` if the message is emphemberal) beacuse it only gets initiatet when the interaction_type is highter than 2
3340

41+
.. _interaction-channel:
42+
3443
:attr:`channel`: Union[:class:`discord.TextChannel`, :class:`discord.DMChannel`]
3544
The Channel the interaction was createt in this is aiter an object of :class:`discord.TextChannel` if it's
3645
inside a guild else it's an object of type :class:`discord.DMChannel`.
46+
47+
.. _interaction-guild:
48+
3749
:attr:`guild`: Union[:class:`discord.Guild`, :class:`None`]
3850
The guild asotiatet with the interaction; aiter an object of type :class:`discord.Guild`,
3951
except the interaction was inside an dm-channel then this would be equal to ``None``
52+
53+
.. _interaction-component:
54+
4055
:attr:`component`: Union[:class:`ButtonClick`, :class:`SelectionSelect`]
4156
The component that invoked this interaction: Aiter an object of type :class:`ButtonClick` or :class:`SelectionSelect`
4257

@@ -46,6 +61,8 @@ Attributes
4661
Methodes
4762
--------
4863

64+
.. _interaction-defer:
65+
4966
:meth:`defer`: None
5067
'Defers' the response, showing a loading state to the use.
5168

@@ -59,21 +76,25 @@ Methodes
5976
A Token will be Valid for 15 Minutes so you could edit the original :attr:`message` with :meth:`edit`, :meth:`respond` or doing anything other with this interaction for 15 minutes.
6077
After that time you have to edit the original message with the Methode :meth:`edit` of the :attr:`message` and sending new messages with the :meth:`send` Methode of :attr:`channel`
6178
(you could not do this hidden as it isn't an respond anymore and also you could not pass more than one :class:`Embed`)
79+
80+
.. _interaction-respond:
6281

6382
:meth:`respond`: Union[:class:`discord.Message`, :class:`discord.EphemeralMessage`]
6483
You could pass the same Paramerts as using :meth:`discord.Messageable.send` but there are two more optional:
65-
84+
6685
* :attr:`embeds` Optional[List[discord.Embed]]
6786
An :class:`list` containing up to 10 Embeds that should send with the respond.
87+
6888
* :attr:`hidden` Optional[Bool]
6989
If set to ``True``, the message will be only vible for the :attr:`author` of the Interaction and will disapears if the :attr:`author` click on ``delete this message`` or reloads the client.
70-
90+
7191
.. note::
7292
If you send an ``hidden`` (emphemberal)-respond, discord dont returns any data like an message you could edit,
7393
**but** you could resive Interactions when the Author interact with an component
7494

7595
Responds to an interaction by sending a message that can be made visible only to the person who invoked the interaction by setting the :attr:`hidden` to ``True``.
7696

97+
7798
.. toctree::
7899
:maxdepth: 3
79100
:caption: Contents:

0 commit comments

Comments
 (0)