Role
- class Role
A guild role, including its permission bitfield, hierarchy position, and display settings.
- Implements:
Properties
Property
Type
Description
color24-bit RGB color for this role.
undefinedwhen omitted;0only when Discord sent 0.colorsRole colors. Prefer this over the legacy singular
colorfield.createdAtWhen this role was created.
guildIdGuild ID this role belongs to.
hoistIndicates whether this role is displayed separately in the member list.
iconHash of the role’s icon, or
nullif not set.idRole ID.
managedIndicates whether this role is managed by an integration.
mentionableIndicates whether this role can be mentioned by anyone.
nameRole name.
permissionsPermission bitmask for this role.
positionPosition in the role hierarchy (higher = higher priority).
unicodeEmojiUnicode emoji displayed as the role icon, or
null.Methods
- async Role.delete(reason: string) Promise<void>
Delete this role.
- Parameters:
reason: Reason for deletion, shown in audit log.
-
async Role.edit(options:
RoleEditOptions) Promise<Role> Edit role properties.
- Parameters:
options: Role properties to update.
- Returns:
The updated role.
-
async Role.fetchMembers(options:
FetchMembersOptions) Promise<GuildMember[]> Fetch guild members who have this role.