Struct serenity::model::Member [] [src]

pub struct Member {
    pub deaf: bool,
    pub joined_at: String,
    pub mute: bool,
    pub nick: Option<String>,
    pub roles: Vec<RoleId>,
    pub user: User,
}

Represents information about a member of a guild.

Fields

True if user isn't allowed to hear in voice channels.

Timestamp representing the date when the member joined.

True if user isn't allowed to talk in voice channels.

Optional nickname. Can't be longer than 32 characters.

Ids of roles that were given to the member.

Attached User struct.

Methods

impl Member
[src]

Adds a Role to the member, editing its roles in-place if the request was successful.

Note: Requires the Manage Roles permission.

Adds one or multiple Roles to the member, editing its roles in-place if the request was successful.

Note: Requires the Manage Roles permission.

Ban the member from its guild, deleting the last X number of days' worth of messages.

Note: Requires the Ban Members role.

Errors

Returns a ClientError::GuildNotFound if the guild could not be found.

Determines the member's colour.

Calculates the member's display name.

The nickname takes priority over the member's username if it exists.

Returns the DiscordTag of a Member, taking possible nickname into account.

Edits the member with the given data. See Context::edit_member for more information.

See EditMember for the permission(s) required for separate builder methods, as well as usage of this.

Finds the Id of the Guild that the member is in.

Errors

Returns a ClientError::GuildNotFound if the guild could not be found.

Removes a Role from the member, editing its roles in-place if the request was successful.

Note: Requires the Manage Roles permission.

Removes one or multiple Roles from the member.

Note: Requires the Manage Roles permission.

Retrieves the full role data for the user's roles.

This is shorthand for manually searching through the CACHE.

If role data can not be found for the member, then None is returned.

Unbans the User from the guild.

Note: Requires the Ban Members permission.

Errors

If the cache is enabled, returns a ClientError::InvalidPermissions if the current user does not have permission to perform bans.

Trait Implementations

impl Display for Member
[src]

Mentions the user so that they receive a notification.

Examples

// assumes a `member` has already been bound
println!("{} is a member!", member);

impl Mentionable for Member
[src]

impl Clone for Member
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Member
[src]

Formats the value using the given formatter.