1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
use serde::{Deserialize, Serialize};
use super::chat::Chat;
use super::files::sticker::Sticker;
// ---------------------------------------------------------------------------
// UniqueGiftColors
// ---------------------------------------------------------------------------
/// Color scheme for a user's name, message replies, and link previews based on a unique gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftColors {
/// Custom emoji identifier of the unique gift's model.
pub model_custom_emoji_id: String,
/// Custom emoji identifier of the unique gift's symbol.
pub symbol_custom_emoji_id: String,
/// Main color used in light themes; RGB format.
pub light_theme_main_color: i64,
/// List of 1–3 additional colors used in light themes; RGB format.
pub light_theme_other_colors: Vec<i64>,
/// Main color used in dark themes; RGB format.
pub dark_theme_main_color: i64,
/// List of 1–3 additional colors used in dark themes; RGB format.
pub dark_theme_other_colors: Vec<i64>,
}
// ---------------------------------------------------------------------------
// UniqueGiftModel
// ---------------------------------------------------------------------------
/// Model of a unique gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftModel {
/// Name of the model.
pub name: String,
/// Sticker that represents the unique gift.
pub sticker: Sticker,
/// Number of unique gifts receiving this model per 1000 upgrades.
pub rarity_per_mille: i64,
/// Rarity of the model if it is a crafted model.
#[serde(skip_serializing_if = "Option::is_none")]
pub rarity: Option<String>,
}
// ---------------------------------------------------------------------------
// UniqueGiftSymbol
// ---------------------------------------------------------------------------
/// Symbol shown on the pattern of a unique gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftSymbol {
/// Name of the symbol.
pub name: String,
/// Sticker that represents the unique gift.
pub sticker: Sticker,
/// Number of unique gifts receiving this symbol per 1000 upgrades.
pub rarity_per_mille: i64,
}
// ---------------------------------------------------------------------------
// UniqueGiftBackdropColors
// ---------------------------------------------------------------------------
/// Colors of the backdrop of a unique gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftBackdropColors {
/// Center color of the backdrop in RGB format.
pub center_color: i64,
/// Edge color of the backdrop in RGB format.
pub edge_color: i64,
/// Color applied to the symbol in RGB format.
pub symbol_color: i64,
/// Text color on the backdrop in RGB format.
pub text_color: i64,
}
// ---------------------------------------------------------------------------
// UniqueGiftBackdrop
// ---------------------------------------------------------------------------
/// Backdrop of a unique gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftBackdrop {
/// Name of the backdrop.
pub name: String,
/// Colors of the backdrop.
pub colors: UniqueGiftBackdropColors,
/// Number of unique gifts receiving this backdrop per 1000 upgrades.
pub rarity_per_mille: i64,
}
// ---------------------------------------------------------------------------
// UniqueGift
// ---------------------------------------------------------------------------
/// A unique gift that was upgraded from a regular gift.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGift {
/// Identifier of the regular gift from which this was upgraded.
pub gift_id: String,
/// Human-readable name of the original regular gift.
pub base_name: String,
/// Unique name usable in `https://t.me/nft/...` links.
pub name: String,
/// Unique number among gifts upgraded from the same regular gift.
pub number: i64,
/// Model of the gift.
pub model: UniqueGiftModel,
/// Symbol of the gift.
pub symbol: UniqueGiftSymbol,
/// Backdrop of the gift.
pub backdrop: UniqueGiftBackdrop,
/// Chat that published the gift.
#[serde(skip_serializing_if = "Option::is_none")]
pub publisher_chat: Option<Chat>,
/// True if the original regular gift was exclusively for Telegram Premium subscribers.
#[serde(skip_serializing_if = "Option::is_none")]
pub is_premium: Option<bool>,
/// True if the gift is assigned from the TON blockchain and cannot be resold in Telegram.
#[serde(skip_serializing_if = "Option::is_none")]
pub is_from_blockchain: Option<bool>,
/// Color scheme available to the gift's owner.
#[serde(skip_serializing_if = "Option::is_none")]
pub colors: Option<UniqueGiftColors>,
/// True if the gift was used to craft another gift and is no longer available.
#[serde(skip_serializing_if = "Option::is_none")]
pub is_burned: Option<bool>,
}
// ---------------------------------------------------------------------------
// UniqueGiftInfo
// ---------------------------------------------------------------------------
/// Service message about a unique gift that was sent or received.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct UniqueGiftInfo {
/// Information about the gift.
pub gift: UniqueGift,
/// Origin of the gift: `"upgrade"`, `"transfer"`, `"resale"`, `"gifted_upgrade"`,
/// or `"offer"`.
pub origin: String,
/// Unique identifier of the received gift for the bot; business accounts only.
#[serde(skip_serializing_if = "Option::is_none")]
pub owned_gift_id: Option<String>,
/// Stars required to transfer the gift; absent if transfer is not possible.
#[serde(skip_serializing_if = "Option::is_none")]
pub transfer_star_count: Option<i64>,
/// Unix timestamp when the gift can be transferred next.
#[serde(skip_serializing_if = "Option::is_none")]
pub next_transfer_date: Option<i64>,
/// Currency of the last resale payment; for resale gifts only.
#[serde(skip_serializing_if = "Option::is_none")]
pub last_resale_currency: Option<String>,
/// Amount paid in the last resale; for resale gifts only.
#[serde(skip_serializing_if = "Option::is_none")]
pub last_resale_amount: Option<i64>,
}