diff options
| author | Rapptz <[email protected]> | 2017-02-10 03:10:30 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-02-10 03:10:30 -0500 |
| commit | bfe2b4fc031f92153da777225a691f99c34aad76 (patch) | |
| tree | f0f91b7179f9b8b3bb2950c4b8dab6791ab23e39 /discord/member.py | |
| parent | Fix NameError in Client.get_invite (diff) | |
| download | discord.py-bfe2b4fc031f92153da777225a691f99c34aad76.tar.xz discord.py-bfe2b4fc031f92153da777225a691f99c34aad76.zip | |
Fix Member.display_name to work.
Diffstat (limited to 'discord/member.py')
| -rw-r--r-- | discord/member.py | 10 |
1 files changed, 10 insertions, 0 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. |