Skip to content

Commit 08c8875

Browse files
Add the ability to disable selcets (#248)
* Add the ability to disable selcets * Update discord_slash/utils/manage_components.py Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Co-authored-by: Ben Woo <30431861+benwoo1110@users.noreply.github.com>
1 parent 26eb863 commit 08c8875

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

discord_slash/utils/manage_components.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def create_select(
202202
placeholder: typing.Optional[str] = None,
203203
min_values: typing.Optional[int] = None,
204204
max_values: typing.Optional[int] = None,
205+
disabled: bool = False,
205206
):
206207
"""
207208
Creates a select (dropdown) component for use with the ``components`` field. Must be inside an ActionRow to be used (see :meth:`create_actionrow`).
@@ -211,6 +212,7 @@ def create_select(
211212
:param placeholder: Custom placeholder text if nothing is selected
212213
:param min_values: The minimum number of items that **must** be chosen
213214
:param max_values: The maximum number of items that **can** be chosen
215+
:param disabled: Disables this component. Defaults to ``False``.
214216
"""
215217
if not len(options) or len(options) > 25:
216218
raise IncorrectFormat("Options length should be between 1 and 25.")
@@ -222,6 +224,7 @@ def create_select(
222224
"placeholder": placeholder or "",
223225
"min_values": min_values,
224226
"max_values": max_values,
227+
"disabled": disabled,
225228
}
226229

227230

0 commit comments

Comments
 (0)