1pub const BOT_API_VERSION: &str = "9.6";
5pub const BOT_API_VERSION_MAJOR: u32 = 9;
7pub const BOT_API_VERSION_MINOR: u32 = 6;
9
10pub const SUPPORTED_WEBHOOK_PORTS: &[u16] = &[443, 80, 88, 8443];
12
13pub const NANOSTAR_VALUE: f64 = 1.0 / 1_000_000_000.0;
15
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub struct AccentColorEntry {
21 pub identifier: u32,
23 pub name: Option<&'static str>,
25 pub light_colors: &'static [u32],
27 pub dark_colors: &'static [u32],
29}
30
31pub mod accent_color {
33 use super::AccentColorEntry;
34 pub const COLOR_000: AccentColorEntry = AccentColorEntry {
36 identifier: 0,
37 name: Some("red"),
38 light_colors: &[],
39 dark_colors: &[],
40 };
41 pub const COLOR_001: AccentColorEntry = AccentColorEntry {
43 identifier: 1,
44 name: Some("orange"),
45 light_colors: &[],
46 dark_colors: &[],
47 };
48 pub const COLOR_002: AccentColorEntry = AccentColorEntry {
50 identifier: 2,
51 name: Some("purple/violet"),
52 light_colors: &[],
53 dark_colors: &[],
54 };
55 pub const COLOR_003: AccentColorEntry = AccentColorEntry {
57 identifier: 3,
58 name: Some("green"),
59 light_colors: &[],
60 dark_colors: &[],
61 };
62 pub const COLOR_004: AccentColorEntry = AccentColorEntry {
64 identifier: 4,
65 name: Some("cyan"),
66 light_colors: &[],
67 dark_colors: &[],
68 };
69 pub const COLOR_005: AccentColorEntry = AccentColorEntry {
71 identifier: 5,
72 name: Some("blue"),
73 light_colors: &[],
74 dark_colors: &[],
75 };
76 pub const COLOR_006: AccentColorEntry = AccentColorEntry {
78 identifier: 6,
79 name: Some("pink"),
80 light_colors: &[],
81 dark_colors: &[],
82 };
83 pub const COLOR_007: AccentColorEntry = AccentColorEntry {
85 identifier: 7,
86 name: None,
87 light_colors: &[0xE15052, 0xF9AE63],
88 dark_colors: &[0xFF9380, 0x992F37],
89 };
90 pub const COLOR_008: AccentColorEntry = AccentColorEntry {
92 identifier: 8,
93 name: None,
94 light_colors: &[0xE0802B, 0xFAC534],
95 dark_colors: &[0xECB04E, 0xC35714],
96 };
97 pub const COLOR_009: AccentColorEntry = AccentColorEntry {
99 identifier: 9,
100 name: None,
101 light_colors: &[0xA05FF3, 0xF48FFF],
102 dark_colors: &[0xC697FF, 0x5E31C8],
103 };
104 pub const COLOR_010: AccentColorEntry = AccentColorEntry {
106 identifier: 10,
107 name: None,
108 light_colors: &[0x27A910, 0xA7DC57],
109 dark_colors: &[0xA7EB6E, 0x167E2D],
110 };
111 pub const COLOR_011: AccentColorEntry = AccentColorEntry {
113 identifier: 11,
114 name: None,
115 light_colors: &[0x27ACCE, 0x82E8D6],
116 dark_colors: &[0x40D8D0, 0x045C7F],
117 };
118 pub const COLOR_012: AccentColorEntry = AccentColorEntry {
120 identifier: 12,
121 name: None,
122 light_colors: &[0x3391D4, 0x7DD3F0],
123 dark_colors: &[0x52BFFF, 0x0B5494],
124 };
125 pub const COLOR_013: AccentColorEntry = AccentColorEntry {
127 identifier: 13,
128 name: None,
129 light_colors: &[0xDD4371, 0xFFBE9F],
130 dark_colors: &[0xFF86A6, 0x8E366E],
131 };
132 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 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 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 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 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 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 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
183pub mod profile_accent_color {
185 use super::AccentColorEntry;
186 pub const COLOR_000: AccentColorEntry = AccentColorEntry {
188 identifier: 0,
189 name: None,
190 light_colors: &[0xBA5650],
191 dark_colors: &[0x9C4540],
192 };
193 pub const COLOR_001: AccentColorEntry = AccentColorEntry {
195 identifier: 1,
196 name: None,
197 light_colors: &[0xC27C3E],
198 dark_colors: &[0x945E2C],
199 };
200 pub const COLOR_002: AccentColorEntry = AccentColorEntry {
202 identifier: 2,
203 name: None,
204 light_colors: &[0x956AC8],
205 dark_colors: &[0x715099],
206 };
207 pub const COLOR_003: AccentColorEntry = AccentColorEntry {
209 identifier: 3,
210 name: None,
211 light_colors: &[0x49A355],
212 dark_colors: &[0x33713B],
213 };
214 pub const COLOR_004: AccentColorEntry = AccentColorEntry {
216 identifier: 4,
217 name: None,
218 light_colors: &[0x3E97AD],
219 dark_colors: &[0x387E87],
220 };
221 pub const COLOR_005: AccentColorEntry = AccentColorEntry {
223 identifier: 5,
224 name: None,
225 light_colors: &[0x5A8FBB],
226 dark_colors: &[0x477194],
227 };
228 pub const COLOR_006: AccentColorEntry = AccentColorEntry {
230 identifier: 6,
231 name: None,
232 light_colors: &[0xB85378],
233 dark_colors: &[0x944763],
234 };
235 pub const COLOR_007: AccentColorEntry = AccentColorEntry {
237 identifier: 7,
238 name: None,
239 light_colors: &[0x7F8B95],
240 dark_colors: &[0x435261],
241 };
242 pub const COLOR_008: AccentColorEntry = AccentColorEntry {
244 identifier: 8,
245 name: None,
246 light_colors: &[0xC9565D, 0xD97C57],
247 dark_colors: &[0x994343, 0xAC583E],
248 };
249 pub const COLOR_009: AccentColorEntry = AccentColorEntry {
251 identifier: 9,
252 name: None,
253 light_colors: &[0xCF7244, 0xCC9433],
254 dark_colors: &[0x8F552F, 0xA17232],
255 };
256 pub const COLOR_010: AccentColorEntry = AccentColorEntry {
258 identifier: 10,
259 name: None,
260 light_colors: &[0x9662D4, 0xB966B6],
261 dark_colors: &[0x634691, 0x9250A2],
262 };
263 pub const COLOR_011: AccentColorEntry = AccentColorEntry {
265 identifier: 11,
266 name: None,
267 light_colors: &[0x3D9755, 0x89A650],
268 dark_colors: &[0x296A43, 0x5F8F44],
269 };
270 pub const COLOR_012: AccentColorEntry = AccentColorEntry {
272 identifier: 12,
273 name: None,
274 light_colors: &[0x3D95BA, 0x50AD98],
275 dark_colors: &[0x306C7C, 0x3E987E],
276 };
277 pub const COLOR_013: AccentColorEntry = AccentColorEntry {
279 identifier: 13,
280 name: None,
281 light_colors: &[0x538BC2, 0x4DA8BD],
282 dark_colors: &[0x38618C, 0x458BA1],
283 };
284 pub const COLOR_014: AccentColorEntry = AccentColorEntry {
286 identifier: 14,
287 name: None,
288 light_colors: &[0xB04F74, 0xD1666D],
289 dark_colors: &[0x884160, 0xA65259],
290 };
291 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
300use serde::{Deserialize, Serialize};
303use std::fmt;
304
305#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
307#[serde(rename_all = "snake_case")]
308#[non_exhaustive]
309pub enum BackgroundTypeType {
310 Fill,
312 Wallpaper,
314 Pattern,
316 ChatTheme,
318}
319
320#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
322#[serde(rename_all = "snake_case")]
323#[non_exhaustive]
324pub enum BackgroundFillType {
325 Solid,
327 Gradient,
329 FreeformGradient,
331}
332
333#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
335#[serde(rename_all = "snake_case")]
336#[non_exhaustive]
337pub enum BotCommandScopeType {
338 Default,
340 AllPrivateChats,
342 AllGroupChats,
344 AllChatAdministrators,
346 Chat,
348 ChatAdministrators,
350 ChatMember,
352}
353
354#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
356#[serde(rename_all = "snake_case")]
357#[non_exhaustive]
358pub enum ChatAction {
359 ChooseSticker,
361 FindLocation,
363 RecordVoice,
365 RecordVideo,
367 RecordVideoNote,
369 Typing,
371 UploadVoice,
373 UploadDocument,
375 UploadPhoto,
377 UploadVideo,
379 UploadVideoNote,
381}
382
383#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
385#[serde(rename_all = "snake_case")]
386#[non_exhaustive]
387pub enum ChatBoostSources {
388 GiftCode,
390 Giveaway,
392 Premium,
394}
395
396#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
398#[non_exhaustive]
399pub enum ChatMemberStatus {
400 #[serde(rename = "administrator")]
402 Administrator,
403 #[serde(rename = "creator")]
405 Owner,
406 #[serde(rename = "kicked")]
408 Banned,
409 #[serde(rename = "left")]
411 Left,
412 #[serde(rename = "member")]
414 Member,
415 #[serde(rename = "restricted")]
417 Restricted,
418}
419
420#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
422#[serde(rename_all = "snake_case")]
423#[non_exhaustive]
424pub enum ChatType {
425 Sender,
427 Private,
429 Group,
431 Supergroup,
433 Channel,
435}
436
437#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
439#[non_exhaustive]
440pub enum DiceEmoji {
441 #[serde(rename = "\u{1F3B2}")]
443 Dice,
444 #[serde(rename = "\u{1F3AF}")]
446 Darts,
447 #[serde(rename = "\u{1F3C0}")]
449 Basketball,
450 #[serde(rename = "\u{26BD}")]
452 Football,
453 #[serde(rename = "\u{1F3B0}")]
455 SlotMachine,
456 #[serde(rename = "\u{1F3B3}")]
458 Bowling,
459}
460
461#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
463#[non_exhaustive]
464pub enum InlineQueryResultType {
465 #[serde(rename = "audio")]
467 Audio,
468 #[serde(rename = "document")]
470 Document,
471 #[serde(rename = "gif")]
473 Gif,
474 #[serde(rename = "mpeg4_gif")]
476 Mpeg4Gif,
477 #[serde(rename = "photo")]
479 Photo,
480 #[serde(rename = "sticker")]
482 Sticker,
483 #[serde(rename = "video")]
485 Video,
486 #[serde(rename = "voice")]
488 Voice,
489 #[serde(rename = "article")]
491 Article,
492 #[serde(rename = "contact")]
494 Contact,
495 #[serde(rename = "game")]
497 Game,
498 #[serde(rename = "location")]
500 Location,
501 #[serde(rename = "venue")]
503 Venue,
504}
505
506#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
508#[serde(rename_all = "snake_case")]
509#[non_exhaustive]
510pub enum InputMediaType {
511 Animation,
513 Document,
515 Audio,
517 Photo,
519 Video,
521}
522
523#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
525#[serde(rename_all = "snake_case")]
526#[non_exhaustive]
527pub enum InputPaidMediaType {
528 Photo,
530 Video,
532}
533
534#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
536#[serde(rename_all = "snake_case")]
537#[non_exhaustive]
538pub enum InputProfilePhotoType {
539 Static,
541 Animated,
543}
544
545#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
547#[serde(rename_all = "snake_case")]
548#[non_exhaustive]
549pub enum InputStoryContentType {
550 Photo,
552 Video,
554}
555
556#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
558#[serde(rename_all = "snake_case")]
559#[non_exhaustive]
560pub enum KeyboardButtonStyle {
561 Primary,
563 Success,
565 Danger,
567}
568
569#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
571#[serde(rename_all = "snake_case")]
572#[non_exhaustive]
573pub enum MaskPositionPoint {
574 Forehead,
576 Eyes,
578 Mouth,
580 Chin,
582}
583
584#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
586#[non_exhaustive]
587pub enum MenuButtonType {
588 #[serde(rename = "commands")]
590 Commands,
591 #[serde(rename = "web_app")]
593 WebApp,
594 #[serde(rename = "default")]
596 Default,
597}
598
599#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
601#[serde(rename_all = "snake_case")]
602#[non_exhaustive]
603pub enum MessageAttachmentType {
604 Animation,
606 Audio,
608 Contact,
610 Dice,
612 Document,
614 Game,
616 Invoice,
618 Location,
620 PaidMedia,
622 PassportData,
624 Photo,
626 Poll,
628 Sticker,
630 Story,
632 SuccessfulPayment,
634 Video,
636 VideoNote,
638 Voice,
640 Venue,
642}
643
644#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
646#[serde(rename_all = "snake_case")]
647#[non_exhaustive]
648pub enum MessageEntityType {
649 Blockquote,
651 Bold,
653 BotCommand,
655 Cashtag,
657 Code,
659 CustomEmoji,
661 DateTime,
663 Email,
665 ExpandableBlockquote,
667 Hashtag,
669 Italic,
671 Mention,
673 PhoneNumber,
675 Pre,
677 Spoiler,
679 Strikethrough,
681 TextLink,
683 TextMention,
685 Underline,
687 Url,
689}
690
691#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
693#[non_exhaustive]
694pub enum MessageEntityDateTimeFormats {
695 #[serde(rename = "r")]
697 Relative,
698 #[serde(rename = "w")]
700 LocalizedWeekday,
701 #[serde(rename = "d")]
703 ShortDate,
704 #[serde(rename = "D")]
706 LongDate,
707 #[serde(rename = "t")]
709 ShortTime,
710 #[serde(rename = "T")]
712 LongTime,
713 #[serde(rename = "wd")]
715 LocalizedWeekdayShortDate,
716 #[serde(rename = "wD")]
718 LocalizedWeekdayLongDate,
719 #[serde(rename = "wt")]
721 LocalizedWeekdayShortTime,
722 #[serde(rename = "wT")]
724 LocalizedWeekdayLongTime,
725 #[serde(rename = "wdt")]
727 LocalizedWeekdayShortDateShortTime,
728 #[serde(rename = "wdT")]
730 LocalizedWeekdayShortDateLongTime,
731 #[serde(rename = "wDt")]
733 LocalizedWeekdayLongDateShortTime,
734 #[serde(rename = "wDT")]
736 LocalizedWeekdayLongDateLongTime,
737 #[serde(rename = "dt")]
739 ShortDateShortTime,
740 #[serde(rename = "dT")]
742 ShortDateLongTime,
743 #[serde(rename = "Dt")]
745 LongDateShortTime,
746 #[serde(rename = "DT")]
748 LongDateLongTime,
749}
750
751#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
753#[serde(rename_all = "snake_case")]
754#[non_exhaustive]
755pub enum MessageOriginType {
756 User,
758 HiddenUser,
760 Chat,
762 Channel,
764}
765
766#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
768#[serde(rename_all = "snake_case")]
769#[non_exhaustive]
770pub enum MessageType {
771 Animation,
773 Audio,
775 BoostAdded,
777 BusinessConnectionId,
779 ChannelChatCreated,
781 ChatBackgroundSet,
783 ChatOwnerChanged,
785 ChatOwnerLeft,
787 ChatShared,
789 Checklist,
791 ChecklistTasksAdded,
793 ChecklistTasksDone,
795 ConnectedWebsite,
797 Contact,
799 DeleteChatPhoto,
801 Dice,
803 DirectMessagePriceChanged,
805 Document,
807 EffectId,
809 ForumTopicCreated,
811 ForumTopicClosed,
813 ForumTopicEdited,
815 ForumTopicReopened,
817 Game,
819 GeneralForumTopicHidden,
821 GeneralForumTopicUnhidden,
823 Gift,
825 GiftUpgradeSent,
827 Giveaway,
829 GiveawayCreated,
831 GiveawayWinners,
833 GiveawayCompleted,
835 GroupChatCreated,
837 Invoice,
839 LeftChatMember,
841 Location,
843 MessageAutoDeleteTimerChanged,
845 MigrateToChatId,
847 NewChatMembers,
849 NewChatTitle,
851 NewChatPhoto,
853 PaidMedia,
855 PaidMessagePriceChanged,
857 SuggestedPostApprovalFailed,
859 SuggestedPostApproved,
861 SuggestedPostDeclined,
863 SuggestedPostInfo,
865 SuggestedPostPaid,
867 SuggestedPostRefunded,
869 PassportData,
871 Photo,
873 PinnedMessage,
875 Poll,
877 ProximityAlertTriggered,
879 RefundedPayment,
881 ReplyToStory,
883 SenderBoostCount,
885 SenderBusinessBot,
887 Sticker,
889 Story,
891 SupergroupChatCreated,
893 SuccessfulPayment,
895 Text,
897 UniqueGift,
899 UsersShared,
901 Venue,
903 Video,
905 VideoChatScheduled,
907 VideoChatStarted,
909 VideoChatEnded,
911 VideoChatParticipantsInvited,
913 VideoNote,
915 Voice,
917 WebAppData,
919 WriteAccessAllowed,
921}
922
923#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
925#[serde(rename_all = "snake_case")]
926#[non_exhaustive]
927pub enum OwnedGiftType {
928 Regular,
930 Unique,
932}
933
934#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
936#[serde(rename_all = "snake_case")]
937#[non_exhaustive]
938pub enum PaidMediaType {
939 Preview,
941 Video,
943 Photo,
945}
946
947#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
949#[non_exhaustive]
950pub enum ParseMode {
951 #[serde(rename = "HTML")]
953 Html,
954 #[serde(rename = "MarkdownV2")]
956 MarkdownV2,
957 #[serde(rename = "Markdown")]
959 Markdown,
960}
961
962#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
964#[serde(rename_all = "snake_case")]
965#[non_exhaustive]
966pub enum PollType {
967 Regular,
969 Quiz,
971}
972
973#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
975#[serde(rename_all = "snake_case")]
976#[non_exhaustive]
977pub enum ReactionType {
978 Emoji,
980 CustomEmoji,
982 Paid,
984}
985
986#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
988#[serde(rename_all = "snake_case")]
989#[non_exhaustive]
990pub enum RevenueWithdrawalStateType {
991 Pending,
993 Succeeded,
995 Failed,
997}
998
999#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1001#[serde(rename_all = "snake_case")]
1002#[non_exhaustive]
1003pub enum StickerFormat {
1004 Static,
1006 Animated,
1008 Video,
1010}
1011
1012#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1014#[serde(rename_all = "snake_case")]
1015#[non_exhaustive]
1016pub enum StickerType {
1017 Regular,
1019 Mask,
1021 CustomEmoji,
1023}
1024
1025#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1027#[serde(rename_all = "snake_case")]
1028#[non_exhaustive]
1029pub enum StoryAreaTypeType {
1030 Location,
1032 SuggestedReaction,
1034 Link,
1036 Weather,
1038 UniqueGift,
1040}
1041
1042#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1044#[serde(rename_all = "snake_case")]
1045#[non_exhaustive]
1046pub enum SuggestedPostInfoState {
1047 Pending,
1049 Approved,
1051 Declined,
1053}
1054
1055#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1057#[serde(rename_all = "snake_case")]
1058#[non_exhaustive]
1059pub enum SuggestedPostRefunded {
1060 PostDeleted,
1062 PaymentRefunded,
1064}
1065
1066#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1068#[serde(rename_all = "snake_case")]
1069#[non_exhaustive]
1070pub enum TransactionPartnerType {
1071 AffiliateProgram,
1073 Chat,
1075 Fragment,
1077 Other,
1079 TelegramAds,
1081 TelegramApi,
1083 User,
1085}
1086
1087#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1089#[serde(rename_all = "snake_case")]
1090#[non_exhaustive]
1091pub enum TransactionPartnerUser {
1092 InvoicePayment,
1094 PaidMediaPayment,
1096 GiftPurchase,
1098 PremiumPurchase,
1100 BusinessAccountTransfer,
1102}
1103
1104#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1106#[non_exhaustive]
1107pub enum UniqueGiftInfoOrigin {
1108 #[serde(rename = "gifted_upgrade")]
1110 GiftedUpgrade,
1111 #[serde(rename = "OFFER")]
1113 Offer,
1114 #[serde(rename = "resale")]
1116 Resale,
1117 #[serde(rename = "transfer")]
1119 Transfer,
1120 #[serde(rename = "upgrade")]
1122 Upgrade,
1123}
1124
1125#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1127#[serde(rename_all = "snake_case")]
1128#[non_exhaustive]
1129pub enum UniqueGiftModelRarity {
1130 Uncommon,
1132 Rare,
1134 Epic,
1136 Legendary,
1138}
1139
1140#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1142#[serde(rename_all = "snake_case")]
1143#[non_exhaustive]
1144pub enum UpdateType {
1145 Message,
1147 EditedMessage,
1149 ChannelPost,
1151 EditedChannelPost,
1153 InlineQuery,
1155 ChosenInlineResult,
1157 CallbackQuery,
1159 ShippingQuery,
1161 PreCheckoutQuery,
1163 Poll,
1165 PollAnswer,
1167 MyChatMember,
1169 ChatMember,
1171 ChatJoinRequest,
1173 ChatBoost,
1175 RemovedChatBoost,
1177 MessageReaction,
1179 MessageReactionCount,
1181 BusinessConnection,
1183 BusinessMessage,
1185 EditedBusinessMessage,
1187 DeletedBusinessMessages,
1189 PurchasedPaidMedia,
1191}
1192
1193#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
1195#[non_exhaustive]
1196pub enum ReactionEmoji {
1197 #[serde(rename = "\u{1F44D}")]
1199 ThumbsUp,
1200 #[serde(rename = "\u{1F44E}")]
1202 ThumbsDown,
1203 #[serde(rename = "\u{2764}")]
1205 RedHeart,
1206 #[serde(rename = "\u{1F525}")]
1208 Fire,
1209 #[serde(rename = "\u{1F970}")]
1211 SmilingFaceWithHearts,
1212 #[serde(rename = "\u{1F44F}")]
1214 ClappingHands,
1215 #[serde(rename = "\u{1F601}")]
1217 GrinningFaceWithSmilingEyes,
1218 #[serde(rename = "\u{1F914}")]
1220 ThinkingFace,
1221 #[serde(rename = "\u{1F92F}")]
1223 ShockedFaceWithExplodingHead,
1224 #[serde(rename = "\u{1F631}")]
1226 FaceScreamingInFear,
1227 #[serde(rename = "\u{1F92C}")]
1229 SeriousFaceWithSymbolsCoveringMouth,
1230 #[serde(rename = "\u{1F622}")]
1232 CryingFace,
1233 #[serde(rename = "\u{1F389}")]
1235 PartyPopper,
1236 #[serde(rename = "\u{1F929}")]
1238 GrinningFaceWithStarEyes,
1239 #[serde(rename = "\u{1F92E}")]
1241 FaceWithOpenMouthVomiting,
1242 #[serde(rename = "\u{1F4A9}")]
1244 PileOfPoo,
1245 #[serde(rename = "\u{1F64F}")]
1247 PersonWithFoldedHands,
1248 #[serde(rename = "\u{1F44C}")]
1250 OkHandSign,
1251 #[serde(rename = "\u{1F54A}")]
1253 DoveOfPeace,
1254 #[serde(rename = "\u{1F921}")]
1256 ClownFace,
1257 #[serde(rename = "\u{1F971}")]
1259 YawningFace,
1260 #[serde(rename = "\u{1F974}")]
1262 FaceWithUnevenEyesAndWavyMouth,
1263 #[serde(rename = "\u{1F60D}")]
1265 SmilingFaceWithHeartShapedEyes,
1266 #[serde(rename = "\u{1F433}")]
1268 SpoutingWhale,
1269 #[serde(rename = "\u{2764}\u{FE0F}\u{200D}\u{1F525}")]
1271 HeartOnFire,
1272 #[serde(rename = "\u{1F31A}")]
1274 NewMoonWithFace,
1275 #[serde(rename = "\u{1F32D}")]
1277 HotDog,
1278 #[serde(rename = "\u{1F4AF}")]
1280 HundredPointsSymbol,
1281 #[serde(rename = "\u{1F923}")]
1283 RollingOnTheFloorLaughing,
1284 #[serde(rename = "\u{26A1}")]
1286 HighVoltageSign,
1287 #[serde(rename = "\u{1F34C}")]
1289 Banana,
1290 #[serde(rename = "\u{1F3C6}")]
1292 Trophy,
1293 #[serde(rename = "\u{1F494}")]
1295 BrokenHeart,
1296 #[serde(rename = "\u{1F928}")]
1298 FaceWithOneEyebrowRaised,
1299 #[serde(rename = "\u{1F610}")]
1301 NeutralFace,
1302 #[serde(rename = "\u{1F353}")]
1304 Strawberry,
1305 #[serde(rename = "\u{1F37E}")]
1307 BottleWithPoppingCork,
1308 #[serde(rename = "\u{1F48B}")]
1310 KissMark,
1311 #[serde(rename = "\u{1F595}")]
1313 ReversedHandWithMiddleFingerExtended,
1314 #[serde(rename = "\u{1F608}")]
1316 SmilingFaceWithHorns,
1317 #[serde(rename = "\u{1F634}")]
1319 SleepingFace,
1320 #[serde(rename = "\u{1F62D}")]
1322 LoudlyCryingFace,
1323 #[serde(rename = "\u{1F913}")]
1325 NerdFace,
1326 #[serde(rename = "\u{1F47B}")]
1328 Ghost,
1329 #[serde(rename = "\u{1F468}\u{200D}\u{1F4BB}")]
1331 ManTechnologist,
1332 #[serde(rename = "\u{1F440}")]
1334 Eyes,
1335 #[serde(rename = "\u{1F383}")]
1337 JackOLantern,
1338 #[serde(rename = "\u{1F648}")]
1340 SeeNoEvilMonkey,
1341 #[serde(rename = "\u{1F607}")]
1343 SmilingFaceWithHalo,
1344 #[serde(rename = "\u{1F628}")]
1346 FearfulFace,
1347 #[serde(rename = "\u{1F91D}")]
1349 Handshake,
1350 #[serde(rename = "\u{270D}")]
1352 WritingHand,
1353 #[serde(rename = "\u{1F917}")]
1355 HuggingFace,
1356 #[serde(rename = "\u{1FAE1}")]
1358 SalutingFace,
1359 #[serde(rename = "\u{1F385}")]
1361 FatherChristmas,
1362 #[serde(rename = "\u{1F384}")]
1364 ChristmasTree,
1365 #[serde(rename = "\u{2603}")]
1367 Snowman,
1368 #[serde(rename = "\u{1F485}")]
1370 NailPolish,
1371 #[serde(rename = "\u{1F92A}")]
1373 GrinningFaceWithOneLargeAndOneSmallEye,
1374 #[serde(rename = "\u{1F5FF}")]
1376 Moyai,
1377 #[serde(rename = "\u{1F192}")]
1379 SquaredCool,
1380 #[serde(rename = "\u{1F498}")]
1382 HeartWithArrow,
1383 #[serde(rename = "\u{1F649}")]
1385 HearNoEvilMonkey,
1386 #[serde(rename = "\u{1F984}")]
1388 UnicornFace,
1389 #[serde(rename = "\u{1F618}")]
1391 FaceThrowingAKiss,
1392 #[serde(rename = "\u{1F48A}")]
1394 Pill,
1395 #[serde(rename = "\u{1F64A}")]
1397 SpeakNoEvilMonkey,
1398 #[serde(rename = "\u{1F60E}")]
1400 SmilingFaceWithSunglasses,
1401 #[serde(rename = "\u{1F47E}")]
1403 AlienMonster,
1404 #[serde(rename = "\u{1F937}\u{200D}\u{2642}\u{FE0F}")]
1406 ManShrugging,
1407 #[serde(rename = "\u{1F937}")]
1409 Shrug,
1410 #[serde(rename = "\u{1F937}\u{200D}\u{2640}\u{FE0F}")]
1412 WomanShrugging,
1413 #[serde(rename = "\u{1F621}")]
1415 PoutingFace,
1416}
1417
1418macro_rules! impl_str_traits_snake {
1436 ($Enum:ident { $( $Variant:ident => $wire:expr ),+ $(,)? }) => {
1437 impl $Enum {
1438 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
1474impl_str_traits_snake!(ParseMode {
1477 Html => "HTML",
1478 MarkdownV2 => "MarkdownV2",
1479 Markdown => "Markdown",
1480});
1481
1482impl_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
1498impl_str_traits_snake!(ChatMemberStatus {
1501 Administrator => "administrator",
1502 Owner => "creator",
1503 Banned => "kicked",
1504 Left => "left",
1505 Member => "member",
1506 Restricted => "restricted",
1507});
1508
1509impl_str_traits_snake!(ChatType {
1512 Sender => "sender",
1513 Private => "private",
1514 Group => "group",
1515 Supergroup => "supergroup",
1516 Channel => "channel",
1517});
1518
1519impl_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
1544impl_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
1738pub mod bot_command_limit {
1742 pub const MIN_COMMAND: u32 = 1;
1744 pub const MAX_COMMAND: u32 = 32;
1746 pub const MIN_DESCRIPTION: u32 = 1;
1748 pub const MAX_DESCRIPTION: u32 = 256;
1750 pub const MAX_COMMAND_NUMBER: u32 = 100;
1752}
1753
1754pub mod bot_description_limit {
1756 pub const MAX_DESCRIPTION_LENGTH: u32 = 512;
1758 pub const MAX_SHORT_DESCRIPTION_LENGTH: u32 = 120;
1760}
1761
1762pub mod bot_name_limit {
1764 pub const MAX_NAME_LENGTH: u32 = 64;
1766}
1767
1768pub mod bulk_request_limit {
1770 pub const MIN_LIMIT: u32 = 1;
1772 pub const MAX_LIMIT: u32 = 100;
1774}
1775
1776pub mod business_limit {
1778 pub const CHAT_ACTIVITY_TIMEOUT: u32 = 86400;
1780 pub const MIN_NAME_LENGTH: u32 = 1;
1782 pub const MAX_NAME_LENGTH: u32 = 64;
1784 pub const MAX_USERNAME_LENGTH: u32 = 32;
1786 pub const MAX_BIO_LENGTH: u32 = 140;
1788 pub const MIN_GIFT_RESULTS: u32 = 1;
1790 pub const MAX_GIFT_RESULTS: u32 = 100;
1792 pub const MIN_STAR_COUNT: u32 = 1;
1794 pub const MAX_STAR_COUNT: u32 = 10000;
1796}
1797
1798pub mod callback_query_limit {
1800 pub const ANSWER_CALLBACK_QUERY_TEXT_LENGTH: u32 = 200;
1802}
1803
1804pub mod chat_id {
1806 pub const ANONYMOUS_ADMIN: i64 = 1_087_968_824;
1808 pub const SERVICE_CHAT: i64 = 777_000;
1810 pub const FAKE_CHANNEL: i64 = 136_817_688;
1812}
1813
1814pub mod chat_invite_link_limit {
1816 pub const MIN_MEMBER_LIMIT: u32 = 1;
1818 pub const MAX_MEMBER_LIMIT: u32 = 99999;
1820 pub const NAME_LENGTH: u32 = 32;
1822}
1823
1824pub mod chat_limit {
1826 pub const CHAT_ADMINISTRATOR_CUSTOM_TITLE_LENGTH: u32 = 16;
1828 pub const CHAT_DESCRIPTION_LENGTH: u32 = 255;
1830 pub const MIN_CHAT_TITLE_LENGTH: u32 = 1;
1832 pub const MAX_CHAT_TITLE_LENGTH: u32 = 128;
1834}
1835
1836pub mod chat_subscription_limit {
1838 pub const SUBSCRIPTION_PERIOD: u32 = 2_592_000;
1840 pub const MIN_PRICE: u32 = 1;
1842 pub const MAX_PRICE: u32 = 10000;
1844}
1845
1846pub mod chat_photo_size {
1848 pub const SMALL: u32 = 160;
1850 pub const BIG: u32 = 640;
1852}
1853
1854pub mod background_type_limit {
1856 pub const MAX_DIMMING: u32 = 100;
1858 pub const MAX_INTENSITY: u32 = 100;
1860}
1861
1862pub mod background_fill_limit {
1864 pub const MAX_ROTATION_ANGLE: u32 = 359;
1866}
1867
1868pub mod contact_limit {
1870 pub const VCARD: u32 = 2048;
1872}
1873
1874pub mod custom_emoji_sticker_limit {
1876 pub const CUSTOM_EMOJI_IDENTIFIER_LIMIT: u32 = 200;
1878}
1879
1880pub mod dice_limit {
1882 pub const MIN_VALUE: u32 = 1;
1884 pub const MAX_VALUE_BASKETBALL: u32 = 5;
1886 pub const MAX_VALUE_BOWLING: u32 = 6;
1888 pub const MAX_VALUE_DARTS: u32 = 6;
1890 pub const MAX_VALUE_DICE: u32 = 6;
1892 pub const MAX_VALUE_FOOTBALL: u32 = 5;
1894 pub const MAX_VALUE_SLOT_MACHINE: u32 = 64;
1896}
1897
1898pub mod file_size_limit {
1900 pub const FILESIZE_DOWNLOAD: u64 = 20_000_000;
1902 pub const FILESIZE_UPLOAD: u64 = 50_000_000;
1904 pub const FILESIZE_UPLOAD_LOCAL_MODE: u64 = 2_000_000_000;
1906 pub const FILESIZE_DOWNLOAD_LOCAL_MODE: u64 = u64::MAX;
1908 pub const PHOTOSIZE_UPLOAD: u64 = 10_000_000;
1910 pub const VOICE_NOTE_FILE_SIZE: u64 = 1_000_000;
1912}
1913
1914pub mod flood_limit {
1916 pub const MESSAGES_PER_SECOND_PER_CHAT: u32 = 1;
1918 pub const MESSAGES_PER_SECOND: u32 = 30;
1920 pub const MESSAGES_PER_MINUTE_PER_GROUP: u32 = 20;
1922 pub const PAID_MESSAGES_PER_SECOND: u32 = 1000;
1924}
1925
1926pub mod forum_icon_color {
1928 pub const BLUE: u32 = 0x6FB9F0;
1930 pub const YELLOW: u32 = 0xFFD67E;
1932 pub const PURPLE: u32 = 0xCB86DB;
1934 pub const GREEN: u32 = 0x8EEE98;
1936 pub const PINK: u32 = 0xFF93B2;
1938 pub const RED: u32 = 0xFB6F5F;
1940}
1941
1942pub mod forum_topic_limit {
1944 pub const MIN_NAME_LENGTH: u32 = 1;
1946 pub const MAX_NAME_LENGTH: u32 = 128;
1948}
1949
1950pub mod gift_limit {
1952 pub const MAX_TEXT_LENGTH: u32 = 128;
1954}
1955
1956pub mod giveaway_limit {
1958 pub const MAX_WINNERS: u32 = 100;
1960}
1961
1962pub mod inline_keyboard_button_limit {
1964 pub const MIN_CALLBACK_DATA: u32 = 1;
1966 pub const MAX_CALLBACK_DATA: u32 = 64;
1968 pub const MIN_COPY_TEXT: u32 = 1;
1970 pub const MAX_COPY_TEXT: u32 = 256;
1972}
1973
1974pub mod inline_keyboard_markup_limit {
1976 pub const TOTAL_BUTTON_NUMBER: u32 = 100;
1978 pub const BUTTONS_PER_ROW: u32 = 8;
1980}
1981
1982pub mod input_checklist_limit {
1984 pub const MIN_TITLE_LENGTH: u32 = 1;
1986 pub const MAX_TITLE_LENGTH: u32 = 255;
1988 pub const MIN_TEXT_LENGTH: u32 = 1;
1990 pub const MAX_TEXT_LENGTH: u32 = 100;
1992 pub const MIN_TASK_NUMBER: u32 = 1;
1994 pub const MAX_TASK_NUMBER: u32 = 30;
1996}
1997
1998pub mod input_story_content_limit {
2000 pub const PHOTOSIZE_UPLOAD: u64 = 10_000_000;
2002 pub const PHOTO_WIDTH: u32 = 1080;
2004 pub const PHOTO_HEIGHT: u32 = 1920;
2006 pub const VIDEOSIZE_UPLOAD: u64 = 30_000_000;
2008 pub const VIDEO_WIDTH: u32 = 720;
2010 pub const VIDEO_HEIGHT: u32 = 1080;
2012 pub const MAX_VIDEO_DURATION: u32 = 60;
2014}
2015
2016pub mod inline_query_limit {
2018 pub const RESULTS: u32 = 50;
2020 pub const MAX_OFFSET_LENGTH: u32 = 64;
2022 pub const MAX_QUERY_LENGTH: u32 = 256;
2024}
2025
2026pub mod inline_query_result_limit {
2028 pub const MIN_ID_LENGTH: u32 = 1;
2030 pub const MAX_ID_LENGTH: u32 = 64;
2032}
2033
2034pub mod inline_query_results_button_limit {
2036 pub const MIN_START_PARAMETER_LENGTH: u32 = 1;
2038 pub const MAX_START_PARAMETER_LENGTH: u32 = 64;
2040}
2041
2042pub mod invoice_limit {
2044 pub const MIN_TITLE_LENGTH: u32 = 1;
2046 pub const MAX_TITLE_LENGTH: u32 = 32;
2048 pub const MIN_DESCRIPTION_LENGTH: u32 = 1;
2050 pub const MAX_DESCRIPTION_LENGTH: u32 = 255;
2052 pub const MIN_PAYLOAD_LENGTH: u32 = 1;
2054 pub const MAX_PAYLOAD_LENGTH: u32 = 128;
2056 pub const MAX_TIP_AMOUNTS: u32 = 4;
2058 pub const MIN_STAR_COUNT: u32 = 1;
2060 pub const MAX_STAR_COUNT: u32 = 25000;
2062 pub const SUBSCRIPTION_PERIOD: f64 = 2_592_000.0;
2064 pub const SUBSCRIPTION_MAX_PRICE: u32 = 10000;
2066}
2067
2068pub mod keyboard_button_request_users_limit {
2070 pub const MIN_QUANTITY: u32 = 1;
2072 pub const MAX_QUANTITY: u32 = 10;
2074}
2075
2076pub mod location_limit {
2078 pub const MIN_CHAT_LOCATION_ADDRESS: u32 = 1;
2080 pub const MAX_CHAT_LOCATION_ADDRESS: u32 = 64;
2082 pub const HORIZONTAL_ACCURACY: u32 = 1500;
2084 pub const MIN_HEADING: u32 = 1;
2086 pub const MAX_HEADING: u32 = 360;
2088 pub const MIN_LIVE_PERIOD: u32 = 60;
2090 pub const MAX_LIVE_PERIOD: u32 = 86400;
2092 pub const LIVE_PERIOD_FOREVER: u32 = 0x7FFF_FFFF;
2094 pub const MIN_PROXIMITY_ALERT_RADIUS: u32 = 1;
2096 pub const MAX_PROXIMITY_ALERT_RADIUS: u32 = 100_000;
2098}
2099
2100pub mod media_group_limit {
2102 pub const MIN_MEDIA_LENGTH: u32 = 2;
2104 pub const MAX_MEDIA_LENGTH: u32 = 10;
2106}
2107
2108pub mod message_limit {
2110 pub const MAX_TEXT_LENGTH: u32 = 4096;
2112 pub const CAPTION_LENGTH: u32 = 1024;
2114 pub const MIN_TEXT_LENGTH: u32 = 1;
2116 pub const DEEP_LINK_LENGTH: u32 = 64;
2118 pub const MESSAGE_ENTITIES: u32 = 100;
2120}
2121
2122pub mod nanostar {
2124 pub const VALUE: f64 = 1.0 / 1_000_000_000.0;
2126}
2127
2128pub mod nanostar_limit {
2130 pub const MIN_AMOUNT: i64 = -999_999_999;
2132 pub const MAX_AMOUNT: i64 = 999_999_999;
2134}
2135
2136pub mod polling_limit {
2138 pub const MIN_LIMIT: u32 = 1;
2140 pub const MAX_LIMIT: u32 = 100;
2142}
2143
2144pub mod poll_limit {
2146 pub const MIN_QUESTION_LENGTH: u32 = 1;
2148 pub const MAX_QUESTION_LENGTH: u32 = 300;
2150 pub const MIN_OPTION_LENGTH: u32 = 1;
2152 pub const MAX_OPTION_LENGTH: u32 = 100;
2154 pub const MIN_OPTION_NUMBER: u32 = 2;
2156 pub const MAX_OPTION_NUMBER: u32 = 12;
2158 pub const MAX_EXPLANATION_LENGTH: u32 = 200;
2160 pub const MAX_EXPLANATION_LINE_FEEDS: u32 = 2;
2162 pub const MIN_OPEN_PERIOD: u32 = 5;
2164 pub const MAX_OPEN_PERIOD: u32 = 600;
2166}
2167
2168pub mod premium_subscription {
2170 pub const MAX_TEXT_LENGTH: u32 = 128;
2172 pub const MONTH_COUNT_THREE: u32 = 3;
2174 pub const MONTH_COUNT_SIX: u32 = 6;
2176 pub const MONTH_COUNT_TWELVE: u32 = 12;
2178 pub const STARS_THREE_MONTHS: u32 = 1000;
2180 pub const STARS_SIX_MONTHS: u32 = 1500;
2182 pub const STARS_TWELVE_MONTHS: u32 = 2500;
2184}
2185
2186pub mod reply_limit {
2188 pub const MIN_INPUT_FIELD_PLACEHOLDER: u32 = 1;
2190 pub const MAX_INPUT_FIELD_PLACEHOLDER: u32 = 64;
2192}
2193
2194pub mod star_transactions_limit {
2196 pub const MIN_LIMIT: u32 = 1;
2198 pub const MAX_LIMIT: u32 = 100;
2200}
2201
2202pub mod sticker_limit {
2204 pub const MIN_NAME_AND_TITLE: u32 = 1;
2206 pub const MAX_NAME_AND_TITLE: u32 = 64;
2208 pub const MIN_STICKER_EMOJI: u32 = 1;
2210 pub const MAX_STICKER_EMOJI: u32 = 20;
2212 pub const MAX_SEARCH_KEYWORDS: u32 = 20;
2214 pub const MAX_KEYWORD_LENGTH: u32 = 64;
2216}
2217
2218pub mod sticker_set_limit {
2220 pub const MIN_INITIAL_STICKERS: u32 = 1;
2222 pub const MAX_INITIAL_STICKERS: u32 = 50;
2224 pub const MAX_EMOJI_STICKERS: u32 = 200;
2226 pub const MAX_ANIMATED_STICKERS: u32 = 50;
2228 pub const MAX_STATIC_STICKERS: u32 = 120;
2230 pub const MAX_STATIC_THUMBNAIL_SIZE: u32 = 128;
2232 pub const MAX_ANIMATED_THUMBNAIL_SIZE: u32 = 32;
2234 pub const STATIC_THUMB_DIMENSIONS: u32 = 100;
2236}
2237
2238pub mod story_area_position_limit {
2240 pub const MAX_ROTATION_ANGLE: u32 = 360;
2242}
2243
2244pub mod story_area_type_limit {
2246 pub const MAX_LOCATION_AREAS: u32 = 10;
2248 pub const MAX_SUGGESTED_REACTION_AREAS: u32 = 5;
2250 pub const MAX_LINK_AREAS: u32 = 3;
2252 pub const MAX_WEATHER_AREAS: u32 = 3;
2254 pub const MAX_UNIQUE_GIFT_AREAS: u32 = 1;
2256}
2257
2258pub mod story_limit {
2260 pub const CAPTION_LENGTH: u32 = 2048;
2262 pub const ACTIVITY_SIX_HOURS: u32 = 6 * 3600;
2264 pub const ACTIVITY_TWELVE_HOURS: u32 = 12 * 3600;
2266 pub const ACTIVITY_ONE_DAY: u32 = 86400;
2268 pub const ACTIVITY_TWO_DAYS: u32 = 2 * 86400;
2270}
2271
2272pub mod suggested_post {
2274 pub const MIN_PRICE_STARS: u32 = 5;
2276 pub const MAX_PRICE_STARS: u32 = 100_000;
2278 pub const MIN_PRICE_NANOTONCOINS: u64 = 10_000_000;
2280 pub const MAX_PRICE_NANOTONCOINS: u64 = 10_000_000_000_000;
2282 pub const MIN_SEND_DATE: u32 = 300;
2284 pub const MAX_SEND_DATE: u32 = 2_678_400;
2286 pub const MAX_COMMENT_LENGTH: u32 = 128;
2288}
2289
2290pub mod user_profile_photos_limit {
2292 pub const MIN_LIMIT: u32 = 1;
2294 pub const MAX_LIMIT: u32 = 100;
2296}
2297
2298pub mod user_profile_audios_limit {
2300 pub const MIN_LIMIT: u32 = 1;
2302 pub const MAX_LIMIT: u32 = 100;
2304}
2305
2306pub mod webhook_limit {
2308 pub const MIN_CONNECTIONS_LIMIT: u32 = 1;
2310 pub const MAX_CONNECTIONS_LIMIT: u32 = 100;
2312 pub const MIN_SECRET_TOKEN_LENGTH: u32 = 1;
2314 pub const MAX_SECRET_TOKEN_LENGTH: u32 = 256;
2316}
2317
2318pub mod verify_limit {
2320 pub const MAX_TEXT_LENGTH: u32 = 70;
2322}
2323
2324pub mod tag_limit {
2326 pub const MAX_TAG_LENGTH: u32 = 16;
2328}