rust_tg_bot_raw/bot/
reactions.rs1use super::{push_opt, Bot, ChatId, Result};
2use crate::request::request_parameter::RequestParameter;
3use crate::types::chat_boost;
4
5#[allow(dead_code)]
6impl Bot {
7 pub async fn set_message_reaction_raw(
15 &self,
16 chat_id: ChatId,
17 message_id: i64,
18 reaction: Option<Vec<serde_json::Value>>,
19 is_big: Option<bool>,
20 ) -> Result<bool> {
21 let mut params = vec![
22 RequestParameter::new("chat_id", serde_json::to_value(&chat_id)?),
23 RequestParameter::new("message_id", serde_json::to_value(message_id)?),
24 ];
25 push_opt(&mut params, "reaction", &reaction)?;
26 push_opt(&mut params, "is_big", &is_big)?;
27 self.do_post("setMessageReaction", params).await
28 }
29
30 pub async fn get_user_chat_boosts_raw(
34 &self,
35 chat_id: ChatId,
36 user_id: i64,
37 ) -> Result<chat_boost::UserChatBoosts> {
38 let params = vec![
39 RequestParameter::new("chat_id", serde_json::to_value(&chat_id)?),
40 RequestParameter::new("user_id", serde_json::to_value(user_id)?),
41 ];
42 self.do_post("getUserChatBoosts", params).await
43 }
44}