aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-08-27 04:49:23 -0400
committerRapptz <[email protected]>2019-08-27 04:50:50 -0400
commitcf79816c5dc5aa3a797137092644c7b6f858d2fe (patch)
tree74fc4e30e582f6997bd12d0ca7956104dd8a7391 /discord/client.py
parentAdd Message.is_system to more intuitively filter system messages. (diff)
downloaddiscord.py-cf79816c5dc5aa3a797137092644c7b6f858d2fe.tar.xz
discord.py-cf79816c5dc5aa3a797137092644c7b6f858d2fe.zip
Allow disabling the message cache with max_messages=None
This also changes the default to 1000 instead of 5000 since it can take some time for small bots to cycle through the default and they make up the majority of it.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/discord/client.py b/discord/client.py
index 333db804..e5712454 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -122,8 +122,10 @@ class Client:
-----------
max_messages: Optional[:class:`int`]
The maximum number of messages to store in the internal message cache.
- This defaults to 5000. Passing in ``None`` or a value less than 100
- will use the default instead of the passed in value.
+ This defaults to 1000. Passing in ``None`` disables the message cache.
+
+ .. versionchanged:: 1.3
+ Allow disabling the message cache and change the default size to 1000.
loop: Optional[:class:`asyncio.AbstractEventLoop`]
The :class:`asyncio.AbstractEventLoop` to use for asynchronous operations.
Defaults to ``None``, in which case the default event loop is used via
@@ -274,7 +276,7 @@ class Client:
.. versionadded:: 1.1.0
"""
- return utils.SequenceProxy(self._connection._messages)
+ return utils.SequenceProxy(self._connection._messages or [])
@property
def private_channels(self):