Skip to content

Commit

Permalink
Fix improperly documented webhook APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
tazz4843 committed Dec 22, 2023
1 parent 695ef7d commit 119b062
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripty_botlists/src/lists/top_gg/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct IncomingWebhook {
#[serde(rename = "type")]
pub kind: VoteWebhookType,

#[serde(default)] // idiots at top.gg don't know how to make a proper webhook
pub is_weekend: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion scripty_botlists/src/lists/wumpus_store/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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 webhook_test: bool,

#[serde(deserialize_with = "deserialize_number_from_string")]
pub user_id: u64,
Expand Down
4 changes: 2 additions & 2 deletions scripty_webserver/src/endpoints/webhooks/wumpus_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<S> FromRequestParts<S> for WumpusStoreAuthorization {
pub async fn wumpus_store_incoming_webhook(
_authorization: WumpusStoreAuthorization,
Json(IncomingWebhook {
test_webhook,
webhook_test,
user_id,
..
}): Json<IncomingWebhook>,
Expand Down Expand Up @@ -92,7 +92,7 @@ pub async fn wumpus_store_incoming_webhook(
don't want to be notified, run `/vote_reminders False`. Thanks for your \
support!"
})
.footer(CreateEmbedFooter::new(if test_webhook {
.footer(CreateEmbedFooter::new(if webhook_test {
"Webhook test"
} else {
""
Expand Down

0 comments on commit 119b062

Please sign in to comment.