Actually add things to the message cache.

This commit is contained in:
Rapptz 2019-08-27 18:36:40 -04:00
parent 5c0b127c96
commit 5d7cf56d7f

View File

@ -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)