Repository: Rapptz/discord.py
File: discord/ui/select.py (Python)

Code before:
        except KeyError:
            payload = data.get("values", [])  # type: ignore

        self._values = values[self.custom_id] = payload
        selected_values.set(values)

    def is_dispatchable(self) -> bool:
        return True

    @classmethod
    def from_component(cls, component: SelectMenu) -> Self:
        return cls(
            **{k: getattr(component, k) for k in cls.__item_repr_attributes__},
            custom_id=component.custom_id,
            row=None,
        )

    @staticmethod
    def _handle_select_defaults(
        defaults: List[ValidDefaultValues], value_type: Optional[SelectDefaultValueType] = None
    ) -> List[SelectDefaultValue]:
        if not defaults:
            return []

        if not isinstance(defaults, list):
            raise TypeError('default_values must be a list.')

        from ..app_commands import AppCommandChannel, AppCommandThread

        default_type_to_enum: Dict[Type[ValidDefaultValues], SelectDefaultValueType] = {
            User: SelectDefaultValueType.user,
            Member: SelectDefaultValueType.user,
            Role: SelectDefaultValueType.role,
            GuildChannel: SelectDefaultValueType.channel,
            AppCommandChannel: SelectDefaultValueType.channel,
            AppCommandThread: SelectDefaultValueType.channel,
            Thread: SelectDefaultValueType.channel,
        }

        values: List[SelectDefaultValue] = []
        for obj in defaults:
            if isinstance(obj, SelectDefaultValue):
                values.append(obj)
                continue

            if not value_type and isinstance(obj, Object) and obj.type == Object:
                raise ValueError(
                    "Object must have a type specified for the chosen select type. Please pass one using the `type` kwarg."
                )

            if not isinstance(obj, (Object, Role, Member, User, GuildChannel, AppCommandChannel, AppCommandThread, Thread)):

Review comment (suggestion):
This is too restrictive, I'd just remove the check.
```suggestion
```

Code after:
            channel_types=[] if channel_types is MISSING else channel_types,
            options=[] if options is MISSING else options,
            default_values=[] if default_values is MISSING else default_values,
        )

        self.row = row
        self._values: List[PossibleValue] = []

    @property
    def values(self) -> List[PossibleValue]:
        values = selected_values.get({})
        return values.get(self.custom_id, self._values)

    @property
    def custom_id(self) -> str:
        """:class:`str`: The ID of the select menu that gets received during an interaction."""
        return self._underlying.custom_id

    @custom_id.setter
    def custom_id(self, value: str) -> None:
        if not isinstance(value, str):
            raise TypeError('custom_id must be a str')

        self._underlying.custom_id = value
        self._provided_custom_id = True

    @property
    def placeholder(self) -> Optional[str]:
        """Optional[:class:`str`]: The placeholder text that is shown if nothing is selected, if any."""
        return self._underlying.placeholder

    @placeholder.setter
    def placeholder(self, value: Optional[str]) -> None:
        if value is not None and not isinstance(value, str):
            raise TypeError('placeholder must be None or str')

        self._underlying.placeholder = value

    @property
    def min_values(self) -> int:
        """:class:`int`: The minimum number of items that must be chosen for this select menu."""
        return self._underlying.min_values

    @min_values.setter
    def min_values(self, value: int) -> None:
        self._underlying.min_values = int(value)

    @property
    def max_values(self) -> int:
        """:class:`int`: The maximum number of items that can be chosen for this select menu."""
        return self._underlying.max_values