ferrisgram/methods/
close_general_forum_topic.rs1#![allow(clippy::too_many_arguments)]
5use serde::Serialize;
6
7use crate::error::Result;
8use crate::Bot;
9
10impl Bot {
11 pub fn close_general_forum_topic(&self, chat_id: i64) -> CloseGeneralForumTopicBuilder {
14 CloseGeneralForumTopicBuilder::new(self, chat_id)
15 }
16}
17
18#[derive(Serialize)]
19pub struct CloseGeneralForumTopicBuilder<'a> {
20 #[serde(skip)]
21 bot: &'a Bot,
22 pub chat_id: i64,
24}
25
26impl<'a> CloseGeneralForumTopicBuilder<'a> {
27 pub fn new(bot: &'a Bot, chat_id: i64) -> Self {
28 Self { bot, chat_id }
29 }
30
31 pub fn chat_id(mut self, chat_id: i64) -> Self {
32 self.chat_id = chat_id;
33 self
34 }
35
36 pub async fn send(self) -> Result<bool> {
37 let form = serde_json::to_value(&self)?;
38 self.bot.get("closeGeneralForumTopic", Some(&form)).await
39 }
40}