diff --git a/scripty_botlists/src/lists/top_gg/models.rs b/scripty_botlists/src/lists/top_gg/models.rs index 4aee255..89b33bc 100644 --- a/scripty_botlists/src/lists/top_gg/models.rs +++ b/scripty_botlists/src/lists/top_gg/models.rs @@ -1,3 +1,5 @@ +use serde_aux::field_attributes::deserialize_number_from_string; + #[derive(Debug, Serialize, Copy, Clone)] pub struct PostStats { pub server_count: usize, @@ -6,10 +8,15 @@ pub struct PostStats { #[derive(Debug, Deserialize, Copy, Clone)] pub struct IncomingWebhook { - pub bot: u64, - pub user: u64, + #[serde(deserialize_with = "deserialize_number_from_string")] + pub bot: u64, + + #[serde(deserialize_with = "deserialize_number_from_string")] + pub user: u64, + #[serde(rename = "type")] - pub kind: VoteWebhookType, + pub kind: VoteWebhookType, + pub is_weekend: bool, } diff --git a/scripty_botlists/src/lists/wumpus_store/models.rs b/scripty_botlists/src/lists/wumpus_store/models.rs index 520d064..d9b2906 100644 --- a/scripty_botlists/src/lists/wumpus_store/models.rs +++ b/scripty_botlists/src/lists/wumpus_store/models.rs @@ -1,7 +1,12 @@ +use serde_aux::field_attributes::deserialize_number_from_string; + #[derive(Debug, Deserialize, Copy, Clone)] #[serde(rename_all = "camelCase")] pub struct IncomingWebhook { pub test_webhook: bool, - pub user_id: u64, - pub bot_id: u64, + + #[serde(deserialize_with = "deserialize_number_from_string")] + pub user_id: u64, + #[serde(deserialize_with = "deserialize_number_from_string")] + pub bot_id: u64, }