#![allow(clippy::too_many_arguments)]
use serde::Serialize;
use crate::error::Result;
use crate::Bot;
impl Bot {
pub fn set_custom_emoji_sticker_set_thumbnail(
&self,
name: String,
) -> SetCustomEmojiStickerSetThumbnailBuilder {
SetCustomEmojiStickerSetThumbnailBuilder::new(self, name)
}
}
#[derive(Serialize)]
pub struct SetCustomEmojiStickerSetThumbnailBuilder<'a> {
#[serde(skip)]
bot: &'a Bot,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_emoji_id: Option<String>,
}
impl<'a> SetCustomEmojiStickerSetThumbnailBuilder<'a> {
pub fn new(bot: &'a Bot, name: String) -> Self {
Self {
bot,
name,
custom_emoji_id: None,
}
}
pub fn name(mut self, name: String) -> Self {
self.name = name;
self
}
pub fn custom_emoji_id(mut self, custom_emoji_id: String) -> Self {
self.custom_emoji_id = Some(custom_emoji_id);
self
}
pub async fn send(self) -> Result<bool> {
let form = serde_json::to_value(&self)?;
self.bot
.get("setCustomEmojiStickerSetThumbnail", Some(&form))
.await
}
}