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::functions;
use crate::types::{BotAccessSettings, PeerRef};

impl Client {
    /// Returns who can use a bot you manage.
    pub async fn get_managed_bot_access_settings(&self, bot_id: impl Into<PeerRef>) -> Result<BotAccessSettings> {
        let bot = self.resolve_user(&bot_id.into()).await?;
        let raw = self.invoke(&functions::bots::GetAccessSettings { bot }).await?;
        Ok(BotAccessSettings::parse(self, raw))
    }
}