diff --git a/discord/enums.py b/discord/enums.py index 8ccbd73c2..04ead90ae 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -85,6 +85,8 @@ __all__ = ( 'MediaItemLoadingState', 'CollectibleType', 'NameplatePalette', + 'NameFont', + 'NameEffect', ) diff --git a/discord/user.py b/discord/user.py index 65f753003..caf4a070a 100644 --- a/discord/user.py +++ b/discord/user.py @@ -58,10 +58,23 @@ if TYPE_CHECKING: __all__ = ( 'User', 'ClientUser', + 'DisplayNameStyle', ) class DisplayNameStyle: + """Represents a user's display name style. + + Attributes + ----------- + font: :class:`NameFont` + The font. + effect: :class:`NameEffect` + The applied effect. + colors: List[:class:`Colour`] + The colors used in the effect. Max of 2. + """ + def __init__(self, *, data: DisplayNameStylePayload) -> None: self.font: NameFont = try_enum(NameFont, data['font_id']) self.effect: NameEffect = try_enum(NameEffect, data['effect_id']) diff --git a/docs/api.rst b/docs/api.rst index 1a564ddca..0496a9a2e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -4132,6 +4132,86 @@ of :class:`enum.Enum`. The collectible nameplate palette is white. +.. class:: NameFont + + Represents the available fonts for a user display name style. + + .. versionadded:: 2.7 + + .. attribute:: default + + The default font is used. + + .. attribute:: bangers + + The 'Bangers' font is used. + + .. attribute:: bio_rhyme + + The 'BioRhyme' font is used. + + .. attribute:: cherry_bomb + + The 'Cherry Bomb' font is used. + + .. attribute:: chicle + + The 'Chicle' font is used. + + .. attribute:: compagnon + + The 'Compagnon' font is used. + + .. attribute:: museo_moderno + + The 'Museo Moderno' font is used. + + .. attribute:: neo_castel + + The 'Neo Castel' font is used. + + .. attribute:: pixelify + + The 'Pixelify' font is used. + + .. attribute:: ribes + + The 'Ribes' font is used. + + .. attribute:: sinistre + + The 'Sinistre' font is used. + + .. attribute:: zilla_slab + + The 'Zilla Slab' font is used. + +.. class:: NameEffect + + Represents the available effects for a user display name style. + + .. versionadded:: 2.7 + + .. attribute:: solid + + The first color provided is used. + + .. attribute:: gradient + + A two colour gradient is used, using both colors provided. + + .. attribute:: neon + + There is a neon glow around the name. + + .. attribute:: toon + + There is a subtle vertical gradient and stroke around the name. + + .. attribute:: pop + + A coloured drop-down shadow is shown. + .. _discord-api-audit-logs: Audit Log Data @@ -5836,6 +5916,14 @@ Collectible .. autoclass:: Collectible() :members: +DisplayNameStyle +~~~~~~~~~~~~~~~~~ + +.. attributetable:: DisplayNameStyle + +.. autoclass:: DisplayNameStyle() + :members: + CallMessage ~~~~~~~~~~~~~~~~~~~