vaegram 0.3.0

Telegram MTProto client library for users and bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::Client;
use crate::errors::Result;
use crate::raw::{base, functions, types};
use crate::types::{THEME_FORMAT, Theme};

impl Client {
    /// Returns a theme by the slug of its share link.
    pub async fn get_theme(&self, slug: impl Into<String>) -> Result<Theme> {
        let theme = base::InputTheme::InputThemeSlug(Box::new(types::InputThemeSlug { slug: slug.into() }));
        Ok(Theme::parse(self.invoke(&functions::account::GetTheme { format: THEME_FORMAT.into(), theme }).await?))
    }
}