diff options
| author | Rapptz <[email protected]> | 2019-08-27 18:36:40 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-08-27 18:36:40 -0400 |
| commit | 5d7cf56d7f5109895f9c58ebd3f3c37060de1ddb (patch) | |
| tree | a65e8f6d32151e801e0918b8ce3918477d0616e4 | |
| parent | Create Permissions and Colour objects when necessary in Role (diff) | |
| download | discord.py-5d7cf56d7f5109895f9c58ebd3f3c37060de1ddb.tar.xz discord.py-5d7cf56d7f5109895f9c58ebd3f3c37060de1ddb.zip | |
Actually add things to the message cache.
| -rw-r--r-- | discord/state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py index 72331d85..e2b155ff 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) |