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};
use crate::types::PeerRef;

impl Client {
    /// Returns a public t.me link to a story.
    pub async fn export_story_link(&self, chat_id: impl Into<PeerRef>, story_id: i32) -> Result<String> {
        let peer = self.resolve_peer(chat_id).await?;
        let base::ExportedStoryLink::ExportedStoryLink(link) =
            self.invoke(&functions::stories::ExportStoryLink { peer, id: story_id }).await?;
        Ok(link.link)
    }
}