diff options
| author | Rapptz <[email protected]> | 2021-05-31 23:15:12 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-05-31 23:15:12 -0400 |
| commit | 78275023ccdbb460d0cd207834882ff29ae4e10c (patch) | |
| tree | 945cd5b397306b8e2a021d3858096364af0df6d7 /discord/client.py | |
| parent | Ensure views added to Client.add_view are persistent views (diff) | |
| download | discord.py-78275023ccdbb460d0cd207834882ff29ae4e10c.tar.xz discord.py-78275023ccdbb460d0cd207834882ff29ae4e10c.zip | |
Add Client.persistent_views to get all persistent views
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py index cc793c0b..27ec55c1 100644 --- a/discord/client.py +++ b/discord/client.py @@ -29,7 +29,7 @@ import logging import signal import sys import traceback -from typing import Any, Generator, List, Optional, TYPE_CHECKING, TypeVar, Union +from typing import Any, Generator, List, Optional, Sequence, TYPE_CHECKING, TypeVar, Union import aiohttp @@ -1463,3 +1463,8 @@ class Client: raise ValueError('View is not persistent. Items need to have a custom_id set and View must have no timeout') self._connection.store_view(view, message_id) + + @property + def persistent_views(self) -> Sequence[View]: + """Sequence[:class:`View`]: A sequence of persistent views added to the client.""" + return self._connection.persistent_views |