ferrisgram/methods/
delete_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 delete_forum_topic(
14 &self,
15 chat_id: i64,
16 message_thread_id: i64,
17 ) -> DeleteForumTopicBuilder {
18 DeleteForumTopicBuilder::new(self, chat_id, message_thread_id)
19 }
20}
21
22#[derive(Serialize)]
23pub struct DeleteForumTopicBuilder<'a> {
24 #[serde(skip)]
25 bot: &'a Bot,
26 pub chat_id: i64,
28 pub message_thread_id: i64,
30}
31
32impl<'a> DeleteForumTopicBuilder<'a> {
33 pub fn new(bot: &'a Bot, chat_id: i64, message_thread_id: i64) -> Self {
34 Self {
35 bot,
36 chat_id,
37 message_thread_id,
38 }
39 }
40
41 pub fn chat_id(mut self, chat_id: i64) -> Self {
42 self.chat_id = chat_id;
43 self
44 }
45
46 pub fn message_thread_id(mut self, message_thread_id: i64) -> Self {
47 self.message_thread_id = message_thread_id;
48 self
49 }
50
51 pub async fn send(self) -> Result<bool> {
52 let form = serde_json::to_value(&self)?;
53 self.bot.get("deleteForumTopic", Some(&form)).await
54 }
55}