diff options
| author | Matthieu <20992787+MatthieuCoder@users.noreply.github.com> | 2021-11-05 19:28:19 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 19:28:19 +0400 |
| commit | de73cf954c477a7f10f64b9caf3eea8f6550b8c8 (patch) | |
| tree | e61f4fd5bd6c515a5317adf8c8cbb10a362d91ff /common/rust/src/discord_models/user.rs | |
| parent | b73f3c90ec2a491d59275818e3f61826471452ba (diff) | |
| parent | 7ddb5d3820c15ce4202e6f43057310a9fbb7178a (diff) | |
Merge pull request #14 from discordnova/feat/twilight
use twilight for deserialization and gateway
Diffstat (limited to 'common/rust/src/discord_models/user.rs')
| -rw-r--r-- | common/rust/src/discord_models/user.rs | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/common/rust/src/discord_models/user.rs b/common/rust/src/discord_models/user.rs deleted file mode 100644 index 36914ce..0000000 --- a/common/rust/src/discord_models/user.rs +++ /dev/null @@ -1,73 +0,0 @@ -use enumflags2::{bitflags, BitFlags}; -use serde::{Deserialize, Serialize}; -use serde_repr::{Deserialize_repr, Serialize_repr}; - -use super::guild::Integration; - -#[bitflags] -#[repr(u64)] -#[derive(Debug, Clone, Copy)] -pub enum UserFlags { - // None = 0 << 0, - DiscordEmployee = 1 << 0, - PartneredServerOwner = 1 << 1, - HypesquadEvents = 1 << 2, - BugHunterLevel1 = 1 << 3, - HouseBravery = 1 << 6, - HouseBrilliance = 1 << 7, - HouseBalance = 1 << 8, - EarlySupporter = 1 << 9, - TeamUser = 1 << 10, - BugHunterLevel2 = 1 << 14, - VerifiedBot = 1 << 16, - EarlyVerifiedBotDeveloper = 1 << 17, - DiscordCertifiedModerator = 1 << 18, -} - -#[derive(Debug, Clone, Deserialize_repr, Serialize_repr)] -#[repr(u8)] -pub enum PremiumTypes { - None = 0, - NitroClassic = 1, - Nitro = 2, -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -/// Represents a User within Discord -pub struct User { - pub id: String, - pub username: String, - pub discriminator: String, - pub avatar: Option<String>, - pub bot: Option<bool>, - pub system: Option<bool>, - pub mfa_enabled: Option<bool>, - pub locale: Option<String>, - pub verified: Option<bool>, - pub email: Option<String>, - pub flags: Option<BitFlags<UserFlags>>, - pub premium_type: Option<PremiumTypes>, - pub public_flags: Option<BitFlags<UserFlags>>, -} - -#[derive(Debug, Clone, Deserialize_repr, Serialize_repr)] -#[repr(u8)] -pub enum VisibilityTypes { - None = 0, - Everyone = 1, -} - -#[derive(Debug, Clone, Deserialize, Serialize)] -/// The connection object that the user has attached. -pub struct Connection { - pub id: String, - pub name: String, - #[serde(rename = "type")] - pub type_: String, - pub revoked: Option<bool>, - pub integrations: Option<Vec<Integration>>, - pub verified: bool, - pub friend_sync: bool, - pub show_activity: bool, - pub visibility: VisibilityTypes, -} |
