You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates list of actionsrows from given components.
31
+
A helper function that spreads your components into ``actionrows`` of a set size
32
32
33
33
:param components: Components dicts (buttons or selects or existing actionrows) to spread. Use `None` to explicitly start a new row.
34
34
:type components: dict
35
35
:param max_in_row: Maximum number of elements in each row.
36
36
:type max_in_row: int
37
37
:return: list
38
+
39
+
.. note:: An action_row can only have a maximum of 5 items in it
38
40
"""
39
41
ifnotcomponentsorlen(components) >25:
40
42
raiseIncorrectFormat("Number of components should be between 1 and 25.")
@@ -94,7 +96,7 @@ def create_button(
94
96
disabled: bool=False,
95
97
) ->dict:
96
98
"""
97
-
Creates a button component for use with the ``components`` field. Must be inside an ActionRow to be used (see :meth:`create_actionrow`).
99
+
Creates a button component for use with the ``components`` field. Must be used within an ``actionRow`` to be used (see :meth:`create_actionrow`).
98
100
99
101
.. note::
100
102
At least a label or emoji is required for a button. You can have both, but not neither of them.
@@ -152,6 +154,9 @@ def create_select_option(
152
154
"""
153
155
Creates an option for select components.
154
156
157
+
.. warning::
158
+
Currently, select components are not available for public use, nor do they have official documentation. The parameters will not be documented at this time.
159
+
155
160
:param label: The label of the option.
156
161
:param value: The value that the bot will recieve when this option is selected.
157
162
:param emoji: The emoji of the option.
@@ -179,8 +184,9 @@ def create_select(
179
184
"""
180
185
Creates a select (dropdown) component for use with the ``components`` field. Must be inside an ActionRow to be used (see :meth:`create_actionrow`).
181
186
187
+
182
188
.. warning::
183
-
Currently, select components are not available for public use, nor have official documentation. The parameters will not be documented at this time.
189
+
Currently, select components are not available for public use, nor do they have official documentation. The parameters will not be documented at this time.
184
190
"""
185
191
ifnotlen(options) orlen(options) >25:
186
192
raiseIncorrectFormat("Options length should be between 1 and 25.")
Returns generator with id of message or list messages.
231
+
Returns generator with the ``id`` of message or list messages.
226
232
227
233
:param message: message ID or message object or list of previous two.
228
234
:returns: typing.Iterator[int]
@@ -249,6 +255,7 @@ async def wait_for_component(
249
255
) ->ComponentContext:
250
256
"""
251
257
Helper function - wrapper around 'client.wait_for("component", ...)'
258
+
252
259
Waits for a component interaction. Only accepts interactions based on the custom ID of the component or/and message ID, and optionally a check function.
Copy file name to clipboardExpand all lines: docs/components.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -75,4 +75,4 @@ Well lucky for you, you don't have to. You can either respond silently, with a t
75
75
How do i know which button was pressed?
76
76
_______________________________________
77
77
78
-
Each button gets a ``custom_id``, this is a unique identifier of which button is being pressed. You can specify what the ID is when you define your button, if you don't; a random one will be generated. When handling the event, simply check the custom_id, and handle accordingly.
78
+
Each button gets a ``custom_id`` (which is always a string), this is a unique identifier of which button is being pressed. You can specify what the ID is when you define your button, if you don't; a random one will be generated. When handling the event, simply check the custom_id, and handle accordingly.
0 commit comments