use crate::{error::VkApiError, error::VkError, param_grid::ParamGrid, send_request, VkApi};
const API: &str = "https://api.vk.com/method/calls.";
pub async fn force_finish(api: &VkApi, call_id: String) -> Result<u8, VkApiError> {
let mut params = ParamGrid::new();
params.insert_if_not_exists("call_id", call_id);
let response_text = send_request(
&api.client,
Some(params),
&format!("{}forceFinish", API),
&api.flow_key,
api.v,
)
.await?;
if let Ok(error) = serde_json::from_str::<VkError>(&response_text) {
return Err(VkApiError::VkError(error));
}
Ok(1)
}