diff options
| author | Rapptz <[email protected]> | 2021-06-30 02:55:03 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-06-30 02:55:03 -0400 |
| commit | 157caaec7c5f58b5d8188c5eaf90bb7fa4ef397b (patch) | |
| tree | 596d0d2e23d945f0b86b104d6a4d3f4217ae7a5e | |
| parent | Fix potential None access in various StageChannel properties (diff) | |
| download | discord.py-157caaec7c5f58b5d8188c5eaf90bb7fa4ef397b.tar.xz discord.py-157caaec7c5f58b5d8188c5eaf90bb7fa4ef397b.zip | |
Add conversion routine for SelectMenu to ui.Select
| -rw-r--r-- | discord/ui/view.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/discord/ui/view.py b/discord/ui/view.py index 8de7a959..42dc8da3 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -33,12 +33,12 @@ import sys import time import os from .item import Item, ItemCallbackType -from ..enums import ComponentType from ..components import ( Component, ActionRow as ActionRowComponent, _component_factory, Button as ButtonComponent, + SelectMenu as SelectComponent, ) __all__ = ( @@ -65,6 +65,10 @@ def _component_to_item(component: Component) -> Item: from .button import Button return Button.from_component(component) + if isinstance(component, SelectComponent): + from .select import Select + + return Select.from_component(component) return Item.from_component(component) |