From: n1c00o Date: Fri, 1 Oct 2021 15:15:30 +0000 (+0200) Subject: Start structs of the Discord API X-Git-Tag: v0.1~55^2~16 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=359c3b277a50fd622786dc962afaaf78ed6d8883;p=matthieu%2Fnova.git Start structs of the Discord API --- diff --git a/common/rust/src/discord_models.rs b/common/rust/src/discord_models.rs new file mode 100644 index 0000000..8426329 --- /dev/null +++ b/common/rust/src/discord_models.rs @@ -0,0 +1,35 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct User { + /// the user's id + pub id: String, + /// the user's username, not unique across the platform + pub username: String, + /// the user's 4-digit discord-tag + pub discriminator: String, + /// the user's avatar hash + pub avatar: Option, + /// whether the user belongs to an OAuth2 application + pub bot: Option, + /// whether the user is an Official Discord System user (part of the urgent message system) + pub system: Option, + /// the user's id + pub mfa_enabled: Option, + /// the user's banner hash + pub banner: Option, + /// the user's banner color encoded as an integer representation of hexadecimal color code + pub accent_color: Option, + /// the user's chosen language option + pub locale: Option, + /// whether the email on this account has been verified + pub verified: Option, + /// the user's email + pub email: Option, + /// the flags on a user's account + pub flags: Option, + /// the type of Nitro subscription on a user's account + pub premium_type: Option, + /// the public flags on a user's account + pub public_flags: Option, +} diff --git a/common/rust/src/lib.rs b/common/rust/src/lib.rs index 943d7cc..a021e97 100644 --- a/common/rust/src/lib.rs +++ b/common/rust/src/lib.rs @@ -1,7 +1,8 @@ /// This crate contains shared code in all the rust projects /// It contains utilities such as monitoring, logging and more. pub mod config; +pub mod discord_models; +pub mod error; pub mod monitoring; pub mod nats; pub mod payloads; -pub mod error; \ No newline at end of file