#Set embed color to the role color for the bot?

3 messages · Page 1 of 1 (latest)

fervent ridge
#

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

modest prawnBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
jagged atlas
#

you have to get the top colored role in the bot's role hierarchy and then set it to the embed color