Skip to main content

rust_tg_bot_raw/
constants.rs

1// ── Version ──────────────────────────────────────────────────────────────────
2
3/// Telegram Bot API version supported by this crate.
4pub const BOT_API_VERSION: &str = "9.6";
5/// Major component of `BOT_API_VERSION`.
6pub const BOT_API_VERSION_MAJOR: u32 = 9;
7/// Minor component of `BOT_API_VERSION`.
8pub const BOT_API_VERSION_MINOR: u32 = 6;
9
10/// Ports accepted by `set_webhook`.
11pub const SUPPORTED_WEBHOOK_PORTS: &[u16] = &[443, 80, 88, 8443];
12
13/// The value of one nanostar as used in `StarTransaction.nanostar_amount`.
14pub const NANOSTAR_VALUE: f64 = 1.0 / 1_000_000_000.0;
15
16// ── AccentColor ───────────────────────────────────────────────────────────────
17
18/// A Telegram accent color entry with optional hex color lists.
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub struct AccentColorEntry {
21    /// The numeric identifier.
22    pub identifier: u32,
23    /// Optional human-readable name.
24    pub name: Option<&'static str>,
25    /// Light-theme hex colors.
26    pub light_colors: &'static [u32],
27    /// Dark-theme hex colors.
28    pub dark_colors: &'static [u32],
29}
30
31/// Accent color palette for `ChatFullInfo.accent_color_id`.
32pub mod accent_color {
33    use super::AccentColorEntry;
34    /// Red accent color (identifier 0).
35    pub const COLOR_000: AccentColorEntry = AccentColorEntry {
36        identifier: 0,
37        name: Some("red"),
38        light_colors: &[],
39        dark_colors: &[],
40    };
41    /// Orange accent color (identifier 1).
42    pub const COLOR_001: AccentColorEntry = AccentColorEntry {
43        identifier: 1,
44        name: Some("orange"),
45        light_colors: &[],
46        dark_colors: &[],
47    };
48    /// Purple/violet accent color (identifier 2).
49    pub const COLOR_002: AccentColorEntry = AccentColorEntry {
50        identifier: 2,
51        name: Some("purple/violet"),
52        light_colors: &[],
53        dark_colors: &[],
54    };
55    /// Green accent color (identifier 3).
56    pub const COLOR_003: AccentColorEntry = AccentColorEntry {
57        identifier: 3,
58        name: Some("green"),
59        light_colors: &[],
60        dark_colors: &[],
61    };
62    /// Cyan accent color (identifier 4).
63    pub const COLOR_004: AccentColorEntry = AccentColorEntry {
64        identifier: 4,
65        name: Some("cyan"),
66        light_colors: &[],
67        dark_colors: &[],
68    };
69    /// Blue accent color (identifier 5).
70    pub const COLOR_005: AccentColorEntry = AccentColorEntry {
71        identifier: 5,
72        name: Some("blue"),
73        light_colors: &[],
74        dark_colors: &[],
75    };
76    /// Pink accent color (identifier 6).
77    pub const COLOR_006: AccentColorEntry = AccentColorEntry {
78        identifier: 6,
79        name: Some("pink"),
80        light_colors: &[],
81        dark_colors: &[],
82    };
83    /// Custom two-color accent (identifier 7).
84    pub const COLOR_007: AccentColorEntry = AccentColorEntry {
85        identifier: 7,
86        name: None,
87        light_colors: &[0xE15052, 0xF9AE63],
88        dark_colors: &[0xFF9380, 0x992F37],
89    };
90    /// Custom two-color accent (identifier 8).
91    pub const COLOR_008: AccentColorEntry = AccentColorEntry {
92        identifier: 8,
93        name: None,
94        light_colors: &[0xE0802B, 0xFAC534],
95        dark_colors: &[0xECB04E, 0xC35714],
96    };
97    /// Custom two-color accent (identifier 9).
98    pub const COLOR_009: AccentColorEntry = AccentColorEntry {
99        identifier: 9,
100        name: None,
101        light_colors: &[0xA05FF3, 0xF48FFF],
102        dark_colors: &[0xC697FF, 0x5E31C8],
103    };
104    /// Custom two-color accent (identifier 10).
105    pub const COLOR_010: AccentColorEntry = AccentColorEntry {
106        identifier: 10,
107        name: None,
108        light_colors: &[0x27A910, 0xA7DC57],
109        dark_colors: &[0xA7EB6E, 0x167E2D],
110    };
111    /// Custom two-color accent (identifier 11).
112    pub const COLOR_011: AccentColorEntry = AccentColorEntry {
113        identifier: 11,
114        name: None,
115        light_colors: &[0x27ACCE, 0x82E8D6],
116        dark_colors: &[0x40D8D0, 0x045C7F],
117    };
118    /// Custom two-color accent (identifier 12).
119    pub const COLOR_012: AccentColorEntry = AccentColorEntry {
120        identifier: 12,
121        name: None,
122        light_colors: &[0x3391D4, 0x7DD3F0],
123        dark_colors: &[0x52BFFF, 0x0B5494],
124    };
125    /// Custom two-color accent (identifier 13).
126    pub const COLOR_013: AccentColorEntry = AccentColorEntry {
127        identifier: 13,
128        name: None,
129        light_colors: &[0xDD4371, 0xFFBE9F],
130        dark_colors: &[0xFF86A6, 0x8E366E],
131    };
132    /// Custom three-color accent (identifier 14).
133    pub const COLOR_014: AccentColorEntry = AccentColorEntry {
134        identifier: 14,
135        name: None,
136        light_colors: &[0x247BED, 0xF04856, 0xFFFFFF],
137        dark_colors: &[0x3FA2FE, 0xE5424F, 0xFFFFFF],
138    };
139    /// Custom three-color accent (identifier 15).
140    pub const COLOR_015: AccentColorEntry = AccentColorEntry {
141        identifier: 15,
142        name: None,
143        light_colors: &[0xD67722, 0x1EA011, 0xFFFFFF],
144        dark_colors: &[0xFF905E, 0x32A527, 0xFFFFFF],
145    };
146    /// Custom three-color accent (identifier 16).
147    pub const COLOR_016: AccentColorEntry = AccentColorEntry {
148        identifier: 16,
149        name: None,
150        light_colors: &[0x179E42, 0xE84A3F, 0xFFFFFF],
151        dark_colors: &[0x66D364, 0xD5444F, 0xFFFFFF],
152    };
153    /// Custom three-color accent (identifier 17).
154    pub const COLOR_017: AccentColorEntry = AccentColorEntry {
155        identifier: 17,
156        name: None,
157        light_colors: &[0x2894AF, 0x6FC456, 0xFFFFFF],
158        dark_colors: &[0x22BCE2, 0x3DA240, 0xFFFFFF],
159    };
160    /// Custom three-color accent (identifier 18).
161    pub const COLOR_018: AccentColorEntry = AccentColorEntry {
162        identifier: 18,
163        name: None,
164        light_colors: &[0x0C9AB3, 0xFFAD95, 0xFFE6B5],
165        dark_colors: &[0x22BCE2, 0xFF9778, 0xFFDA6B],
166    };
167    /// Custom three-color accent (identifier 19).
168    pub const COLOR_019: AccentColorEntry = AccentColorEntry {
169        identifier: 19,
170        name: None,
171        light_colors: &[0x7757D6, 0xF79610, 0xFFDE8E],
172        dark_colors: &[0x9791FF, 0xF2731D, 0xFFDB59],
173    };
174    /// Custom three-color accent (identifier 20).
175    pub const COLOR_020: AccentColorEntry = AccentColorEntry {
176        identifier: 20,
177        name: None,
178        light_colors: &[0x1585CF, 0xF2AB1D, 0xFFFFFF],
179        dark_colors: &[0x3DA6EB, 0xEEA51D, 0xFFFFFF],
180    };
181}
182
183/// Profile accent color palette for `ChatFullInfo.profile_accent_color_id`.
184pub mod profile_accent_color {
185    use super::AccentColorEntry;
186    /// Single-color profile accent (identifier 0).
187    pub const COLOR_000: AccentColorEntry = AccentColorEntry {
188        identifier: 0,
189        name: None,
190        light_colors: &[0xBA5650],
191        dark_colors: &[0x9C4540],
192    };
193    /// Single-color profile accent (identifier 1).
194    pub const COLOR_001: AccentColorEntry = AccentColorEntry {
195        identifier: 1,
196        name: None,
197        light_colors: &[0xC27C3E],
198        dark_colors: &[0x945E2C],
199    };
200    /// Single-color profile accent (identifier 2).
201    pub const COLOR_002: AccentColorEntry = AccentColorEntry {
202        identifier: 2,
203        name: None,
204        light_colors: &[0x956AC8],
205        dark_colors: &[0x715099],
206    };
207    /// Single-color profile accent (identifier 3).
208    pub const COLOR_003: AccentColorEntry = AccentColorEntry {
209        identifier: 3,
210        name: None,
211        light_colors: &[0x49A355],
212        dark_colors: &[0x33713B],
213    };
214    /// Single-color profile accent (identifier 4).
215    pub const COLOR_004: AccentColorEntry = AccentColorEntry {
216        identifier: 4,
217        name: None,
218        light_colors: &[0x3E97AD],
219        dark_colors: &[0x387E87],
220    };
221    /// Single-color profile accent (identifier 5).
222    pub const COLOR_005: AccentColorEntry = AccentColorEntry {
223        identifier: 5,
224        name: None,
225        light_colors: &[0x5A8FBB],
226        dark_colors: &[0x477194],
227    };
228    /// Single-color profile accent (identifier 6).
229    pub const COLOR_006: AccentColorEntry = AccentColorEntry {
230        identifier: 6,
231        name: None,
232        light_colors: &[0xB85378],
233        dark_colors: &[0x944763],
234    };
235    /// Single-color profile accent (identifier 7).
236    pub const COLOR_007: AccentColorEntry = AccentColorEntry {
237        identifier: 7,
238        name: None,
239        light_colors: &[0x7F8B95],
240        dark_colors: &[0x435261],
241    };
242    /// Two-color profile accent (identifier 8).
243    pub const COLOR_008: AccentColorEntry = AccentColorEntry {
244        identifier: 8,
245        name: None,
246        light_colors: &[0xC9565D, 0xD97C57],
247        dark_colors: &[0x994343, 0xAC583E],
248    };
249    /// Two-color profile accent (identifier 9).
250    pub const COLOR_009: AccentColorEntry = AccentColorEntry {
251        identifier: 9,
252        name: None,
253        light_colors: &[0xCF7244, 0xCC9433],
254        dark_colors: &[0x8F552F, 0xA17232],
255    };
256    /// Two-color profile accent (identifier 10).
257    pub const COLOR_010: AccentColorEntry = AccentColorEntry {
258        identifier: 10,
259        name: None,
260        light_colors: &[0x9662D4, 0xB966B6],
261        dark_colors: &[0x634691, 0x9250A2],
262    };
263    /// Two-color profile accent (identifier 11).
264    pub const COLOR_011: AccentColorEntry = AccentColorEntry {
265        identifier: 11,
266        name: None,
267        light_colors: &[0x3D9755, 0x89A650],
268        dark_colors: &[0x296A43, 0x5F8F44],
269    };
270    /// Two-color profile accent (identifier 12).
271    pub const COLOR_012: AccentColorEntry = AccentColorEntry {
272        identifier: 12,
273        name: None,
274        light_colors: &[0x3D95BA, 0x50AD98],
275        dark_colors: &[0x306C7C, 0x3E987E],
276    };
277    /// Two-color profile accent (identifier 13).
278    pub const COLOR_013: AccentColorEntry = AccentColorEntry {
279        identifier: 13,
280        name: None,
281        light_colors: &[0x538BC2, 0x4DA8BD],
282        dark_colors: &[0x38618C, 0x458BA1],
283    };
284    /// Two-color profile accent (identifier 14).
285    pub const COLOR_014: AccentColorEntry = AccentColorEntry {
286        identifier: 14,
287        name: None,
288        light_colors: &[0xB04F74, 0xD1666D],
289        dark_colors: &[0x884160, 0xA65259],
290    };
291    /// Two-color profile accent (identifier 15).
292    pub const COLOR_015: AccentColorEntry = AccentColorEntry {
293        identifier: 15,
294        name: None,
295        light_colors: &[0x637482, 0x7B8A97],
296        dark_colors: &[0x53606E, 0x384654],
297    };
298}
299
300// ── String enums ─────────────────────────────────────────────────────────────
301
302use serde::{Deserialize, Serialize};
303use std::fmt;
304
305/// Available types of `BackgroundType`.
306#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
307#[serde(rename_all = "snake_case")]
308#[non_exhaustive]
309pub enum BackgroundTypeType {
310    /// A background filled with a single color, gradient, or freeform gradient.
311    Fill,
312    /// A wallpaper in JPEG format.
313    Wallpaper,
314    /// A PNG or TGV pattern to be combined with a background fill.
315    Pattern,
316    /// A background taken from a chat theme.
317    ChatTheme,
318}
319
320/// Available types of `BackgroundFill`.
321#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
322#[serde(rename_all = "snake_case")]
323#[non_exhaustive]
324pub enum BackgroundFillType {
325    /// A solid single-color fill.
326    Solid,
327    /// A linear gradient fill.
328    Gradient,
329    /// A freeform gradient with multiple colors.
330    FreeformGradient,
331}
332
333/// Available types of `BotCommandScope`.
334#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
335#[serde(rename_all = "snake_case")]
336#[non_exhaustive]
337pub enum BotCommandScopeType {
338    /// Default scope covering all chats.
339    Default,
340    /// Scope covering all private chats.
341    AllPrivateChats,
342    /// Scope covering all group chats.
343    AllGroupChats,
344    /// Scope covering all chat administrators.
345    AllChatAdministrators,
346    /// Scope covering a specific chat.
347    Chat,
348    /// Scope covering administrators of a specific chat.
349    ChatAdministrators,
350    /// Scope covering a specific member in a specific chat.
351    ChatMember,
352}
353
354/// Available chat actions for `Bot::send_chat_action`.
355#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
356#[serde(rename_all = "snake_case")]
357#[non_exhaustive]
358pub enum ChatAction {
359    /// Bot is choosing a sticker.
360    ChooseSticker,
361    /// Bot is finding a location.
362    FindLocation,
363    /// Bot is recording a voice message.
364    RecordVoice,
365    /// Bot is recording a video.
366    RecordVideo,
367    /// Bot is recording a video note.
368    RecordVideoNote,
369    /// Bot is typing a text message.
370    Typing,
371    /// Bot is uploading a voice message.
372    UploadVoice,
373    /// Bot is uploading a document.
374    UploadDocument,
375    /// Bot is uploading a photo.
376    UploadPhoto,
377    /// Bot is uploading a video.
378    UploadVideo,
379    /// Bot is uploading a video note.
380    UploadVideoNote,
381}
382
383/// Available sources for a `ChatBoostSource`.
384#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
385#[serde(rename_all = "snake_case")]
386#[non_exhaustive]
387pub enum ChatBoostSources {
388    /// Boost obtained via a gift code.
389    GiftCode,
390    /// Boost obtained via a giveaway.
391    Giveaway,
392    /// Boost obtained via a Telegram Premium subscription.
393    Premium,
394}
395
396/// Available states for `ChatMember`.
397#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
398#[non_exhaustive]
399pub enum ChatMemberStatus {
400    /// Chat member is an administrator.
401    #[serde(rename = "administrator")]
402    Administrator,
403    /// Chat member is the owner (creator) of the chat.
404    #[serde(rename = "creator")]
405    Owner,
406    /// Chat member has been banned (kicked) from the chat.
407    #[serde(rename = "kicked")]
408    Banned,
409    /// Chat member has left the chat.
410    #[serde(rename = "left")]
411    Left,
412    /// Chat member is a regular member.
413    #[serde(rename = "member")]
414    Member,
415    /// Chat member is restricted (limited permissions).
416    #[serde(rename = "restricted")]
417    Restricted,
418}
419
420/// Available types of `Chat`.
421#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
422#[serde(rename_all = "snake_case")]
423#[non_exhaustive]
424pub enum ChatType {
425    /// Chat type used for inline query results sent on behalf of the user.
426    Sender,
427    /// A private one-on-one chat.
428    Private,
429    /// A basic group chat.
430    Group,
431    /// A supergroup chat.
432    Supergroup,
433    /// A channel.
434    Channel,
435}
436
437/// Available emoji for `Dice` / `Bot::send_dice`.
438#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
439#[non_exhaustive]
440pub enum DiceEmoji {
441    /// Game die emoji; values 1--6.
442    #[serde(rename = "\u{1F3B2}")]
443    Dice,
444    /// Darts emoji; values 1--6.
445    #[serde(rename = "\u{1F3AF}")]
446    Darts,
447    /// Basketball emoji; values 1--5.
448    #[serde(rename = "\u{1F3C0}")]
449    Basketball,
450    /// Football (soccer) emoji; values 1--5.
451    #[serde(rename = "\u{26BD}")]
452    Football,
453    /// Slot machine emoji; values 1--64.
454    #[serde(rename = "\u{1F3B0}")]
455    SlotMachine,
456    /// Bowling emoji; values 1--6.
457    #[serde(rename = "\u{1F3B3}")]
458    Bowling,
459}
460
461/// Available types of `InlineQueryResult`.
462#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
463#[non_exhaustive]
464pub enum InlineQueryResultType {
465    /// An audio file result.
466    #[serde(rename = "audio")]
467    Audio,
468    /// A general document (file) result.
469    #[serde(rename = "document")]
470    Document,
471    /// A GIF animation result.
472    #[serde(rename = "gif")]
473    Gif,
474    /// An MPEG-4 GIF animation result.
475    #[serde(rename = "mpeg4_gif")]
476    Mpeg4Gif,
477    /// A photo result.
478    #[serde(rename = "photo")]
479    Photo,
480    /// A sticker result.
481    #[serde(rename = "sticker")]
482    Sticker,
483    /// A video result.
484    #[serde(rename = "video")]
485    Video,
486    /// A voice message result.
487    #[serde(rename = "voice")]
488    Voice,
489    /// An article result (text content with optional URL).
490    #[serde(rename = "article")]
491    Article,
492    /// A contact result.
493    #[serde(rename = "contact")]
494    Contact,
495    /// A game result.
496    #[serde(rename = "game")]
497    Game,
498    /// A location result.
499    #[serde(rename = "location")]
500    Location,
501    /// A venue result.
502    #[serde(rename = "venue")]
503    Venue,
504}
505
506/// Available types of `InputMedia`.
507#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
508#[serde(rename_all = "snake_case")]
509#[non_exhaustive]
510pub enum InputMediaType {
511    /// An animation (GIF or H.264/MPEG-4 AVC video without sound).
512    Animation,
513    /// A general file to be sent as a document.
514    Document,
515    /// An audio file to be treated as music.
516    Audio,
517    /// A photo.
518    Photo,
519    /// A video.
520    Video,
521}
522
523/// Available types of `InputPaidMedia`.
524#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
525#[serde(rename_all = "snake_case")]
526#[non_exhaustive]
527pub enum InputPaidMediaType {
528    /// A paid photo.
529    Photo,
530    /// A paid video.
531    Video,
532}
533
534/// Available types of `InputProfilePhoto`.
535#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
536#[serde(rename_all = "snake_case")]
537#[non_exhaustive]
538pub enum InputProfilePhotoType {
539    /// A static profile photo (JPEG).
540    Static,
541    /// An animated profile photo (MPEG-4).
542    Animated,
543}
544
545/// Available types of `InputStoryContent`.
546#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
547#[serde(rename_all = "snake_case")]
548#[non_exhaustive]
549pub enum InputStoryContentType {
550    /// A photo story.
551    Photo,
552    /// A video story.
553    Video,
554}
555
556/// Available button styles for `InlineKeyboardButton` and `KeyboardButton`.
557#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
558#[serde(rename_all = "snake_case")]
559#[non_exhaustive]
560pub enum KeyboardButtonStyle {
561    /// Primary (default blue) button style.
562    Primary,
563    /// Success (green) button style.
564    Success,
565    /// Danger (red) button style.
566    Danger,
567}
568
569/// Available positions for `MaskPosition`.
570#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
571#[serde(rename_all = "snake_case")]
572#[non_exhaustive]
573pub enum MaskPositionPoint {
574    /// The mask is placed on the forehead.
575    Forehead,
576    /// The mask is placed on the eyes.
577    Eyes,
578    /// The mask is placed on the mouth.
579    Mouth,
580    /// The mask is placed on the chin.
581    Chin,
582}
583
584/// Available types of `MenuButton`.
585#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
586#[non_exhaustive]
587pub enum MenuButtonType {
588    /// A button that opens the list of bot commands.
589    #[serde(rename = "commands")]
590    Commands,
591    /// A button that launches a Web App.
592    #[serde(rename = "web_app")]
593    WebApp,
594    /// No specific menu button is set; the default behavior applies.
595    #[serde(rename = "default")]
596    Default,
597}
598
599/// Available types of `Message` that can be seen as attachment.
600#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
601#[serde(rename_all = "snake_case")]
602#[non_exhaustive]
603pub enum MessageAttachmentType {
604    /// An animation (GIF or H.264/MPEG-4 AVC video without sound).
605    Animation,
606    /// An audio file.
607    Audio,
608    /// A shared contact.
609    Contact,
610    /// A dice with a random value.
611    Dice,
612    /// A general file (document).
613    Document,
614    /// A game.
615    Game,
616    /// An invoice for a payment.
617    Invoice,
618    /// A shared location.
619    Location,
620    /// Paid media content.
621    PaidMedia,
622    /// Telegram Passport data.
623    PassportData,
624    /// A photo.
625    Photo,
626    /// A native poll.
627    Poll,
628    /// A sticker.
629    Sticker,
630    /// A forwarded story.
631    Story,
632    /// A successful payment notification.
633    SuccessfulPayment,
634    /// A video file.
635    Video,
636    /// A video note (rounded video message).
637    VideoNote,
638    /// A voice message.
639    Voice,
640    /// A venue.
641    Venue,
642}
643
644/// Available types of `MessageEntity`.
645#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
646#[serde(rename_all = "snake_case")]
647#[non_exhaustive]
648pub enum MessageEntityType {
649    /// A block quotation.
650    Blockquote,
651    /// Bold text.
652    Bold,
653    /// A bot command (e.g. `/start`).
654    BotCommand,
655    /// A cashtag (e.g. `$USD`).
656    Cashtag,
657    /// Monowidth inline code.
658    Code,
659    /// A custom emoji specified by its unique identifier.
660    CustomEmoji,
661    /// A date/time entity with optional formatting.
662    DateTime,
663    /// An email address.
664    Email,
665    /// An expandable block quotation.
666    ExpandableBlockquote,
667    /// A hashtag (e.g. `#hashtag`).
668    Hashtag,
669    /// Italic text.
670    Italic,
671    /// An `@username` mention.
672    Mention,
673    /// A phone number.
674    PhoneNumber,
675    /// Monowidth code block (optionally with a language).
676    Pre,
677    /// A spoiler (hidden until tapped).
678    Spoiler,
679    /// Strikethrough text.
680    Strikethrough,
681    /// A clickable text URL.
682    TextLink,
683    /// A mention of a user without a username.
684    TextMention,
685    /// Underlined text.
686    Underline,
687    /// A URL (e.g. `https://telegram.org`).
688    Url,
689}
690
691/// All possible formats for `MessageEntity.date_time_format`.
692#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
693#[non_exhaustive]
694pub enum MessageEntityDateTimeFormats {
695    /// Relative time (e.g. "in 5 minutes").
696    #[serde(rename = "r")]
697    Relative,
698    /// Localized weekday name.
699    #[serde(rename = "w")]
700    LocalizedWeekday,
701    /// Short date format.
702    #[serde(rename = "d")]
703    ShortDate,
704    /// Long date format.
705    #[serde(rename = "D")]
706    LongDate,
707    /// Short time format.
708    #[serde(rename = "t")]
709    ShortTime,
710    /// Long time format.
711    #[serde(rename = "T")]
712    LongTime,
713    /// Localized weekday with short date.
714    #[serde(rename = "wd")]
715    LocalizedWeekdayShortDate,
716    /// Localized weekday with long date.
717    #[serde(rename = "wD")]
718    LocalizedWeekdayLongDate,
719    /// Localized weekday with short time.
720    #[serde(rename = "wt")]
721    LocalizedWeekdayShortTime,
722    /// Localized weekday with long time.
723    #[serde(rename = "wT")]
724    LocalizedWeekdayLongTime,
725    /// Localized weekday with short date and short time.
726    #[serde(rename = "wdt")]
727    LocalizedWeekdayShortDateShortTime,
728    /// Localized weekday with short date and long time.
729    #[serde(rename = "wdT")]
730    LocalizedWeekdayShortDateLongTime,
731    /// Localized weekday with long date and short time.
732    #[serde(rename = "wDt")]
733    LocalizedWeekdayLongDateShortTime,
734    /// Localized weekday with long date and long time.
735    #[serde(rename = "wDT")]
736    LocalizedWeekdayLongDateLongTime,
737    /// Short date with short time.
738    #[serde(rename = "dt")]
739    ShortDateShortTime,
740    /// Short date with long time.
741    #[serde(rename = "dT")]
742    ShortDateLongTime,
743    /// Long date with short time.
744    #[serde(rename = "Dt")]
745    LongDateShortTime,
746    /// Long date with long time.
747    #[serde(rename = "DT")]
748    LongDateLongTime,
749}
750
751/// Available types of `MessageOrigin`.
752#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
753#[serde(rename_all = "snake_case")]
754#[non_exhaustive]
755pub enum MessageOriginType {
756    /// The message was originally sent by a known user.
757    User,
758    /// The message was originally sent by an unknown user.
759    HiddenUser,
760    /// The message was originally sent on behalf of a chat.
761    Chat,
762    /// The message was originally sent to a channel.
763    Channel,
764}
765
766/// Available types of `Message`.
767#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
768#[serde(rename_all = "snake_case")]
769#[non_exhaustive]
770pub enum MessageType {
771    /// An animation (GIF or H.264/MPEG-4 AVC video without sound).
772    Animation,
773    /// An audio file.
774    Audio,
775    /// Service message: a user boosted the chat.
776    BoostAdded,
777    /// The message was sent via a business connection.
778    BusinessConnectionId,
779    /// Service message: channel chat was created.
780    ChannelChatCreated,
781    /// Service message: chat background was set.
782    ChatBackgroundSet,
783    /// Service message: the chat owner has changed.
784    ChatOwnerChanged,
785    /// Service message: the chat owner has left.
786    ChatOwnerLeft,
787    /// Service message: a chat was shared with the bot.
788    ChatShared,
789    /// A checklist message.
790    Checklist,
791    /// Service message: tasks were added to a checklist.
792    ChecklistTasksAdded,
793    /// Service message: checklist tasks were marked done.
794    ChecklistTasksDone,
795    /// Service message: a website was connected via the bot.
796    ConnectedWebsite,
797    /// A shared contact.
798    Contact,
799    /// Service message: the chat photo was deleted.
800    DeleteChatPhoto,
801    /// A dice with a random value.
802    Dice,
803    /// Service message: the direct message price was changed.
804    DirectMessagePriceChanged,
805    /// A general file (document).
806    Document,
807    /// The message contains a visual effect.
808    EffectId,
809    /// Service message: a forum topic was created.
810    ForumTopicCreated,
811    /// Service message: a forum topic was closed.
812    ForumTopicClosed,
813    /// Service message: a forum topic was edited.
814    ForumTopicEdited,
815    /// Service message: a forum topic was reopened.
816    ForumTopicReopened,
817    /// A game.
818    Game,
819    /// Service message: the general forum topic was hidden.
820    GeneralForumTopicHidden,
821    /// Service message: the general forum topic was unhidden.
822    GeneralForumTopicUnhidden,
823    /// A gift sent in the message.
824    Gift,
825    /// Service message: a gift upgrade was sent.
826    GiftUpgradeSent,
827    /// A scheduled giveaway message.
828    Giveaway,
829    /// Service message: a giveaway was created.
830    GiveawayCreated,
831    /// Service message: giveaway winners were selected.
832    GiveawayWinners,
833    /// Service message: a giveaway was completed.
834    GiveawayCompleted,
835    /// Service message: a basic group was created.
836    GroupChatCreated,
837    /// An invoice for a payment.
838    Invoice,
839    /// Service message: a member left the chat.
840    LeftChatMember,
841    /// A shared location.
842    Location,
843    /// Service message: the auto-delete timer was changed.
844    MessageAutoDeleteTimerChanged,
845    /// Service message: the group was migrated to a supergroup.
846    MigrateToChatId,
847    /// Service message: new members joined the chat.
848    NewChatMembers,
849    /// Service message: the chat title was changed.
850    NewChatTitle,
851    /// Service message: the chat photo was changed.
852    NewChatPhoto,
853    /// Paid media content.
854    PaidMedia,
855    /// Service message: the paid message price was changed.
856    PaidMessagePriceChanged,
857    /// Service message: a suggested post approval failed.
858    SuggestedPostApprovalFailed,
859    /// Service message: a suggested post was approved.
860    SuggestedPostApproved,
861    /// Service message: a suggested post was declined.
862    SuggestedPostDeclined,
863    /// Service message: information about a suggested post.
864    SuggestedPostInfo,
865    /// Service message: a suggested post was paid for.
866    SuggestedPostPaid,
867    /// Service message: a suggested post was refunded.
868    SuggestedPostRefunded,
869    /// Telegram Passport data.
870    PassportData,
871    /// A photo.
872    Photo,
873    /// Service message: a message was pinned.
874    PinnedMessage,
875    /// A native poll.
876    Poll,
877    /// Service message: a proximity alert was triggered.
878    ProximityAlertTriggered,
879    /// Service message: a refunded payment.
880    RefundedPayment,
881    /// The message is a reply to a story.
882    ReplyToStory,
883    /// The sender's boost count in the chat.
884    SenderBoostCount,
885    /// The business bot that sent this message.
886    SenderBusinessBot,
887    /// A sticker.
888    Sticker,
889    /// A forwarded story.
890    Story,
891    /// Service message: a supergroup was created.
892    SupergroupChatCreated,
893    /// A successful payment notification.
894    SuccessfulPayment,
895    /// A text message.
896    Text,
897    /// A unique gift sent in the message.
898    UniqueGift,
899    /// Service message: users were shared with the bot.
900    UsersShared,
901    /// A venue.
902    Venue,
903    /// A video file.
904    Video,
905    /// Service message: a video chat was scheduled.
906    VideoChatScheduled,
907    /// Service message: a video chat was started.
908    VideoChatStarted,
909    /// Service message: a video chat has ended.
910    VideoChatEnded,
911    /// Service message: new participants were invited to a video chat.
912    VideoChatParticipantsInvited,
913    /// A video note (rounded video message).
914    VideoNote,
915    /// A voice message.
916    Voice,
917    /// Data sent from a Web App.
918    WebAppData,
919    /// Service message: a user was granted write access.
920    WriteAccessAllowed,
921}
922
923/// Available types of `OwnedGift`.
924#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
925#[serde(rename_all = "snake_case")]
926#[non_exhaustive]
927pub enum OwnedGiftType {
928    /// A regular gift.
929    Regular,
930    /// A unique (upgraded) gift.
931    Unique,
932}
933
934/// Available types of `PaidMedia`.
935#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
936#[serde(rename_all = "snake_case")]
937#[non_exhaustive]
938pub enum PaidMediaType {
939    /// A preview of paid media (before purchase).
940    Preview,
941    /// A paid video.
942    Video,
943    /// A paid photo.
944    Photo,
945}
946
947/// Available parse modes.
948#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
949#[non_exhaustive]
950pub enum ParseMode {
951    /// HTML-style formatting.
952    #[serde(rename = "HTML")]
953    Html,
954    /// MarkdownV2-style formatting.
955    #[serde(rename = "MarkdownV2")]
956    MarkdownV2,
957    /// Legacy Markdown formatting (use MarkdownV2 for new code).
958    #[serde(rename = "Markdown")]
959    Markdown,
960}
961
962/// Available types for `Poll`.
963#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
964#[serde(rename_all = "snake_case")]
965#[non_exhaustive]
966pub enum PollType {
967    /// A regular poll allowing one or multiple answers.
968    Regular,
969    /// A quiz poll with exactly one correct answer.
970    Quiz,
971}
972
973/// Available types of `ReactionType`.
974#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
975#[serde(rename_all = "snake_case")]
976#[non_exhaustive]
977pub enum ReactionType {
978    /// A reaction based on a standard Unicode emoji.
979    Emoji,
980    /// A reaction based on a custom emoji.
981    CustomEmoji,
982    /// A paid reaction (star reaction).
983    Paid,
984}
985
986/// Available types of `RevenueWithdrawalState`.
987#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
988#[serde(rename_all = "snake_case")]
989#[non_exhaustive]
990pub enum RevenueWithdrawalStateType {
991    /// The withdrawal is pending.
992    Pending,
993    /// The withdrawal has succeeded.
994    Succeeded,
995    /// The withdrawal has failed.
996    Failed,
997}
998
999/// Available formats of `Sticker` in the set.
1000#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1001#[serde(rename_all = "snake_case")]
1002#[non_exhaustive]
1003pub enum StickerFormat {
1004    /// A static `.WEBP` or `.PNG` sticker.
1005    Static,
1006    /// An animated `.TGS` sticker.
1007    Animated,
1008    /// A video `.WEBM` sticker.
1009    Video,
1010}
1011
1012/// Available types of `Sticker`.
1013#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1014#[serde(rename_all = "snake_case")]
1015#[non_exhaustive]
1016pub enum StickerType {
1017    /// A regular sticker.
1018    Regular,
1019    /// A mask sticker positioned on faces in photos.
1020    Mask,
1021    /// A custom emoji sticker usable as a custom emoji.
1022    CustomEmoji,
1023}
1024
1025/// Available types of `StoryAreaType`.
1026#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1027#[serde(rename_all = "snake_case")]
1028#[non_exhaustive]
1029pub enum StoryAreaTypeType {
1030    /// A location area in the story.
1031    Location,
1032    /// A suggested reaction area in the story.
1033    SuggestedReaction,
1034    /// A clickable link area in the story.
1035    Link,
1036    /// A weather widget area in the story.
1037    Weather,
1038    /// A unique gift area in the story.
1039    UniqueGift,
1040}
1041
1042/// Available states of `SuggestedPostInfo.state`.
1043#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1044#[serde(rename_all = "snake_case")]
1045#[non_exhaustive]
1046pub enum SuggestedPostInfoState {
1047    /// The suggested post is pending review.
1048    Pending,
1049    /// The suggested post has been approved.
1050    Approved,
1051    /// The suggested post has been declined.
1052    Declined,
1053}
1054
1055/// Available refund reasons for `SuggestedPostRefunded`.
1056#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1057#[serde(rename_all = "snake_case")]
1058#[non_exhaustive]
1059pub enum SuggestedPostRefunded {
1060    /// The post was deleted, triggering a refund.
1061    PostDeleted,
1062    /// The payment was refunded.
1063    PaymentRefunded,
1064}
1065
1066/// Available types of `TransactionPartner`.
1067#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1068#[serde(rename_all = "snake_case")]
1069#[non_exhaustive]
1070pub enum TransactionPartnerType {
1071    /// Transaction with an affiliate program.
1072    AffiliateProgram,
1073    /// Transaction with a chat (channel).
1074    Chat,
1075    /// Withdrawal to the Fragment platform.
1076    Fragment,
1077    /// Transaction with an unknown partner.
1078    Other,
1079    /// Transaction with Telegram Ads.
1080    TelegramAds,
1081    /// Transaction with the Telegram Bot API (e.g. paid broadcasts).
1082    TelegramApi,
1083    /// Transaction with a user.
1084    User,
1085}
1086
1087/// Constants for `TransactionPartnerUser.transaction_type`.
1088#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1089#[serde(rename_all = "snake_case")]
1090#[non_exhaustive]
1091pub enum TransactionPartnerUser {
1092    /// Payment for a bot invoice.
1093    InvoicePayment,
1094    /// Payment for paid media.
1095    PaidMediaPayment,
1096    /// A gift purchase.
1097    GiftPurchase,
1098    /// A Telegram Premium subscription purchase.
1099    PremiumPurchase,
1100    /// A business account transfer.
1101    BusinessAccountTransfer,
1102}
1103
1104/// Available origins for `UniqueGiftInfo`.
1105#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1106#[non_exhaustive]
1107pub enum UniqueGiftInfoOrigin {
1108    /// Obtained via a gifted upgrade.
1109    #[serde(rename = "gifted_upgrade")]
1110    GiftedUpgrade,
1111    /// Obtained via an offer.
1112    #[serde(rename = "OFFER")]
1113    Offer,
1114    /// Obtained via resale.
1115    #[serde(rename = "resale")]
1116    Resale,
1117    /// Obtained via a transfer.
1118    #[serde(rename = "transfer")]
1119    Transfer,
1120    /// Obtained via an upgrade.
1121    #[serde(rename = "upgrade")]
1122    Upgrade,
1123}
1124
1125/// Available rarities for `UniqueGiftModel`.
1126#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1127#[serde(rename_all = "snake_case")]
1128#[non_exhaustive]
1129pub enum UniqueGiftModelRarity {
1130    /// Uncommon rarity.
1131    Uncommon,
1132    /// Rare rarity.
1133    Rare,
1134    /// Epic rarity.
1135    Epic,
1136    /// Legendary rarity.
1137    Legendary,
1138}
1139
1140/// Available types of `Update`.
1141#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1142#[serde(rename_all = "snake_case")]
1143#[non_exhaustive]
1144pub enum UpdateType {
1145    /// A new incoming message of any kind.
1146    Message,
1147    /// An edited message.
1148    EditedMessage,
1149    /// A new incoming channel post of any kind.
1150    ChannelPost,
1151    /// An edited channel post.
1152    EditedChannelPost,
1153    /// A new incoming inline query.
1154    InlineQuery,
1155    /// A result of an inline query that was chosen by the user.
1156    ChosenInlineResult,
1157    /// A new incoming callback query.
1158    CallbackQuery,
1159    /// A new incoming shipping query (payments only).
1160    ShippingQuery,
1161    /// A new incoming pre-checkout query (payments only).
1162    PreCheckoutQuery,
1163    /// A new poll state (stopped or answer option counts changed).
1164    Poll,
1165    /// A user changed their answer in a non-anonymous poll.
1166    PollAnswer,
1167    /// The bot's chat member status was updated.
1168    MyChatMember,
1169    /// A chat member's status was updated.
1170    ChatMember,
1171    /// A request to join the chat has been sent.
1172    ChatJoinRequest,
1173    /// A chat boost was added or changed.
1174    ChatBoost,
1175    /// A chat boost was removed.
1176    RemovedChatBoost,
1177    /// A reaction to a message was changed by a user.
1178    MessageReaction,
1179    /// Anonymous reaction counts on a message were updated.
1180    MessageReactionCount,
1181    /// A business connection update.
1182    BusinessConnection,
1183    /// A new message from a connected business account.
1184    BusinessMessage,
1185    /// An edited business message.
1186    EditedBusinessMessage,
1187    /// Messages were deleted from a connected business account.
1188    DeletedBusinessMessages,
1189    /// A user purchased paid media from the bot.
1190    PurchasedPaidMedia,
1191}
1192
1193/// Available emojis of `ReactionTypeEmoji`.
1194#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1195#[non_exhaustive]
1196pub enum ReactionEmoji {
1197    /// Thumbs up reaction.
1198    #[serde(rename = "\u{1F44D}")]
1199    ThumbsUp,
1200    /// Thumbs down reaction.
1201    #[serde(rename = "\u{1F44E}")]
1202    ThumbsDown,
1203    /// Red heart reaction.
1204    #[serde(rename = "\u{2764}")]
1205    RedHeart,
1206    /// Fire reaction.
1207    #[serde(rename = "\u{1F525}")]
1208    Fire,
1209    /// Smiling face with hearts reaction.
1210    #[serde(rename = "\u{1F970}")]
1211    SmilingFaceWithHearts,
1212    /// Clapping hands reaction.
1213    #[serde(rename = "\u{1F44F}")]
1214    ClappingHands,
1215    /// Grinning face with smiling eyes reaction.
1216    #[serde(rename = "\u{1F601}")]
1217    GrinningFaceWithSmilingEyes,
1218    /// Thinking face reaction.
1219    #[serde(rename = "\u{1F914}")]
1220    ThinkingFace,
1221    /// Shocked face with exploding head reaction.
1222    #[serde(rename = "\u{1F92F}")]
1223    ShockedFaceWithExplodingHead,
1224    /// Face screaming in fear reaction.
1225    #[serde(rename = "\u{1F631}")]
1226    FaceScreamingInFear,
1227    /// Serious face with symbols covering mouth reaction.
1228    #[serde(rename = "\u{1F92C}")]
1229    SeriousFaceWithSymbolsCoveringMouth,
1230    /// Crying face reaction.
1231    #[serde(rename = "\u{1F622}")]
1232    CryingFace,
1233    /// Party popper reaction.
1234    #[serde(rename = "\u{1F389}")]
1235    PartyPopper,
1236    /// Grinning face with star eyes reaction.
1237    #[serde(rename = "\u{1F929}")]
1238    GrinningFaceWithStarEyes,
1239    /// Face with open mouth vomiting reaction.
1240    #[serde(rename = "\u{1F92E}")]
1241    FaceWithOpenMouthVomiting,
1242    /// Pile of poo reaction.
1243    #[serde(rename = "\u{1F4A9}")]
1244    PileOfPoo,
1245    /// Person with folded hands (prayer) reaction.
1246    #[serde(rename = "\u{1F64F}")]
1247    PersonWithFoldedHands,
1248    /// OK hand sign reaction.
1249    #[serde(rename = "\u{1F44C}")]
1250    OkHandSign,
1251    /// Dove of peace reaction.
1252    #[serde(rename = "\u{1F54A}")]
1253    DoveOfPeace,
1254    /// Clown face reaction.
1255    #[serde(rename = "\u{1F921}")]
1256    ClownFace,
1257    /// Yawning face reaction.
1258    #[serde(rename = "\u{1F971}")]
1259    YawningFace,
1260    /// Face with uneven eyes and wavy mouth reaction.
1261    #[serde(rename = "\u{1F974}")]
1262    FaceWithUnevenEyesAndWavyMouth,
1263    /// Smiling face with heart-shaped eyes reaction.
1264    #[serde(rename = "\u{1F60D}")]
1265    SmilingFaceWithHeartShapedEyes,
1266    /// Spouting whale reaction.
1267    #[serde(rename = "\u{1F433}")]
1268    SpoutingWhale,
1269    /// Heart on fire reaction.
1270    #[serde(rename = "\u{2764}\u{FE0F}\u{200D}\u{1F525}")]
1271    HeartOnFire,
1272    /// New moon with face reaction.
1273    #[serde(rename = "\u{1F31A}")]
1274    NewMoonWithFace,
1275    /// Hot dog reaction.
1276    #[serde(rename = "\u{1F32D}")]
1277    HotDog,
1278    /// Hundred points symbol reaction.
1279    #[serde(rename = "\u{1F4AF}")]
1280    HundredPointsSymbol,
1281    /// Rolling on the floor laughing reaction.
1282    #[serde(rename = "\u{1F923}")]
1283    RollingOnTheFloorLaughing,
1284    /// High voltage sign reaction.
1285    #[serde(rename = "\u{26A1}")]
1286    HighVoltageSign,
1287    /// Banana reaction.
1288    #[serde(rename = "\u{1F34C}")]
1289    Banana,
1290    /// Trophy reaction.
1291    #[serde(rename = "\u{1F3C6}")]
1292    Trophy,
1293    /// Broken heart reaction.
1294    #[serde(rename = "\u{1F494}")]
1295    BrokenHeart,
1296    /// Face with one eyebrow raised reaction.
1297    #[serde(rename = "\u{1F928}")]
1298    FaceWithOneEyebrowRaised,
1299    /// Neutral face reaction.
1300    #[serde(rename = "\u{1F610}")]
1301    NeutralFace,
1302    /// Strawberry reaction.
1303    #[serde(rename = "\u{1F353}")]
1304    Strawberry,
1305    /// Bottle with popping cork reaction.
1306    #[serde(rename = "\u{1F37E}")]
1307    BottleWithPoppingCork,
1308    /// Kiss mark reaction.
1309    #[serde(rename = "\u{1F48B}")]
1310    KissMark,
1311    /// Middle finger reaction.
1312    #[serde(rename = "\u{1F595}")]
1313    ReversedHandWithMiddleFingerExtended,
1314    /// Smiling face with horns reaction.
1315    #[serde(rename = "\u{1F608}")]
1316    SmilingFaceWithHorns,
1317    /// Sleeping face reaction.
1318    #[serde(rename = "\u{1F634}")]
1319    SleepingFace,
1320    /// Loudly crying face reaction.
1321    #[serde(rename = "\u{1F62D}")]
1322    LoudlyCryingFace,
1323    /// Nerd face reaction.
1324    #[serde(rename = "\u{1F913}")]
1325    NerdFace,
1326    /// Ghost reaction.
1327    #[serde(rename = "\u{1F47B}")]
1328    Ghost,
1329    /// Man technologist reaction.
1330    #[serde(rename = "\u{1F468}\u{200D}\u{1F4BB}")]
1331    ManTechnologist,
1332    /// Eyes reaction.
1333    #[serde(rename = "\u{1F440}")]
1334    Eyes,
1335    /// Jack-o-lantern reaction.
1336    #[serde(rename = "\u{1F383}")]
1337    JackOLantern,
1338    /// See-no-evil monkey reaction.
1339    #[serde(rename = "\u{1F648}")]
1340    SeeNoEvilMonkey,
1341    /// Smiling face with halo reaction.
1342    #[serde(rename = "\u{1F607}")]
1343    SmilingFaceWithHalo,
1344    /// Fearful face reaction.
1345    #[serde(rename = "\u{1F628}")]
1346    FearfulFace,
1347    /// Handshake reaction.
1348    #[serde(rename = "\u{1F91D}")]
1349    Handshake,
1350    /// Writing hand reaction.
1351    #[serde(rename = "\u{270D}")]
1352    WritingHand,
1353    /// Hugging face reaction.
1354    #[serde(rename = "\u{1F917}")]
1355    HuggingFace,
1356    /// Saluting face reaction.
1357    #[serde(rename = "\u{1FAE1}")]
1358    SalutingFace,
1359    /// Father Christmas (Santa Claus) reaction.
1360    #[serde(rename = "\u{1F385}")]
1361    FatherChristmas,
1362    /// Christmas tree reaction.
1363    #[serde(rename = "\u{1F384}")]
1364    ChristmasTree,
1365    /// Snowman reaction.
1366    #[serde(rename = "\u{2603}")]
1367    Snowman,
1368    /// Nail polish reaction.
1369    #[serde(rename = "\u{1F485}")]
1370    NailPolish,
1371    /// Zany face (grinning with one large and one small eye) reaction.
1372    #[serde(rename = "\u{1F92A}")]
1373    GrinningFaceWithOneLargeAndOneSmallEye,
1374    /// Moyai (Easter Island statue) reaction.
1375    #[serde(rename = "\u{1F5FF}")]
1376    Moyai,
1377    /// Squared COOL reaction.
1378    #[serde(rename = "\u{1F192}")]
1379    SquaredCool,
1380    /// Heart with arrow reaction.
1381    #[serde(rename = "\u{1F498}")]
1382    HeartWithArrow,
1383    /// Hear-no-evil monkey reaction.
1384    #[serde(rename = "\u{1F649}")]
1385    HearNoEvilMonkey,
1386    /// Unicorn face reaction.
1387    #[serde(rename = "\u{1F984}")]
1388    UnicornFace,
1389    /// Face throwing a kiss reaction.
1390    #[serde(rename = "\u{1F618}")]
1391    FaceThrowingAKiss,
1392    /// Pill reaction.
1393    #[serde(rename = "\u{1F48A}")]
1394    Pill,
1395    /// Speak-no-evil monkey reaction.
1396    #[serde(rename = "\u{1F64A}")]
1397    SpeakNoEvilMonkey,
1398    /// Smiling face with sunglasses reaction.
1399    #[serde(rename = "\u{1F60E}")]
1400    SmilingFaceWithSunglasses,
1401    /// Alien monster reaction.
1402    #[serde(rename = "\u{1F47E}")]
1403    AlienMonster,
1404    /// Man shrugging reaction.
1405    #[serde(rename = "\u{1F937}\u{200D}\u{2642}\u{FE0F}")]
1406    ManShrugging,
1407    /// Person shrugging reaction.
1408    #[serde(rename = "\u{1F937}")]
1409    Shrug,
1410    /// Woman shrugging reaction.
1411    #[serde(rename = "\u{1F937}\u{200D}\u{2640}\u{FE0F}")]
1412    WomanShrugging,
1413    /// Pouting face reaction.
1414    #[serde(rename = "\u{1F621}")]
1415    PoutingFace,
1416}
1417
1418// ── Display / From / PartialEq implementations ─────────────────────────────
1419//
1420// These trait implementations let the typed constant enums interoperate
1421// seamlessly with the `String` / `&str` fields used throughout the API types
1422// and builder methods.  In particular:
1423//
1424// - `Display` / `From<Enum> for String` lets you pass enum values directly
1425//   into builder methods that accept `impl Into<String>`.
1426// - `PartialEq<Enum> for String` (and `&str`) lets you compare deserialized
1427//   JSON string fields against the typed constants without `.as_str()`.
1428
1429// ── helpers ──────────────────────────────────────────────────────────────────
1430
1431/// Generate `as_str()`, `Display`, `From<$Enum> for String`,
1432/// `PartialEq<$Enum> for String`, `PartialEq<$Enum> for str`,
1433/// `PartialEq<String> for $Enum`, and `PartialEq<&str> for $Enum`
1434/// for a `snake_case` serde enum.
1435macro_rules! impl_str_traits_snake {
1436    ($Enum:ident { $( $Variant:ident => $wire:expr ),+ $(,)? }) => {
1437        impl $Enum {
1438            /// Returns the wire-format string representation of this variant.
1439            pub fn as_str(&self) -> &'static str {
1440                match self {
1441                    $( Self::$Variant => $wire, )+
1442                }
1443            }
1444        }
1445
1446        impl fmt::Display for $Enum {
1447            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1448                f.write_str(self.as_str())
1449            }
1450        }
1451
1452        impl From<$Enum> for String {
1453            fn from(val: $Enum) -> Self { val.as_str().to_owned() }
1454        }
1455
1456        impl PartialEq<$Enum> for String {
1457            fn eq(&self, other: &$Enum) -> bool { self.as_str() == other.as_str() }
1458        }
1459
1460        impl PartialEq<$Enum> for str {
1461            fn eq(&self, other: &$Enum) -> bool { self == other.as_str() }
1462        }
1463
1464        impl PartialEq<String> for $Enum {
1465            fn eq(&self, other: &String) -> bool { self.as_str() == other.as_str() }
1466        }
1467
1468        impl PartialEq<&str> for $Enum {
1469            fn eq(&self, other: &&str) -> bool { self.as_str() == *other }
1470        }
1471    };
1472}
1473
1474// ── ParseMode ────────────────────────────────────────────────────────────────
1475
1476impl_str_traits_snake!(ParseMode {
1477    Html       => "HTML",
1478    MarkdownV2 => "MarkdownV2",
1479    Markdown   => "Markdown",
1480});
1481
1482// ── ChatAction ───────────────────────────────────────────────────────────────
1483
1484impl_str_traits_snake!(ChatAction {
1485    ChooseSticker   => "choose_sticker",
1486    FindLocation    => "find_location",
1487    RecordVoice     => "record_voice",
1488    RecordVideo     => "record_video",
1489    RecordVideoNote => "record_video_note",
1490    Typing          => "typing",
1491    UploadVoice     => "upload_voice",
1492    UploadDocument  => "upload_document",
1493    UploadPhoto     => "upload_photo",
1494    UploadVideo     => "upload_video",
1495    UploadVideoNote => "upload_video_note",
1496});
1497
1498// ── ChatMemberStatus ─────────────────────────────────────────────────────────
1499
1500impl_str_traits_snake!(ChatMemberStatus {
1501    Administrator => "administrator",
1502    Owner         => "creator",
1503    Banned        => "kicked",
1504    Left          => "left",
1505    Member        => "member",
1506    Restricted    => "restricted",
1507});
1508
1509// ── ChatType ─────────────────────────────────────────────────────────────────
1510
1511impl_str_traits_snake!(ChatType {
1512    Sender     => "sender",
1513    Private    => "private",
1514    Group      => "group",
1515    Supergroup => "supergroup",
1516    Channel    => "channel",
1517});
1518
1519// ── MessageEntityType ────────────────────────────────────────────────────────
1520
1521impl_str_traits_snake!(MessageEntityType {
1522    Blockquote           => "blockquote",
1523    Bold                 => "bold",
1524    BotCommand           => "bot_command",
1525    Cashtag              => "cashtag",
1526    Code                 => "code",
1527    CustomEmoji          => "custom_emoji",
1528    DateTime             => "date_time",
1529    Email                => "email",
1530    ExpandableBlockquote => "expandable_blockquote",
1531    Hashtag              => "hashtag",
1532    Italic               => "italic",
1533    Mention              => "mention",
1534    PhoneNumber          => "phone_number",
1535    Pre                  => "pre",
1536    Spoiler              => "spoiler",
1537    Strikethrough        => "strikethrough",
1538    TextLink             => "text_link",
1539    TextMention          => "text_mention",
1540    Underline            => "underline",
1541    Url                  => "url",
1542});
1543
1544// ── Additional enums with custom serde renames ───────────────────────────────
1545
1546impl_str_traits_snake!(BackgroundTypeType {
1547    Fill      => "fill",
1548    Wallpaper => "wallpaper",
1549    Pattern   => "pattern",
1550    ChatTheme => "chat_theme",
1551});
1552
1553impl_str_traits_snake!(BackgroundFillType {
1554    Solid            => "solid",
1555    Gradient         => "gradient",
1556    FreeformGradient => "freeform_gradient",
1557});
1558
1559impl_str_traits_snake!(BotCommandScopeType {
1560    Default              => "default",
1561    AllPrivateChats      => "all_private_chats",
1562    AllGroupChats        => "all_group_chats",
1563    AllChatAdministrators => "all_chat_administrators",
1564    Chat                 => "chat",
1565    ChatAdministrators   => "chat_administrators",
1566    ChatMember           => "chat_member",
1567});
1568
1569impl_str_traits_snake!(ChatBoostSources {
1570    GiftCode => "gift_code",
1571    Giveaway => "giveaway",
1572    Premium  => "premium",
1573});
1574
1575impl_str_traits_snake!(InputMediaType {
1576    Animation => "animation",
1577    Document  => "document",
1578    Audio     => "audio",
1579    Photo     => "photo",
1580    Video     => "video",
1581});
1582
1583impl_str_traits_snake!(InputPaidMediaType {
1584    Photo => "photo",
1585    Video => "video",
1586});
1587
1588impl_str_traits_snake!(InputProfilePhotoType {
1589    Static   => "static",
1590    Animated => "animated",
1591});
1592
1593impl_str_traits_snake!(InputStoryContentType {
1594    Photo => "photo",
1595    Video => "video",
1596});
1597
1598impl_str_traits_snake!(KeyboardButtonStyle {
1599    Primary => "primary",
1600    Success => "success",
1601    Danger  => "danger",
1602});
1603
1604impl_str_traits_snake!(MaskPositionPoint {
1605    Forehead => "forehead",
1606    Eyes     => "eyes",
1607    Mouth    => "mouth",
1608    Chin     => "chin",
1609});
1610
1611impl_str_traits_snake!(MenuButtonType {
1612    Commands => "commands",
1613    WebApp   => "web_app",
1614    Default  => "default",
1615});
1616
1617impl_str_traits_snake!(MessageAttachmentType {
1618    Animation         => "animation",
1619    Audio             => "audio",
1620    Contact           => "contact",
1621    Dice              => "dice",
1622    Document          => "document",
1623    Game              => "game",
1624    Invoice           => "invoice",
1625    Location          => "location",
1626    PaidMedia         => "paid_media",
1627    PassportData      => "passport_data",
1628    Photo             => "photo",
1629    Poll              => "poll",
1630    Sticker           => "sticker",
1631    Story             => "story",
1632    SuccessfulPayment => "successful_payment",
1633    Video             => "video",
1634    VideoNote         => "video_note",
1635    Voice             => "voice",
1636    Venue             => "venue",
1637});
1638
1639impl_str_traits_snake!(MessageOriginType {
1640    User       => "user",
1641    HiddenUser => "hidden_user",
1642    Chat       => "chat",
1643    Channel    => "channel",
1644});
1645
1646impl_str_traits_snake!(PaidMediaType {
1647    Preview => "preview",
1648    Video   => "video",
1649    Photo   => "photo",
1650});
1651
1652impl_str_traits_snake!(PollType {
1653    Regular => "regular",
1654    Quiz    => "quiz",
1655});
1656
1657impl_str_traits_snake!(ReactionType {
1658    Emoji       => "emoji",
1659    CustomEmoji => "custom_emoji",
1660    Paid        => "paid",
1661});
1662
1663impl_str_traits_snake!(RevenueWithdrawalStateType {
1664    Pending   => "pending",
1665    Succeeded => "succeeded",
1666    Failed    => "failed",
1667});
1668
1669impl_str_traits_snake!(StickerFormat {
1670    Static   => "static",
1671    Animated => "animated",
1672    Video    => "video",
1673});
1674
1675impl_str_traits_snake!(StickerType {
1676    Regular     => "regular",
1677    Mask        => "mask",
1678    CustomEmoji => "custom_emoji",
1679});
1680
1681impl_str_traits_snake!(StoryAreaTypeType {
1682    Location          => "location",
1683    SuggestedReaction => "suggested_reaction",
1684    Link              => "link",
1685    Weather           => "weather",
1686    UniqueGift        => "unique_gift",
1687});
1688
1689impl_str_traits_snake!(SuggestedPostInfoState {
1690    Pending  => "pending",
1691    Approved => "approved",
1692    Declined => "declined",
1693});
1694
1695impl_str_traits_snake!(SuggestedPostRefunded {
1696    PostDeleted     => "post_deleted",
1697    PaymentRefunded => "payment_refunded",
1698});
1699
1700impl_str_traits_snake!(TransactionPartnerType {
1701    AffiliateProgram => "affiliate_program",
1702    Chat             => "chat",
1703    Fragment         => "fragment",
1704    Other            => "other",
1705    TelegramAds      => "telegram_ads",
1706    TelegramApi      => "telegram_api",
1707    User             => "user",
1708});
1709
1710impl_str_traits_snake!(TransactionPartnerUser {
1711    InvoicePayment          => "invoice_payment",
1712    PaidMediaPayment        => "paid_media_payment",
1713    GiftPurchase            => "gift_purchase",
1714    PremiumPurchase         => "premium_purchase",
1715    BusinessAccountTransfer => "business_account_transfer",
1716});
1717
1718impl_str_traits_snake!(UniqueGiftInfoOrigin {
1719    GiftedUpgrade => "gifted_upgrade",
1720    Offer         => "OFFER",
1721    Resale        => "resale",
1722    Transfer      => "transfer",
1723    Upgrade       => "upgrade",
1724});
1725
1726impl_str_traits_snake!(UniqueGiftModelRarity {
1727    Uncommon  => "uncommon",
1728    Rare      => "rare",
1729    Epic      => "epic",
1730    Legendary => "legendary",
1731});
1732
1733impl_str_traits_snake!(OwnedGiftType {
1734    Regular => "regular",
1735    Unique  => "unique",
1736});
1737
1738// ── Integer / Limit constants ────────────────────────────────────────────────
1739
1740/// Limitations for `BotCommand` and `Bot::set_my_commands`.
1741pub mod bot_command_limit {
1742    /// Minimum length of a bot command string.
1743    pub const MIN_COMMAND: u32 = 1;
1744    /// Maximum length of a bot command string.
1745    pub const MAX_COMMAND: u32 = 32;
1746    /// Minimum length of a bot command description.
1747    pub const MIN_DESCRIPTION: u32 = 1;
1748    /// Maximum length of a bot command description.
1749    pub const MAX_DESCRIPTION: u32 = 256;
1750    /// Maximum number of commands in a single `set_my_commands` call.
1751    pub const MAX_COMMAND_NUMBER: u32 = 100;
1752}
1753
1754/// Limitations for `Bot::set_my_description` and `Bot::set_my_short_description`.
1755pub mod bot_description_limit {
1756    /// Maximum length of the bot description.
1757    pub const MAX_DESCRIPTION_LENGTH: u32 = 512;
1758    /// Maximum length of the bot short description.
1759    pub const MAX_SHORT_DESCRIPTION_LENGTH: u32 = 120;
1760}
1761
1762/// Limitations for `Bot::set_my_name`.
1763pub mod bot_name_limit {
1764    /// Maximum length of the bot name.
1765    pub const MAX_NAME_LENGTH: u32 = 64;
1766}
1767
1768/// Limitations for `Bot::delete_messages`, `Bot::forward_messages`, and `Bot::copy_messages`.
1769pub mod bulk_request_limit {
1770    /// Minimum number of messages per bulk request.
1771    pub const MIN_LIMIT: u32 = 1;
1772    /// Maximum number of messages per bulk request.
1773    pub const MAX_LIMIT: u32 = 100;
1774}
1775
1776/// Limitations related to handling business accounts.
1777pub mod business_limit {
1778    /// 24 hours in seconds.
1779    pub const CHAT_ACTIVITY_TIMEOUT: u32 = 86400;
1780    /// Minimum length of a business account name.
1781    pub const MIN_NAME_LENGTH: u32 = 1;
1782    /// Maximum length of a business account name.
1783    pub const MAX_NAME_LENGTH: u32 = 64;
1784    /// Maximum length of a business account username.
1785    pub const MAX_USERNAME_LENGTH: u32 = 32;
1786    /// Maximum length of a business account bio.
1787    pub const MAX_BIO_LENGTH: u32 = 140;
1788    /// Minimum number of gift results to request.
1789    pub const MIN_GIFT_RESULTS: u32 = 1;
1790    /// Maximum number of gift results to request.
1791    pub const MAX_GIFT_RESULTS: u32 = 100;
1792    /// Minimum star count for business operations.
1793    pub const MIN_STAR_COUNT: u32 = 1;
1794    /// Maximum star count for business operations.
1795    pub const MAX_STAR_COUNT: u32 = 10000;
1796}
1797
1798/// Limitations for `CallbackQuery` / `Bot::answer_callback_query`.
1799pub mod callback_query_limit {
1800    /// Maximum length of the `answer_callback_query` text parameter.
1801    pub const ANSWER_CALLBACK_QUERY_TEXT_LENGTH: u32 = 200;
1802}
1803
1804/// Special chat IDs.
1805pub mod chat_id {
1806    /// Chat ID of the anonymous admin sender.
1807    pub const ANONYMOUS_ADMIN: i64 = 1_087_968_824;
1808    /// Chat ID of the Telegram service notifications chat.
1809    pub const SERVICE_CHAT: i64 = 777_000;
1810    /// Chat ID of the fake channel sender used by Telegram.
1811    pub const FAKE_CHANNEL: i64 = 136_817_688;
1812}
1813
1814/// Limitations for `ChatInviteLink`.
1815pub mod chat_invite_link_limit {
1816    /// Minimum member limit for an invite link.
1817    pub const MIN_MEMBER_LIMIT: u32 = 1;
1818    /// Maximum member limit for an invite link.
1819    pub const MAX_MEMBER_LIMIT: u32 = 99999;
1820    /// Maximum length of an invite link name.
1821    pub const NAME_LENGTH: u32 = 32;
1822}
1823
1824/// Limitations for chat title, description, and admin custom title.
1825pub mod chat_limit {
1826    /// Maximum length of a chat administrator custom title.
1827    pub const CHAT_ADMINISTRATOR_CUSTOM_TITLE_LENGTH: u32 = 16;
1828    /// Maximum length of a chat description.
1829    pub const CHAT_DESCRIPTION_LENGTH: u32 = 255;
1830    /// Minimum length of a chat title.
1831    pub const MIN_CHAT_TITLE_LENGTH: u32 = 1;
1832    /// Maximum length of a chat title.
1833    pub const MAX_CHAT_TITLE_LENGTH: u32 = 128;
1834}
1835
1836/// Limitations for chat subscription invite links.
1837pub mod chat_subscription_limit {
1838    /// 30 days in seconds.
1839    pub const SUBSCRIPTION_PERIOD: u32 = 2_592_000;
1840    /// Minimum subscription price in Telegram Stars.
1841    pub const MIN_PRICE: u32 = 1;
1842    /// Maximum subscription price in Telegram Stars.
1843    pub const MAX_PRICE: u32 = 10000;
1844}
1845
1846/// Limitations for `ChatPhoto` sizes.
1847pub mod chat_photo_size {
1848    /// Small chat photo size in pixels.
1849    pub const SMALL: u32 = 160;
1850    /// Big chat photo size in pixels.
1851    pub const BIG: u32 = 640;
1852}
1853
1854/// Limitations for `BackgroundType` subclasses.
1855pub mod background_type_limit {
1856    /// Maximum dimming percentage for background types.
1857    pub const MAX_DIMMING: u32 = 100;
1858    /// Maximum pattern intensity percentage.
1859    pub const MAX_INTENSITY: u32 = 100;
1860}
1861
1862/// Limitations for `BackgroundFillGradient`.
1863pub mod background_fill_limit {
1864    /// Maximum rotation angle in degrees for a gradient fill.
1865    pub const MAX_ROTATION_ANGLE: u32 = 359;
1866}
1867
1868/// Limitations for `Contact` vcard.
1869pub mod contact_limit {
1870    /// Maximum length of a vCard string.
1871    pub const VCARD: u32 = 2048;
1872}
1873
1874/// Limitations for `Bot::get_custom_emoji_stickers`.
1875pub mod custom_emoji_sticker_limit {
1876    /// Maximum number of custom emoji identifiers per request.
1877    pub const CUSTOM_EMOJI_IDENTIFIER_LIMIT: u32 = 200;
1878}
1879
1880/// Limitations for `Dice` value ranges.
1881pub mod dice_limit {
1882    /// Minimum dice value.
1883    pub const MIN_VALUE: u32 = 1;
1884    /// Maximum value for basketball dice.
1885    pub const MAX_VALUE_BASKETBALL: u32 = 5;
1886    /// Maximum value for bowling dice.
1887    pub const MAX_VALUE_BOWLING: u32 = 6;
1888    /// Maximum value for darts dice.
1889    pub const MAX_VALUE_DARTS: u32 = 6;
1890    /// Maximum value for standard dice.
1891    pub const MAX_VALUE_DICE: u32 = 6;
1892    /// Maximum value for football dice.
1893    pub const MAX_VALUE_FOOTBALL: u32 = 5;
1894    /// Maximum value for slot machine dice.
1895    pub const MAX_VALUE_SLOT_MACHINE: u32 = 64;
1896}
1897
1898/// Limitations regarding file upload and download sizes.
1899pub mod file_size_limit {
1900    /// 20 MB.
1901    pub const FILESIZE_DOWNLOAD: u64 = 20_000_000;
1902    /// 50 MB.
1903    pub const FILESIZE_UPLOAD: u64 = 50_000_000;
1904    /// 2000 MB.
1905    pub const FILESIZE_UPLOAD_LOCAL_MODE: u64 = 2_000_000_000;
1906    /// Unlimited when using a local bot API server.
1907    pub const FILESIZE_DOWNLOAD_LOCAL_MODE: u64 = u64::MAX;
1908    /// 10 MB.
1909    pub const PHOTOSIZE_UPLOAD: u64 = 10_000_000;
1910    /// 1 MB.
1911    pub const VOICE_NOTE_FILE_SIZE: u64 = 1_000_000;
1912}
1913
1914/// Limitations regarding flood limits.
1915pub mod flood_limit {
1916    /// Maximum messages per second to the same chat.
1917    pub const MESSAGES_PER_SECOND_PER_CHAT: u32 = 1;
1918    /// Maximum messages per second overall.
1919    pub const MESSAGES_PER_SECOND: u32 = 30;
1920    /// Maximum messages per minute per group chat.
1921    pub const MESSAGES_PER_MINUTE_PER_GROUP: u32 = 20;
1922    /// Maximum paid messages per second.
1923    pub const PAID_MESSAGES_PER_SECOND: u32 = 1000;
1924}
1925
1926/// Available colors for `Bot::create_forum_topic.icon_color`.
1927pub mod forum_icon_color {
1928    /// Blue forum topic icon color.
1929    pub const BLUE: u32 = 0x6FB9F0;
1930    /// Yellow forum topic icon color.
1931    pub const YELLOW: u32 = 0xFFD67E;
1932    /// Purple forum topic icon color.
1933    pub const PURPLE: u32 = 0xCB86DB;
1934    /// Green forum topic icon color.
1935    pub const GREEN: u32 = 0x8EEE98;
1936    /// Pink forum topic icon color.
1937    pub const PINK: u32 = 0xFF93B2;
1938    /// Red forum topic icon color.
1939    pub const RED: u32 = 0xFB6F5F;
1940}
1941
1942/// Limitations for `Bot::create_forum_topic` and `Bot::edit_forum_topic`.
1943pub mod forum_topic_limit {
1944    /// Minimum length of a forum topic name.
1945    pub const MIN_NAME_LENGTH: u32 = 1;
1946    /// Maximum length of a forum topic name.
1947    pub const MAX_NAME_LENGTH: u32 = 128;
1948}
1949
1950/// Limitations for `Bot::send_gift`.
1951pub mod gift_limit {
1952    /// Maximum length of the gift text.
1953    pub const MAX_TEXT_LENGTH: u32 = 128;
1954}
1955
1956/// Limitations for `Giveaway` and related classes.
1957pub mod giveaway_limit {
1958    /// Maximum number of giveaway winners.
1959    pub const MAX_WINNERS: u32 = 100;
1960}
1961
1962/// Limitations for `InlineKeyboardButton`.
1963pub mod inline_keyboard_button_limit {
1964    /// Minimum length of callback data.
1965    pub const MIN_CALLBACK_DATA: u32 = 1;
1966    /// Maximum length of callback data.
1967    pub const MAX_CALLBACK_DATA: u32 = 64;
1968    /// Minimum length of copy text.
1969    pub const MIN_COPY_TEXT: u32 = 1;
1970    /// Maximum length of copy text.
1971    pub const MAX_COPY_TEXT: u32 = 256;
1972}
1973
1974/// Limitations for `InlineKeyboardMarkup`.
1975pub mod inline_keyboard_markup_limit {
1976    /// Maximum total number of buttons in an inline keyboard.
1977    pub const TOTAL_BUTTON_NUMBER: u32 = 100;
1978    /// Maximum number of buttons per row.
1979    pub const BUTTONS_PER_ROW: u32 = 8;
1980}
1981
1982/// Limitations for `InputChecklist` / `InputChecklistTask`.
1983pub mod input_checklist_limit {
1984    /// Minimum length of a checklist title.
1985    pub const MIN_TITLE_LENGTH: u32 = 1;
1986    /// Maximum length of a checklist title.
1987    pub const MAX_TITLE_LENGTH: u32 = 255;
1988    /// Minimum length of a checklist task text.
1989    pub const MIN_TEXT_LENGTH: u32 = 1;
1990    /// Maximum length of a checklist task text.
1991    pub const MAX_TEXT_LENGTH: u32 = 100;
1992    /// Minimum number of tasks in a checklist.
1993    pub const MIN_TASK_NUMBER: u32 = 1;
1994    /// Maximum number of tasks in a checklist.
1995    pub const MAX_TASK_NUMBER: u32 = 30;
1996}
1997
1998/// Limitations for `InputStoryContentPhoto` / `InputStoryContentVideo`.
1999pub mod input_story_content_limit {
2000    /// 10 MB (same as `file_size_limit::PHOTOSIZE_UPLOAD`).
2001    pub const PHOTOSIZE_UPLOAD: u64 = 10_000_000;
2002    /// Maximum photo width in pixels for stories.
2003    pub const PHOTO_WIDTH: u32 = 1080;
2004    /// Maximum photo height in pixels for stories.
2005    pub const PHOTO_HEIGHT: u32 = 1920;
2006    /// 30 MB.
2007    pub const VIDEOSIZE_UPLOAD: u64 = 30_000_000;
2008    /// Maximum video width in pixels for stories.
2009    pub const VIDEO_WIDTH: u32 = 720;
2010    /// Maximum video height in pixels for stories.
2011    pub const VIDEO_HEIGHT: u32 = 1080;
2012    /// 60 seconds.
2013    pub const MAX_VIDEO_DURATION: u32 = 60;
2014}
2015
2016/// Limitations for `InlineQuery` / `Bot::answer_inline_query`.
2017pub mod inline_query_limit {
2018    /// Maximum number of inline query results per response.
2019    pub const RESULTS: u32 = 50;
2020    /// Maximum length of the offset string.
2021    pub const MAX_OFFSET_LENGTH: u32 = 64;
2022    /// Maximum length of the inline query text.
2023    pub const MAX_QUERY_LENGTH: u32 = 256;
2024}
2025
2026/// Limitations for `InlineQueryResult` and its subclasses.
2027pub mod inline_query_result_limit {
2028    /// Minimum length of an inline query result ID.
2029    pub const MIN_ID_LENGTH: u32 = 1;
2030    /// Maximum length of an inline query result ID.
2031    pub const MAX_ID_LENGTH: u32 = 64;
2032}
2033
2034/// Limitations for `InlineQueryResultsButton`.
2035pub mod inline_query_results_button_limit {
2036    /// Minimum length of the start parameter.
2037    pub const MIN_START_PARAMETER_LENGTH: u32 = 1;
2038    /// Maximum length of the start parameter.
2039    pub const MAX_START_PARAMETER_LENGTH: u32 = 64;
2040}
2041
2042/// Limitations for `Invoice` / `Bot::send_invoice` / `Bot::create_invoice_link`.
2043pub mod invoice_limit {
2044    /// Minimum length of an invoice title.
2045    pub const MIN_TITLE_LENGTH: u32 = 1;
2046    /// Maximum length of an invoice title.
2047    pub const MAX_TITLE_LENGTH: u32 = 32;
2048    /// Minimum length of an invoice description.
2049    pub const MIN_DESCRIPTION_LENGTH: u32 = 1;
2050    /// Maximum length of an invoice description.
2051    pub const MAX_DESCRIPTION_LENGTH: u32 = 255;
2052    /// Minimum length of an invoice payload.
2053    pub const MIN_PAYLOAD_LENGTH: u32 = 1;
2054    /// Maximum length of an invoice payload.
2055    pub const MAX_PAYLOAD_LENGTH: u32 = 128;
2056    /// Maximum number of suggested tip amounts.
2057    pub const MAX_TIP_AMOUNTS: u32 = 4;
2058    /// Minimum star count for an invoice.
2059    pub const MIN_STAR_COUNT: u32 = 1;
2060    /// Maximum star count for an invoice.
2061    pub const MAX_STAR_COUNT: u32 = 25000;
2062    /// 30 days in seconds.
2063    pub const SUBSCRIPTION_PERIOD: f64 = 2_592_000.0;
2064    /// Maximum subscription price in Telegram Stars.
2065    pub const SUBSCRIPTION_MAX_PRICE: u32 = 10000;
2066}
2067
2068/// Limitations for `KeyboardButtonRequestUsers`.
2069pub mod keyboard_button_request_users_limit {
2070    /// Minimum number of users to request.
2071    pub const MIN_QUANTITY: u32 = 1;
2072    /// Maximum number of users to request.
2073    pub const MAX_QUANTITY: u32 = 10;
2074}
2075
2076/// Limitations for `Location` / `ChatLocation` / `Bot::send_location`.
2077pub mod location_limit {
2078    /// Minimum length of a chat location address.
2079    pub const MIN_CHAT_LOCATION_ADDRESS: u32 = 1;
2080    /// Maximum length of a chat location address.
2081    pub const MAX_CHAT_LOCATION_ADDRESS: u32 = 64;
2082    /// Maximum horizontal accuracy in meters.
2083    pub const HORIZONTAL_ACCURACY: u32 = 1500;
2084    /// Minimum heading in degrees.
2085    pub const MIN_HEADING: u32 = 1;
2086    /// Maximum heading in degrees.
2087    pub const MAX_HEADING: u32 = 360;
2088    /// Minimum live period in seconds.
2089    pub const MIN_LIVE_PERIOD: u32 = 60;
2090    /// Maximum live period in seconds.
2091    pub const MAX_LIVE_PERIOD: u32 = 86400;
2092    /// `0x7FFFFFFF` -- edit indefinitely.
2093    pub const LIVE_PERIOD_FOREVER: u32 = 0x7FFF_FFFF;
2094    /// Minimum proximity alert radius in meters.
2095    pub const MIN_PROXIMITY_ALERT_RADIUS: u32 = 1;
2096    /// Maximum proximity alert radius in meters.
2097    pub const MAX_PROXIMITY_ALERT_RADIUS: u32 = 100_000;
2098}
2099
2100/// Limitations for `Bot::send_media_group`.
2101pub mod media_group_limit {
2102    /// Minimum number of media items in a group.
2103    pub const MIN_MEDIA_LENGTH: u32 = 2;
2104    /// Maximum number of media items in a group.
2105    pub const MAX_MEDIA_LENGTH: u32 = 10;
2106}
2107
2108/// Limitations for `Message` / `InputTextMessageContent` / `Bot::send_message`.
2109pub mod message_limit {
2110    /// Maximum length of a text message.
2111    pub const MAX_TEXT_LENGTH: u32 = 4096;
2112    /// Maximum length of a media caption.
2113    pub const CAPTION_LENGTH: u32 = 1024;
2114    /// Minimum length of a text message.
2115    pub const MIN_TEXT_LENGTH: u32 = 1;
2116    /// Maximum length of a deep link parameter.
2117    pub const DEEP_LINK_LENGTH: u32 = 64;
2118    /// Maximum number of entities in a single message.
2119    pub const MESSAGE_ENTITIES: u32 = 100;
2120}
2121
2122/// Nanostar value constant.
2123pub mod nanostar {
2124    /// One nanostar expressed as a fraction of a star.
2125    pub const VALUE: f64 = 1.0 / 1_000_000_000.0;
2126}
2127
2128/// Limitations for nanostar amounts.
2129pub mod nanostar_limit {
2130    /// Minimum nanostar amount.
2131    pub const MIN_AMOUNT: i64 = -999_999_999;
2132    /// Maximum nanostar amount.
2133    pub const MAX_AMOUNT: i64 = 999_999_999;
2134}
2135
2136/// Limitations for `Bot::get_updates.limit`.
2137pub mod polling_limit {
2138    /// Minimum number of updates to retrieve per request.
2139    pub const MIN_LIMIT: u32 = 1;
2140    /// Maximum number of updates to retrieve per request.
2141    pub const MAX_LIMIT: u32 = 100;
2142}
2143
2144/// Limitations for `Poll` / `PollOption` / `Bot::send_poll`.
2145pub mod poll_limit {
2146    /// Minimum length of a poll question.
2147    pub const MIN_QUESTION_LENGTH: u32 = 1;
2148    /// Maximum length of a poll question.
2149    pub const MAX_QUESTION_LENGTH: u32 = 300;
2150    /// Minimum length of a poll option text.
2151    pub const MIN_OPTION_LENGTH: u32 = 1;
2152    /// Maximum length of a poll option text.
2153    pub const MAX_OPTION_LENGTH: u32 = 100;
2154    /// Minimum number of poll options.
2155    pub const MIN_OPTION_NUMBER: u32 = 2;
2156    /// Maximum number of poll options.
2157    pub const MAX_OPTION_NUMBER: u32 = 12;
2158    /// Maximum length of a quiz explanation text.
2159    pub const MAX_EXPLANATION_LENGTH: u32 = 200;
2160    /// Maximum number of line feeds in a quiz explanation.
2161    pub const MAX_EXPLANATION_LINE_FEEDS: u32 = 2;
2162    /// Minimum open period for a poll in seconds.
2163    pub const MIN_OPEN_PERIOD: u32 = 5;
2164    /// Maximum open period for a poll in seconds.
2165    pub const MAX_OPEN_PERIOD: u32 = 600;
2166}
2167
2168/// Limitations for `Bot::gift_premium_subscription`.
2169pub mod premium_subscription {
2170    /// Maximum length of the premium subscription gift text.
2171    pub const MAX_TEXT_LENGTH: u32 = 128;
2172    /// Three-month subscription duration.
2173    pub const MONTH_COUNT_THREE: u32 = 3;
2174    /// Six-month subscription duration.
2175    pub const MONTH_COUNT_SIX: u32 = 6;
2176    /// Twelve-month subscription duration.
2177    pub const MONTH_COUNT_TWELVE: u32 = 12;
2178    /// Star cost for a three-month premium subscription.
2179    pub const STARS_THREE_MONTHS: u32 = 1000;
2180    /// Star cost for a six-month premium subscription.
2181    pub const STARS_SIX_MONTHS: u32 = 1500;
2182    /// Star cost for a twelve-month premium subscription.
2183    pub const STARS_TWELVE_MONTHS: u32 = 2500;
2184}
2185
2186/// Limitations for `ForceReply` and `ReplyKeyboardMarkup`.
2187pub mod reply_limit {
2188    /// Minimum length of the input field placeholder.
2189    pub const MIN_INPUT_FIELD_PLACEHOLDER: u32 = 1;
2190    /// Maximum length of the input field placeholder.
2191    pub const MAX_INPUT_FIELD_PLACEHOLDER: u32 = 64;
2192}
2193
2194/// Limitations for `Bot::get_star_transactions`.
2195pub mod star_transactions_limit {
2196    /// Minimum number of transactions to retrieve.
2197    pub const MIN_LIMIT: u32 = 1;
2198    /// Maximum number of transactions to retrieve.
2199    pub const MAX_LIMIT: u32 = 100;
2200}
2201
2202/// Limitations for various sticker methods.
2203pub mod sticker_limit {
2204    /// Minimum length of a sticker set name or title.
2205    pub const MIN_NAME_AND_TITLE: u32 = 1;
2206    /// Maximum length of a sticker set name or title.
2207    pub const MAX_NAME_AND_TITLE: u32 = 64;
2208    /// Minimum number of emojis associated with a sticker.
2209    pub const MIN_STICKER_EMOJI: u32 = 1;
2210    /// Maximum number of emojis associated with a sticker.
2211    pub const MAX_STICKER_EMOJI: u32 = 20;
2212    /// Maximum number of search keywords for a sticker.
2213    pub const MAX_SEARCH_KEYWORDS: u32 = 20;
2214    /// Maximum length of a single search keyword.
2215    pub const MAX_KEYWORD_LENGTH: u32 = 64;
2216}
2217
2218/// Limitations for sticker set methods.
2219pub mod sticker_set_limit {
2220    /// Minimum number of initial stickers when creating a set.
2221    pub const MIN_INITIAL_STICKERS: u32 = 1;
2222    /// Maximum number of initial stickers when creating a set.
2223    pub const MAX_INITIAL_STICKERS: u32 = 50;
2224    /// Maximum number of emoji stickers in a set.
2225    pub const MAX_EMOJI_STICKERS: u32 = 200;
2226    /// Maximum number of animated stickers in a set.
2227    pub const MAX_ANIMATED_STICKERS: u32 = 50;
2228    /// Maximum number of static stickers in a set.
2229    pub const MAX_STATIC_STICKERS: u32 = 120;
2230    /// Maximum static thumbnail size in kilobytes.
2231    pub const MAX_STATIC_THUMBNAIL_SIZE: u32 = 128;
2232    /// Maximum animated thumbnail size in kilobytes.
2233    pub const MAX_ANIMATED_THUMBNAIL_SIZE: u32 = 32;
2234    /// Required dimensions (width/height) for a static thumbnail in pixels.
2235    pub const STATIC_THUMB_DIMENSIONS: u32 = 100;
2236}
2237
2238/// Limitations for `StoryAreaPosition`.
2239pub mod story_area_position_limit {
2240    /// Maximum rotation angle in degrees for a story area.
2241    pub const MAX_ROTATION_ANGLE: u32 = 360;
2242}
2243
2244/// Limitations for subclasses of `StoryAreaType`.
2245pub mod story_area_type_limit {
2246    /// Maximum number of location areas per story.
2247    pub const MAX_LOCATION_AREAS: u32 = 10;
2248    /// Maximum number of suggested reaction areas per story.
2249    pub const MAX_SUGGESTED_REACTION_AREAS: u32 = 5;
2250    /// Maximum number of link areas per story.
2251    pub const MAX_LINK_AREAS: u32 = 3;
2252    /// Maximum number of weather areas per story.
2253    pub const MAX_WEATHER_AREAS: u32 = 3;
2254    /// Maximum number of unique gift areas per story.
2255    pub const MAX_UNIQUE_GIFT_AREAS: u32 = 1;
2256}
2257
2258/// Limitations for `Bot::post_story` and `Bot::edit_story`.
2259pub mod story_limit {
2260    /// Maximum length of a story caption.
2261    pub const CAPTION_LENGTH: u32 = 2048;
2262    /// 6 hours in seconds.
2263    pub const ACTIVITY_SIX_HOURS: u32 = 6 * 3600;
2264    /// 12 hours in seconds.
2265    pub const ACTIVITY_TWELVE_HOURS: u32 = 12 * 3600;
2266    /// 1 day in seconds.
2267    pub const ACTIVITY_ONE_DAY: u32 = 86400;
2268    /// 2 days in seconds.
2269    pub const ACTIVITY_TWO_DAYS: u32 = 2 * 86400;
2270}
2271
2272/// Limitations for `SuggestedPostPrice` / `SuggestedPostParameters` / `Bot::decline_suggested_post`.
2273pub mod suggested_post {
2274    /// Minimum suggested post price in Telegram Stars.
2275    pub const MIN_PRICE_STARS: u32 = 5;
2276    /// Maximum suggested post price in Telegram Stars.
2277    pub const MAX_PRICE_STARS: u32 = 100_000;
2278    /// Minimum suggested post price in nanotoncoins.
2279    pub const MIN_PRICE_NANOTONCOINS: u64 = 10_000_000;
2280    /// Maximum suggested post price in nanotoncoins.
2281    pub const MAX_PRICE_NANOTONCOINS: u64 = 10_000_000_000_000;
2282    /// Minimum send date offset in seconds from now.
2283    pub const MIN_SEND_DATE: u32 = 300;
2284    /// Maximum send date offset in seconds from now.
2285    pub const MAX_SEND_DATE: u32 = 2_678_400;
2286    /// Maximum length of a decline comment.
2287    pub const MAX_COMMENT_LENGTH: u32 = 128;
2288}
2289
2290/// Limitations for `Bot::get_user_profile_photos.limit`.
2291pub mod user_profile_photos_limit {
2292    /// Minimum number of profile photos to retrieve.
2293    pub const MIN_LIMIT: u32 = 1;
2294    /// Maximum number of profile photos to retrieve.
2295    pub const MAX_LIMIT: u32 = 100;
2296}
2297
2298/// Limitations for `Bot::get_user_profile_audios.limit`.
2299pub mod user_profile_audios_limit {
2300    /// Minimum number of profile audios to retrieve.
2301    pub const MIN_LIMIT: u32 = 1;
2302    /// Maximum number of profile audios to retrieve.
2303    pub const MAX_LIMIT: u32 = 100;
2304}
2305
2306/// Limitations for `Bot::set_webhook`.
2307pub mod webhook_limit {
2308    /// Minimum number of simultaneous webhook connections.
2309    pub const MIN_CONNECTIONS_LIMIT: u32 = 1;
2310    /// Maximum number of simultaneous webhook connections.
2311    pub const MAX_CONNECTIONS_LIMIT: u32 = 100;
2312    /// Minimum length of the webhook secret token.
2313    pub const MIN_SECRET_TOKEN_LENGTH: u32 = 1;
2314    /// Maximum length of the webhook secret token.
2315    pub const MAX_SECRET_TOKEN_LENGTH: u32 = 256;
2316}
2317
2318/// Limitations for `Bot::verify_chat` and `Bot::verify_user`.
2319pub mod verify_limit {
2320    /// Maximum length of the verification text.
2321    pub const MAX_TEXT_LENGTH: u32 = 70;
2322}
2323
2324/// Limitations for `Bot::set_chat_member_tag`.
2325pub mod tag_limit {
2326    /// Maximum length of a chat member tag.
2327    pub const MAX_TAG_LENGTH: u32 = 16;
2328}