#[non_exhaustive]pub struct Role {Show 13 fields
pub id: RoleId,
pub name: CompactString,
pub color: u32,
pub colors: RoleColors,
pub hoist: bool,
pub icon: Option<ImageHash>,
pub unicode_emoji: Option<CompactString>,
pub position: i32,
pub permissions: Permissions,
pub managed: bool,
pub mentionable: bool,
pub tags: Option<Box<RoleTags>>,
pub flags: RoleFlags,
}Expand description
A role: a named set of permissions (and a color, icon and position in the member list) that members can have.
The @everyone role has the guild’s ID.
discord.js counterpart: Role.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: RoleIdThe role’s ID.
name: CompactStringThe role’s name.
color: u32The role’s primary color as an RGB integer. Deprecated by Discord in favor of
colors, but still sent.
colors: RoleColorsThe role’s colors (solid, gradient or holographic).
hoist: boolWhether members with this role are listed separately in the member list.
icon: Option<ImageHash>The role icon hash.
unicode_emoji: Option<CompactString>The role’s Unicode emoji, shown instead of an icon.
position: i32The role’s position in the role list; roles with equal positions are ordered by ID.
permissions: PermissionsThe permissions the role grants.
managed: boolWhether the role is managed by an integration (bot role, booster role, …).
mentionable: boolWhether everyone can mention the role.
What the role is tied to (a bot, an integration, boosting, a subscription, …).
flags: RoleFlagsThe role’s flags.