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