From 1768311b9e330c4d81415c3bf76a8702535d9f82 Mon Sep 17 00:00:00 2001 From: ec Date: Tue, 8 Jul 2025 19:07:27 -0700 Subject: [PATCH] use Colour over Color --- discord/audit_logs.py | 18 +++++++++--------- discord/types/audit_log.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 8501fe11c..d691b34b2 100644 --- a/discord/audit_logs.py +++ b/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_colours(self.before, elem['old_value']) # type: ignore # should be a RoleColours dict + self._handle_colours(self.after, elem['new_value']) # type: ignore # should be a RoleColours dict continue try: @@ -545,15 +545,15 @@ class AuditLogChanges: except (AttributeError, TypeError): pass - def _handle_colors(self, diff: AuditLogDiff, colors: RoleColours): - # handle colors to multiple color attributes - diff.color = diff.colour = Colour(colors['primary_color']) + def _handle_colors(self, diff: AuditLogDiff, colours: RoleColours): + # handle colours to multiple colour attributes + diff.color = diff.colour = Colour(colours['primary_color']) - secondary_color = colors['secondary_color'] - tertiary_color = colors['tertiary_color'] + secondary_colour = colours['secondary_color'] + tertiary_colour= colours['tertiary_color'] - diff.secondary_color = diff.secondary_colour = Colour(secondary_color) if secondary_color is not None else None - diff.tertiary_color = diff.tertiary_colour = Colour(tertiary_color) if tertiary_color is not None else None + diff.secondary_color = diff.secondary_colour = Colour(secondary_colour) if secondary_colour is not None else None + diff.tertiary_color = diff.tertiary_colour = Colour(tertiary_colour) if tertiary_colour is not None else None def _create_trigger(self, diff: AuditLogDiff, entry: AuditLogEntry) -> AutoModTrigger: # check if trigger has already been created diff --git a/discord/types/audit_log.py b/discord/types/audit_log.py index 905ad4c7e..c9d305695 100644 --- a/discord/types/audit_log.py +++ b/discord/types/audit_log.py @@ -297,7 +297,7 @@ class _AuditLogChange_TriggerMetadata(TypedDict): old_value: Optional[AutoModerationTriggerMetadata] -class _AuditLogChange_RoleColors(TypedDict): +class _AuditLogChange_RoleColours(TypedDict): key: Literal['colors'] new_value: RoleColours old_value: RoleColours @@ -327,7 +327,7 @@ AuditLogChange = Union[ _AuditLogChange_AvailableTags, _AuditLogChange_DefaultReactionEmoji, _AuditLogChange_TriggerMetadata, - _AuditLogChange_RoleColors, + _AuditLogChange_RoleColours, ]