Skip to content

Commit

Permalink
Dispatch user updates if the global cache gets stale in update events
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Jan 8, 2021
1 parent 16195a7 commit 4429625
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,12 @@ def parse_guild_member_update(self, data):
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)

Expand Down

0 comments on commit 4429625

Please sign in to comment.