aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/member.py10
-rw-r--r--discord/user.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/discord/member.py b/discord/member.py
index 05432891..2100e5ff 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -246,6 +246,16 @@ class Member(discord.abc.Messageable):
return '<@!{}>'.format(self.id)
return '<@{}>'.format(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 guild specific nickname then that
+ is returned instead.
+ """
+ return self.nick if self.nick is not None else self.name
+
def mentioned_in(self, message):
"""Checks if the member is mentioned in the specified message.
diff --git a/discord/user.py b/discord/user.py
index cadf84db..0cde6ea0 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -120,7 +120,7 @@ class BaseUser:
if they have a guild specific nickname then that
is returned instead.
"""
- return getattr(self, 'nick', None) or self.name
+ return self.name
def mentioned_in(self, message):
"""Checks if the user is mentioned in the specified message.