Role

Role

Represents a role

Constructor

new Role()

Properties:
Properties
Name Type Attributes Description
color Number

The hex color of the role in base 10

createdAt Number

Timestamp of the role's creation

flags Number

The flags of the role (see constants)

guild Guild

The guild that owns the role

hoist Boolean

Whether users with the role are hoisted in the user list or not

icon String <nullable>

The hash of the role's icon, or null if no icon

iconURL String <nullable>

The URL of the role's icon

id String

The ID of the role

json Object

Generates a JSON representation of the role permissions

managed Boolean

Whether a guild integration manages the role or not

mention String

A string that mentions the role

mentionable Boolean

Whether the role is mentionable or not

name String

The name of the role

permissions Permission

The permissions representation of the role

position Number

The position of the role

tags Object <nullable>

The tags of the role

Name Type Attributes Description
bot_id String <nullable>

The ID of the bot associated with the role

integration_id String <nullable>

The ID of the integration associated with the role

premium_subscriber Boolean <nullable>

Whether the role is the guild's premium subscriber role

subscription_listing_id String <nullable>

The id of the role's subscription sku and listing

available_for_purchase Boolean <nullable>

Whether the role is available for purchase

guild_connections Boolean <nullable>

Whether the role is a guild's linked role

unicodeEmoji String <nullable>

Unicode emoji for the role

Source:

Methods

delete(reasonopt) → {Promise}

Delete the role

Source:
Parameters:
Name Type Attributes Description
reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

edit(options, reasonopt) → {Promise.<Role>}

Edit the guild role

Source:
Parameters:
Name Type Attributes Description
options Object

The properties to edit

Name Type Attributes Description
color Number <optional>

The hex color of the role, in number form (ex: 0x3da5b3 or 4040115)

hoist Boolean <optional>

Whether to hoist the role in the user list or not

icon String <optional>

The role icon as a base64 data URI

mentionable Boolean <optional>

Whether the role is mentionable or not

name String <optional>

The name of the role

permissions BigInt | Number <optional>

The role permissions number

unicodeEmoji String <optional>
<nullable>

The role's unicode emoji

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Role>

editPosition(position) → {Promise}

Edit the role's position. Note that role position numbers are highest on top and lowest at the bottom.

Source:
Parameters:
Name Type Description
position Number

The new position of the role

Returns:
Type:
Promise