class BaseRole
extends
Baseexport class BaseRole extends BaseThe base role class.
Constructors
protectedconstructor(client: Client<true>data: APIInviteRole | APIRole)
client: Client<true>
data: APIInviteRole | APIRole
Constructs a new instance of the BaseRole class
colors : RoleColors
The colors of the role
readonlycreatedAt : Date
The time the role was created at
readonlycreatedTimestamp : number
The timestamp the role was created at
readonlyhexColor : HexColorString
The hexadecimal version of the role color, with a leading hashtag
id : Snowflake
The role's id (unique to the guild it is part of)
name : string
The name of the role
rawPosition : number
The raw position of the role from the API
iconURL(options?: ImageURLOptions = {}) : string | null
options?: ImageURLOptions = {}
A link to the role's icon
toJSON() : unknown
toString() : RoleMention
When concatenated with a string, this automatically returns the role's mention instead of the Role object.
Examples:
// Logs: Role: <@&123456789012345678>
console.log(`Role: ${role}`);