Fix ui.Select.values in modals

This commit is contained in:
Mikey
2022-08-14 12:25:43 -07:00
committed by GitHub
parent 584c22f642
commit 9c38cf3aef
3 changed files with 18 additions and 11 deletions

View File

@ -174,9 +174,11 @@ class Modal(View):
continue
item._refresh_state(component) # type: ignore
async def _scheduled_task(self, interaction: Interaction):
async def _scheduled_task(self, interaction: Interaction, components: List[ModalSubmitComponentInteractionDataPayload]):
try:
self._refresh_timeout()
self._refresh(components)
allow = await self.interaction_check(interaction)
if not allow:
return
@ -189,8 +191,10 @@ class Modal(View):
# In the future, maybe this will require checking if we set an error response.
self.stop()
def _dispatch_submit(self, interaction: Interaction) -> None:
asyncio.create_task(self._scheduled_task(interaction), name=f'discord-ui-modal-dispatch-{self.id}')
def _dispatch_submit(
self, interaction: Interaction, components: List[ModalSubmitComponentInteractionDataPayload]
) -> None:
asyncio.create_task(self._scheduled_task(interaction, components), name=f'discord-ui-modal-dispatch-{self.id}')
def to_dict(self) -> Dict[str, Any]:
payload = {