mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 08:17:47 +00:00
Actually add things to the message cache.
This commit is contained in:
parent
5c0b127c96
commit
5d7cf56d7f
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user