Skip to content

Commit b532df6

Browse files
committed
fix: Remove trailing color references (#11007)
fix: role colour fixes
1 parent d60e0bf commit b532df6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/discord.js/src/managers/RoleManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class RoleManager extends CachedManager {
6060
* @example
6161
* // Fetch a single role
6262
* message.guild.roles.fetch('222078108977594368')
63-
* .then(role => console.log(`The role color is: ${role.color}`))
63+
* .then(role => console.log(`The role color is: ${role.colors.primaryColor}`))
6464
* .catch(console.error);
6565
*/
6666
async fetch(id, { cache = true, force = false } = {}) {

packages/discord.js/src/structures/GuildMember.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class GuildMember extends Base {
270270
* @readonly
271271
*/
272272
get displayColor() {
273-
return this.roles.color?.color ?? 0;
273+
return this.roles.color?.colors.primaryColor ?? 0;
274274
}
275275

276276
/**

packages/discord.js/src/structures/Role.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Role extends Base {
196196
* @readonly
197197
*/
198198
get hexColor() {
199-
return `#${this.color.toString(16).padStart(6, '0')}`;
199+
return `#${this.colors.primaryColor.toString(16).padStart(6, '0')}`;
200200
}
201201

202202
/**

0 commit comments

Comments
 (0)