|
|
@ -602,17 +602,13 @@ class ConnectionState: |
|
|
|
member_id = int(user['id']) |
|
|
|
member = guild.get_member(member_id) |
|
|
|
if member is None: |
|
|
|
if 'username' not in user: |
|
|
|
# sometimes we receive 'incomplete' member data post-removal. |
|
|
|
# skip these useless cases. |
|
|
|
return |
|
|
|
log.debug('PRESENCE_UPDATE referencing an unknown member ID: %s. Discarding', member_id) |
|
|
|
return |
|
|
|
|
|
|
|
member, old_member = Member._from_presence_update(guild=guild, data=data, state=self) |
|
|
|
else: |
|
|
|
old_member = Member._copy(member) |
|
|
|
user_update = member._presence_update(data=data, user=user) |
|
|
|
if user_update: |
|
|
|
self.dispatch('user_update', user_update[0], user_update[1]) |
|
|
|
old_member = Member._copy(member) |
|
|
|
user_update = member._presence_update(data=data, user=user) |
|
|
|
if user_update: |
|
|
|
self.dispatch('user_update', user_update[0], user_update[1]) |
|
|
|
|
|
|
|
self.dispatch('member_update', old_member, member) |
|
|
|
|
|
|
|