use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Bot {
pub avatar: Option<String>,
pub certified_bot: bool,
pub date: DateTime<FixedOffset>,
pub def_avatar: Option<String>,
#[serde(rename = "longdesc")]
pub description_long: Option<String>,
#[serde(rename = "shortdesc")]
pub description_short: String,
pub discriminator: String,
pub github: Option<String>,
pub id: String,
pub invite: Option<String>,
pub lib: String,
pub owners: Vec<String>,
pub points: u64,
pub prefix: String,
pub support: Option<String>,
pub tags: Vec<String>,
pub username: String,
pub vanity: Option<String>,
pub website: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BotStats {
pub server_count: Option<u64>,
pub shards: Vec<u64>,
pub shard_count: Option<u64>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum BotVotes {
Ids(Vec<u64>),
Users(Vec<DiscordUser>),
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DiscordUser {
pub avatar: Option<String>,
pub discriminator: u16,
pub id: String,
pub username: String,
}
#[derive(Deserialize)]
pub(crate) struct ResponseUserVoted {
pub voted: u8,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SearchResponse<T> {
pub count: u64,
pub limit: u64,
pub offset: u64,
pub results: Vec<T>,
pub total: u64,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum ShardStats {
Cumulative {
shard_count: Option<u64>,
#[serde(rename = "server_count")]
guild_count: u64,
},
Shard {
#[serde(rename = "server_count")]
guild_count: u16,
shard_count: u64,
shard_id: u64,
},
Shards(Vec<u64>),
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Social {
pub github: String,
pub instagram: String,
pub reddit: String,
pub twitter: String,
pub youtube: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct User {
pub admin: bool,
pub avatar: Option<String>,
pub banner: Option<String>,
pub bio: Option<String>,
pub certified_dev: bool,
#[serde(rename = "color")]
pub colour: Option<String>,
pub def_avatar: Option<String>,
pub discriminator: String,
pub id: String,
#[serde(rename = "mod")]
pub mod_: bool,
#[serde(default)]
pub social: Social,
pub supporter: bool,
pub username: String,
pub web_mod: bool,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Webhook {
pub bot: String,
pub is_weekend: bool,
#[serde(rename = "type")]
pub kind: WebhookType,
pub query: String,
#[serde(rename = "user")]
pub user_id: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum WebhookType {
Test,
Upvote,
}