diff --git a/src/api/channels/channels.rs b/src/api/channels/channels.rs index aba4725..12df44e 100644 --- a/src/api/channels/channels.rs +++ b/src/api/channels/channels.rs @@ -38,4 +38,29 @@ impl Channel { }), } } + + pub async fn delete( + token: &str, + url_api: &str, + channel_id: &str, + limits_user: &mut Limits, + limits_instance: &mut Limits, + ) -> Option { + let request = Client::new() + .delete(format!("{}/channels/{}/", url_api, channel_id)) + .bearer_auth(token); + match LimitedRequester::new() + .await + .send_request( + request, + crate::api::limits::LimitType::Channel, + limits_instance, + limits_user, + ) + .await + { + Ok(_) => None, + Err(e) => return Some(e), + } + } }