mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Allow assigning Select.options to refresh the select menu
This commit is contained in:
parent
02c317d9a4
commit
1b15772671
@ -160,6 +160,15 @@ class Select(Item[V]):
|
||||
"""List[:class:`discord.SelectOption`]: A list of options that can be selected in this menu."""
|
||||
return self._underlying.options
|
||||
|
||||
@options.setter
|
||||
def options(self, value: List[SelectOption]):
|
||||
if not isinstance(value, list):
|
||||
raise TypeError('options must be a list of SelectOption')
|
||||
if not all(isinstance(obj, SelectOption) for obj in value):
|
||||
raise TypeError('all list items must subclass SelectOption')
|
||||
|
||||
self._underlying.options = value
|
||||
|
||||
def add_option(
|
||||
self,
|
||||
*,
|
||||
|
Loading…
x
Reference in New Issue
Block a user