Skip to content

Commit

Permalink
Add global name to user object
Browse files Browse the repository at this point in the history
  • Loading branch information
4Kaylum committed Apr 7, 2024
1 parent 973faeb commit f29a06b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions novus/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class User(Hashable, Messageable):
The ID of the user.
username : str
The username of the user.
global_name : str | None
The global name of the user.
discriminator : str
The discriminator of the user.
avatar_hash : str | None
Expand Down Expand Up @@ -174,6 +176,7 @@ def _update(self, data: payloads.User | payloads.PartialUser) -> Self:
"""

self.username = data['username']
self.global_name = data.get('global_name')
self.discriminator = data['discriminator']
del self.default_avatar
self.avatar_hash = data.get('avatar')
Expand Down
1 change: 1 addition & 0 deletions novus/payloads/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class _UserOptional(TypedDict, total=False):
class User(_UserOptional):
id: Snowflake
username: str
global_name: Optional[str]
discriminator: int
avatar: Optional[str]

Expand Down

0 comments on commit f29a06b

Please sign in to comment.