rust_tg_bot_raw/bot/
verification.rs1use super::{push_opt_str, Bot, ChatId, Result};
2use crate::request::request_parameter::RequestParameter;
3
4#[allow(dead_code)]
5impl Bot {
6 pub async fn verify_chat_raw(
14 &self,
15 chat_id: ChatId,
16 custom_description: Option<&str>,
17 ) -> Result<bool> {
18 let mut params = vec![RequestParameter::new(
19 "chat_id",
20 serde_json::to_value(&chat_id)?,
21 )];
22 push_opt_str(&mut params, "custom_description", custom_description);
23 self.do_post("verifyChat", params).await
24 }
25
26 pub async fn verify_user_raw(
30 &self,
31 user_id: i64,
32 custom_description: Option<&str>,
33 ) -> Result<bool> {
34 let mut params = vec![RequestParameter::new(
35 "user_id",
36 serde_json::to_value(user_id)?,
37 )];
38 push_opt_str(&mut params, "custom_description", custom_description);
39 self.do_post("verifyUser", params).await
40 }
41
42 pub async fn remove_chat_verification_raw(&self, chat_id: ChatId) -> Result<bool> {
46 let params = vec![RequestParameter::new(
47 "chat_id",
48 serde_json::to_value(&chat_id)?,
49 )];
50 self.do_post("removeChatVerification", params).await
51 }
52
53 pub async fn remove_user_verification_raw(&self, user_id: i64) -> Result<bool> {
57 let params = vec![RequestParameter::new(
58 "user_id",
59 serde_json::to_value(user_id)?,
60 )];
61 self.do_post("removeUserVerification", params).await
62 }
63}