From 2ed3e049e1f36a30024fbed0a2ae2a75878d0b96 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 31 May 2021 00:12:08 -0400 Subject: Add View.is_finished() to query listening state --- discord/ui/view.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'discord') diff --git a/discord/ui/view.py b/discord/ui/view.py index 55806830..13016a8e 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -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. -- cgit v1.2.3