From 4fab3f88815f1d5ea93f03748a104007f859c114 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 11:39:45 +0300 Subject: [PATCH 01/13] fix(role): ensure secondary and tertiary attributes are not missing --- discord/role.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discord/role.py b/discord/role.py index c37c2f5a4f..8f62f37560 100644 --- a/discord/role.py +++ b/discord/role.py @@ -374,7 +374,9 @@ def is_holographic(self) -> bool: """ return ( self.primary.value == 11127295 + and self.secondary is not None and self.secondary.value == 16759788 + and self.tertiary is not None and self.tertiary.value == 16761760 ) From 0677995851b2d77c45ded525a1d606f41cec2046 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 11:50:11 +0300 Subject: [PATCH 02/13] chore: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cb6480ec..5426ec616d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed +- Fixed `RoleColours.is_holographic` raising `AttributeError` when `secondary` or + `tertiary` is `None`. + ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. ([#3235](https://github.com/Pycord-Development/pycord/pull/3235)) - Include `bypass_slowmode` in `Permissions.all`. From 0875ebb6c542e7802e5a7d85520b2d369e0bd3f5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 11 Jun 2026 11:53:40 +0300 Subject: [PATCH 03/13] Update CHANGELOG.md Co-authored-by: Paillat Signed-off-by: Michael --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5426ec616d..a857a65a8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed `RoleColours.is_holographic` raising `AttributeError` when `secondary` or +- Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. From 6cce978c145d39fe88ac2e1a2d39dee628761658 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 08:54:08 +0000 Subject: [PATCH 04/13] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a857a65a8b..e7a3f97ccf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or +- Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. From 92a3f9af665ffb4db09eb2ee4fab4f3b0a8b8a4b Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 11:59:52 +0300 Subject: [PATCH 05/13] refactor(role): move holographic colour values to class constants --- discord/role.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/discord/role.py b/discord/role.py index 8f62f37560..c17d92b551 100644 --- a/discord/role.py +++ b/discord/role.py @@ -308,9 +308,13 @@ class RoleColours: secondary: Optional[:class:`Colour`] The secondary colour of the role. tertiary: Optional[:class:`Colour`] - The tertiary colour of the role. At the moment, only `16761760` is allowed. + The tertiary colour of the role. At the moment, only :attr:`HOLOGRAPHIC_TERTIARY` is allowed. """ + HOLOGRAPHIC_PRIMARY = Colour(11127295) + HOLOGRAPHIC_SECONDARY = Colour(16759788) + HOLOGRAPHIC_TERTIARY = Colour(16761760) + def __init__( self, primary: Colour, @@ -362,22 +366,26 @@ def default(cls) -> RoleColours: def holographic(cls) -> RoleColours: """Returns a :class:`RoleColours` that makes the role look holographic. - Currently holographic roles are only supported with colours 11127295, 16759788, and 16761760. + Currently holographic roles are only supported with colours defined in + :attr:`HOLOGRAPHIC_PRIMARY`, :attr:`HOLOGRAPHIC_SECONDARY`, and :attr:`HOLOGRAPHIC_TERTIARY`. """ - return cls(Colour(11127295), Colour(16759788), Colour(16761760)) + return cls( + cls.HOLOGRAPHIC_PRIMARY, cls.HOLOGRAPHIC_SECONDARY, cls.HOLOGRAPHIC_TERTIARY + ) @property def is_holographic(self) -> bool: """Whether the role is holographic. - Currently roles are holographic when colours are set to 11127295, 16759788, and 16761760. + Currently roles are holographic when colours are set to + :attr:`HOLOGRAPHIC_PRIMARY`, :attr:`HOLOGRAPHIC_SECONDARY`, and :attr:`HOLOGRAPHIC_TERTIARY`. """ return ( - self.primary.value == 11127295 + self.primary == self.HOLOGRAPHIC_PRIMARY and self.secondary is not None - and self.secondary.value == 16759788 + and self.secondary == self.HOLOGRAPHIC_SECONDARY and self.tertiary is not None - and self.tertiary.value == 16761760 + and self.tertiary == self.HOLOGRAPHIC_TERTIARY ) def __repr__(self) -> str: From 06aa164d7da47d8ddb7897f9d53563d20ac96f4c Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:02:31 +0300 Subject: [PATCH 06/13] fix(role): check if holographic is not MISSING --- discord/role.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/role.py b/discord/role.py index c17d92b551..ce411dab3e 100644 --- a/discord/role.py +++ b/discord/role.py @@ -370,7 +370,9 @@ def holographic(cls) -> RoleColours: :attr:`HOLOGRAPHIC_PRIMARY`, :attr:`HOLOGRAPHIC_SECONDARY`, and :attr:`HOLOGRAPHIC_TERTIARY`. """ return cls( - cls.HOLOGRAPHIC_PRIMARY, cls.HOLOGRAPHIC_SECONDARY, cls.HOLOGRAPHIC_TERTIARY + cls.HOLOGRAPHIC_PRIMARY, + cls.HOLOGRAPHIC_SECONDARY, + cls.HOLOGRAPHIC_TERTIARY, ) @property @@ -866,7 +868,7 @@ async def edit( if isinstance(colour, int): colour = Colour(colour) colours = RoleColours(primary=colour) - if holographic: + if holographic is not MISSING and holographic: colours = RoleColours.holographic() if colours is not MISSING: if not isinstance(colours, RoleColours): From 54d6ee2e6eff4112e98a62bc39a93ce7b4ddf3d0 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:07:06 +0300 Subject: [PATCH 07/13] chore: update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a3f97ccf..7995d39dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ These changes are available on the `master` branch, but have not yet been releas ### Added +- Added `RoleColours.HOLOGRAPHIC_PRIMARY`, `RoleColours.HOLOGRAPHIC_SECONDARY`, and + `RoleColours.HOLOGRAPHIC_TERTIARY` class constants. + ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) + ### Changed ### Fixed @@ -19,6 +23,9 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) +- Fixed `Role.edit` not checking if `holographic` is `MISSING` + before applying holographic colours. + ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. ([#3235](https://github.com/Pycord-Development/pycord/pull/3235)) - Include `bypass_slowmode` in `Permissions.all`. From d62186cfa8de722a6582656cab6f59020373078f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 09:07:52 +0000 Subject: [PATCH 08/13] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7995d39dab..ab04f452b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,9 +23,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) -- Fixed `Role.edit` not checking if `holographic` is `MISSING` - before applying holographic colours. - ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) +- Fixed `Role.edit` not checking if `holographic` is `MISSING` before applying + holographic colours. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. ([#3235](https://github.com/Pycord-Development/pycord/pull/3235)) - Include `bypass_slowmode` in `Permissions.all`. From 3b90ec4024714f5db7aeef7be625b89ef4de8058 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:20:35 +0300 Subject: [PATCH 09/13] chore: document new attrs --- CHANGELOG.md | 3 --- discord/role.py | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7995d39dab..fb5e938d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,9 +23,6 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) -- Fixed `Role.edit` not checking if `holographic` is `MISSING` - before applying holographic colours. - ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. ([#3235](https://github.com/Pycord-Development/pycord/pull/3235)) - Include `bypass_slowmode` in `Permissions.all`. diff --git a/discord/role.py b/discord/role.py index ce411dab3e..48b1d30bc0 100644 --- a/discord/role.py +++ b/discord/role.py @@ -309,6 +309,12 @@ class RoleColours: The secondary colour of the role. tertiary: Optional[:class:`Colour`] The tertiary colour of the role. At the moment, only :attr:`HOLOGRAPHIC_TERTIARY` is allowed. + HOLOGRAPHIC_PRIMARY: :class:`Colour` + The primary colour used for holographic roles. + HOLOGRAPHIC_SECONDARY: :class:`Colour` + The secondary colour used for holographic roles. + HOLOGRAPHIC_TERTIARY: :class:`Colour` + The tertiary colour used for holographic roles. """ HOLOGRAPHIC_PRIMARY = Colour(11127295) @@ -868,7 +874,7 @@ async def edit( if isinstance(colour, int): colour = Colour(colour) colours = RoleColours(primary=colour) - if holographic is not MISSING and holographic: + if holographic: colours = RoleColours.holographic() if colours is not MISSING: if not isinstance(colours, RoleColours): From 972616f95c15d0d69654c4cd20028b363120c123 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:24:19 +0300 Subject: [PATCH 10/13] chore: update changelog --- CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e6436022..fb5e938d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,11 +23,6 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) -<<<<<<< HEAD -======= -- Fixed `Role.edit` not checking if `holographic` is `MISSING` before applying - holographic colours. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) ->>>>>>> d62186cfa8de722a6582656cab6f59020373078f - Fix typehint for `SlashCommandGroup.__new__`. ([#3235](https://github.com/Pycord-Development/pycord/pull/3235)) - Include `bypass_slowmode` in `Permissions.all`. From b494cee659ebe98650dd21c088061b74da098a43 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:39:25 +0300 Subject: [PATCH 11/13] upd(role): remove None checks --- discord/role.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/discord/role.py b/discord/role.py index 48b1d30bc0..e7d24a6f83 100644 --- a/discord/role.py +++ b/discord/role.py @@ -390,9 +390,7 @@ def is_holographic(self) -> bool: """ return ( self.primary == self.HOLOGRAPHIC_PRIMARY - and self.secondary is not None and self.secondary == self.HOLOGRAPHIC_SECONDARY - and self.tertiary is not None and self.tertiary == self.HOLOGRAPHIC_TERTIARY ) From 91db769a4c86f0154a507dfb5cfdc95e27bb1fcc Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:40:59 +0300 Subject: [PATCH 12/13] chore: update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb5e938d61..07e1e629dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or +- Fixed `RoleColours.is_holographic` incorrectly returning `False` when `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`. From 14d7adaea9ad2cce845e40236067fe02f58942b1 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 11 Jun 2026 12:46:11 +0300 Subject: [PATCH 13/13] chore: rever changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07e1e629dc..fb5e938d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed `RoleColours.is_holographic` incorrectly returning `False` when `secondary` or +- Fixed an `AttributeError` when using `RoleColours.is_holographic` and `secondary` or `tertiary` is `None`. ([#3268](https://github.com/Pycord-Development/pycord/pull/3268)) - Fix typehint for `SlashCommandGroup.__new__`.