Skip to main content

rustigram_types/
gifts.rs

1use crate::sticker::Sticker;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5/// A Telegram gift that can be sent to users.
6///
7/// Retrieve available gifts with [`getAvailableGifts`](https://core.telegram.org/bots/api#getavailablegifts).
8pub struct Gift {
9    /// Unique gift identifier.
10    pub id: String,
11    /// The sticker that represents this gift.
12    pub sticker: Sticker,
13    /// Number of Telegram Stars that must be paid to send this gift.
14    pub star_count: u32,
15    /// Number of Telegram Stars required to upgrade this gift to a unique gift.
16    pub upgrade_star_count: Option<u32>,
17    /// Total number of gifts of this type that can be sent; `None` if unlimited.
18    pub total_count: Option<u32>,
19    /// Number of remaining gifts of this type that can be sent.
20    pub remaining_count: Option<u32>,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24/// Collection of available gifts returned by `getAvailableGifts`.
25pub struct Gifts {
26    /// The list of available gifts.
27    pub gifts: Vec<Gift>,
28}