From f61f7411dfacbdd59b6074bf3817dc73735bf1f7 Mon Sep 17 00:00:00 2001 From: cibere <71997063+cibere@users.noreply.github.com> Date: Thu, 17 Nov 2022 02:46:09 -0800 Subject: [PATCH] Add setter method for ChannelSelect.channel_types --- discord/ui/select.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/discord/ui/select.py b/discord/ui/select.py index aa3126b26..45fca382d 100644 --- a/discord/ui/select.py +++ b/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."""