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

impl Client {
    /// Shows a channel on your profile. Passing `None` removes it.
    pub async fn set_personal_channel(&self, chat_id: Option<PeerRef>) -> Result<()> {
        let channel = match chat_id {
            Some(chat_id) => self.resolve_channel(&chat_id).await?,
            None => base::InputChannel::InputChannelEmpty,
        };
        accepted(self.invoke(&functions::account::UpdatePersonalChannel { channel }).await?)
    }
}