Browse Source

Add new color attributes to docs

pull/10225/head
ec 6 days ago
parent
commit
9b0c4d6b33
  1. 4
      discord/audit_logs.py
  2. 34
      docs/api.rst

4
discord/audit_logs.py

@ -409,8 +409,8 @@ class AuditLogChanges:
# special case for colors to set secondary and tertiary colos/colour attributes
if attr == 'colors':
self._handle_colors(self.before, elem['old_value']) #type: ignore # should be a RoleColours dict
self._handle_colors(self.after, elem['new_value']) #type: ignore # should be a RoleColours dict
self._handle_colors(self.before, elem['old_value']) # type: ignore # should be a RoleColours dict
self._handle_colors(self.after, elem['new_value']) # type: ignore # should be a RoleColours dict
continue
try:

34
docs/api.rst

@ -927,25 +927,25 @@ Members
.. function:: on_raw_presence_update(payload)
Called when a :class:`Member` updates their presence.
This requires :attr:`Intents.presences` to be enabled.
Unlike :func:`on_presence_update`, when enabled, this is called regardless of the state of internal guild
Unlike :func:`on_presence_update`, when enabled, this is called regardless of the state of internal guild
and member caches, and **does not** provide a comparison between the previous and updated states of the :class:`Member`.
.. important::
By default, this event is only dispatched when :attr:`Intents.presences` is enabled **and** :attr:`Intents.members`
By default, this event is only dispatched when :attr:`Intents.presences` is enabled **and** :attr:`Intents.members`
is disabled.
You can manually override this behaviour by setting the **enable_raw_presences** flag in the :class:`Client`,
however :attr:`Intents.presences` is always required for this event to work.
.. versionadded:: 2.5
:param payload: The raw presence update event model.
:type payload: :class:`RawPresenceUpdateEvent`
Messages
~~~~~~~~~
@ -2456,6 +2456,8 @@ of :class:`enum.Enum`.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.colour`
- :attr:`~AuditLogDiff.secondary_colour`
- :attr:`~AuditLogDiff.tertiary_colour`
- :attr:`~AuditLogDiff.mentionable`
- :attr:`~AuditLogDiff.hoist`
- :attr:`~AuditLogDiff.icon`
@ -2479,6 +2481,8 @@ of :class:`enum.Enum`.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.colour`
- :attr:`~AuditLogDiff.secondary_colour`
- :attr:`~AuditLogDiff.tertiary_colour`
- :attr:`~AuditLogDiff.mentionable`
- :attr:`~AuditLogDiff.hoist`
- :attr:`~AuditLogDiff.icon`
@ -2496,6 +2500,8 @@ of :class:`enum.Enum`.
Possible attributes for :class:`AuditLogDiff`:
- :attr:`~AuditLogDiff.colour`
- :attr:`~AuditLogDiff.secondary_colour`
- :attr:`~AuditLogDiff.tertiary_colour`
- :attr:`~AuditLogDiff.mentionable`
- :attr:`~AuditLogDiff.hoist`
- :attr:`~AuditLogDiff.name`
@ -4210,6 +4216,24 @@ AuditLogDiff
:type: :class:`Colour`
.. attribute:: secondary_colour
secondary_color
The secondary colour of a role.
See also :attr:`Role.secondary_colour`
:type: Optional[]:class:`Colour`]
.. attribute:: tertiary_colour
tertiary_color
The tertiary colour of a role.
See also :attr:`Role.tertiary_colour`
:type: Optional[:class:`Colour`]
.. attribute:: hoist
Whether the role is being hoisted or not.

Loading…
Cancel
Save