#![allow(clippy::too_many_arguments)]
use serde::Serialize;
use crate::error::Result;
use crate::Bot;
impl Bot {
pub fn unpin_all_forum_topic_messages(
&self,
chat_id: i64,
message_thread_id: i64,
) -> UnpinAllForumTopicMessagesBuilder {
UnpinAllForumTopicMessagesBuilder::new(self, chat_id, message_thread_id)
}
}
#[derive(Serialize)]
pub struct UnpinAllForumTopicMessagesBuilder<'a> {
#[serde(skip)]
bot: &'a Bot,
pub chat_id: i64,
pub message_thread_id: i64,
}
impl<'a> UnpinAllForumTopicMessagesBuilder<'a> {
pub fn new(bot: &'a Bot, chat_id: i64, message_thread_id: i64) -> Self {
Self {
bot,
chat_id,
message_thread_id,
}
}
pub fn chat_id(mut self, chat_id: i64) -> Self {
self.chat_id = chat_id;
self
}
pub fn message_thread_id(mut self, message_thread_id: i64) -> Self {
self.message_thread_id = message_thread_id;
self
}
pub async fn send(self) -> Result<bool> {
let form = serde_json::to_value(&self)?;
self.bot
.get("unpinAllForumTopicMessages", Some(&form))
.await
}
}