vaegram 0.2.0

Telegram MTProto client library for users and bots
Documentation
use crate::Client;
use crate::errors::Result;
use crate::raw::functions;
use crate::utils::input_sticker_set;

impl Client {
    /// Archives the installed sticker set with this short `name`.
    pub async fn archive_sticker_set(&self, name: &str) -> Result<()> {
        self.toggle_sticker_set_archived(name, true).await
    }

    pub(crate) async fn toggle_sticker_set_archived(&self, name: &str, archive: bool) -> Result<()> {
        let stickersets = vec![input_sticker_set(name)];
        let unarchive = !archive;
        let request = functions::messages::ToggleStickerSets { uninstall: false, archive, unarchive, stickersets };
        self.invoke(&request).await?;
        Ok(())
    }
}