class BaseRole

extends

Base
export class BaseRole extends Base

The base role class.

Constructors

protected
constructor(
client: Client<true>
)

Constructs a new instance of the BaseRole class

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

colors : RoleColors

The colors of the role

readonly
createdAt : Date

The time the role was created at

readonly
createdTimestamp : number

The timestamp the role was created at

readonly
hexColor : HexColorString

The hexadecimal version of the role color, with a leading hashtag

icon : string | null

The icon hash of the role

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

unicodeEmoji : string | null

The unicode emoji for the role

iconURL(
options?: ImageURLOptions = {}
) : string | null

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}`);

valueOf() : string

Inherited from: Base