From 5d7cf56d7f5109895f9c58ebd3f3c37060de1ddb Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 27 Aug 2019 18:36:40 -0400 Subject: [PATCH] Actually add things to the message cache. --- discord/state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/state.py b/discord/state.py index 72331d859..e2b155ff2 100644 --- a/discord/state.py +++ b/discord/state.py @@ -401,7 +401,7 @@ class ConnectionState: channel, _ = self._get_guild_channel(data) message = Message(channel=channel, data=data, state=self) self.dispatch('message', message) - if self._messages: + if self._messages is not None: self._messages.append(message) if channel and channel.__class__ is TextChannel: channel.last_message_id = message.id @@ -411,7 +411,7 @@ class ConnectionState: found = self._get_message(raw.message_id) raw.cached_message = found self.dispatch('raw_message_delete', raw) - if self._messages and found is not None: + if self._messages is not None and found is not None: self.dispatch('message_delete', found) self._messages.remove(found)