Add View.is_finished() to query listening state

This commit is contained in:
Rapptz 2021-05-31 00:12:08 -04:00
parent 61a189c217
commit 2ed3e049e1

View File

@ -335,6 +335,10 @@ class View:
if self._cancel_callback:
self._cancel_callback(self)
def is_finished(self) -> bool:
""":class:`bool`: Whether the view has finished interacting."""
return self._stopped.done()
async def wait(self) -> bool:
"""Waits until the view has finished interacting.