1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-09 23:39:50 +00:00

Add View.is_dispatching to detect whether a view has been added

This commit is contained in:
Rapptz 2021-06-04 04:30:19 -04:00
parent 9e4bcd3df7
commit dbd9ed2c41

@ -334,11 +334,16 @@ class View:
if self._cancel_callback:
self._cancel_callback(self)
self._cancel_callback = None
def is_finished(self) -> bool:
""":class:`bool`: Whether the view has finished interacting."""
return self._stopped.done()
def is_dispatching(self) -> bool:
""":class:`bool`: Whether the view has been added for dispatching purposes."""
return self._cancel_callback is not None
def is_persistent(self) -> bool:
""":class:`bool`: Whether the view is set up as persistent.