Skip to content
Advertisement

How do I get a list of all the roles my discord bot has?

I am trying to get a list of all the roles my bot has from top to bottom so I can get the highest role’s color.

Advertisement

Answer

Not sure what you mean by the “highest role’s color”, also your post is missing your code.

One way to get the roles the bot has in the guild (via a command) is to get the guild member object and then loop the role objects for that member.

Try this:

JavaScript

Console output:

JavaScript
Advertisement