Skip to content

Commit

Permalink
fix: invalid component type
Browse files Browse the repository at this point in the history
  • Loading branch information
eunwoo1104 committed Aug 27, 2023
1 parent 0d9c988 commit 87836a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dico/model/interactions/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,17 @@ class SelectMenu(Component):
def __init__(
self,
*,
component_type: typing.Union[int, "ComponentTypes"],
custom_id: str,
options: typing.List[typing.Union["SelectOption", dict]],
channel_types: typing.List[int] = None,
placeholder: typing.Optional[str] = None,
min_values: typing.Optional[int] = None,
max_values: typing.Optional[int] = None,
disabled: typing.Optional[bool] = None,
**_ # Dummy.
**kwargs
):
super().__init__(ComponentTypes.SELECT_MENU)
super().__init__(ComponentTypes(kwargs["type"]) if "type" in kwargs else ComponentTypes(int(component_type)))
self.custom_id: str = custom_id
self.options: typing.List[SelectOption] = [
SelectOption.create(x) if isinstance(x, dict) else x for x in options
Expand Down

0 comments on commit 87836a8

Please sign in to comment.