mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-05 11:27:13 +00:00
Add conversion routine for SelectMenu to ui.Select
This commit is contained in:
parent
62dad0f7bf
commit
157caaec7c
@ -33,12 +33,12 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
from .item import Item, ItemCallbackType
|
from .item import Item, ItemCallbackType
|
||||||
from ..enums import ComponentType
|
|
||||||
from ..components import (
|
from ..components import (
|
||||||
Component,
|
Component,
|
||||||
ActionRow as ActionRowComponent,
|
ActionRow as ActionRowComponent,
|
||||||
_component_factory,
|
_component_factory,
|
||||||
Button as ButtonComponent,
|
Button as ButtonComponent,
|
||||||
|
SelectMenu as SelectComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
@ -65,6 +65,10 @@ def _component_to_item(component: Component) -> Item:
|
|||||||
from .button import Button
|
from .button import Button
|
||||||
|
|
||||||
return Button.from_component(component)
|
return Button.from_component(component)
|
||||||
|
if isinstance(component, SelectComponent):
|
||||||
|
from .select import Select
|
||||||
|
|
||||||
|
return Select.from_component(component)
|
||||||
return Item.from_component(component)
|
return Item.from_component(component)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user