mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 04:17:16 +00:00
Fix Member.display_name to work.
This commit is contained in:
parent
c16a515e50
commit
bfe2b4fc03
@ -246,6 +246,16 @@ class Member(discord.abc.Messageable):
|
|||||||
return '<@!{}>'.format(self.id)
|
return '<@!{}>'.format(self.id)
|
||||||
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):
|
def mentioned_in(self, message):
|
||||||
"""Checks if the member is mentioned in the specified message.
|
"""Checks if the member is mentioned in the specified message.
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class BaseUser:
|
|||||||
if they have a guild specific nickname then that
|
if they have a guild specific nickname then that
|
||||||
is returned instead.
|
is returned instead.
|
||||||
"""
|
"""
|
||||||
return getattr(self, 'nick', None) or self.name
|
return self.name
|
||||||
|
|
||||||
def mentioned_in(self, message):
|
def mentioned_in(self, message):
|
||||||
"""Checks if the user is mentioned in the specified message.
|
"""Checks if the user is mentioned in the specified message.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user