Role class

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

Inheritance
Implemented types

Properties

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

Methods

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

Operators

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