Browse Source

GUILD_MEMBER_UPDATE no longer does actual user updates.

This had been delegated to PRESENCE_UPDATE a long time ago,
unfortunately.
pull/2054/head
Rapptz 6 years ago
parent
commit
1a9726087a
  1. 8
      discord/member.py
  2. 2
      discord/state.py

8
discord/member.py

@ -210,13 +210,7 @@ class Member(discord.abc.Messageable, _BaseUser):
def _update_roles(self, data):
self._roles = utils.SnowflakeList(map(int, data['roles']))
def _update(self, data, user=None):
if user:
self._user.name = user['username']
self._user.discriminator = user['discriminator']
self._user.avatar = user['avatar']
self._user.bot = user.get('bot', False)
def _update(self, data):
# the nickname change is optional,
# if it isn't in the payload then it didn't change
try:

2
discord/state.py

@ -604,7 +604,7 @@ class ConnectionState:
member = guild.get_member(user_id)
if member is not None:
old_member = copy.copy(member)
member._update(data, user)
member._update(data)
self.dispatch('member_update', old_member, member)
else:
log.warning('GUILD_MEMBER_UPDATE referencing an unknown member ID: %s. Discarding.', user_id)

Loading…
Cancel
Save