Skip to content

Commit

Permalink
refactor: wait for on_timeout only view is timed out
Browse files Browse the repository at this point in the history
  • Loading branch information
sushichan044 committed Oct 17, 2023
1 parent 6c4e0f8 commit 4d5ab70
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 4d5ab70

Please sign in to comment.