From a7f711b30f3089a155a0ee721e2eff511d4759fb Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Sun, 20 Jul 2025 13:26:24 +0100 Subject: [PATCH] fix: Remove trailing `color` references (#11007) fix: role colour fixes --- packages/discord.js/src/managers/RoleManager.js | 2 +- packages/discord.js/src/structures/GuildMember.js | 2 +- packages/discord.js/src/structures/Role.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/discord.js/src/managers/RoleManager.js b/packages/discord.js/src/managers/RoleManager.js index 1f741b3d6..e17f4f46d 100644 --- a/packages/discord.js/src/managers/RoleManager.js +++ b/packages/discord.js/src/managers/RoleManager.js @@ -61,7 +61,7 @@ class RoleManager extends CachedManager { * @example * // Fetch a single role * message.guild.roles.fetch('222078108977594368') - * .then(role => console.log(`The role color is: ${role.color}`)) + * .then(role => console.log(`The role color is: ${role.colors.primaryColor}`)) * .catch(console.error); */ async fetch(id, { cache = true, force = false } = {}) { diff --git a/packages/discord.js/src/structures/GuildMember.js b/packages/discord.js/src/structures/GuildMember.js index 3be4822e0..d4c3bc7ec 100644 --- a/packages/discord.js/src/structures/GuildMember.js +++ b/packages/discord.js/src/structures/GuildMember.js @@ -293,7 +293,7 @@ class GuildMember extends Base { * @readonly */ get displayColor() { - return this.roles.color?.color ?? 0; + return this.roles.color?.colors.primaryColor ?? 0; } /** diff --git a/packages/discord.js/src/structures/Role.js b/packages/discord.js/src/structures/Role.js index 92ee08b3f..4f58186ac 100644 --- a/packages/discord.js/src/structures/Role.js +++ b/packages/discord.js/src/structures/Role.js @@ -206,7 +206,7 @@ class Role extends Base { * @readonly */ get hexColor() { - return `#${this.color.toString(16).padStart(6, '0')}`; + return `#${this.colors.primaryColor.toString(16).padStart(6, '0')}`; } /**