pub mod command;
pub mod component;
pub mod interaction;
pub mod oauth;
use super::id::{snowflake, ApplicationId, UserId};
use super::user::User;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PartialCurrentApplicationInfo {
pub id: ApplicationId,
pub flags: ApplicationFlags,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[non_exhaustive]
pub struct CurrentApplicationInfo {
pub description: String,
pub icon: Option<String>,
pub id: ApplicationId,
pub name: String,
pub owner: User,
#[serde(default)]
pub rpc_origins: Vec<String>,
pub bot_public: bool,
pub bot_require_code_grant: bool,
pub team: Option<Team>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Team {
pub icon: Option<String>,
#[serde(with = "snowflake")]
pub id: u64,
pub name: String,
pub members: Vec<TeamMember>,
pub owner_user_id: UserId,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TeamMember {
pub membership_state: MembershipState,
pub permissions: Vec<String>,
#[serde(with = "snowflake")]
pub team_id: u64,
pub user: User,
}
#[derive(Clone, Debug, Copy, PartialEq)]
pub enum MembershipState {
Invited = 1,
Accepted = 2,
Unknown = !0,
}
enum_number!(MembershipState {
Invited,
Accepted
});
bitflags! {
#[derive(Default)]
pub struct ApplicationFlags: u64 {
const GATEWAY_PRESENCE = 1 << 12;
const GATEWAY_PRESENCE_LIMITED = 1 << 13;
const GATEWAY_GUILD_MEMBERS = 1 << 14;
const GATEWAY_GUILD_MEMBERS_LIMITED = 1 << 15;
const VERIFICATION_PENDING_GUILD_LIMIT = 2 << 16;
const EMBEDDED = 2 << 17;
const GATEWAY_MESSAGE_CONTENT = 2 << 18;
const GATEWAY_MESSAGE_CONTENT_LIMITED = 2 << 19;
}
}