Set embed color to the role color for the bot?

Is there a way to set the color of an embedded message to the color of the bot's primary role in a server? I have a bot that responds with an embedded message when a command is sent, and I'd like to have the embed color set to the same color as the bot's username in whichever server the command was sent in. Is there a simple way of doing this? Versions: discord.js v14.14.1 node v20.10.0
3 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
skull
skull3mo ago
you have to get the top colored role in the bot's role hierarchy and then set it to the embed color
d.js docs
d.js docs3mo ago
:property: GuildMember#displayColor The displayed role color of this member in base 10