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
15
16
use crate::Client;
use crate::dispatcher::Entities;
use crate::errors::Result;
use crate::raw::{base, functions};
use crate::types::BusinessChatLink;

impl Client {
    /// Returns the business chat links of the account.
    pub async fn get_business_chat_links(&self) -> Result<Vec<BusinessChatLink>> {
        let base::account::BusinessChatLinks::BusinessChatLinks(l) =
            self.invoke(&functions::account::GetBusinessChatLinks {}).await?;
        let l = *l;
        let entities = Entities::new(self, l.users, l.chats);
        Ok(l.links.into_iter().map(|link| BusinessChatLink::parse(link, &entities)).collect())
    }
}