discord_webhook2/user/mod.rs
1use serde::{Deserialize, Serialize};
2
3use crate::id::DiscordID;
4use crate::user::avatar_decoration::AvatarDecoration;
5use crate::user::flags::UserFlags;
6use crate::user::premium_type::PremiumType;
7
8mod avatar_decoration;
9mod flags;
10mod premium_type;
11
12#[derive(Serialize, Deserialize, Debug, Clone)]
13pub struct User {
14 /// The user's id
15 id: DiscordID,
16 /// The user's username, not unique across the platform
17 username: String,
18 /// The user's Discord-tag
19 discriminator: String,
20 /// The user's display name, if it is set. For bots, this is the application name
21 global_name: Option<String>,
22 /// The user's avatar hash
23 avatar: Option<String>,
24 /// Whether the user belongs to an OAuth2 application
25 bot: Option<bool>,
26 /// Whether the user is an Official Discord System user (part of the urgent message system)
27 system: Option<bool>,
28 /// Whether the user has two-factor enabled on their account
29 mfa_enabled: Option<bool>,
30 /// The user's banner hash
31 banner: Option<String>,
32 /// The user's banner color encoded as an integer representation of hexadecimal color code
33 accent_color: Option<u32>,
34 /// The user's chosen language option
35 locale: Option<String>,
36 /// Whether the email on this account has been verified
37 verified: Option<bool>,
38 /// The user's email
39 email: Option<String>,
40 /// The flags on a user's account
41 flags: Option<UserFlags>,
42 /// The type of Nitro subscription on a user's account
43 premium_type: Option<PremiumType>,
44 /// The public flags on a user's account
45 public_flags: Option<UserFlags>,
46 /// Data for the user's avatar decoration
47 avatar_decoration_data: Option<AvatarDecoration>,
48}