diff options
| author | n1c00o <git.n1c00o@gmail.com> | 2021-10-02 23:00:08 +0200 |
|---|---|---|
| committer | n1c00o <git.n1c00o@gmail.com> | 2021-10-02 23:00:08 +0200 |
| commit | ca0efb3e31b48812e934b5615878a40b767f1abd (patch) | |
| tree | e89c65fbc311310f1feb28253d5ecd43524ed445 /common/rust/src/discord_models/application.rs | |
| parent | 13955d7089a1f6a7a5c711533a965d9d57eed2d8 (diff) | |
Add Application-related structures
Diffstat (limited to 'common/rust/src/discord_models/application.rs')
| -rw-r--r-- | common/rust/src/discord_models/application.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/common/rust/src/discord_models/application.rs b/common/rust/src/discord_models/application.rs new file mode 100644 index 0000000..65707d2 --- /dev/null +++ b/common/rust/src/discord_models/application.rs @@ -0,0 +1,38 @@ +use enumflags2::{bitflags, BitFlags}; +use serde::{Deserialize, Serialize}; + +use super::{teams::Team, user::User}; + +#[bitflags] +#[repr(u64)] +#[derive(Debug, Clone, Copy)] +pub enum ApplicationFlags { + GatewayPresence = 1 << 12, + GatewayPresenceLimit = 1 << 13, + GatewayGuildMembers = 1 << 14, + GatewayGuildMembersLimited = 1 << 15, + VerificationPendingGuildLimit = 1 << 16, + Embedded = 1 << 17, +} + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Application { + pub id: String, + pub name: String, + pub icon: Option<String>, + pub description: String, + pub rpc_origins: Option<Vec<String>>, + pub bot_public: bool, + pub bot_require_code_grant: bool, + pub terms_of_service_url: Option<String>, + pub privacy_policy_url: Option<String>, + pub owner: Option<User>, + pub summary: String, + pub verify_key: String, + pub team: Option<Team>, + pub guild_id: Option<String>, + pub primary_sku_id: Option<String>, + pub slug: Option<String>, + pub cover_image: Option<String>, + pub flags: Option<BitFlags<ApplicationFlags>>, +} |
