Skip to content

Commit

Permalink
Fix User public flags not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasCoderT authored Jan 17, 2021
1 parent c5a44d8 commit d7b41e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions discord/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,12 @@ def _presence_update(self, data, user):

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

Expand Down
1 change: 1 addition & 0 deletions discord/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def _copy(cls, user):
self.avatar = user.avatar
self.bot = user.bot
self._state = user._state
self._public_flags = user._public_flags

return self

Expand Down

0 comments on commit d7b41e0

Please sign in to comment.