1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use super::{push_opt_str, Bot, ChatId, Result};
use crate::request::request_parameter::RequestParameter;
#[allow(dead_code)]
impl Bot {
// ======================================================================
// Verification
// ======================================================================
/// Use this method to verify a chat on behalf of the organization that the bot represents.
///
/// Calls the Telegram `verifyChat` API method.
pub async fn verify_chat_raw(
&self,
chat_id: ChatId,
custom_description: Option<&str>,
) -> Result<bool> {
let mut params = vec![RequestParameter::new(
"chat_id",
serde_json::to_value(&chat_id)?,
)];
push_opt_str(&mut params, "custom_description", custom_description);
self.do_post("verifyChat", params).await
}
/// Use this method to verify a user on behalf of the organization that the bot represents.
///
/// Calls the Telegram `verifyUser` API method.
pub async fn verify_user_raw(
&self,
user_id: i64,
custom_description: Option<&str>,
) -> Result<bool> {
let mut params = vec![RequestParameter::new(
"user_id",
serde_json::to_value(user_id)?,
)];
push_opt_str(&mut params, "custom_description", custom_description);
self.do_post("verifyUser", params).await
}
/// Use this method to remove verification from a chat.
///
/// Calls the Telegram `removeChatVerification` API method.
pub async fn remove_chat_verification_raw(&self, chat_id: ChatId) -> Result<bool> {
let params = vec![RequestParameter::new(
"chat_id",
serde_json::to_value(&chat_id)?,
)];
self.do_post("removeChatVerification", params).await
}
/// Use this method to remove verification from a user.
///
/// Calls the Telegram `removeUserVerification` API method.
pub async fn remove_user_verification_raw(&self, user_id: i64) -> Result<bool> {
let params = vec![RequestParameter::new(
"user_id",
serde_json::to_value(user_id)?,
)];
self.do_post("removeUserVerification", params).await
}
}