Dispatch user updates if the global cache gets stale in update events

This commit is contained in:
Rapptz 2021-01-07 23:05:01 -05:00
parent 16195a7d2f
commit 442962596e

View File

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