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

impl Client {
    /// Reads the status of the giveaway announced in message `message_id` of `chat_id`.
    pub async fn get_giveaway_info(&self, chat_id: impl Into<PeerRef>, message_id: i32) -> Result<GiveawayInfo> {
        let peer = self.resolve_peer(chat_id).await?;
        let info = self.invoke(&functions::payments::GetGiveawayInfo { peer, msg_id: message_id }).await?;
        Ok(GiveawayInfo::parse(info))
    }
}