Closed Taelyn closed 1 year ago
You don't appear to be force-fetching. Force-fetching is required for the property to be present or updated as documented.
As i said it does not work ;) force or not, it does not give the data on a Nitro User Nitro users have 2 color options on there profile instead of one
perhaps read first before you comment.
I cannot reproduce this.
Without knowing who you fetched, we cannot confirm either. Supply ids. I can only speculate otherwise: you are correctly seeing the properties but believe otherwise or you are misunderstanding what these properties do.
Iam perfectly aware what the properties do. If you look in your own code:
get displayColor() {
return this.roles.color?.color ?? 0;
}
get displayHexColor() {
return this.roles.color?.hexColor ?? '#000000';
}
GuildMember.displayColor and HexColor is giveing the role color of the role that the member has. So your documentation is wrong or you asigned the wrong code. Since neither the 2 properties have anywhere explained it gives a role color
const _member = await interaction.member.fetch(true);
console.log("_member.displayColor: " + _member.displayColor);
console.log("_member.displayHexColor: " + _member.displayHexColor);
const _user = await interaction.user.fetch(true);
console.log("_user.accentColor: " + _user.accentColor);
on a non nitro user:
As you see it works, it outputs the accentColor the user has, Dark Green and displayColor, displayHexColor output the Role color what is yellow
on a Nitro User:
accentColor is Null. Since my profile has 2 colors due to nitro. displayColor and displayHexColor give again the role color what is yellow
Profile 1 Id : 1114640765050683575 Profile 2 Id: 317550181098717185
I hope its clear enough this way
These properties are working as intended!
Since updates to guild member profiles, I can see a change in documentation could be made to alleviate the confusion between the colours in a profile and the role colour, but there is no issue in code here.
I looked into the accent color a little bit and the behavior we see in the library is consistent with the behavior of the API (which is wholly scuffed), so here is the current theory:
fancy profiles := two colors, banner
null
and the client will instead determine it based on the avatarThis would suggest, that you never set a manual, solid, banner (aka accent) color before you got access to fancy profiles, but instead relied on the auto-set one based on your avatar, hence the value is null
.
The other person (used as non-nitro user in your example) clearly has one set, their avatar is blue and their banner is solid green. (Unless discords banner color determining algorithm is really, really horrible)
[!NOTE]
TL;DR: accent color is not fancy profile 2 colors, nor are fancy profile colors exposed anywhere, neither for global nor guild based profiles
Thanks both!
Which package is this bug report for?
discord.js
Issue description
user.accentColor member.displayColor member.displayHexColor
Seems to be null when user / member has nitro subscription I seem to only get user.accentColor working on a user without Nitro
Code sample
Versions
discord.js v14.13.0 Typescript v5.2.2 Node LTS v18.17.1
Issue priority
Low (slightly annoying)
Which partials do you have configured?
User, Channel, GuildMember, Message, Reaction, ThreadMember
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildModeration, GuildEmojisAndStickers, GuildIntegrations, GuildWebhooks, GuildInvites, GuildVoiceStates, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, MessageContent, GuildScheduledEvents, AutoModerationConfiguration, AutoModerationExecution
I have tested this issue on a development release
No response