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

impl Client {
    /// Returns Telegram's app configuration as a JSON value.
    pub async fn get_app_config(&self) -> Result<Json> {
        match self.invoke(&functions::help::GetAppConfig { hash: 0 }).await? {
            base::help::AppConfig::AppConfig(c) => Ok(Json::parse(c.config)),
            base::help::AppConfig::AppConfigNotModified => Ok(Json::Object(Vec::new())),
        }
    }
}