summaryrefslogtreecommitdiff
path: root/common/rust/src
diff options
context:
space:
mode:
authorn1c00o <git.n1c00o@gmail.com>2021-10-01 17:15:30 +0200
committern1c00o <git.n1c00o@gmail.com>2021-10-01 17:15:30 +0200
commit359c3b277a50fd622786dc962afaaf78ed6d8883 (patch)
tree5fe29e7b4cb332facf1fdb1954b13bf618974a06 /common/rust/src
parent376f00642c2adba158b148a7933383af53ecdba1 (diff)
Start structs of the Discord API
Diffstat (limited to 'common/rust/src')
-rw-r--r--common/rust/src/discord_models.rs35
-rw-r--r--common/rust/src/lib.rs3
2 files changed, 37 insertions, 1 deletions
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<String>,
+ /// whether the user belongs to an OAuth2 application
+ pub bot: Option<bool>,
+ /// whether the user is an Official Discord System user (part of the urgent message system)
+ pub system: Option<bool>,
+ /// the user's id
+ pub mfa_enabled: Option<bool>,
+ /// the user's banner hash
+ pub banner: Option<String>,
+ /// the user's banner color encoded as an integer representation of hexadecimal color code
+ pub accent_color: Option<i64>,
+ /// the user's chosen language option
+ pub locale: Option<String>,
+ /// whether the email on this account has been verified
+ pub verified: Option<bool>,
+ /// the user's email
+ pub email: Option<String>,
+ /// the flags on a user's account
+ pub flags: Option<i64>,
+ /// the type of Nitro subscription on a user's account
+ pub premium_type: Option<u8>,
+ /// the public flags on a user's account
+ pub public_flags: Option<i64>,
+}
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