Role class

Represents a Discord guild role, which is used to assign priority, permissions, and a color to guild members

Implemented types


client Nyxx
Reference to client
final, inherited
color DiscordColor
The role's color, 0 if no color.
read / write, final, late
createdAt DateTime
Gets creation timestamp included in Snowflake
read-only, inherited
guild Guild
The role's guild.
read / write, final, late, override-getter
guildId Snowflake
Id of role's Guild
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hoist bool
If the role is pinned in the user listing.
read / write, final, late
id Snowflake
ID of entity as Snowflake
final, inherited
managed bool
Whether or not the role is managed by an integration.
read / write, final, late
mention String
Mention of role. If role cannot be mentioned it returns name of role (@name)
read-only, override
mentionable bool
Whether or not the role is mentionable.
read / write, final, late
name String
The role's name.
read / write, final, late
permissions Permissions
The role's permissions.
read / write, final, late
position int
The role's position.
read / write, final, late
roleTags RoleTags
Additional role data like if role is managed by integration or role is from server boosting.
read / write, final, late
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


addToUser(User user, {String auditReason}) Future<void>
Adds role to user.
delete({String auditReason}) Future<void>
Deletes the role.
edit(RoleBuilder role, {String auditReason}) Future<Role>
Edits the role.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
Returns a mention of role. If role cannot be mentioned it returns name of role.


operator ==(Object other) bool
The equality operator. [...]