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