Struct serenity::model::Role [] [src]

pub struct Role {
    pub id: RoleId,
    pub colour: Colour,
    pub hoist: bool,
    pub managed: bool,
    pub mentionable: bool,
    pub name: String,
    pub permissions: Permissions,
    pub position: u64,
}

Information about a role within a guild. A role represents a set of permissions, and can be attached to one or multiple users. A role has various miscellaneous configurations, such as being assigned a colour. Roles are unique per guild and do not cross over to other guilds in any way, and can have channel-specific permission overrides in addition to guild-level permissions.

Fields

The colour of the role in 0xRRGGBB format. This is an ergonomic representation of the inner value.

Whether the role is pinned above lesser roles, causing members in the role to be seen above others.

Whether the role is managed by an integration service.

Whether the role can be mentioned, similar to mentioning a specific member or @everyone. Only members of the role will be notified if a role is mentioned with this set to true.

A set of permissions that the role has been assigned. See the permissions module for more information.

The role's position in the position list. Roles above another are considered higher in the role hierarchy in most situations. The @everyone role is always position 0.

Methods

impl Role
[src]

Deletes the role.

Note Requires the Manage Roles permission.

Searches the cache for the guild that owns the role.

Errors

Returns a ClientError::GuildNotFound if a guild is not in the cache that contains the role.

Check that the role has the given permission.

Checks whether the role has all of the given permissions.

The 'precise' argument is used to check if the role's permissions are precisely equivilant to the given permissions. If you need only check that the role has at least the given permissions, pass false.

Return a Mention which will ping members of the role.

Trait Implementations

impl Display for Role
[src]

Format a mention for the role, pinging its members.

impl Mentionable for Role
[src]

impl Clone for Role
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Role
[src]

Formats the value using the given formatter.