Add channel delete method
This commit is contained in:
parent
5a7565b0b3
commit
268da9525c
|
@ -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<InstanceServerError> {
|
||||||
|
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),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue