Constructor
new Role()
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 |
unicodeEmojiString
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
|
|||||||||||||||||||||||||||||||||
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