mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-15 18:29:52 +00:00
Add support for new pink default avatars
This commit is contained in:
parent
e6d2d82803
commit
eedd7e3014
@ -509,5 +509,15 @@ class Colour:
|
|||||||
"""
|
"""
|
||||||
return cls(0xEEEFF1)
|
return cls(0xEEEFF1)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def pink(cls) -> Self:
|
||||||
|
"""A factory method that returns a :class:`Colour` with a value of ``0xEB459F``.
|
||||||
|
|
||||||
|
.. colour:: #EB459F
|
||||||
|
|
||||||
|
.. versionadded:: 2.3
|
||||||
|
"""
|
||||||
|
return cls(0xEB459F)
|
||||||
|
|
||||||
|
|
||||||
Color = Colour
|
Color = Colour
|
||||||
|
@ -295,6 +295,7 @@ class DefaultAvatar(Enum):
|
|||||||
green = 2
|
green = 2
|
||||||
orange = 3
|
orange = 3
|
||||||
red = 4
|
red = 4
|
||||||
|
pink = 5
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -173,7 +173,7 @@ class BaseUser(_UserTag):
|
|||||||
if self.discriminator == '0':
|
if self.discriminator == '0':
|
||||||
avatar_id = (self.id >> 22) % len(DefaultAvatar)
|
avatar_id = (self.id >> 22) % len(DefaultAvatar)
|
||||||
else:
|
else:
|
||||||
avatar_id = int(self.discriminator) % len(DefaultAvatar)
|
avatar_id = int(self.discriminator) % 5
|
||||||
|
|
||||||
return Asset._from_default_avatar(self._state, avatar_id)
|
return Asset._from_default_avatar(self._state, avatar_id)
|
||||||
|
|
||||||
|
@ -2896,6 +2896,12 @@ of :class:`enum.Enum`.
|
|||||||
|
|
||||||
Represents the default avatar with the color red.
|
Represents the default avatar with the color red.
|
||||||
See also :attr:`Colour.red`
|
See also :attr:`Colour.red`
|
||||||
|
.. attribute:: pink
|
||||||
|
|
||||||
|
Represents the default avatar with the color pink.
|
||||||
|
See also :attr:`Colour.pink`
|
||||||
|
|
||||||
|
.. versionadded:: 2.3
|
||||||
|
|
||||||
.. class:: StickerType
|
.. class:: StickerType
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user