aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-01-07 23:05:01 -0500
committerRapptz <[email protected]>2021-01-07 23:57:14 -0500
commit442962596eb1482331024e6fd0c5797ceb185d9a (patch)
tree96e190b531ff79b4121e89d710b0e415f8f59aae
parentfix method reference in documentation (diff)
downloaddiscord.py-442962596eb1482331024e6fd0c5797ceb185d9a.tar.xz
discord.py-442962596eb1482331024e6fd0c5797ceb185d9a.zip
Dispatch user updates if the global cache gets stale in update events
-rw-r--r--discord/state.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py
index 214313ae..8005fb95 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -793,6 +793,12 @@ class ConnectionState:
else:
if self.member_cache_flags.joined:
member = Member(data=data, guild=guild, state=self)
+
+ # Force an update on the inner user if necessary
+ user_update = member._update_inner_user(user)
+ if user_update:
+ self.dispatch('user_update', user_update[0], user_update[1])
+
guild._add_member(member)
log.debug('GUILD_MEMBER_UPDATE referencing an unknown member ID: %s. Discarding.', user_id)