Class

Role

Guild role. Cached in Guild; permissions computed via GuildMember.

Extends Base

Constructor

new Role(client: Client, data: APIRole, guildId: string)
ParamTypeDescription
clientClient
dataAPIRole
guildIdstring

Properties

client: Client (readonly)

Parent client instance.

color: number

Role color (24-bit RGB).

guildId: string (readonly)

Guild this role belongs to.

hoist: boolean

Whether this role is hoisted (shown separately in member list).

hoistPosition: number | null

Hoist position (null = not hoisted).

id: string (readonly)

Role snowflake ID.

mentionable: boolean

Whether this role is mentionable.

name: string

Role name.

permissions: PermissionsBitField (readonly)

Permissions bitfield (Administrator grants all permissions).

position: number

Role position (higher = above).

unicodeEmoji: string | null

Unicode emoji for this role (null = none).

Methods

delete(): Promise<void>

DELETE role. Requires Manage Roles.

edit(options: RoleEditOptions): Promise<Role>

PATCH role. Requires Manage Roles.

ParamTypeDescription
optionsRoleEditOptions

CamelCase fields to update

toString(): string

Format as a mention string (`<@&id>`).