From cf79816c5dc5aa3a797137092644c7b6f858d2fe Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 27 Aug 2019 04:49:23 -0400 Subject: 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. --- discord/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'discord/client.py') 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): -- cgit v1.2.3