ferrisgram 0.2.1

An elegent rust client for the Telegram Bot API.
Documentation
// WARNING: THIS CODE IS AUTOGENERATED.
// DO NOT EDIT!!!

#![allow(clippy::too_many_arguments)]
use serde::Serialize;

use crate::error::Result;
use crate::types::Sticker;
use crate::Bot;

impl Bot {
    /// Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
    /// <https://core.telegram.org/bots/api#getforumtopiciconstickers>
    pub fn get_forum_topic_icon_stickers(&self) -> GetForumTopicIconStickersBuilder {
        GetForumTopicIconStickersBuilder::new(self)
    }
}

#[derive(Serialize)]
pub struct GetForumTopicIconStickersBuilder<'a> {
    #[serde(skip)]
    bot: &'a Bot,
}

impl<'a> GetForumTopicIconStickersBuilder<'a> {
    pub fn new(bot: &'a Bot) -> Self {
        Self { bot }
    }

    pub async fn send(self) -> Result<Vec<Sticker>> {
        let form = serde_json::to_value(&self)?;
        self.bot.get("getForumTopicIconStickers", Some(&form)).await
    }
}