Browse Source

Fix User public flags not updating

pull/6325/head
Lucas 4 years ago
committed by GitHub
parent
commit
d7b41e0a21
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      discord/member.py
  2. 1
      discord/user.py

6
discord/member.py

@ -290,12 +290,12 @@ class Member(discord.abc.Messageable, _BaseUser):
def _update_inner_user(self, user):
u = self._user
original = (u.name, u.avatar, u.discriminator)
original = (u.name, u.avatar, u.discriminator, u._public_flags)
# These keys seem to always be available
modified = (user['username'], user['avatar'], user['discriminator'])
modified = (user['username'], user['avatar'], user['discriminator'], user.get('public_flags', 0))
if original != modified:
to_return = User._copy(self._user)
u.name, u.avatar, u.discriminator = modified
u.name, u.avatar, u.discriminator, u._public_flags = modified
# Signal to dispatch on_user_update
return to_return, u

1
discord/user.py

@ -120,6 +120,7 @@ class BaseUser(_BaseUser):
self.avatar = user.avatar
self.bot = user.bot
self._state = user._state
self._public_flags = user._public_flags
return self

Loading…
Cancel
Save