Add support for Modal Interactions

This commit is contained in:
Josh
2022-02-20 19:57:44 +10:00
committed by GitHub
parent 964ca0a6f1
commit 19c6687b55
13 changed files with 679 additions and 17 deletions

View File

@ -47,7 +47,7 @@ if TYPE_CHECKING:
from .view import View
from ..types.components import SelectMenu as SelectMenuPayload
from ..types.interactions import (
ComponentInteractionData,
MessageComponentInteractionData,
)
S = TypeVar('S', bound='Select')
@ -270,8 +270,7 @@ class Select(Item[V]):
def refresh_component(self, component: SelectMenu) -> None:
self._underlying = component
def refresh_state(self, interaction: Interaction) -> None:
data: ComponentInteractionData = interaction.data # type: ignore
def refresh_state(self, data: MessageComponentInteractionData) -> None:
self._selected_values = data.get('values', [])
@classmethod