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 {
    /// Deletes a forum topic together with all messages in it.
    pub async fn delete_forum_topic(&self, chat_id: impl Into<PeerRef>, topic_id: i32) -> Result<()> {
        let (chat_id, peer) = self.resolve(&chat_id.into()).await?;
        self.affected_history(chat_id, &functions::messages::DeleteTopicHistory { peer, top_msg_id: topic_id }).await?;
        self.0.caches.evict_chat(chat_id);
        self.0.caches.evict_topic(chat_id, topic_id);
        Ok(())
    }
}