aboutsummaryrefslogtreecommitdiff
path: root/discord/components.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/components.py')
-rw-r--r--discord/components.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/components.py b/discord/components.py
index 1ddf7863..b9b7fb20 100644
--- a/discord/components.py
+++ b/discord/components.py
@@ -226,6 +226,8 @@ class SelectMenu(Component):
Defaults to 1 and must be between 1 and 25.
options: List[:class:`SelectOption`]
A list of options that can be selected in this menu.
+ disabled: :class:`bool`
+ Whether the select is disabled or not.
"""
__slots__: Tuple[str, ...] = (
@@ -234,6 +236,7 @@ class SelectMenu(Component):
'min_values',
'max_values',
'options',
+ 'disabled',
)
__repr_info__: ClassVar[Tuple[str, ...]] = __slots__
@@ -245,6 +248,7 @@ class SelectMenu(Component):
self.min_values: int = data.get('min_values', 1)
self.max_values: int = data.get('max_values', 1)
self.options: List[SelectOption] = [SelectOption.from_dict(option) for option in data.get('options', [])]
+ self.disabled: bool = data.get('disabled', False)
def to_dict(self) -> SelectMenuPayload:
payload: SelectMenuPayload = {
@@ -253,6 +257,7 @@ class SelectMenu(Component):
'min_values': self.min_values,
'max_values': self.max_values,
'options': [op.to_dict() for op in self.options],
+ 'disabled': self.disabled,
}
if self.placeholder: