-
Notifications
You must be signed in to change notification settings - Fork 143
Role
extends Snowflake
Represents a Discord guild role, which is used to assign priority, permissions, and a color to guild members.
Instances of this class should not be constructed by users.
Properties Inherited From Snowflake
Name | Type | Description |
---|---|---|
createdAt | number | The Unix time in seconds at which this object was created by Discord. Additional decimal points may be present, though only the first 3 (milliseconds) should be considered accurate. Equivalent to Date.parseSnowflake(Snowflake.id) . |
id | string | The Snowflake ID that can be used to identify the object. This is guaranteed to be unique except in cases where an object shares the ID of its parent. |
timestamp | string | The date and time at which this object was created by Discord, represented as an ISO 8601 string plus microseconds when available. Equivalent to Date.fromSnowflake(Snowflake.id):toISO() . |
Name | Type | Description |
---|---|---|
color | number | Represents the display color of the role as a decimal value. |
emojis | FilteredIterable | A filtered iterable of guild emojis that have this role. If you want to check whether a specific emoji has this role, it would be better to get the emoji object elsewhere and use Emoji:hasRole rather than check whether the emoji exists here. |
guild | Guild | The guild in which this role exists. |
hoisted | boolean | Whether members with this role should be shown separated from other members in the guild member list. |
managed | boolean | Whether this role is managed by some integration or bot inclusion. |
members | FilteredIterable | A filtered iterable of guild members that have this role. If you want to check whether a specific member has this role, it would be better to get the member object elsewhere and use Member:hasRole rather than check whether the member exists here. |
mentionString | string | A string that, when included in a message content, may resolve as a role notification in the official Discord client. |
mentionable | boolean | Whether this role can be mentioned in a text channel message. |
name | string | The name of the role. This should be between 1 and 100 characters in length. |
permissions | number | Represents the total permissions of the role as a decimal value. |
position | number | The position of the role, where 0 is the lowest. |
Methods Inherited From Snowflake
Returns
Snowflake.id
Returns: string
Returns a unique Date object that represents when the object was created by Discord. Equivalent to
Date.fromSnowflake(Snowflake.id)
Returns: Date
Permanently deletes the role. This cannot be undone!
Returns: boolean
Disables all permissions for this role. This does not necessarily fully disallow the permissions.
Returns: boolean
Disallows anyone to mention this role in text messages.
Returns: boolean
Parameter Type ... Permission-Resolvables Disables individual permissions for this role. This does not necessarily fully disallow the permissions.
Returns: boolean
Enables all permissions for this role. This does not necessarily fully allow the permissions.
Returns: boolean
Allows anyone to mention this role in text messages.
Returns: boolean
Parameter Type ... Permission-Resolvables Enables individual permissions for this role. This does not necessarily fully allow the permissions.
Returns: boolean
Returns a color object that represents the role's display color.
Returns: Color
Returns a permissions object that represents the permissions that this role has enabled.
Returns: Permissions
Causes members with this role to display above unhoisted roles in the member list.
Returns: boolean
Parameter Type n number Moves a role down its list. The parameter
n
indicates how many spaces the role should be moved, clamped to the lowest position, with a default of 1 if it is omitted. This will also normalize the positions of all roles. Note that the default everyone role cannot be moved.Returns: boolean
Parameter Type n number Moves a role up its list. The parameter
n
indicates how many spaces the role should be moved, clamped to the highest position, with a default of 1 if it is omitted. This will also normalize the positions of all roles. Note that the default everyone role cannot be moved.Returns: boolean
Parameter Type color Color-Resolvable Sets the role's display color.
Returns: boolean
Parameter Type name string Sets the role's name. The name must be between 1 and 100 characters in length.
Returns: boolean
Parameter Type permissions Permissions-Resolvable Sets the permissions that this role explicitly allows.
Returns: boolean
Causes member with this role to display amongst other unhoisted members.
Returns: boolean