diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/mod.rs | 21 | ||||
| -rw-r--r-- | src/http/ratelimiting.rs | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs index 1828bd7..2348794 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -625,7 +625,12 @@ pub fn delete_role(guild_id: u64, role_id: u64) -> Result<()> { pub fn delete_webhook(webhook_id: u64) -> Result<()> { verify( 204, - request!(Route::WebhooksId, delete, "/webhooks/{}", webhook_id), + request!( + Route::WebhooksId(webhook_id), + delete, + "/webhooks/{}", + webhook_id, + ), ) } @@ -855,7 +860,12 @@ pub fn edit_role(guild_id: u64, role_id: u64, map: &JsonMap) -> Result<Role> { // external crates being incredibly messy and misleading in the end user's view. pub fn edit_webhook(webhook_id: u64, map: &Value) -> Result<Webhook> { let body = map.to_string(); - let response = request!(Route::WebhooksId, patch(body), "/webhooks/{}", webhook_id); + let response = request!( + Route::WebhooksId(webhook_id), + patch(body), + "/webhooks/{}", + webhook_id, + ); serde_json::from_reader::<HyperResponse, Webhook>(response) .map_err(From::from) @@ -1518,7 +1528,12 @@ pub fn get_voice_regions() -> Result<Vec<VoiceRegion>> { /// /// [`get_webhook_with_token`]: fn.get_webhook_with_token.html pub fn get_webhook(webhook_id: u64) -> Result<Webhook> { - let response = request!(Route::WebhooksId, get, "/webhooks/{}", webhook_id); + let response = request!( + Route::WebhooksId(webhook_id), + get, + "/webhooks/{}", + webhook_id, + ); serde_json::from_reader::<HyperResponse, Webhook>(response) .map_err(From::from) diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs index ed3eb71..93ca4f6 100644 --- a/src/http/ratelimiting.rs +++ b/src/http/ratelimiting.rs @@ -338,7 +338,7 @@ pub enum Route { /// Route for the `/voice/regions` path. VoiceRegions, /// Route for the `/webhooks/:webhook_id` path. - WebhooksId, + WebhooksId(u64), /// Route where no ratelimit headers are in place (i.e. user account-only /// routes). /// |