@grom.js/effect-tg 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +387 -22
  2. package/dist/BotApi.d.ts +32 -0
  3. package/dist/BotApi.d.ts.map +1 -1
  4. package/dist/BotApi.js +16 -0
  5. package/dist/BotApi.js.map +1 -1
  6. package/dist/BotApiError.js +1 -1
  7. package/dist/BotApiError.js.map +1 -1
  8. package/dist/Dialog.d.ts +24 -23
  9. package/dist/Dialog.d.ts.map +1 -1
  10. package/dist/Dialog.js +15 -17
  11. package/dist/Dialog.js.map +1 -1
  12. package/dist/Markup.d.ts +200 -11
  13. package/dist/Markup.d.ts.map +1 -1
  14. package/dist/Markup.js +39 -0
  15. package/dist/Markup.js.map +1 -1
  16. package/dist/Reply.d.ts +22 -0
  17. package/dist/Reply.d.ts.map +1 -0
  18. package/dist/Reply.js +18 -0
  19. package/dist/Reply.js.map +1 -0
  20. package/dist/Send.d.ts +16 -1
  21. package/dist/Send.d.ts.map +1 -1
  22. package/dist/Send.js +28 -5
  23. package/dist/Send.js.map +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/internal/botApi.gen.d.ts +263 -191
  29. package/dist/internal/botApi.gen.d.ts.map +1 -1
  30. package/dist/internal/dialog.d.ts +4 -4
  31. package/dist/internal/dialog.d.ts.map +1 -1
  32. package/dist/internal/dialog.js +12 -13
  33. package/dist/internal/dialog.js.map +1 -1
  34. package/dist/internal/send.d.ts +4 -1
  35. package/dist/internal/send.d.ts.map +1 -1
  36. package/dist/internal/send.js +150 -6
  37. package/dist/internal/send.js.map +1 -1
  38. package/package.json +11 -10
  39. package/src/BotApi.ts +62 -0
  40. package/src/BotApiError.ts +1 -1
  41. package/src/Dialog.ts +31 -30
  42. package/src/Markup.ts +251 -11
  43. package/src/Reply.ts +36 -0
  44. package/src/Send.ts +51 -17
  45. package/src/index.ts +1 -0
  46. package/src/internal/botApi.gen.ts +267 -191
  47. package/src/internal/dialog.ts +16 -17
  48. package/src/internal/send.ts +170 -6
@@ -95,6 +95,8 @@ export interface BotApi {
95
95
  setMessageReaction: BotApiMethod<'setMessageReaction'>;
96
96
  /** Use this method to get a list of profile pictures for a user. Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object. */
97
97
  getUserProfilePhotos: BotApiMethod<'getUserProfilePhotos'>;
98
+ /** Use this method to get a list of profile audios for a user. Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object. */
99
+ getUserProfileAudios: BotApiMethod<'getUserProfileAudios'>;
98
100
  /** Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method [requestEmojiStatusAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps). Returns _True_ on success. */
99
101
  setUserEmojiStatus: BotApiMethod<'setUserEmojiStatus'>;
100
102
  /**
@@ -169,7 +171,7 @@ export interface BotApi {
169
171
  deleteChatStickerSet: BotApiMethod<'deleteChatStickerSet'>;
170
172
  /** Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects. */
171
173
  getForumTopicIconStickers: BotApiMethod<'getForumTopicIconStickers'>;
172
- /** Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights. Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object. */
174
+ /** Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator right. Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object. */
173
175
  createForumTopic: BotApiMethod<'createForumTopic'>;
174
176
  /** Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the _can\_manage\_topics_ administrator rights, unless it is the creator of the topic. Returns _True_ on success. */
175
177
  editForumTopic: BotApiMethod<'editForumTopic'>;
@@ -221,6 +223,10 @@ export interface BotApi {
221
223
  setMyShortDescription: BotApiMethod<'setMyShortDescription'>;
222
224
  /** Use this method to get the current bot short description for the given user language. Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success. */
223
225
  getMyShortDescription: BotApiMethod<'getMyShortDescription'>;
226
+ /** Changes the profile photo of the bot. Returns _True_ on success. */
227
+ setMyProfilePhoto: BotApiMethod<'setMyProfilePhoto'>;
228
+ /** Removes the profile photo of the bot. Requires no parameters. Returns _True_ on success. */
229
+ removeMyProfilePhoto: BotApiMethod<'removeMyProfilePhoto'>;
224
230
  /** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns _True_ on success. */
225
231
  setChatMenuButton: BotApiMethod<'setChatMenuButton'>;
226
232
  /** Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns [MenuButton](https://core.telegram.org/bots/api#menubutton) on success. */
@@ -511,13 +517,15 @@ export declare namespace Types {
511
517
  has_main_web_app?: boolean;
512
518
  /** _True_, if the bot has forum topic mode enabled in private chats. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
513
519
  has_topics_enabled?: boolean;
520
+ /** _True_, if the bot allows users to create and delete topics in private chats. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
521
+ allows_users_to_create_topics?: boolean;
514
522
  }
515
523
  /** This object represents a chat. */
516
524
  interface Chat {
517
525
  /** Unique identifier for this chat. */
518
526
  id: number;
519
527
  /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
520
- type: string;
528
+ type: 'private' | 'group' | 'supergroup' | 'channel';
521
529
  /** Title, for supergroups, channels and group chats */
522
530
  title?: string;
523
531
  /** Username, for private chats, supergroups and channels if available */
@@ -536,7 +544,7 @@ export declare namespace Types {
536
544
  /** Unique identifier for this chat. */
537
545
  id: number;
538
546
  /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
539
- type: string;
547
+ type: 'private' | 'group' | 'supergroup' | 'channel';
540
548
  /** Title, for supergroups, channels and group chats */
541
549
  title?: string;
542
550
  /** Username, for private chats, supergroups and channels if available */
@@ -629,6 +637,8 @@ export declare namespace Types {
629
637
  location?: Types.ChatLocation;
630
638
  /** For private chats, the rating of the user if any */
631
639
  rating?: Types.UserRating;
640
+ /** For private chats, the first audio added to the profile of the user */
641
+ first_profile_audio?: Types.Audio;
632
642
  /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
633
643
  unique_gift_colors?: Types.UniqueGiftColors;
634
644
  /** The number of Telegram Stars a general user have to pay to send a message to the chat */
@@ -744,6 +754,10 @@ export declare namespace Types {
744
754
  new_chat_members?: Array<Types.User>;
745
755
  /** A member was removed from the group, information about them (this member may be the bot itself) */
746
756
  left_chat_member?: Types.User;
757
+ /** Service message: chat owner has left */
758
+ chat_owner_left?: Types.ChatOwnerLeft;
759
+ /** Service message: chat owner has changed */
760
+ chat_owner_changed?: Types.ChatOwnerChanged;
747
761
  /** A chat title was changed to this value */
748
762
  new_chat_title?: string;
749
763
  /** A chat photo was change to this value */
@@ -855,7 +869,7 @@ export declare namespace Types {
855
869
  /** Unique message identifier inside the chat */
856
870
  message_id: number;
857
871
  /** Always 0. The field can be used to differentiate regular and inaccessible messages. */
858
- date: number;
872
+ date: 0;
859
873
  }
860
874
  /**
861
875
  * This object describes a message that can be inaccessible to the bot. It can be one of
@@ -867,7 +881,7 @@ export declare namespace Types {
867
881
  /** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
868
882
  interface MessageEntity {
869
883
  /** Type of the entity. Currently, can be “mention” (`@username`), “hashtag” (`#hashtag` or `#hashtag@chatusername`), “cashtag” (`$USD` or `$USD@chatusername`), “bot\_command” (`/start@jobs_bot`), “url” (`https://telegram.org`), “email” (`do-not-reply@telegram.org`), “phone\_number” (`+1-212-555-0123`), “bold” (**bold text**), “italic” (_italic text_), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable\_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text\_link” (for clickable text URLs), “text\_mention” (for users [without usernames](https://telegram.org/blog/edit#new-mentions)), “custom\_emoji” (for inline custom emoji stickers) */
870
- type: string;
884
+ type: 'mention' | 'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'blockquote' | 'expandable_blockquote' | 'code' | 'pre' | 'text_link' | 'text_mention' | 'custom_emoji';
871
885
  /** Offset in [UTF-16 code units](https://core.telegram.org/api/entities#entity-length) to the start of the entity */
872
886
  offset: number;
873
887
  /** Length of the entity in [UTF-16 code units](https://core.telegram.org/api/entities#entity-length) */
@@ -956,7 +970,7 @@ export declare namespace Types {
956
970
  /** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities. The message will fail to send if the quote isn't found in the original message. */
957
971
  quote?: string;
958
972
  /** Mode for parsing entities in the quote. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
959
- quote_parse_mode?: string;
973
+ quote_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
960
974
  /** An array of special entities that appear in the quote. It can be specified instead of _quote\_parse\_mode_. */
961
975
  quote_entities?: Array<Types.MessageEntity>;
962
976
  /** Position of the quote in the original message in UTF-16 code units */
@@ -976,7 +990,7 @@ export declare namespace Types {
976
990
  /** The message was originally sent by a known user. */
977
991
  interface MessageOriginUser {
978
992
  /** Type of the message origin, always “user” */
979
- type: string;
993
+ type: 'user';
980
994
  /** Date the message was sent originally in Unix time */
981
995
  date: number;
982
996
  /** User that sent the message originally */
@@ -985,7 +999,7 @@ export declare namespace Types {
985
999
  /** The message was originally sent by an unknown user. */
986
1000
  interface MessageOriginHiddenUser {
987
1001
  /** Type of the message origin, always “hidden\_user” */
988
- type: string;
1002
+ type: 'hidden_user';
989
1003
  /** Date the message was sent originally in Unix time */
990
1004
  date: number;
991
1005
  /** Name of the user that sent the message originally */
@@ -994,7 +1008,7 @@ export declare namespace Types {
994
1008
  /** The message was originally sent on behalf of a chat to a group chat. */
995
1009
  interface MessageOriginChat {
996
1010
  /** Type of the message origin, always “chat” */
997
- type: string;
1011
+ type: 'chat';
998
1012
  /** Date the message was sent originally in Unix time */
999
1013
  date: number;
1000
1014
  /** Chat that sent the message originally */
@@ -1005,7 +1019,7 @@ export declare namespace Types {
1005
1019
  /** The message was originally sent to a channel chat. */
1006
1020
  interface MessageOriginChannel {
1007
1021
  /** Type of the message origin, always “channel” */
1008
- type: string;
1022
+ type: 'channel';
1009
1023
  /** Date the message was sent originally in Unix time */
1010
1024
  date: number;
1011
1025
  /** Channel chat to which the message was originally sent */
@@ -1092,6 +1106,21 @@ export declare namespace Types {
1092
1106
  /** Unique identifier for the story in the chat */
1093
1107
  id: number;
1094
1108
  }
1109
+ /** This object represents a video file of a specific quality. */
1110
+ interface VideoQuality {
1111
+ /** Identifier for this file, which can be used to download or reuse the file */
1112
+ file_id: string;
1113
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
1114
+ file_unique_id: string;
1115
+ /** Video width */
1116
+ width: number;
1117
+ /** Video height */
1118
+ height: number;
1119
+ /** Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” */
1120
+ codec: 'h264' | 'h265' | 'av01';
1121
+ /** File size in bytes. */
1122
+ file_size?: number;
1123
+ }
1095
1124
  /** This object represents a video file. */
1096
1125
  interface Video {
1097
1126
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -1110,6 +1139,8 @@ export declare namespace Types {
1110
1139
  cover?: Array<Types.PhotoSize>;
1111
1140
  /** Timestamp in seconds from which the video will play in the message */
1112
1141
  start_timestamp?: number;
1142
+ /** List of available qualities of the video */
1143
+ qualities?: Array<Types.VideoQuality>;
1113
1144
  /** Original filename as defined by the sender */
1114
1145
  file_name?: string;
1115
1146
  /** MIME type of the file as defined by the sender */
@@ -1163,7 +1194,7 @@ export declare namespace Types {
1163
1194
  /** The paid media isn't available before the payment. */
1164
1195
  interface PaidMediaPreview {
1165
1196
  /** Type of the paid media, always “preview” */
1166
- type: string;
1197
+ type: 'preview';
1167
1198
  /** Media width as defined by the sender */
1168
1199
  width?: number;
1169
1200
  /** Media height as defined by the sender */
@@ -1174,14 +1205,14 @@ export declare namespace Types {
1174
1205
  /** The paid media is a photo. */
1175
1206
  interface PaidMediaPhoto {
1176
1207
  /** Type of the paid media, always “photo” */
1177
- type: string;
1208
+ type: 'photo';
1178
1209
  /** The photo */
1179
1210
  photo: Array<Types.PhotoSize>;
1180
1211
  }
1181
1212
  /** The paid media is a video. */
1182
1213
  interface PaidMediaVideo {
1183
1214
  /** Type of the paid media, always “video” */
1184
- type: string;
1215
+ type: 'video';
1185
1216
  /** The video */
1186
1217
  video: Types.Video;
1187
1218
  }
@@ -1201,7 +1232,7 @@ export declare namespace Types {
1201
1232
  /** This object represents an animated emoji that displays a random value. */
1202
1233
  interface Dice {
1203
1234
  /** Emoji on which the dice throw animation is based */
1204
- emoji: string;
1235
+ emoji: '🎲' | '🎯' | '🎳' | '🏀' | '⚽' | '🎰';
1205
1236
  /** Value of the dice, 1-6 for “![🎲](//telegram.org/img/emoji/40/F09F8EB2.png)”, “![🎯](//telegram.org/img/emoji/40/F09F8EAF.png)” and “![🎳](//telegram.org/img/emoji/40/F09F8EB3.png)” base emoji, 1-5 for “![🏀](//telegram.org/img/emoji/40/F09F8F80.png)” and “![⚽](//telegram.org/img/emoji/40/E29ABD.png)” base emoji, 1-64 for “![🎰](//telegram.org/img/emoji/40/F09F8EB0.png)” base emoji */
1206
1237
  value: number;
1207
1238
  }
@@ -1219,7 +1250,7 @@ export declare namespace Types {
1219
1250
  /** Option text, 1-100 characters */
1220
1251
  text: string;
1221
1252
  /** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. Currently, only custom emoji entities are allowed */
1222
- text_parse_mode?: string;
1253
+ text_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
1223
1254
  /** An array of special entities that appear in the poll option text. It can be specified instead of _text\_parse\_mode_ */
1224
1255
  text_entities?: Array<Types.MessageEntity>;
1225
1256
  }
@@ -1251,7 +1282,7 @@ export declare namespace Types {
1251
1282
  /** _True_, if the poll is anonymous */
1252
1283
  is_anonymous: boolean;
1253
1284
  /** Poll type, currently can be “regular” or “quiz” */
1254
- type: string;
1285
+ type: 'regular' | 'quiz';
1255
1286
  /** _True_, if the poll allows multiple answers */
1256
1287
  allows_multiple_answers: boolean;
1257
1288
  /** 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
@@ -1300,7 +1331,7 @@ export declare namespace Types {
1300
1331
  /** Text of the task; 1-100 characters after entities parsing */
1301
1332
  text: string;
1302
1333
  /** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
1303
- parse_mode?: string;
1334
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
1304
1335
  /** List of special entities that appear in the text, which can be specified instead of parse\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities are allowed. */
1305
1336
  text_entities?: Array<Types.MessageEntity>;
1306
1337
  }
@@ -1309,7 +1340,7 @@ export declare namespace Types {
1309
1340
  /** Title of the checklist; 1-255 characters after entities parsing */
1310
1341
  title: string;
1311
1342
  /** Mode for parsing entities in the title. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
1312
- parse_mode?: string;
1343
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
1313
1344
  /** List of special entities that appear in the title, which can be specified instead of parse\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities are allowed. */
1314
1345
  title_entities?: Array<Types.MessageEntity>;
1315
1346
  /** List of 1-30 tasks in the checklist */
@@ -1404,14 +1435,14 @@ export declare namespace Types {
1404
1435
  /** The background is filled using the selected color. */
1405
1436
  interface BackgroundFillSolid {
1406
1437
  /** Type of the background fill, always “solid” */
1407
- type: string;
1438
+ type: 'solid';
1408
1439
  /** The color of the background fill in the RGB24 format */
1409
1440
  color: number;
1410
1441
  }
1411
1442
  /** The background is a gradient fill. */
1412
1443
  interface BackgroundFillGradient {
1413
1444
  /** Type of the background fill, always “gradient” */
1414
- type: string;
1445
+ type: 'gradient';
1415
1446
  /** Top color of the gradient in the RGB24 format */
1416
1447
  top_color: number;
1417
1448
  /** Bottom color of the gradient in the RGB24 format */
@@ -1422,7 +1453,7 @@ export declare namespace Types {
1422
1453
  /** The background is a freeform gradient that rotates after every message in the chat. */
1423
1454
  interface BackgroundFillFreeformGradient {
1424
1455
  /** Type of the background fill, always “freeform\_gradient” */
1425
- type: string;
1456
+ type: 'freeform_gradient';
1426
1457
  /** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
1427
1458
  colors: Array<number>;
1428
1459
  }
@@ -1438,7 +1469,7 @@ export declare namespace Types {
1438
1469
  /** The background is automatically filled based on the selected colors. */
1439
1470
  interface BackgroundTypeFill {
1440
1471
  /** Type of the background, always “fill” */
1441
- type: string;
1472
+ type: 'fill';
1442
1473
  /** The background fill */
1443
1474
  fill: Types.BackgroundFill;
1444
1475
  /** Dimming of the background in dark themes, as a percentage; 0-100 */
@@ -1447,7 +1478,7 @@ export declare namespace Types {
1447
1478
  /** The background is a wallpaper in the JPEG format. */
1448
1479
  interface BackgroundTypeWallpaper {
1449
1480
  /** Type of the background, always “wallpaper” */
1450
- type: string;
1481
+ type: 'wallpaper';
1451
1482
  /** Document with the wallpaper */
1452
1483
  document: Types.Document;
1453
1484
  /** Dimming of the background in dark themes, as a percentage; 0-100 */
@@ -1460,7 +1491,7 @@ export declare namespace Types {
1460
1491
  /** The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
1461
1492
  interface BackgroundTypePattern {
1462
1493
  /** Type of the background, always “pattern” */
1463
- type: string;
1494
+ type: 'pattern';
1464
1495
  /** Document with the pattern */
1465
1496
  document: Types.Document;
1466
1497
  /** The background fill that is combined with the pattern */
@@ -1475,7 +1506,7 @@ export declare namespace Types {
1475
1506
  /** The background is taken directly from a built-in chat theme. */
1476
1507
  interface BackgroundTypeChatTheme {
1477
1508
  /** Type of the background, always “chat\_theme” */
1478
- type: string;
1509
+ type: 'chat_theme';
1479
1510
  /** Name of the chat theme, which is usually an emoji */
1480
1511
  theme_name: string;
1481
1512
  }
@@ -1614,7 +1645,7 @@ export declare namespace Types {
1614
1645
  /** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
1615
1646
  suggested_post_message?: Types.Message;
1616
1647
  /** Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins */
1617
- currency: string;
1648
+ currency: 'XTR' | 'TON';
1618
1649
  /** The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only */
1619
1650
  amount?: number;
1620
1651
  /** The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only */
@@ -1625,7 +1656,7 @@ export declare namespace Types {
1625
1656
  /** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
1626
1657
  suggested_post_message?: Types.Message;
1627
1658
  /** Reason for the refund. Currently, one of “post\_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment\_refunded” if the payer refunded their payment. */
1628
- reason: string;
1659
+ reason: 'post_deleted' | 'payment_refunded';
1629
1660
  }
1630
1661
  /** This object represents a service message about the creation of a scheduled giveaway. */
1631
1662
  interface GiveawayCreated {
@@ -1707,14 +1738,14 @@ export declare namespace Types {
1707
1738
  /** Describes the price of a suggested post. */
1708
1739
  interface SuggestedPostPrice {
1709
1740
  /** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
1710
- currency: string;
1741
+ currency: 'XTR' | 'TON';
1711
1742
  /** The amount of the currency that will be paid for the post in the _smallest units_ of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. */
1712
1743
  amount: number;
1713
1744
  }
1714
1745
  /** Contains information about a suggested post. */
1715
1746
  interface SuggestedPostInfo {
1716
1747
  /** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
1717
- state: string;
1748
+ state: 'pending' | 'approved' | 'declined';
1718
1749
  /** Proposed price of the post. If the field is omitted, then the post is unpaid. */
1719
1750
  price?: Types.SuggestedPostPrice;
1720
1751
  /** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. */
@@ -1741,6 +1772,13 @@ export declare namespace Types {
1741
1772
  /** Requested profile pictures (in up to 4 sizes each) */
1742
1773
  photos: Array<Array<Types.PhotoSize>>;
1743
1774
  }
1775
+ /** This object represents the audios displayed on a user's profile. */
1776
+ interface UserProfileAudios {
1777
+ /** Total number of profile audios for the target user */
1778
+ total_count: number;
1779
+ /** Requested profile audios */
1780
+ audios: Array<Types.Audio>;
1781
+ }
1744
1782
  /**
1745
1783
  * This object represents a file ready to be downloaded. The file can be downloaded via the link `https://api.telegram.org/file/bot<token>/<file_path>`. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling [getFile](https://core.telegram.org/bots/api#getfile).
1746
1784
  *
@@ -1764,7 +1802,7 @@ export declare namespace Types {
1764
1802
  /** This object represents a [custom keyboard](https://core.telegram.org/bots/features#keyboards) with reply options (see [Introduction to bots](https://core.telegram.org/bots/features#keyboards) for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
1765
1803
  interface ReplyKeyboardMarkup {
1766
1804
  /** Array of button rows, each represented by an Array of [KeyboardButton](https://core.telegram.org/bots/api#keyboardbutton) objects */
1767
- keyboard: Array<Array<Types.KeyboardButton>>;
1805
+ keyboard: Array<Array<string | Types.KeyboardButton>>;
1768
1806
  /** Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to _false_, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
1769
1807
  is_persistent?: boolean;
1770
1808
  /** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to _false_, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
@@ -1780,14 +1818,14 @@ export declare namespace Types {
1780
1818
  */
1781
1819
  selective?: boolean;
1782
1820
  }
1783
- /**
1784
- * This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, _String_ can be used instead of this object to specify the button text.
1785
- *
1786
- * **Note:** _request\_users_ and _request\_chat_ options will only work in Telegram versions released after 3 February, 2023. Older clients will display _unsupported message_.
1787
- */
1821
+ /** This object represents one button of the reply keyboard. At most one of the fields other than _text_, _icon\_custom\_emoji\_id_, and _style_ must be used to specify the type of the button. For simple text buttons, _String_ can be used instead of this object to specify the button text. */
1788
1822
  interface KeyboardButton {
1789
- /** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
1823
+ /** Text of the button. If none of the fields other than _text_, _icon\_custom\_emoji\_id_, and _style_ are used, it will be sent as a message when the button is pressed */
1790
1824
  text: string;
1825
+ /** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on [Fragment](https://fragment.com/) or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
1826
+ icon_custom_emoji_id?: string;
1827
+ /** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
1828
+ style?: 'danger' | 'success' | 'primary';
1791
1829
  /** If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users\_shared” service message. Available in private chats only. */
1792
1830
  request_users?: Types.KeyboardButtonRequestUsers;
1793
1831
  /** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat\_shared” service message. Available in private chats only. */
@@ -1846,7 +1884,7 @@ export declare namespace Types {
1846
1884
  /** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
1847
1885
  interface KeyboardButtonPollType {
1848
1886
  /** If _quiz_ is passed, the user will be allowed to create only polls in the quiz mode. If _regular_ is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
1849
- type?: string;
1887
+ type?: 'quiz' | 'regular';
1850
1888
  }
1851
1889
  /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see [ReplyKeyboardMarkup](https://core.telegram.org/bots/api#replykeyboardmarkup)). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
1852
1890
  interface ReplyKeyboardRemove {
@@ -1864,10 +1902,14 @@ export declare namespace Types {
1864
1902
  /** Array of button rows, each represented by an Array of [InlineKeyboardButton](https://core.telegram.org/bots/api#inlinekeyboardbutton) objects */
1865
1903
  inline_keyboard: Array<Array<Types.InlineKeyboardButton>>;
1866
1904
  }
1867
- /** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
1905
+ /** This object represents one button of an inline keyboard. Exactly one of the fields other than _text_, _icon\_custom\_emoji\_id_, and _style_ must be used to specify the type of the button. */
1868
1906
  interface InlineKeyboardButton {
1869
1907
  /** Label text on the button */
1870
1908
  text: string;
1909
+ /** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on [Fragment](https://fragment.com/) or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
1910
+ icon_custom_emoji_id?: string;
1911
+ /** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
1912
+ style?: 'danger' | 'success' | 'primary';
1871
1913
  /** HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. */
1872
1914
  url?: string;
1873
1915
  /** Data to be sent in a [callback query](https://core.telegram.org/bots/api#callbackquery) to the bot when the button is pressed, 1-64 bytes */
@@ -2085,7 +2127,7 @@ export declare namespace Types {
2085
2127
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that owns the chat and has all administrator privileges. */
2086
2128
  interface ChatMemberOwner {
2087
2129
  /** The member's status in the chat, always “creator” */
2088
- status: string;
2130
+ status: 'creator';
2089
2131
  /** Information about the user */
2090
2132
  user: Types.User;
2091
2133
  /** _True_, if the user's presence in the chat is hidden */
@@ -2096,7 +2138,7 @@ export declare namespace Types {
2096
2138
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that has some additional privileges. */
2097
2139
  interface ChatMemberAdministrator {
2098
2140
  /** The member's status in the chat, always “administrator” */
2099
- status: string;
2141
+ status: 'administrator';
2100
2142
  /** Information about the user */
2101
2143
  user: Types.User;
2102
2144
  /** _True_, if the bot is allowed to edit administrator privileges of that user */
@@ -2139,7 +2181,7 @@ export declare namespace Types {
2139
2181
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that has no additional privileges or restrictions. */
2140
2182
  interface ChatMemberMember {
2141
2183
  /** The member's status in the chat, always “member” */
2142
- status: string;
2184
+ status: 'member';
2143
2185
  /** Information about the user */
2144
2186
  user: Types.User;
2145
2187
  /** Date when the user's subscription will expire; Unix time */
@@ -2148,7 +2190,7 @@ export declare namespace Types {
2148
2190
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that is under certain restrictions in the chat. Supergroups only. */
2149
2191
  interface ChatMemberRestricted {
2150
2192
  /** The member's status in the chat, always “restricted” */
2151
- status: string;
2193
+ status: 'restricted';
2152
2194
  /** Information about the user */
2153
2195
  user: Types.User;
2154
2196
  /** _True_, if the user is a member of the chat at the moment of the request */
@@ -2187,14 +2229,14 @@ export declare namespace Types {
2187
2229
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that isn't currently a member of the chat, but may join it themselves. */
2188
2230
  interface ChatMemberLeft {
2189
2231
  /** The member's status in the chat, always “left” */
2190
- status: string;
2232
+ status: 'left';
2191
2233
  /** Information about the user */
2192
2234
  user: Types.User;
2193
2235
  }
2194
2236
  /** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that was banned in the chat and can't return to the chat or view chat messages. */
2195
2237
  interface ChatMemberBanned {
2196
2238
  /** The member's status in the chat, always “kicked” */
2197
- status: string;
2239
+ status: 'kicked';
2198
2240
  /** Information about the user */
2199
2241
  user: Types.User;
2200
2242
  /** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever */
@@ -2335,7 +2377,7 @@ export declare namespace Types {
2335
2377
  /** Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. */
2336
2378
  interface StoryAreaTypeLocation {
2337
2379
  /** Type of the area, always “location” */
2338
- type: string;
2380
+ type: 'location';
2339
2381
  /** Location latitude in degrees */
2340
2382
  latitude: number;
2341
2383
  /** Location longitude in degrees */
@@ -2346,7 +2388,7 @@ export declare namespace Types {
2346
2388
  /** Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. */
2347
2389
  interface StoryAreaTypeSuggestedReaction {
2348
2390
  /** Type of the area, always “suggested\_reaction” */
2349
- type: string;
2391
+ type: 'suggested_reaction';
2350
2392
  /** Type of the reaction */
2351
2393
  reaction_type: Types.ReactionType;
2352
2394
  /** Pass _True_ if the reaction area has a dark background */
@@ -2357,14 +2399,14 @@ export declare namespace Types {
2357
2399
  /** Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. */
2358
2400
  interface StoryAreaTypeLink {
2359
2401
  /** Type of the area, always “link” */
2360
- type: string;
2402
+ type: 'link';
2361
2403
  /** HTTP or tg:// URL to be opened when the area is clicked */
2362
2404
  url: string;
2363
2405
  }
2364
2406
  /** Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. */
2365
2407
  interface StoryAreaTypeWeather {
2366
2408
  /** Type of the area, always “weather” */
2367
- type: string;
2409
+ type: 'weather';
2368
2410
  /** Temperature, in degree Celsius */
2369
2411
  temperature: number;
2370
2412
  /** Emoji representing the weather */
@@ -2375,7 +2417,7 @@ export declare namespace Types {
2375
2417
  /** Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. */
2376
2418
  interface StoryAreaTypeUniqueGift {
2377
2419
  /** Type of the area, always “unique\_gift” */
2378
- type: string;
2420
+ type: 'unique_gift';
2379
2421
  /** Unique name of the gift */
2380
2422
  name: string;
2381
2423
  }
@@ -2404,21 +2446,21 @@ export declare namespace Types {
2404
2446
  /** The reaction is based on an emoji. */
2405
2447
  interface ReactionTypeEmoji {
2406
2448
  /** Type of the reaction, always “emoji” */
2407
- type: string;
2449
+ type: 'emoji';
2408
2450
  /** Reaction emoji. Currently, it can be one of "![❤](//telegram.org/img/emoji/40/E29DA4.png)", "![👍](//telegram.org/img/emoji/40/F09F918D.png)", "![👎](//telegram.org/img/emoji/40/F09F918E.png)", "![🔥](//telegram.org/img/emoji/40/F09F94A5.png)", "![🥰](//telegram.org/img/emoji/40/F09FA5B0.png)", "![👏](//telegram.org/img/emoji/40/F09F918F.png)", "![😁](//telegram.org/img/emoji/40/F09F9881.png)", "![🤔](//telegram.org/img/emoji/40/F09FA494.png)", "![🤯](//telegram.org/img/emoji/40/F09FA4AF.png)", "![😱](//telegram.org/img/emoji/40/F09F98B1.png)", "![🤬](//telegram.org/img/emoji/40/F09FA4AC.png)", "![😢](//telegram.org/img/emoji/40/F09F98A2.png)", "![🎉](//telegram.org/img/emoji/40/F09F8E89.png)", "![🤩](//telegram.org/img/emoji/40/F09FA4A9.png)", "![🤮](//telegram.org/img/emoji/40/F09FA4AE.png)", "![💩](//telegram.org/img/emoji/40/F09F92A9.png)", "![🙏](//telegram.org/img/emoji/40/F09F998F.png)", "![👌](//telegram.org/img/emoji/40/F09F918C.png)", "![🕊](//telegram.org/img/emoji/40/F09F958A.png)", "![🤡](//telegram.org/img/emoji/40/F09FA4A1.png)", "![🥱](//telegram.org/img/emoji/40/F09FA5B1.png)", "![🥴](//telegram.org/img/emoji/40/F09FA5B4.png)", "![😍](//telegram.org/img/emoji/40/F09F988D.png)", "![🐳](//telegram.org/img/emoji/40/F09F90B3.png)", "![❤‍🔥](//telegram.org/img/emoji/40/E29DA4E2808DF09F94A5.png)", "![🌚](//telegram.org/img/emoji/40/F09F8C9A.png)", "![🌭](//telegram.org/img/emoji/40/F09F8CAD.png)", "![💯](//telegram.org/img/emoji/40/F09F92AF.png)", "![🤣](//telegram.org/img/emoji/40/F09FA4A3.png)", "![⚡](//telegram.org/img/emoji/40/E29AA1.png)", "![🍌](//telegram.org/img/emoji/40/F09F8D8C.png)", "![🏆](//telegram.org/img/emoji/40/F09F8F86.png)", "![💔](//telegram.org/img/emoji/40/F09F9294.png)", "![🤨](//telegram.org/img/emoji/40/F09FA4A8.png)", "![😐](//telegram.org/img/emoji/40/F09F9890.png)", "![🍓](//telegram.org/img/emoji/40/F09F8D93.png)", "![🍾](//telegram.org/img/emoji/40/F09F8DBE.png)", "![💋](//telegram.org/img/emoji/40/F09F928B.png)", "![🖕](//telegram.org/img/emoji/40/F09F9695.png)", "![😈](//telegram.org/img/emoji/40/F09F9888.png)", "![😴](//telegram.org/img/emoji/40/F09F98B4.png)", "![😭](//telegram.org/img/emoji/40/F09F98AD.png)", "![🤓](//telegram.org/img/emoji/40/F09FA493.png)", "![👻](//telegram.org/img/emoji/40/F09F91BB.png)", "![👨‍💻](//telegram.org/img/emoji/40/F09F91A8E2808DF09F92BB.png)", "![👀](//telegram.org/img/emoji/40/F09F9180.png)", "![🎃](//telegram.org/img/emoji/40/F09F8E83.png)", "![🙈](//telegram.org/img/emoji/40/F09F9988.png)", "![😇](//telegram.org/img/emoji/40/F09F9887.png)", "![😨](//telegram.org/img/emoji/40/F09F98A8.png)", "![🤝](//telegram.org/img/emoji/40/F09FA49D.png)", "![✍](//telegram.org/img/emoji/40/E29C8D.png)", "![🤗](//telegram.org/img/emoji/40/F09FA497.png)", "![🫡](//telegram.org/img/emoji/40/F09FABA1.png)", "![🎅](//telegram.org/img/emoji/40/F09F8E85.png)", "![🎄](//telegram.org/img/emoji/40/F09F8E84.png)", "![☃](//telegram.org/img/emoji/40/E29883.png)", "![💅](//telegram.org/img/emoji/40/F09F9285.png)", "![🤪](//telegram.org/img/emoji/40/F09FA4AA.png)", "![🗿](//telegram.org/img/emoji/40/F09F97BF.png)", "![🆒](//telegram.org/img/emoji/40/F09F8692.png)", "![💘](//telegram.org/img/emoji/40/F09F9298.png)", "![🙉](//telegram.org/img/emoji/40/F09F9989.png)", "![🦄](//telegram.org/img/emoji/40/F09FA684.png)", "![😘](//telegram.org/img/emoji/40/F09F9898.png)", "![💊](//telegram.org/img/emoji/40/F09F928A.png)", "![🙊](//telegram.org/img/emoji/40/F09F998A.png)", "![😎](//telegram.org/img/emoji/40/F09F988E.png)", "![👾](//telegram.org/img/emoji/40/F09F91BE.png)", "![🤷‍♂](//telegram.org/img/emoji/40/F09FA4B7E2808DE29982.png)", "![🤷](//telegram.org/img/emoji/40/F09FA4B7.png)", "![🤷‍♀](//telegram.org/img/emoji/40/F09FA4B7E2808DE29980.png)", "![😡](//telegram.org/img/emoji/40/F09F98A1.png)" */
2409
2451
  emoji: string;
2410
2452
  }
2411
2453
  /** The reaction is based on a custom emoji. */
2412
2454
  interface ReactionTypeCustomEmoji {
2413
2455
  /** Type of the reaction, always “custom\_emoji” */
2414
- type: string;
2456
+ type: 'custom_emoji';
2415
2457
  /** Custom emoji identifier */
2416
2458
  custom_emoji_id: string;
2417
2459
  }
2418
2460
  /** The reaction is paid. */
2419
2461
  interface ReactionTypePaid {
2420
2462
  /** Type of the reaction, always “paid” */
2421
- type: string;
2463
+ type: 'paid';
2422
2464
  }
2423
2465
  /** Represents a reaction added to a message along with the number of times it was added. */
2424
2466
  interface ReactionCount {
@@ -2517,8 +2559,10 @@ export declare namespace Types {
2517
2559
  name: string;
2518
2560
  /** The sticker that represents the unique gift */
2519
2561
  sticker: Types.Sticker;
2520
- /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
2562
+ /** The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts. */
2521
2563
  rarity_per_mille: number;
2564
+ /** Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”. */
2565
+ rarity?: 'uncommon' | 'rare' | 'epic' | 'legendary';
2522
2566
  }
2523
2567
  /** This object describes the symbol shown on the pattern of a unique gift. */
2524
2568
  interface UniqueGiftSymbol {
@@ -2582,6 +2626,8 @@ export declare namespace Types {
2582
2626
  backdrop: Types.UniqueGiftBackdrop;
2583
2627
  /** _True_, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers */
2584
2628
  is_premium?: true;
2629
+ /** _True_, if the gift was used to craft another gift and isn't available anymore */
2630
+ is_burned?: true;
2585
2631
  /** _True_, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram */
2586
2632
  is_from_blockchain?: true;
2587
2633
  /** The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only */
@@ -2617,9 +2663,9 @@ export declare namespace Types {
2617
2663
  /** Information about the gift */
2618
2664
  gift: Types.UniqueGift;
2619
2665
  /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted\_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers */
2620
- origin: string;
2666
+ origin: 'upgrade' | 'transfer' | 'resale' | 'gifted_upgrade' | 'offer';
2621
2667
  /** For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. */
2622
- last_resale_currency?: string;
2668
+ last_resale_currency?: 'XTR' | 'TON';
2623
2669
  /** For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins */
2624
2670
  last_resale_amount?: number;
2625
2671
  /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
@@ -2639,7 +2685,7 @@ export declare namespace Types {
2639
2685
  /** Describes a regular gift owned by a user or a chat. */
2640
2686
  interface OwnedGiftRegular {
2641
2687
  /** Type of the gift, always “regular” */
2642
- type: string;
2688
+ type: 'regular';
2643
2689
  /** Information about the regular gift */
2644
2690
  gift: Types.Gift;
2645
2691
  /** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
@@ -2672,7 +2718,7 @@ export declare namespace Types {
2672
2718
  /** Describes a unique gift received and owned by a user or a chat. */
2673
2719
  interface OwnedGiftUnique {
2674
2720
  /** Type of the gift, always “unique” */
2675
- type: string;
2721
+ type: 'unique';
2676
2722
  /** Information about the unique gift */
2677
2723
  gift: Types.UniqueGift;
2678
2724
  /** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
@@ -2741,41 +2787,41 @@ export declare namespace Types {
2741
2787
  /** Represents the default [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands. Default commands are used if no commands with a [narrower scope](https://core.telegram.org/bots/api#determining-list-of-commands) are specified for the user. */
2742
2788
  interface BotCommandScopeDefault {
2743
2789
  /** Scope type, must be _default_ */
2744
- type: string;
2790
+ type: 'default';
2745
2791
  }
2746
2792
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all private chats. */
2747
2793
  interface BotCommandScopeAllPrivateChats {
2748
2794
  /** Scope type, must be _all\_private\_chats_ */
2749
- type: string;
2795
+ type: 'all_private_chats';
2750
2796
  }
2751
2797
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all group and supergroup chats. */
2752
2798
  interface BotCommandScopeAllGroupChats {
2753
2799
  /** Scope type, must be _all\_group\_chats_ */
2754
- type: string;
2800
+ type: 'all_group_chats';
2755
2801
  }
2756
2802
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all group and supergroup chat administrators. */
2757
2803
  interface BotCommandScopeAllChatAdministrators {
2758
2804
  /** Scope type, must be _all\_chat\_administrators_ */
2759
- type: string;
2805
+ type: 'all_chat_administrators';
2760
2806
  }
2761
2807
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering a specific chat. */
2762
2808
  interface BotCommandScopeChat {
2763
2809
  /** Scope type, must be _chat_ */
2764
- type: string;
2810
+ type: 'chat';
2765
2811
  /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
2766
2812
  chat_id: number | string;
2767
2813
  }
2768
2814
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all administrators of a specific group or supergroup chat. */
2769
2815
  interface BotCommandScopeChatAdministrators {
2770
2816
  /** Scope type, must be _chat\_administrators_ */
2771
- type: string;
2817
+ type: 'chat_administrators';
2772
2818
  /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
2773
2819
  chat_id: number | string;
2774
2820
  }
2775
2821
  /** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering a specific member of a group or supergroup chat. */
2776
2822
  interface BotCommandScopeChatMember {
2777
2823
  /** Scope type, must be _chat\_member_ */
2778
- type: string;
2824
+ type: 'chat_member';
2779
2825
  /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
2780
2826
  chat_id: number | string;
2781
2827
  /** Unique identifier of the target user */
@@ -2809,12 +2855,12 @@ export declare namespace Types {
2809
2855
  /** Represents a menu button, which opens the bot's list of commands. */
2810
2856
  interface MenuButtonCommands {
2811
2857
  /** Type of the button, must be _commands_ */
2812
- type: string;
2858
+ type: 'commands';
2813
2859
  }
2814
2860
  /** Represents a menu button, which launches a [Web App](https://core.telegram.org/bots/webapps). */
2815
2861
  interface MenuButtonWebApp {
2816
2862
  /** Type of the button, must be _web\_app_ */
2817
- type: string;
2863
+ type: 'web_app';
2818
2864
  /** Text on the button */
2819
2865
  text: string;
2820
2866
  /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery). Alternatively, a `t.me` link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. */
@@ -2823,7 +2869,7 @@ export declare namespace Types {
2823
2869
  /** Describes that no specific value for the menu button was set. */
2824
2870
  interface MenuButtonDefault {
2825
2871
  /** Type of the button, must be _default_ */
2826
- type: string;
2872
+ type: 'default';
2827
2873
  }
2828
2874
  /**
2829
2875
  * This object describes the source of a chat boost. It can be one of
@@ -2836,21 +2882,21 @@ export declare namespace Types {
2836
2882
  /** The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. */
2837
2883
  interface ChatBoostSourcePremium {
2838
2884
  /** Source of the boost, always “premium” */
2839
- source: string;
2885
+ source: 'premium';
2840
2886
  /** User that boosted the chat */
2841
2887
  user: Types.User;
2842
2888
  }
2843
2889
  /** The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
2844
2890
  interface ChatBoostSourceGiftCode {
2845
2891
  /** Source of the boost, always “gift\_code” */
2846
- source: string;
2892
+ source: 'gift_code';
2847
2893
  /** User for which the gift code was created */
2848
2894
  user: Types.User;
2849
2895
  }
2850
2896
  /** The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and _prize\_star\_count_ / 500 times for one year for Telegram Star giveaways. */
2851
2897
  interface ChatBoostSourceGiveaway {
2852
2898
  /** Source of the boost, always “giveaway” */
2853
- source: string;
2899
+ source: 'giveaway';
2854
2900
  /** Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. */
2855
2901
  giveaway_message_id: number;
2856
2902
  /** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
@@ -2889,6 +2935,16 @@ export declare namespace Types {
2889
2935
  /** Source of the removed boost */
2890
2936
  source: Types.ChatBoostSource;
2891
2937
  }
2938
+ /** Describes a service message about the chat owner leaving the chat. */
2939
+ interface ChatOwnerLeft {
2940
+ /** The user which will be the new owner of the chat if the previous owner does not return to the chat */
2941
+ new_owner?: Types.User;
2942
+ }
2943
+ /** Describes a service message about an ownership change in the chat. */
2944
+ interface ChatOwnerChanged {
2945
+ /** The new owner of the chat */
2946
+ new_owner: Types.User;
2947
+ }
2892
2948
  /** This object represents a list of boosts added to a chat by a user. */
2893
2949
  interface UserChatBoosts {
2894
2950
  /** The list of boosts added to the chat by the user */
@@ -2969,13 +3025,13 @@ export declare namespace Types {
2969
3025
  /** Represents a photo to be sent. */
2970
3026
  interface InputMediaPhoto {
2971
3027
  /** Type of the result, must be _photo_ */
2972
- type: string;
3028
+ type: 'photo';
2973
3029
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
2974
3030
  media: string;
2975
3031
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
2976
3032
  caption?: string;
2977
3033
  /** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
2978
- parse_mode?: string;
3034
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
2979
3035
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
2980
3036
  caption_entities?: Array<Types.MessageEntity>;
2981
3037
  /** Pass _True_, if the caption must be shown above the message media */
@@ -2986,7 +3042,7 @@ export declare namespace Types {
2986
3042
  /** Represents a video to be sent. */
2987
3043
  interface InputMediaVideo {
2988
3044
  /** Type of the result, must be _video_ */
2989
- type: string;
3045
+ type: 'video';
2990
3046
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
2991
3047
  media: string;
2992
3048
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the thumbnail was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
@@ -2998,7 +3054,7 @@ export declare namespace Types {
2998
3054
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
2999
3055
  caption?: string;
3000
3056
  /** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3001
- parse_mode?: string;
3057
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3002
3058
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3003
3059
  caption_entities?: Array<Types.MessageEntity>;
3004
3060
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3017,7 +3073,7 @@ export declare namespace Types {
3017
3073
  /** Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. */
3018
3074
  interface InputMediaAnimation {
3019
3075
  /** Type of the result, must be _animation_ */
3020
- type: string;
3076
+ type: 'animation';
3021
3077
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3022
3078
  media: string;
3023
3079
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the thumbnail was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
@@ -3025,7 +3081,7 @@ export declare namespace Types {
3025
3081
  /** Caption of the animation to be sent, 0-1024 characters after entities parsing */
3026
3082
  caption?: string;
3027
3083
  /** Mode for parsing entities in the animation caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3028
- parse_mode?: string;
3084
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3029
3085
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3030
3086
  caption_entities?: Array<Types.MessageEntity>;
3031
3087
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3042,7 +3098,7 @@ export declare namespace Types {
3042
3098
  /** Represents an audio file to be treated as music to be sent. */
3043
3099
  interface InputMediaAudio {
3044
3100
  /** Type of the result, must be _audio_ */
3045
- type: string;
3101
+ type: 'audio';
3046
3102
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3047
3103
  media: string;
3048
3104
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the thumbnail was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
@@ -3050,7 +3106,7 @@ export declare namespace Types {
3050
3106
  /** Caption of the audio to be sent, 0-1024 characters after entities parsing */
3051
3107
  caption?: string;
3052
3108
  /** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3053
- parse_mode?: string;
3109
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3054
3110
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3055
3111
  caption_entities?: Array<Types.MessageEntity>;
3056
3112
  /** Duration of the audio in seconds */
@@ -3063,7 +3119,7 @@ export declare namespace Types {
3063
3119
  /** Represents a general file to be sent. */
3064
3120
  interface InputMediaDocument {
3065
3121
  /** Type of the result, must be _document_ */
3066
- type: string;
3122
+ type: 'document';
3067
3123
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3068
3124
  media: string;
3069
3125
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the thumbnail was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
@@ -3071,7 +3127,7 @@ export declare namespace Types {
3071
3127
  /** Caption of the document to be sent, 0-1024 characters after entities parsing */
3072
3128
  caption?: string;
3073
3129
  /** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3074
- parse_mode?: string;
3130
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3075
3131
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3076
3132
  caption_entities?: Array<Types.MessageEntity>;
3077
3133
  /** Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always _True_, if the document is sent as part of an album. */
@@ -3087,14 +3143,14 @@ export declare namespace Types {
3087
3143
  /** The paid media to send is a photo. */
3088
3144
  interface InputPaidMediaPhoto {
3089
3145
  /** Type of the media, must be _photo_ */
3090
- type: string;
3146
+ type: 'photo';
3091
3147
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3092
3148
  media: string;
3093
3149
  }
3094
3150
  /** The paid media to send is a video. */
3095
3151
  interface InputPaidMediaVideo {
3096
3152
  /** Type of the media, must be _video_ */
3097
- type: string;
3153
+ type: 'video';
3098
3154
  /** File to send. Pass a file\_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new one using multipart/form-data under <file\_attach\_name> name. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3099
3155
  media: string;
3100
3156
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the thumbnail was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
@@ -3122,14 +3178,14 @@ export declare namespace Types {
3122
3178
  /** A static profile photo in the .JPG format. */
3123
3179
  interface InputProfilePhotoStatic {
3124
3180
  /** Type of the profile photo, must be _static_ */
3125
- type: string;
3181
+ type: 'static';
3126
3182
  /** The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3127
3183
  photo: string;
3128
3184
  }
3129
3185
  /** An animated profile photo in the MPEG4 format. */
3130
3186
  interface InputProfilePhotoAnimated {
3131
3187
  /** Type of the profile photo, must be _animated_ */
3132
- type: string;
3188
+ type: 'animated';
3133
3189
  /** The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3134
3190
  animation: string;
3135
3191
  /** Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */
@@ -3145,14 +3201,14 @@ export declare namespace Types {
3145
3201
  /** Describes a photo to post as a story. */
3146
3202
  interface InputStoryContentPhoto {
3147
3203
  /** Type of the content, must be _photo_ */
3148
- type: string;
3204
+ type: 'photo';
3149
3205
  /** The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3150
3206
  photo: string;
3151
3207
  }
3152
3208
  /** Describes a video to post as a story. */
3153
3209
  interface InputStoryContentVideo {
3154
3210
  /** Type of the content, must be _video_ */
3155
- type: string;
3211
+ type: 'video';
3156
3212
  /** The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the video was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3157
3213
  video: string;
3158
3214
  /** Precise duration of the video in seconds; 0-60 */
@@ -3169,7 +3225,7 @@ export declare namespace Types {
3169
3225
  /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
3170
3226
  file_unique_id: string;
3171
3227
  /** Type of the sticker, currently one of “regular”, “mask”, “custom\_emoji”. The type of the sticker is independent from its format, which is determined by the fields _is\_animated_ and _is\_video_. */
3172
- type: string;
3228
+ type: 'regular' | 'mask' | 'custom_emoji';
3173
3229
  /** Sticker width */
3174
3230
  width: number;
3175
3231
  /** Sticker height */
@@ -3202,7 +3258,7 @@ export declare namespace Types {
3202
3258
  /** Sticker set title */
3203
3259
  title: string;
3204
3260
  /** Type of stickers in the set, currently one of “regular”, “mask”, “custom\_emoji” */
3205
- sticker_type: string;
3261
+ sticker_type: 'regular' | 'mask' | 'custom_emoji';
3206
3262
  /** List of all set stickers */
3207
3263
  stickers: Array<Types.Sticker>;
3208
3264
  /** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
@@ -3211,7 +3267,7 @@ export declare namespace Types {
3211
3267
  /** This object describes the position on faces where a mask should be placed by default. */
3212
3268
  interface MaskPosition {
3213
3269
  /** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */
3214
- point: string;
3270
+ point: 'forehead' | 'eyes' | 'mouth' | 'chin';
3215
3271
  /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
3216
3272
  x_shift: number;
3217
3273
  /** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
@@ -3224,7 +3280,7 @@ export declare namespace Types {
3224
3280
  /** The added sticker. Pass a _file\_id_ as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new file using multipart/form-data under <file\_attach\_name> name. Animated and video stickers can't be uploaded via HTTP URL. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
3225
3281
  sticker: string;
3226
3282
  /** Format of the added sticker, must be one of “static” for a **.WEBP** or **.PNG** image, “animated” for a **.TGS** animation, “video” for a **.WEBM** video */
3227
- format: string;
3283
+ format: 'static' | 'animated' | 'video';
3228
3284
  /** List of 1-20 emoji associated with the sticker */
3229
3285
  emoji_list: Array<string>;
3230
3286
  /** Position where the mask should be placed on faces. For “mask” stickers only. */
@@ -3243,7 +3299,7 @@ export declare namespace Types {
3243
3299
  /** Offset of the results to be returned, can be controlled by the bot */
3244
3300
  offset: string;
3245
3301
  /** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
3246
- chat_type?: string;
3302
+ chat_type?: 'sender' | 'private' | 'group' | 'supergroup' | 'channel';
3247
3303
  /** Sender location, only for bots that request user location */
3248
3304
  location?: Types.Location;
3249
3305
  }
@@ -3290,7 +3346,7 @@ export declare namespace Types {
3290
3346
  /** Represents a link to an article or web page. */
3291
3347
  interface InlineQueryResultArticle {
3292
3348
  /** Type of the result, must be _article_ */
3293
- type: string;
3349
+ type: 'article';
3294
3350
  /** Unique identifier for this result, 1-64 Bytes */
3295
3351
  id: string;
3296
3352
  /** Title of the result */
@@ -3313,7 +3369,7 @@ export declare namespace Types {
3313
3369
  /** Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the photo. */
3314
3370
  interface InlineQueryResultPhoto {
3315
3371
  /** Type of the result, must be _photo_ */
3316
- type: string;
3372
+ type: 'photo';
3317
3373
  /** Unique identifier for this result, 1-64 bytes */
3318
3374
  id: string;
3319
3375
  /** A valid URL of the photo. Photo must be in **JPEG** format. Photo size must not exceed 5MB */
@@ -3331,7 +3387,7 @@ export declare namespace Types {
3331
3387
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
3332
3388
  caption?: string;
3333
3389
  /** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3334
- parse_mode?: string;
3390
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3335
3391
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3336
3392
  caption_entities?: Array<Types.MessageEntity>;
3337
3393
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3344,7 +3400,7 @@ export declare namespace Types {
3344
3400
  /** Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
3345
3401
  interface InlineQueryResultGif {
3346
3402
  /** Type of the result, must be _gif_ */
3347
- type: string;
3403
+ type: 'gif';
3348
3404
  /** Unique identifier for this result, 1-64 bytes */
3349
3405
  id: string;
3350
3406
  /** A valid URL for the GIF file */
@@ -3358,13 +3414,13 @@ export declare namespace Types {
3358
3414
  /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
3359
3415
  thumbnail_url: string;
3360
3416
  /** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
3361
- thumbnail_mime_type?: string;
3417
+ thumbnail_mime_type?: 'image/jpeg' | 'image/gif' | 'video/mp4';
3362
3418
  /** Title for the result */
3363
3419
  title?: string;
3364
3420
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
3365
3421
  caption?: string;
3366
3422
  /** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3367
- parse_mode?: string;
3423
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3368
3424
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3369
3425
  caption_entities?: Array<Types.MessageEntity>;
3370
3426
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3377,7 +3433,7 @@ export declare namespace Types {
3377
3433
  /** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
3378
3434
  interface InlineQueryResultMpeg4Gif {
3379
3435
  /** Type of the result, must be _mpeg4\_gif_ */
3380
- type: string;
3436
+ type: 'mpeg4_gif';
3381
3437
  /** Unique identifier for this result, 1-64 bytes */
3382
3438
  id: string;
3383
3439
  /** A valid URL for the MPEG4 file */
@@ -3391,13 +3447,13 @@ export declare namespace Types {
3391
3447
  /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
3392
3448
  thumbnail_url: string;
3393
3449
  /** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
3394
- thumbnail_mime_type?: string;
3450
+ thumbnail_mime_type?: 'image/jpeg' | 'image/gif' | 'video/mp4';
3395
3451
  /** Title for the result */
3396
3452
  title?: string;
3397
3453
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
3398
3454
  caption?: string;
3399
3455
  /** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3400
- parse_mode?: string;
3456
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3401
3457
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3402
3458
  caption_entities?: Array<Types.MessageEntity>;
3403
3459
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3414,13 +3470,13 @@ export declare namespace Types {
3414
3470
  */
3415
3471
  interface InlineQueryResultVideo {
3416
3472
  /** Type of the result, must be _video_ */
3417
- type: string;
3473
+ type: 'video';
3418
3474
  /** Unique identifier for this result, 1-64 bytes */
3419
3475
  id: string;
3420
3476
  /** A valid URL for the embedded video player or video file */
3421
3477
  video_url: string;
3422
3478
  /** MIME type of the content of the video URL, “text/html” or “video/mp4” */
3423
- mime_type: string;
3479
+ mime_type: 'text/html' | 'video/mp4';
3424
3480
  /** URL of the thumbnail (JPEG only) for the video */
3425
3481
  thumbnail_url: string;
3426
3482
  /** Title for the result */
@@ -3428,7 +3484,7 @@ export declare namespace Types {
3428
3484
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
3429
3485
  caption?: string;
3430
3486
  /** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3431
- parse_mode?: string;
3487
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3432
3488
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3433
3489
  caption_entities?: Array<Types.MessageEntity>;
3434
3490
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3449,7 +3505,7 @@ export declare namespace Types {
3449
3505
  /** Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the audio. */
3450
3506
  interface InlineQueryResultAudio {
3451
3507
  /** Type of the result, must be _audio_ */
3452
- type: string;
3508
+ type: 'audio';
3453
3509
  /** Unique identifier for this result, 1-64 bytes */
3454
3510
  id: string;
3455
3511
  /** A valid URL for the audio file */
@@ -3459,7 +3515,7 @@ export declare namespace Types {
3459
3515
  /** Caption, 0-1024 characters after entities parsing */
3460
3516
  caption?: string;
3461
3517
  /** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3462
- parse_mode?: string;
3518
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3463
3519
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3464
3520
  caption_entities?: Array<Types.MessageEntity>;
3465
3521
  /** Performer */
@@ -3474,7 +3530,7 @@ export declare namespace Types {
3474
3530
  /** Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the the voice message. */
3475
3531
  interface InlineQueryResultVoice {
3476
3532
  /** Type of the result, must be _voice_ */
3477
- type: string;
3533
+ type: 'voice';
3478
3534
  /** Unique identifier for this result, 1-64 bytes */
3479
3535
  id: string;
3480
3536
  /** A valid URL for the voice recording */
@@ -3484,7 +3540,7 @@ export declare namespace Types {
3484
3540
  /** Caption, 0-1024 characters after entities parsing */
3485
3541
  caption?: string;
3486
3542
  /** Mode for parsing entities in the voice message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3487
- parse_mode?: string;
3543
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3488
3544
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3489
3545
  caption_entities?: Array<Types.MessageEntity>;
3490
3546
  /** Recording duration in seconds */
@@ -3497,7 +3553,7 @@ export declare namespace Types {
3497
3553
  /** Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the file. Currently, only **.PDF** and **.ZIP** files can be sent using this method. */
3498
3554
  interface InlineQueryResultDocument {
3499
3555
  /** Type of the result, must be _document_ */
3500
- type: string;
3556
+ type: 'document';
3501
3557
  /** Unique identifier for this result, 1-64 bytes */
3502
3558
  id: string;
3503
3559
  /** Title for the result */
@@ -3505,13 +3561,13 @@ export declare namespace Types {
3505
3561
  /** Caption of the document to be sent, 0-1024 characters after entities parsing */
3506
3562
  caption?: string;
3507
3563
  /** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3508
- parse_mode?: string;
3564
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3509
3565
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3510
3566
  caption_entities?: Array<Types.MessageEntity>;
3511
3567
  /** A valid URL for the file */
3512
3568
  document_url: string;
3513
3569
  /** MIME type of the content of the file, either “application/pdf” or “application/zip” */
3514
- mime_type: string;
3570
+ mime_type: 'application/pdf' | 'application/zip';
3515
3571
  /** Short description of the result */
3516
3572
  description?: string;
3517
3573
  /** Inline keyboard attached to the message */
@@ -3528,7 +3584,7 @@ export declare namespace Types {
3528
3584
  /** Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the location. */
3529
3585
  interface InlineQueryResultLocation {
3530
3586
  /** Type of the result, must be _location_ */
3531
- type: string;
3587
+ type: 'location';
3532
3588
  /** Unique identifier for this result, 1-64 Bytes */
3533
3589
  id: string;
3534
3590
  /** Location latitude in degrees */
@@ -3559,7 +3615,7 @@ export declare namespace Types {
3559
3615
  /** Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the venue. */
3560
3616
  interface InlineQueryResultVenue {
3561
3617
  /** Type of the result, must be _venue_ */
3562
- type: string;
3618
+ type: 'venue';
3563
3619
  /** Unique identifier for this result, 1-64 Bytes */
3564
3620
  id: string;
3565
3621
  /** Latitude of the venue location in degrees */
@@ -3592,7 +3648,7 @@ export declare namespace Types {
3592
3648
  /** Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the contact. */
3593
3649
  interface InlineQueryResultContact {
3594
3650
  /** Type of the result, must be _contact_ */
3595
- type: string;
3651
+ type: 'contact';
3596
3652
  /** Unique identifier for this result, 1-64 Bytes */
3597
3653
  id: string;
3598
3654
  /** Contact's phone number */
@@ -3617,7 +3673,7 @@ export declare namespace Types {
3617
3673
  /** Represents a [Game](https://core.telegram.org/bots/api#games). */
3618
3674
  interface InlineQueryResultGame {
3619
3675
  /** Type of the result, must be _game_ */
3620
- type: string;
3676
+ type: 'game';
3621
3677
  /** Unique identifier for this result, 1-64 bytes */
3622
3678
  id: string;
3623
3679
  /** Short name of the game */
@@ -3628,7 +3684,7 @@ export declare namespace Types {
3628
3684
  /** Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the photo. */
3629
3685
  interface InlineQueryResultCachedPhoto {
3630
3686
  /** Type of the result, must be _photo_ */
3631
- type: string;
3687
+ type: 'photo';
3632
3688
  /** Unique identifier for this result, 1-64 bytes */
3633
3689
  id: string;
3634
3690
  /** A valid file identifier of the photo */
@@ -3640,7 +3696,7 @@ export declare namespace Types {
3640
3696
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
3641
3697
  caption?: string;
3642
3698
  /** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3643
- parse_mode?: string;
3699
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3644
3700
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3645
3701
  caption_entities?: Array<Types.MessageEntity>;
3646
3702
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3653,7 +3709,7 @@ export declare namespace Types {
3653
3709
  /** Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with specified content instead of the animation. */
3654
3710
  interface InlineQueryResultCachedGif {
3655
3711
  /** Type of the result, must be _gif_ */
3656
- type: string;
3712
+ type: 'gif';
3657
3713
  /** Unique identifier for this result, 1-64 bytes */
3658
3714
  id: string;
3659
3715
  /** A valid file identifier for the GIF file */
@@ -3663,7 +3719,7 @@ export declare namespace Types {
3663
3719
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
3664
3720
  caption?: string;
3665
3721
  /** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3666
- parse_mode?: string;
3722
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3667
3723
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3668
3724
  caption_entities?: Array<Types.MessageEntity>;
3669
3725
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3676,7 +3732,7 @@ export declare namespace Types {
3676
3732
  /** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
3677
3733
  interface InlineQueryResultCachedMpeg4Gif {
3678
3734
  /** Type of the result, must be _mpeg4\_gif_ */
3679
- type: string;
3735
+ type: 'mpeg4_gif';
3680
3736
  /** Unique identifier for this result, 1-64 bytes */
3681
3737
  id: string;
3682
3738
  /** A valid file identifier for the MPEG4 file */
@@ -3686,7 +3742,7 @@ export declare namespace Types {
3686
3742
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
3687
3743
  caption?: string;
3688
3744
  /** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3689
- parse_mode?: string;
3745
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3690
3746
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3691
3747
  caption_entities?: Array<Types.MessageEntity>;
3692
3748
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3699,7 +3755,7 @@ export declare namespace Types {
3699
3755
  /** Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the sticker. */
3700
3756
  interface InlineQueryResultCachedSticker {
3701
3757
  /** Type of the result, must be _sticker_ */
3702
- type: string;
3758
+ type: 'sticker';
3703
3759
  /** Unique identifier for this result, 1-64 bytes */
3704
3760
  id: string;
3705
3761
  /** A valid file identifier of the sticker */
@@ -3712,7 +3768,7 @@ export declare namespace Types {
3712
3768
  /** Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the file. */
3713
3769
  interface InlineQueryResultCachedDocument {
3714
3770
  /** Type of the result, must be _document_ */
3715
- type: string;
3771
+ type: 'document';
3716
3772
  /** Unique identifier for this result, 1-64 bytes */
3717
3773
  id: string;
3718
3774
  /** Title for the result */
@@ -3724,7 +3780,7 @@ export declare namespace Types {
3724
3780
  /** Caption of the document to be sent, 0-1024 characters after entities parsing */
3725
3781
  caption?: string;
3726
3782
  /** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3727
- parse_mode?: string;
3783
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3728
3784
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3729
3785
  caption_entities?: Array<Types.MessageEntity>;
3730
3786
  /** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
@@ -3735,7 +3791,7 @@ export declare namespace Types {
3735
3791
  /** Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the video. */
3736
3792
  interface InlineQueryResultCachedVideo {
3737
3793
  /** Type of the result, must be _video_ */
3738
- type: string;
3794
+ type: 'video';
3739
3795
  /** Unique identifier for this result, 1-64 bytes */
3740
3796
  id: string;
3741
3797
  /** A valid file identifier for the video file */
@@ -3747,7 +3803,7 @@ export declare namespace Types {
3747
3803
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
3748
3804
  caption?: string;
3749
3805
  /** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3750
- parse_mode?: string;
3806
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3751
3807
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3752
3808
  caption_entities?: Array<Types.MessageEntity>;
3753
3809
  /** Pass _True_, if the caption must be shown above the message media */
@@ -3760,7 +3816,7 @@ export declare namespace Types {
3760
3816
  /** Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the voice message. */
3761
3817
  interface InlineQueryResultCachedVoice {
3762
3818
  /** Type of the result, must be _voice_ */
3763
- type: string;
3819
+ type: 'voice';
3764
3820
  /** Unique identifier for this result, 1-64 bytes */
3765
3821
  id: string;
3766
3822
  /** A valid file identifier for the voice message */
@@ -3770,7 +3826,7 @@ export declare namespace Types {
3770
3826
  /** Caption, 0-1024 characters after entities parsing */
3771
3827
  caption?: string;
3772
3828
  /** Mode for parsing entities in the voice message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3773
- parse_mode?: string;
3829
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3774
3830
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3775
3831
  caption_entities?: Array<Types.MessageEntity>;
3776
3832
  /** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
@@ -3781,7 +3837,7 @@ export declare namespace Types {
3781
3837
  /** Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the audio. */
3782
3838
  interface InlineQueryResultCachedAudio {
3783
3839
  /** Type of the result, must be _audio_ */
3784
- type: string;
3840
+ type: 'audio';
3785
3841
  /** Unique identifier for this result, 1-64 bytes */
3786
3842
  id: string;
3787
3843
  /** A valid file identifier for the audio file */
@@ -3789,7 +3845,7 @@ export declare namespace Types {
3789
3845
  /** Caption, 0-1024 characters after entities parsing */
3790
3846
  caption?: string;
3791
3847
  /** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3792
- parse_mode?: string;
3848
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3793
3849
  /** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
3794
3850
  caption_entities?: Array<Types.MessageEntity>;
3795
3851
  /** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
@@ -3812,7 +3868,7 @@ export declare namespace Types {
3812
3868
  /** Text of the message to be sent, 1-4096 characters */
3813
3869
  message_text: string;
3814
3870
  /** Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
3815
- parse_mode?: string;
3871
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
3816
3872
  /** List of special entities that appear in message text, which can be specified instead of _parse\_mode_ */
3817
3873
  entities?: Array<Types.MessageEntity>;
3818
3874
  /** Link preview generation options for the message */
@@ -4016,7 +4072,7 @@ export declare namespace Types {
4016
4072
  /** This object contains basic information about a refunded payment. */
4017
4073
  interface RefundedPayment {
4018
4074
  /** Three-letter ISO 4217 [currency](https://core.telegram.org/bots/payments#supported-currencies) code, or “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90). Currently, always “XTR” */
4019
- currency: string;
4075
+ currency: 'XTR';
4020
4076
  /** Total refunded price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45`, `total_amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
4021
4077
  total_amount: number;
4022
4078
  /** Bot-specified invoice payload */
@@ -4072,12 +4128,12 @@ export declare namespace Types {
4072
4128
  /** The withdrawal is in progress. */
4073
4129
  interface RevenueWithdrawalStatePending {
4074
4130
  /** Type of the state, always “pending” */
4075
- type: string;
4131
+ type: 'pending';
4076
4132
  }
4077
4133
  /** The withdrawal succeeded. */
4078
4134
  interface RevenueWithdrawalStateSucceeded {
4079
4135
  /** Type of the state, always “succeeded” */
4080
- type: string;
4136
+ type: 'succeeded';
4081
4137
  /** Date the withdrawal was completed in Unix time */
4082
4138
  date: number;
4083
4139
  /** An HTTPS URL that can be used to see transaction details */
@@ -4086,7 +4142,7 @@ export declare namespace Types {
4086
4142
  /** The withdrawal failed and the transaction was refunded. */
4087
4143
  interface RevenueWithdrawalStateFailed {
4088
4144
  /** Type of the state, always “failed” */
4089
- type: string;
4145
+ type: 'failed';
4090
4146
  }
4091
4147
  /** Contains information about the affiliate that received a commission via this transaction. */
4092
4148
  interface AffiliateInfo {
@@ -4116,9 +4172,9 @@ export declare namespace Types {
4116
4172
  /** Describes a transaction with a user. */
4117
4173
  interface TransactionPartnerUser {
4118
4174
  /** Type of the transaction partner, always “user” */
4119
- type: string;
4175
+ type: 'user';
4120
4176
  /** Type of the transaction, currently one of “invoice\_payment” for payments via invoices, “paid\_media\_payment” for payments for paid media, “gift\_purchase” for gifts sent by the bot, “premium\_purchase” for Telegram Premium subscriptions gifted by the bot, “business\_account\_transfer” for direct transfers from managed business accounts */
4121
- transaction_type: string;
4177
+ transaction_type: 'invoice_payment' | 'paid_media_payment' | 'gift_purchase' | 'premium_purchase' | 'business_account_transfer';
4122
4178
  /** Information about the user */
4123
4179
  user: Types.User;
4124
4180
  /** Information about the affiliate that received a commission via this transaction. Can be available only for “invoice\_payment” and “paid\_media\_payment” transactions. */
@@ -4139,7 +4195,7 @@ export declare namespace Types {
4139
4195
  /** Describes a transaction with a chat. */
4140
4196
  interface TransactionPartnerChat {
4141
4197
  /** Type of the transaction partner, always “chat” */
4142
- type: string;
4198
+ type: 'chat';
4143
4199
  /** Information about the chat */
4144
4200
  chat: Types.Chat;
4145
4201
  /** The gift sent to the chat by the bot */
@@ -4148,7 +4204,7 @@ export declare namespace Types {
4148
4204
  /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
4149
4205
  interface TransactionPartnerAffiliateProgram {
4150
4206
  /** Type of the transaction partner, always “affiliate\_program” */
4151
- type: string;
4207
+ type: 'affiliate_program';
4152
4208
  /** Information about the bot that sponsored the affiliate program */
4153
4209
  sponsor_user?: Types.User;
4154
4210
  /** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
@@ -4157,26 +4213,26 @@ export declare namespace Types {
4157
4213
  /** Describes a withdrawal transaction with Fragment. */
4158
4214
  interface TransactionPartnerFragment {
4159
4215
  /** Type of the transaction partner, always “fragment” */
4160
- type: string;
4216
+ type: 'fragment';
4161
4217
  /** State of the transaction if the transaction is outgoing */
4162
4218
  withdrawal_state?: Types.RevenueWithdrawalState;
4163
4219
  }
4164
4220
  /** Describes a withdrawal transaction to the Telegram Ads platform. */
4165
4221
  interface TransactionPartnerTelegramAds {
4166
4222
  /** Type of the transaction partner, always “telegram\_ads” */
4167
- type: string;
4223
+ type: 'telegram_ads';
4168
4224
  }
4169
4225
  /** Describes a transaction with payment for [paid broadcasting](https://core.telegram.org/bots/api#paid-broadcasts). */
4170
4226
  interface TransactionPartnerTelegramApi {
4171
4227
  /** Type of the transaction partner, always “telegram\_api” */
4172
- type: string;
4228
+ type: 'telegram_api';
4173
4229
  /** The number of successful requests that exceeded regular limits and were therefore billed */
4174
4230
  request_count: number;
4175
4231
  }
4176
4232
  /** Describes a transaction with an unknown source or recipient. */
4177
4233
  interface TransactionPartnerOther {
4178
4234
  /** Type of the transaction partner, always “other” */
4179
- type: string;
4235
+ type: 'other';
4180
4236
  }
4181
4237
  /** Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. */
4182
4238
  interface StarTransaction {
@@ -4219,7 +4275,7 @@ export declare namespace Types {
4219
4275
  /** Describes documents or other Telegram Passport elements shared with the bot by the user. */
4220
4276
  interface EncryptedPassportElement {
4221
4277
  /** Element type. One of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration”, “phone\_number”, “email”. */
4222
- type: string;
4278
+ type: 'personal_details' | 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'address' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration' | 'phone_number' | 'email';
4223
4279
  /** Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport” and “address” types. Can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
4224
4280
  data?: string;
4225
4281
  /** User's verified phone number; available only for “phone\_number” type */
@@ -4265,9 +4321,9 @@ export declare namespace Types {
4265
4321
  /** Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. */
4266
4322
  interface PassportElementErrorDataField {
4267
4323
  /** Error source, must be _data_ */
4268
- source: string;
4324
+ source: 'data';
4269
4325
  /** The section of the user's Telegram Passport which has the error, one of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address” */
4270
- type: string;
4326
+ type: 'personal_details' | 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'address';
4271
4327
  /** Name of the data field which has the error */
4272
4328
  field_name: string;
4273
4329
  /** Base64-encoded data hash */
@@ -4278,9 +4334,9 @@ export declare namespace Types {
4278
4334
  /** Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. */
4279
4335
  interface PassportElementErrorFrontSide {
4280
4336
  /** Error source, must be _front\_side_ */
4281
- source: string;
4337
+ source: 'front_side';
4282
4338
  /** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport” */
4283
- type: string;
4339
+ type: 'passport' | 'driver_license' | 'identity_card' | 'internal_passport';
4284
4340
  /** Base64-encoded hash of the file with the front side of the document */
4285
4341
  file_hash: string;
4286
4342
  /** Error message */
@@ -4289,9 +4345,9 @@ export declare namespace Types {
4289
4345
  /** Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. */
4290
4346
  interface PassportElementErrorReverseSide {
4291
4347
  /** Error source, must be _reverse\_side_ */
4292
- source: string;
4348
+ source: 'reverse_side';
4293
4349
  /** The section of the user's Telegram Passport which has the issue, one of “driver\_license”, “identity\_card” */
4294
- type: string;
4350
+ type: 'driver_license' | 'identity_card';
4295
4351
  /** Base64-encoded hash of the file with the reverse side of the document */
4296
4352
  file_hash: string;
4297
4353
  /** Error message */
@@ -4300,9 +4356,9 @@ export declare namespace Types {
4300
4356
  /** Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. */
4301
4357
  interface PassportElementErrorSelfie {
4302
4358
  /** Error source, must be _selfie_ */
4303
- source: string;
4359
+ source: 'selfie';
4304
4360
  /** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport” */
4305
- type: string;
4361
+ type: 'passport' | 'driver_license' | 'identity_card' | 'internal_passport';
4306
4362
  /** Base64-encoded hash of the file with the selfie */
4307
4363
  file_hash: string;
4308
4364
  /** Error message */
@@ -4311,9 +4367,9 @@ export declare namespace Types {
4311
4367
  /** Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. */
4312
4368
  interface PassportElementErrorFile {
4313
4369
  /** Error source, must be _file_ */
4314
- source: string;
4370
+ source: 'file';
4315
4371
  /** The section of the user's Telegram Passport which has the issue, one of “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
4316
- type: string;
4372
+ type: 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration';
4317
4373
  /** Base64-encoded file hash */
4318
4374
  file_hash: string;
4319
4375
  /** Error message */
@@ -4322,9 +4378,9 @@ export declare namespace Types {
4322
4378
  /** Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. */
4323
4379
  interface PassportElementErrorFiles {
4324
4380
  /** Error source, must be _files_ */
4325
- source: string;
4381
+ source: 'files';
4326
4382
  /** The section of the user's Telegram Passport which has the issue, one of “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
4327
- type: string;
4383
+ type: 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration';
4328
4384
  /** List of base64-encoded file hashes */
4329
4385
  file_hashes: Array<string>;
4330
4386
  /** Error message */
@@ -4333,9 +4389,9 @@ export declare namespace Types {
4333
4389
  /** Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. */
4334
4390
  interface PassportElementErrorTranslationFile {
4335
4391
  /** Error source, must be _translation\_file_ */
4336
- source: string;
4392
+ source: 'translation_file';
4337
4393
  /** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
4338
- type: string;
4394
+ type: 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration';
4339
4395
  /** Base64-encoded file hash */
4340
4396
  file_hash: string;
4341
4397
  /** Error message */
@@ -4344,9 +4400,9 @@ export declare namespace Types {
4344
4400
  /** Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. */
4345
4401
  interface PassportElementErrorTranslationFiles {
4346
4402
  /** Error source, must be _translation\_files_ */
4347
- source: string;
4403
+ source: 'translation_files';
4348
4404
  /** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
4349
- type: string;
4405
+ type: 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration';
4350
4406
  /** List of base64-encoded file hashes */
4351
4407
  file_hashes: Array<string>;
4352
4408
  /** Error message */
@@ -4355,7 +4411,7 @@ export declare namespace Types {
4355
4411
  /** Represents an issue in an unspecified place. The error is considered resolved when new data is added. */
4356
4412
  interface PassportElementErrorUnspecified {
4357
4413
  /** Error source, must be _unspecified_ */
4358
- source: string;
4414
+ source: 'unspecified';
4359
4415
  /** Type of element of the user's Telegram Passport which has the issue */
4360
4416
  type: string;
4361
4417
  /** Base64-encoded element hash */
@@ -4446,7 +4502,7 @@ export interface MethodParams {
4446
4502
  /** Text of the message to be sent, 1-4096 characters after entities parsing */
4447
4503
  text: string;
4448
4504
  /** Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4449
- parse_mode?: string;
4505
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4450
4506
  /** An array of special entities that appear in message text, which can be specified instead of _parse\_mode_ */
4451
4507
  entities?: Array<Types.MessageEntity>;
4452
4508
  /** Link preview generation options for the message */
@@ -4520,7 +4576,7 @@ export interface MethodParams {
4520
4576
  /** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
4521
4577
  caption?: string;
4522
4578
  /** Mode for parsing entities in the new caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4523
- parse_mode?: string;
4579
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4524
4580
  /** An array of special entities that appear in the new caption, which can be specified instead of _parse\_mode_ */
4525
4581
  caption_entities?: Array<Types.MessageEntity>;
4526
4582
  /** Pass _True_, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
@@ -4572,7 +4628,7 @@ export interface MethodParams {
4572
4628
  /** Photo caption (may also be used when resending photos by _file\_id_), 0-1024 characters after entities parsing */
4573
4629
  caption?: string;
4574
4630
  /** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4575
- parse_mode?: string;
4631
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4576
4632
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4577
4633
  caption_entities?: Array<Types.MessageEntity>;
4578
4634
  /** Pass _True_, if the caption must be shown above the message media */
@@ -4608,7 +4664,7 @@ export interface MethodParams {
4608
4664
  /** Audio caption, 0-1024 characters after entities parsing */
4609
4665
  caption?: string;
4610
4666
  /** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4611
- parse_mode?: string;
4667
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4612
4668
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4613
4669
  caption_entities?: Array<Types.MessageEntity>;
4614
4670
  /** Duration of the audio in seconds */
@@ -4650,7 +4706,7 @@ export interface MethodParams {
4650
4706
  /** Document caption (may also be used when resending documents by _file\_id_), 0-1024 characters after entities parsing */
4651
4707
  caption?: string;
4652
4708
  /** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4653
- parse_mode?: string;
4709
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4654
4710
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4655
4711
  caption_entities?: Array<Types.MessageEntity>;
4656
4712
  /** Disables automatic server-side content type detection for files uploaded using multipart/form-data */
@@ -4696,7 +4752,7 @@ export interface MethodParams {
4696
4752
  /** Video caption (may also be used when resending videos by _file\_id_), 0-1024 characters after entities parsing */
4697
4753
  caption?: string;
4698
4754
  /** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4699
- parse_mode?: string;
4755
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4700
4756
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4701
4757
  caption_entities?: Array<Types.MessageEntity>;
4702
4758
  /** Pass _True_, if the caption must be shown above the message media */
@@ -4742,7 +4798,7 @@ export interface MethodParams {
4742
4798
  /** Animation caption (may also be used when resending animation by _file\_id_), 0-1024 characters after entities parsing */
4743
4799
  caption?: string;
4744
4800
  /** Mode for parsing entities in the animation caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4745
- parse_mode?: string;
4801
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4746
4802
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4747
4803
  caption_entities?: Array<Types.MessageEntity>;
4748
4804
  /** Pass _True_, if the caption must be shown above the message media */
@@ -4778,7 +4834,7 @@ export interface MethodParams {
4778
4834
  /** Voice message caption, 0-1024 characters after entities parsing */
4779
4835
  caption?: string;
4780
4836
  /** Mode for parsing entities in the voice message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4781
- parse_mode?: string;
4837
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4782
4838
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4783
4839
  caption_entities?: Array<Types.MessageEntity>;
4784
4840
  /** Duration of the voice message in seconds */
@@ -4848,7 +4904,7 @@ export interface MethodParams {
4848
4904
  /** Media caption, 0-1024 characters after entities parsing */
4849
4905
  caption?: string;
4850
4906
  /** Mode for parsing entities in the media caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
4851
- parse_mode?: string;
4907
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
4852
4908
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
4853
4909
  caption_entities?: Array<Types.MessageEntity>;
4854
4910
  /** Pass _True_, if the caption must be shown above the message media */
@@ -5006,7 +5062,7 @@ export interface MethodParams {
5006
5062
  /** Poll question, 1-300 characters */
5007
5063
  question: string;
5008
5064
  /** Mode for parsing entities in the question. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. Currently, only custom emoji entities are allowed */
5009
- question_parse_mode?: string;
5065
+ question_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5010
5066
  /** An array of special entities that appear in the poll question. It can be specified instead of _question\_parse\_mode_ */
5011
5067
  question_entities?: Array<Types.MessageEntity>;
5012
5068
  /** An array of 2-12 answer options */
@@ -5014,7 +5070,7 @@ export interface MethodParams {
5014
5070
  /** _True_, if the poll needs to be anonymous, defaults to _True_ */
5015
5071
  is_anonymous?: boolean;
5016
5072
  /** Poll type, “quiz” or “regular”, defaults to “regular” */
5017
- type?: string;
5073
+ type?: 'quiz' | 'regular';
5018
5074
  /** _True_, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to _False_ */
5019
5075
  allows_multiple_answers?: boolean;
5020
5076
  /** 0-based identifier of the correct answer option, required for polls in quiz mode */
@@ -5022,7 +5078,7 @@ export interface MethodParams {
5022
5078
  /** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing */
5023
5079
  explanation?: string;
5024
5080
  /** Mode for parsing entities in the explanation. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5025
- explanation_parse_mode?: string;
5081
+ explanation_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5026
5082
  /** An array of special entities that appear in the poll explanation. It can be specified instead of _explanation\_parse\_mode_ */
5027
5083
  explanation_entities?: Array<Types.MessageEntity>;
5028
5084
  /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with _close\_date_. */
@@ -5072,7 +5128,7 @@ export interface MethodParams {
5072
5128
  /** Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat */
5073
5129
  direct_messages_topic_id?: number;
5074
5130
  /** Emoji on which the dice throw animation is based. Currently, must be one of “![🎲](//telegram.org/img/emoji/40/F09F8EB2.png)”, “![🎯](//telegram.org/img/emoji/40/F09F8EAF.png)”, “![🏀](//telegram.org/img/emoji/40/F09F8F80.png)”, “![⚽](//telegram.org/img/emoji/40/E29ABD.png)”, “![🎳](//telegram.org/img/emoji/40/F09F8EB3.png)”, or “![🎰](//telegram.org/img/emoji/40/F09F8EB0.png)”. Dice can have values 1-6 for “![🎲](//telegram.org/img/emoji/40/F09F8EB2.png)”, “![🎯](//telegram.org/img/emoji/40/F09F8EAF.png)” and “![🎳](//telegram.org/img/emoji/40/F09F8EB3.png)”, values 1-5 for “![🏀](//telegram.org/img/emoji/40/F09F8F80.png)” and “![⚽](//telegram.org/img/emoji/40/E29ABD.png)”, and values 1-64 for “![🎰](//telegram.org/img/emoji/40/F09F8EB0.png)”. Defaults to “![🎲](//telegram.org/img/emoji/40/F09F8EB2.png)” */
5075
- emoji?: string;
5131
+ emoji?: '🎲' | '🎯' | '🏀' | '⚽' | '🎳' | '🎰';
5076
5132
  /** Sends the message [silently](https://telegram.org/blog/channels-2-0#silent-messages). Users will receive a notification with no sound. */
5077
5133
  disable_notification?: boolean;
5078
5134
  /** Protects the contents of the sent message from forwarding */
@@ -5098,7 +5154,7 @@ export interface MethodParams {
5098
5154
  /** Text of the message to be sent, 1-4096 characters after entities parsing */
5099
5155
  text: string;
5100
5156
  /** Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5101
- parse_mode?: string;
5157
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5102
5158
  /** An array of special entities that appear in message text, which can be specified instead of _parse\_mode_ */
5103
5159
  entities?: Array<Types.MessageEntity>;
5104
5160
  };
@@ -5110,7 +5166,7 @@ export interface MethodParams {
5110
5166
  /** Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only */
5111
5167
  message_thread_id?: number;
5112
5168
  /** Type of action to broadcast. Choose one, depending on what the user is about to receive: _typing_ for [text messages](https://core.telegram.org/bots/api#sendmessage), _upload\_photo_ for [photos](https://core.telegram.org/bots/api#sendphoto), _record\_video_ or _upload\_video_ for [videos](https://core.telegram.org/bots/api#sendvideo), _record\_voice_ or _upload\_voice_ for [voice notes](https://core.telegram.org/bots/api#sendvoice), _upload\_document_ for [general files](https://core.telegram.org/bots/api#senddocument), _choose\_sticker_ for [stickers](https://core.telegram.org/bots/api#sendsticker), _find\_location_ for [location data](https://core.telegram.org/bots/api#sendlocation), _record\_video\_note_ or _upload\_video\_note_ for [video notes](https://core.telegram.org/bots/api#sendvideonote). */
5113
- action: string;
5169
+ action: 'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'choose_sticker' | 'find_location' | 'record_video_note' | 'upload_video_note';
5114
5170
  };
5115
5171
  setMessageReaction: {
5116
5172
  /** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
@@ -5130,6 +5186,14 @@ export interface MethodParams {
5130
5186
  /** Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
5131
5187
  limit?: number;
5132
5188
  };
5189
+ getUserProfileAudios: {
5190
+ /** Unique identifier of the target user */
5191
+ user_id: number;
5192
+ /** Sequential number of the first audio to be returned. By default, all audios are returned. */
5193
+ offset?: number;
5194
+ /** Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
5195
+ limit?: number;
5196
+ };
5133
5197
  setUserEmojiStatus: {
5134
5198
  /** Unique identifier of the target user */
5135
5199
  user_id: number;
@@ -5274,7 +5338,7 @@ export interface MethodParams {
5274
5338
  /** Invite link name; 0-32 characters */
5275
5339
  name?: string;
5276
5340
  /** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). */
5277
- subscription_period: number;
5341
+ subscription_period: 2592000;
5278
5342
  /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 */
5279
5343
  subscription_price: number;
5280
5344
  };
@@ -5387,7 +5451,7 @@ export interface MethodParams {
5387
5451
  /** Topic name, 1-128 characters */
5388
5452
  name: string;
5389
5453
  /** Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) */
5390
- icon_color?: number;
5454
+ icon_color?: 7322096 | 16766590 | 13338331 | 9367192 | 16749490 | 16478047;
5391
5455
  /** Unique identifier of the custom emoji shown as the topic icon. Use [getForumTopicIconStickers](https://core.telegram.org/bots/api#getforumtopiciconstickers) to get all allowed custom emoji identifiers. */
5392
5456
  icon_custom_emoji_id?: string;
5393
5457
  };
@@ -5527,6 +5591,11 @@ export interface MethodParams {
5527
5591
  /** A two-letter ISO 639-1 language code or an empty string */
5528
5592
  language_code?: string;
5529
5593
  };
5594
+ setMyProfilePhoto: {
5595
+ /** The new profile photo to set */
5596
+ photo: Types.InputProfilePhoto;
5597
+ };
5598
+ removeMyProfilePhoto: void | Record<string, never>;
5530
5599
  setChatMenuButton: void | {
5531
5600
  /** Unique identifier for the target private chat. If not specified, default bot's menu button will be changed */
5532
5601
  chat_id?: number;
@@ -5560,7 +5629,7 @@ export interface MethodParams {
5560
5629
  /** Text that will be shown along with the gift; 0-128 characters */
5561
5630
  text?: string;
5562
5631
  /** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom\_emoji” are ignored. */
5563
- text_parse_mode?: string;
5632
+ text_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5564
5633
  /** An array of special entities that appear in the gift text. It can be specified instead of _text\_parse\_mode_. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom\_emoji” are ignored. */
5565
5634
  text_entities?: Array<Types.MessageEntity>;
5566
5635
  };
@@ -5568,13 +5637,13 @@ export interface MethodParams {
5568
5637
  /** Unique identifier of the target user who will receive a Telegram Premium subscription */
5569
5638
  user_id: number;
5570
5639
  /** Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 */
5571
- month_count: number;
5640
+ month_count: 3 | 6 | 12;
5572
5641
  /** Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months */
5573
- star_count: number;
5642
+ star_count: 1000 | 1500 | 2500;
5574
5643
  /** Text that will be shown along with the service message about the subscription; 0-128 characters */
5575
5644
  text?: string;
5576
5645
  /** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom\_emoji” are ignored. */
5577
- text_parse_mode?: string;
5646
+ text_parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5578
5647
  /** An array of special entities that appear in the gift text. It can be specified instead of _text\_parse\_mode_. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom\_emoji” are ignored. */
5579
5648
  text_entities?: Array<Types.MessageEntity>;
5580
5649
  };
@@ -5764,11 +5833,11 @@ export interface MethodParams {
5764
5833
  /** Content of the story */
5765
5834
  content: Types.InputStoryContent;
5766
5835
  /** Period after which the story is moved to the archive, in seconds; must be one of `6 * 3600`, `12 * 3600`, `86400`, or `2 * 86400` */
5767
- active_period: number;
5836
+ active_period: 21600 | 43200 | 86400 | 172800;
5768
5837
  /** Caption of the story, 0-2048 characters after entities parsing */
5769
5838
  caption?: string;
5770
5839
  /** Mode for parsing entities in the story caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5771
- parse_mode?: string;
5840
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5772
5841
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
5773
5842
  caption_entities?: Array<Types.MessageEntity>;
5774
5843
  /** An array of clickable areas to be shown on the story */
@@ -5786,7 +5855,7 @@ export interface MethodParams {
5786
5855
  /** Unique identifier of the story that should be reposted */
5787
5856
  from_story_id: number;
5788
5857
  /** Period after which the story is moved to the archive, in seconds; must be one of `6 * 3600`, `12 * 3600`, `86400`, or `2 * 86400` */
5789
- active_period: number;
5858
+ active_period: 21600 | 43200 | 86400 | 172800;
5790
5859
  /** Pass _True_ to keep the story accessible after it expires */
5791
5860
  post_to_chat_page?: boolean;
5792
5861
  /** Pass _True_ if the content of the story must be protected from forwarding and screenshotting */
@@ -5802,7 +5871,7 @@ export interface MethodParams {
5802
5871
  /** Caption of the story, 0-2048 characters after entities parsing */
5803
5872
  caption?: string;
5804
5873
  /** Mode for parsing entities in the story caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5805
- parse_mode?: string;
5874
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5806
5875
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
5807
5876
  caption_entities?: Array<Types.MessageEntity>;
5808
5877
  /** An array of clickable areas to be shown on the story */
@@ -5826,7 +5895,7 @@ export interface MethodParams {
5826
5895
  /** New text of the message, 1-4096 characters after entities parsing */
5827
5896
  text: string;
5828
5897
  /** Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5829
- parse_mode?: string;
5898
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5830
5899
  /** An array of special entities that appear in message text, which can be specified instead of _parse\_mode_ */
5831
5900
  entities?: Array<Types.MessageEntity>;
5832
5901
  /** Link preview generation options for the message */
@@ -5846,7 +5915,7 @@ export interface MethodParams {
5846
5915
  /** New caption of the message, 0-1024 characters after entities parsing */
5847
5916
  caption?: string;
5848
5917
  /** Mode for parsing entities in the message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
5849
- parse_mode?: string;
5918
+ parse_mode?: 'HTML' | 'MarkdownV2' | 'Markdown';
5850
5919
  /** An array of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
5851
5920
  caption_entities?: Array<Types.MessageEntity>;
5852
5921
  /** Pass _True_, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
@@ -6008,7 +6077,7 @@ export interface MethodParams {
6008
6077
  /** A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See [](https://core.telegram.org/stickers)[https://core.telegram.org/stickers](https://core.telegram.org/stickers) for technical requirements. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
6009
6078
  sticker: InputFile;
6010
6079
  /** Format of the sticker, must be one of “static”, “animated”, “video” */
6011
- sticker_format: string;
6080
+ sticker_format: 'static' | 'animated' | 'video';
6012
6081
  };
6013
6082
  createNewStickerSet: {
6014
6083
  /** User identifier of created sticker set owner */
@@ -6020,7 +6089,7 @@ export interface MethodParams {
6020
6089
  /** An array of 1-50 initial stickers to be added to the sticker set */
6021
6090
  stickers: Array<Types.InputSticker>;
6022
6091
  /** Type of stickers in the set, pass “regular”, “mask”, or “custom\_emoji”. By default, a regular sticker set is created. */
6023
- sticker_type?: string;
6092
+ sticker_type?: 'regular' | 'mask' | 'custom_emoji';
6024
6093
  /** Pass _True_ if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only */
6025
6094
  needs_repainting?: boolean;
6026
6095
  };
@@ -6084,7 +6153,7 @@ export interface MethodParams {
6084
6153
  /** A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see [](https://core.telegram.org/stickers#animation-requirements)[https://core.telegram.org/stickers#animation-requirements](https://core.telegram.org/stickers#animation-requirements) for animated sticker technical requirements), or a **.WEBM** video with the thumbnail up to 32 kilobytes in size; see [](https://core.telegram.org/stickers#video-requirements)[https://core.telegram.org/stickers#video-requirements](https://core.telegram.org/stickers#video-requirements) for video sticker technical requirements. Pass a _file\_id_ as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files). Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. */
6085
6154
  thumbnail?: InputFile | string;
6086
6155
  /** Format of the thumbnail, must be one of “static” for a **.WEBP** or **.PNG** image, “animated” for a **.TGS** animation, or “video” for a **.WEBM** video */
6087
- format: string;
6156
+ format: 'static' | 'animated' | 'video';
6088
6157
  };
6089
6158
  setCustomEmojiStickerSetThumbnail: {
6090
6159
  /** Sticker set name */
@@ -6210,7 +6279,7 @@ export interface MethodParams {
6210
6279
  /** Price breakdown, an array of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in [Telegram Stars](https://t.me/BotNews/90). */
6211
6280
  prices: Array<Types.LabeledPrice>;
6212
6281
  /** The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars. */
6213
- subscription_period?: number;
6282
+ subscription_period?: 2592000;
6214
6283
  /** The maximum accepted amount for tips in the _smallest units_ of the currency (integer, **not** float/double). For example, for a maximum tip of `US$ 1.45` pass `max_tip_amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in [Telegram Stars](https://t.me/BotNews/90). */
6215
6284
  max_tip_amount?: number;
6216
6285
  /** An array of suggested amounts of tips in the _smallest units_ of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed _max\_tip\_amount_. */
@@ -6366,6 +6435,7 @@ export interface MethodResults {
6366
6435
  sendChatAction: true;
6367
6436
  setMessageReaction: true;
6368
6437
  getUserProfilePhotos: Types.UserProfilePhotos;
6438
+ getUserProfileAudios: Types.UserProfileAudios;
6369
6439
  setUserEmojiStatus: true;
6370
6440
  getFile: Types.File;
6371
6441
  banChatMember: true;
@@ -6423,6 +6493,8 @@ export interface MethodResults {
6423
6493
  getMyDescription: Types.BotDescription;
6424
6494
  setMyShortDescription: true;
6425
6495
  getMyShortDescription: Types.BotShortDescription;
6496
+ setMyProfilePhoto: true;
6497
+ removeMyProfilePhoto: true;
6426
6498
  setChatMenuButton: true;
6427
6499
  getChatMenuButton: Types.MenuButton;
6428
6500
  setMyDefaultAdministratorRights: true;