From b1fae0861a6011fb4c37859db2d78f7ceb4a7b13 Mon Sep 17 00:00:00 2001 From: khazhyk Date: Sun, 14 Apr 2019 18:50:28 -0700 Subject: add read-only cached_messages property to Client For those of us who want access to this sweet trove of zero hop messages --- discord/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'discord/client.py') diff --git a/discord/client.py b/discord/client.py index e0d7900b..2f70082b 100644 --- a/discord/client.py +++ b/discord/client.py @@ -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. -- cgit v1.2.3