Role class

Role structure

Roles represent a set of permissions attached to a group of users. Roles have unique names, colors, and can be "pinned" to the side bar, causing their members to be listed separately. Roles are unique per guild, and can have separate permission profiles for the global context (guild) and channel context. The @everyone role has the same ID as the guild it belongs to.

https://discord.com/developers/docs/topics/permissions#role-object-role-structure

Annotations
  • @JsonSerializable(includeIfNull: false)

Constructors

Role({required String id, required String name, required int color, required bool hoist, String? icon, String? unicodeEmoji, required int position, required List<Permission> permissions, required bool managed, required bool mentionable, RoleTags? tags})
Constructor
Role.fromJson(Map<String, dynamic> json)
From json
factory

Properties

color int
integer representation of hexadecimal color code
final
hashCode int
The hash code for this object.
no setterinherited
hoist bool
if this role is pinned in the user listing
final
icon String?
role icon hash
final
id String
role id
final
managed bool
whether this role is managed by an integration
final
mentionable bool
whether this role is mentionable
final
name String
role name
final
permissions List<Permission>
permission bit set
final
position int
position of this role
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tags RoleTags?
the tags this role has
final
unicodeEmoji String?
role unicode emoji
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
To json
toString() String
A string representation of this object.
inherited

Operators

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