Represents data for a Server Role.
Number, position of the role when viewing the roles of a server.
String, name of the role.
Boolean, whether Discord has created the role itself. Currently only used for Twitch integration.
String, ID of the role.
Boolean, whether the role should be displayed as a separate category in the users section.
Number, a base 10 colour. Use
role.colorAsHex() to get a hex colour instead.
A Date referring to when the role was created.
Makes an object with the permission names found in Permission Constants and a boolean value for them.
Sees whether the role has the permission given.
- permission - See Permission Constants for valid permission names.
Returns the role’s colour as hex, e.g.
Returns a valid string that can be sent in a message to mention the role. By default,
role.toString() does this so by adding a role object to a string, e.g.
role + "", their mention code will be retrieved. If the role isn’t mentionable, its name gets returned.