Browse Source

Format and docs

pull/10285/head
Soheab_ 4 days ago
parent
commit
654c57a40e
  1. 2
      discord/enums.py
  2. 13
      discord/user.py
  3. 88
      docs/api.rst

2
discord/enums.py

@ -85,6 +85,8 @@ __all__ = (
'MediaItemLoadingState',
'CollectibleType',
'NameplatePalette',
'NameFont',
'NameEffect',
)

13
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'])

88
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
~~~~~~~~~~~~~~~~~~~

Loading…
Cancel
Save