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
13
use crate::Client;
use crate::errors::Result;
use crate::raw::{base, functions, types};
use crate::types::ChatBackground;

impl Client {
    /// Returns a wallpaper by the slug of its share link.
    pub async fn get_wallpaper(&self, slug: impl Into<String>) -> Result<ChatBackground> {
        let slug = types::InputWallPaperSlug { slug: slug.into() };
        let wallpaper = base::InputWallPaper::InputWallPaperSlug(Box::new(slug));
        Ok(ChatBackground::parse(self.invoke(&functions::account::GetWallPaper { wallpaper }).await?))
    }
}