Skip to content

Commit

Permalink
Merge pull request #48 from sushi-chaaaan/refactor/#37-conditional-vi…
Browse files Browse the repository at this point in the history
…ew-wait

refactor: wait for on_timeout only view is timed out
  • Loading branch information
sushichan044 authored Oct 17, 2023
2 parents 6c4e0f8 + 4d5ab70 commit 55f6f15
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ductile/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ async def wait(self) -> ViewResult:
"""
is_timed_out = await self.__raw_view.wait()

# this is got from discord.ui.View._dispatch_timeout()
timeout_task_name = f"discord-ui-view-timeout-{self.__raw_view.id}"
await wait_tasks_by_name([timeout_task_name])
if is_timed_out:
# this is got from discord.ui.View._dispatch_timeout()
timeout_task_name = f"discord-ui-view-timeout-{self.__raw_view.id}"
await wait_tasks_by_name([timeout_task_name])

d = {}
for key, state in self._get_all_state_in_view():
Expand Down

0 comments on commit 55f6f15

Please sign in to comment.