Skip to content

Commit a7f711b

Browse files
authored
fix: Remove trailing color references (#11007)
fix: role colour fixes
1 parent 43a995b commit a7f711b

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
@@ -61,7 +61,7 @@ class RoleManager extends CachedManager {
6161
* @example
6262
* // Fetch a single role
6363
* message.guild.roles.fetch('222078108977594368')
64-
* .then(role => console.log(`The role color is: ${role.color}`))
64+
* .then(role => console.log(`The role color is: ${role.colors.primaryColor}`))
6565
* .catch(console.error);
6666
*/
6767
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
@@ -293,7 +293,7 @@ class GuildMember extends Base {
293293
* @readonly
294294
*/
295295
get displayColor() {
296-
return this.roles.color?.color ?? 0;
296+
return this.roles.color?.colors.primaryColor ?? 0;
297297
}
298298

299299
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class Role extends Base {
206206
* @readonly
207207
*/
208208
get hexColor() {
209-
return `#${this.color.toString(16).padStart(6, '0')}`;
209+
return `#${this.colors.primaryColor.toString(16).padStart(6, '0')}`;
210210
}
211211

212212
/**

0 commit comments

Comments
 (0)