aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-11-20 01:41:23 -0500
committerRapptz <[email protected]>2019-11-20 01:41:23 -0500
commit45f342ff79cb17668ce9df4f9939cf624f896764 (patch)
tree6b15f6f0e0b4c3daeb75e8f2e6b4f0077b3ad1a5 /discord/state.py
parentMove PartialEmoji over to a new namespace to avoid circular imports (diff)
downloaddiscord.py-45f342ff79cb17668ce9df4f9939cf624f896764.tar.xz
discord.py-45f342ff79cb17668ce9df4f9939cf624f896764.zip
Fix regression with references being overwritten from the cache.
A proper fix for this would be to just request presence information as well since the chunk request would probably be more up to date than the current cache. However this delta requires a little bit more work and will be done later.
Diffstat (limited to 'discord/state.py')
-rw-r--r--discord/state.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/state.py b/discord/state.py
index 08222aa4..ca7afcbe 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -842,7 +842,9 @@ class ConnectionState:
log.info('Processed a chunk for %s members in guild ID %s.', len(members), guild_id)
if self._cache_members:
for member in members:
- guild._add_member(member)
+ existing = guild.get_member(member.id)
+ if existing is None or existing.joined_at is None:
+ guild._add_member(member)
self.process_listeners(ListenerType.chunk, guild, len(members))
names = [x.name.lower() for x in members]