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

Code before:
    def _refresh_state(self, interaction: Interaction, data: SelectMessageComponentInteractionData) -> None:
        values = selected_values.get({})
        payload: List[PossibleValue]
        try:
            resolved = Namespace._get_resolved_items(interaction, data['resolved'])
            payload = list(resolved.values())
        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


Review comment (suggestion):
```suggestion
        defaults: Sequence[ValidDefaultValues], value_type: Optional[SelectDefaultValueType] = None
```

Code after:
            type=type,
            custom_id=custom_id,
            placeholder=placeholder,
            min_values=min_values,
            max_values=max_values,
            disabled=disabled,
            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: