Struct serenity::model::CurrentUser [] [src]

pub struct CurrentUser {
    pub id: UserId,
    pub avatar: Option<String>,
    pub bot: bool,
    pub discriminator: u16,
    pub email: Option<String>,
    pub mfa_enabled: bool,
    pub mobile: Option<bool>,
    pub name: String,
    pub verified: bool,
}

Information about the current user.

Fields

Whether the current user has logged in on mobile before.

Methods

impl CurrentUser
[src]

Returns the formatted URL of the user's icon, if one exists.

This will produce a WEBP image URL, or GIF if the user has a GIF avatar.

Returns the DiscordTag of a User.

Edits the current user's profile settings.

This mutates the current user in-place.

Refer to EditProfile's documentation for its methods.

Examples

Change the avatar:

use serenity::client::CACHE;

let avatar = serenity::utils::read_image("./avatar.png").unwrap();

CACHE.write().unwrap().user.edit(|p| p.avatar(Some(&avatar)));

Gets a list of guilds that the current user is in.

Returns a static formatted URL of the user's icon, if one exists.

This will always produce a WEBP image URL.

Trait Implementations

impl Clone for CurrentUser
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for CurrentUser
[src]

Formats the value using the given formatter.