vaegram 0.2.0

Telegram MTProto client library for users and bots
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Client;
use crate::errors::Result;
use crate::raw::functions;
use crate::types::PeerRef;

impl Client {
    /// Gives a bot permission to message you.
    ///
    /// Use [`can_bot_send_message`](Client::can_bot_send_message) to check whether it already can.
    pub async fn allow_bot_send_message(&self, bot_id: impl Into<PeerRef>) -> Result<()> {
        self.invoke(&functions::bots::AllowSendMessage { bot: self.resolve_user(&bot_id.into()).await? })
            .await
            .map(drop)
    }
}