vaegram 0.2.0

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

impl Client {
    /// Returns whether the bot is allowed to message you.
    pub async fn can_bot_send_message(&self, bot_id: impl Into<PeerRef>) -> Result<bool> {
        self.invoke(&functions::bots::CanSendMessage { bot: self.resolve_user(&bot_id.into()).await? }).await
    }
}