mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-03-05 03:02:49 +00:00
Add support for new modal components
This commit is contained in:
@@ -506,10 +506,8 @@ class Select(BaseSelect[V]):
|
||||
|
||||
@options.setter
|
||||
def options(self, value: List[SelectOption]) -> None:
|
||||
if not isinstance(value, list):
|
||||
if not isinstance(value, list) or not all(isinstance(obj, SelectOption) for obj in value):
|
||||
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
|
||||
|
||||
@@ -576,7 +574,7 @@ class Select(BaseSelect[V]):
|
||||
"""
|
||||
|
||||
if len(self._underlying.options) >= 25:
|
||||
raise ValueError('maximum number of options already provided')
|
||||
raise ValueError('maximum number of options already provided (25)')
|
||||
|
||||
self._underlying.options.append(option)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user