mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Add support for server specific nicknames.
This commit is contained in:
1 parent
cc78cfedb6
commit
133e8d3a44
3 files changed
+21
-2
No files matched your search
@@ -125,3 +125,14 @@ class User:
|
||||
This is when the user's discord account was created."""
|
||||
return snowflake_time(self.id)
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
"""Returns the user's display name.
|
||||
|
||||
For regular users this is just their username, but
|
||||
if they have a server specific nickname then that
|
||||
is returned instead.
|
||||
"""
|
||||
nickname = getattr(self, 'nick', None)
|
||||
return nickname if nickname is not None else self.name
|
||||
|
||||
Reference in new issue
Block a user