mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Implement New Select Types
Co-authored-by: Soheab_ <33902984+Soheab@users.noreply.github.com> Co-authored-by: rdrescher909 <51489753+rdrescher909@users.noreply.github.com> Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
@ -163,21 +163,21 @@ class Modal(View):
|
||||
"""
|
||||
_log.error('Ignoring exception in modal %r:', self, exc_info=error)
|
||||
|
||||
def _refresh(self, components: Sequence[ModalSubmitComponentInteractionDataPayload]) -> None:
|
||||
def _refresh(self, interaction: Interaction, components: Sequence[ModalSubmitComponentInteractionDataPayload]) -> None:
|
||||
for component in components:
|
||||
if component['type'] == 1:
|
||||
self._refresh(component['components'])
|
||||
self._refresh(interaction, component['components'])
|
||||
else:
|
||||
item = find(lambda i: i.custom_id == component['custom_id'], self._children) # type: ignore
|
||||
if item is None:
|
||||
_log.debug("Modal interaction referencing unknown item custom_id %s. Discarding", component['custom_id'])
|
||||
continue
|
||||
item._refresh_state(component) # type: ignore
|
||||
item._refresh_state(interaction, component) # type: ignore
|
||||
|
||||
async def _scheduled_task(self, interaction: Interaction, components: List[ModalSubmitComponentInteractionDataPayload]):
|
||||
try:
|
||||
self._refresh_timeout()
|
||||
self._refresh(components)
|
||||
self._refresh(interaction, components)
|
||||
|
||||
allow = await self.interaction_check(interaction)
|
||||
if not allow:
|
||||
|
Reference in New Issue
Block a user