add read-only cached_messages property to Client

For those of us who want access to this sweet trove of zero hop messages
This commit is contained in:
khazhyk
2019-04-14 18:50:28 -07:00
committed by Rapptz
parent 296d4bf580
commit b1fae0861a
3 changed files with 39 additions and 2 deletions

View File

@ -227,6 +227,14 @@ class Client:
"""List[:class:`.Emoji`]: The emojis that the connected client has."""
return self._connection.emojis
@property
def cached_messages(self):
"""Sequence[:class:`~discord.Message`]: Read-only list of messages the connected client has cached.
.. versionadded:: 1.1.0
"""
return utils.SequenceProxy(self._connection._messages)
@property
def private_channels(self):
"""List[:class:`abc.PrivateChannel`]: The private channels that the connected client is participating on.