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

impl Client {
    /// Disconnects a bot from the account's business profile.
    pub async fn remove_connected_bot(&self, bot_id: impl Into<PeerRef>) -> Result<()> {
        let bot = self.resolve_user(&bot_id.into()).await?;
        let recipients = BusinessRecipients::default().write_bot(self).await?;
        let request = functions::account::UpdateConnectedBot { deleted: true, rights: None, bot, recipients };
        self.invoke(&request).await.map(drop)
    }
}