Represents a role on Discord.
The client that instantiated this
The base 10 color of the role
The time the role was created at
The timestamp the role was created at
Whether the role is editable by the client user
The flags of this role
The guild that the role belongs to
The hexadecimal version of the role color, with a leading hashtag
If true, users that are part of this role will appear in a separate category in the users list
The role's id (unique to the guild it is part of)
Whether or not the role is managed by an external service
Whether or not the role can be mentioned by anyone
The name of the role
The position of the role in the role manager
The raw position of the role from the API
Compares this role's position to another role's.
ReturnsNegative number if this role's position is lower (other role's is higher), positive number if this one is higher (other's is lower), 0 if equal
Deletes the role.
Edits the role.
Whether this role equals another role. It compares all properties, so for most operations it is advisable to just compare
role.id === role2.idas it is much faster and is often what most users need.
A link to the role's icon
channel.permissionsFor(role). Returns permissions for a role in a guild channel, taking into account permission overwrites.
Sets a new color for the role.
Sets whether or not the role should be hoisted.
Sets a new icon for the role.
Sets whether this role is mentionable.
Sets a new name for the role.
Sets the permissions of the role.
Sets the new position of the role.
Sets a new unicode emoji for the role.
When concatenated with a string, this automatically returns the role's mention instead of the Role object.