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

impl Client {
    /// Returns the notification settings you have for a chat.
    pub async fn get_chat_notifications(&self, chat_id: impl Into<PeerRef>) -> Result<ChatNotifications> {
        let peer = base::InputNotifyPeer::InputNotifyPeer(Box::new(types::InputNotifyPeer {
            peer: self.resolve_peer(chat_id).await?,
        }));
        Ok(ChatNotifications::parse(self.invoke(&functions::account::GetNotifySettings { peer }).await?))
    }
}