|
|
@ -250,7 +250,8 @@ class View: |
|
|
|
self._timeout_handler = loop.call_later(self.timeout, self.dispatch_timeout) |
|
|
|
|
|
|
|
def dispatch_timeout(self): |
|
|
|
self._stopped.set_result(True) |
|
|
|
if not self._stopped.done(): |
|
|
|
self._stopped.set_result(True) |
|
|
|
asyncio.create_task(self.on_timeout(), name=f'discord-ui-view-timeout-{self.id}') |
|
|
|
|
|
|
|
def dispatch(self, state: Any, item: Item, interaction: Interaction): |
|
|
@ -282,7 +283,9 @@ class View: |
|
|
|
|
|
|
|
This operation cannot be undone. |
|
|
|
""" |
|
|
|
self._stopped.set_result(False) |
|
|
|
if not self._stopped.done(): |
|
|
|
self._stopped.set_result(False) |
|
|
|
|
|
|
|
if self._timeout_handler: |
|
|
|
self._timeout_handler.cancel() |
|
|
|
|
|
|
|