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

@@ -688,8 +688,11 @@ class ConnectionState:
if data['type'] == 3: # interaction component
custom_id = interaction.data['custom_id'] # type: ignore
component_type = interaction.data['component_type'] # type: ignore
self._view_store.dispatch(component_type, custom_id, interaction)
self._view_store.dispatch_view(component_type, custom_id, interaction)
elif data['type'] == 5: # modal submit
custom_id = interaction.data['custom_id'] # type: ignore
components = interaction.data['components'] # type: ignore
self._view_store.dispatch_modal(custom_id, interaction, components) # type: ignore
self.dispatch('interaction', interaction)
def parse_presence_update(self, data) -> None: