mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add colour attribute for BaseUser
This commit is contained in:
parent
53433bca48
commit
2c1ba84346
@ -27,6 +27,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
from .utils import snowflake_time, _bytes_to_base64_data, parse_time, valid_icon_size
|
||||
from .enums import DefaultAvatar, RelationshipType, UserFlags, HypeSquadHouse
|
||||
from .errors import ClientException, InvalidArgument
|
||||
from .colour import Colour
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
@ -170,6 +171,17 @@ class BaseUser(_BaseUser):
|
||||
"""Returns a URL for a user's default avatar."""
|
||||
return 'https://cdn.discordapp.com/embed/avatars/{}.png'.format(self.default_avatar.value)
|
||||
|
||||
@property
|
||||
def colour(self):
|
||||
"""A property that returns a :class:`Colour` denoting the rendered colour
|
||||
for the user. This always returns :meth:`Colour.default`.
|
||||
|
||||
There is an alias for this under ``color``.
|
||||
"""
|
||||
return Colour.default()
|
||||
|
||||
color = colour
|
||||
|
||||
@property
|
||||
def mention(self):
|
||||
"""Returns a string that allows you to mention the given user."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user