Browse Source
Add setter method for ChannelSelect.channel_types
pull/9077/head
cibere
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
discord/ui/select.py
@ -655,6 +655,15 @@ class ChannelSelect(BaseSelect[V]):
""" List[:class:`~discord.ChannelType`]: A list of channel types that can be selected. """
return self . _underlying . channel_types
@channel_types . setter
def channel_types ( self , value : List [ ChannelType ] ) - > None :
if not isinstance ( value , list ) :
raise TypeError ( ' channel_types must be a list of ChannelType ' )
if not all ( isinstance ( obj , ChannelType ) for obj in value ) :
raise TypeError ( ' all list items must be a ChannelType ' )
self . _underlying . channel_types = value
@property
def values ( self ) - > List [ Union [ AppCommandChannel , AppCommandThread ] ] :
""" List[Union[:class:`~discord.app_commands.AppCommandChannel`, :class:`~discord.app_commands.AppCommandThread`]]: A list of channels selected by the user. """