@telegram.ts/types 1.9.0 → 1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -11,6 +11,7 @@
11
11
  "api",
12
12
  "types"
13
13
  ],
14
+ "homepage": "https://telegramsjs.vercel.app/",
14
15
  "license": "MIT",
15
16
  "bugs": {
16
17
  "url": "https://github.com/telegramsjs/types/issues"
@@ -43,7 +43,11 @@ import type {
43
43
  StickerSet,
44
44
  } from "./messageTypes.ts";
45
45
  import type { PassportElementError } from "./passportTypes.ts";
46
- import type { LabeledPrice, ShippingOption } from "./invoiceTypes.ts";
46
+ import type {
47
+ LabeledPrice,
48
+ ShippingOption,
49
+ StarTransactions,
50
+ } from "./invoiceTypes.ts";
47
51
  import type {
48
52
  BotCommandScope,
49
53
  BotDescription,
@@ -140,6 +144,8 @@ export type ApiMethods = {
140
144
  disable_notification?: boolean;
141
145
  /** Protects the contents of the sent message from forwarding and saving */
142
146
  protect_content?: boolean;
147
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
148
+ message_effect_id?: string;
143
149
  /** Description of the message to reply to */
144
150
  reply_parameters?: ReplyParameters;
145
151
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -200,13 +206,15 @@ export type ApiMethods = {
200
206
  parse_mode?: string;
201
207
  /** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
202
208
  caption_entities?: MessageEntity[];
209
+ /** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
210
+ show_caption_above_media?: boolean;
203
211
  /** Sends the message silently. Users will receive a notification with no sound. */
204
212
  disable_notification?: boolean;
205
213
  /** Protects the contents of the sent message from forwarding and saving */
206
214
  protect_content?: boolean;
207
215
  /** Description of the message to reply to */
208
216
  reply_parameters?: ReplyParameters;
209
- /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
217
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
210
218
  reply_markup?:
211
219
  | InlineKeyboardMarkup
212
220
  | ReplyKeyboardMarkup
@@ -243,19 +251,23 @@ export type ApiMethods = {
243
251
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
244
252
  message_thread_id?: number;
245
253
  /** Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. */
246
- photo: Buffer | ReadStream | string | string;
254
+ photo: Buffer | ReadStream | string;
247
255
  /** Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing */
248
256
  caption?: string;
249
257
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
250
258
  parse_mode?: ParseMode;
251
259
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
252
260
  caption_entities?: MessageEntity[];
261
+ /** Pass True, if the caption must be shown above the message media */
262
+ show_caption_above_media?: boolean;
253
263
  /** Pass True if the photo needs to be covered with a spoiler animation */
254
264
  has_spoiler?: boolean;
255
265
  /** Sends the message silently. Users will receive a notification with no sound. */
256
266
  disable_notification?: boolean;
257
267
  /** Protects the contents of the sent message from forwarding and saving */
258
268
  protect_content?: boolean;
269
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
270
+ message_effect_id?: string;
259
271
  /** Description of the message to reply to */
260
272
  reply_parameters?: ReplyParameters;
261
273
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -268,7 +280,9 @@ export type ApiMethods = {
268
280
  reply_to_message_id?: number;
269
281
  }): Message.PhotoMessage;
270
282
 
271
- /** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
283
+ /** Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
284
+
285
+ For sending voice messages, use the sendVoice method instead. */
272
286
  sendAudio(args: {
273
287
  /** Unique identifier of the business connection on behalf of which the message will be sent */
274
288
  business_connection_id?: string;
@@ -277,7 +291,7 @@ export type ApiMethods = {
277
291
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
278
292
  message_thread_id?: number;
279
293
  /** Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. */
280
- audio: Buffer | ReadStream | string | string;
294
+ audio: Buffer | ReadStream | string;
281
295
  /** Audio caption, 0-1024 characters after entities parsing */
282
296
  caption?: string;
283
297
  /** Mode for parsing entities in the audio caption. See formatting options for more details. */
@@ -296,6 +310,8 @@ export type ApiMethods = {
296
310
  disable_notification?: boolean;
297
311
  /** Protects the contents of the sent message from forwarding and saving */
298
312
  protect_content?: boolean;
313
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
314
+ message_effect_id?: string;
299
315
  /** Description of the message to reply to */
300
316
  reply_parameters?: ReplyParameters;
301
317
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -317,7 +333,7 @@ export type ApiMethods = {
317
333
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
318
334
  message_thread_id?: number;
319
335
  /** File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), 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. */
320
- document: Buffer | ReadStream | string | string;
336
+ document: Buffer | ReadStream | string;
321
337
  /** 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>. */
322
338
  thumbnail?: Buffer | ReadStream | string;
323
339
  /** Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing */
@@ -332,6 +348,8 @@ export type ApiMethods = {
332
348
  disable_notification?: boolean;
333
349
  /** Protects the contents of the sent message from forwarding and saving */
334
350
  protect_content?: boolean;
351
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
352
+ message_effect_id?: string;
335
353
  /** Description of the message to reply to */
336
354
  reply_parameters?: ReplyParameters;
337
355
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -353,7 +371,7 @@ export type ApiMethods = {
353
371
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
354
372
  message_thread_id?: number;
355
373
  /** Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. */
356
- video: Buffer | ReadStream | string | string;
374
+ video: Buffer | ReadStream | string;
357
375
  /** Duration of sent video in seconds */
358
376
  duration?: number;
359
377
  /** Video width */
@@ -368,6 +386,8 @@ export type ApiMethods = {
368
386
  parse_mode?: ParseMode;
369
387
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
370
388
  caption_entities?: MessageEntity[];
389
+ /** Pass True, if the caption must be shown above the message media */
390
+ show_caption_above_media?: boolean;
371
391
  /** Pass True if the video needs to be covered with a spoiler animation */
372
392
  has_spoiler?: boolean;
373
393
  /** Pass True if the uploaded video is suitable for streaming */
@@ -376,6 +396,8 @@ export type ApiMethods = {
376
396
  disable_notification?: boolean;
377
397
  /** Protects the contents of the sent message from forwarding and saving */
378
398
  protect_content?: boolean;
399
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
400
+ message_effect_id?: string;
379
401
  /** Description of the message to reply to */
380
402
  reply_parameters?: ReplyParameters;
381
403
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -397,7 +419,7 @@ export type ApiMethods = {
397
419
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
398
420
  message_thread_id?: number;
399
421
  /** Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. */
400
- animation: Buffer | ReadStream | string | string;
422
+ animation: Buffer | ReadStream | string;
401
423
  /** Duration of sent animation in seconds */
402
424
  duration?: number;
403
425
  /** Animation width */
@@ -412,12 +434,16 @@ export type ApiMethods = {
412
434
  parse_mode?: ParseMode;
413
435
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
414
436
  caption_entities?: MessageEntity[];
437
+ /** Pass True, if the caption must be shown above the message media */
438
+ show_caption_above_media?: boolean;
415
439
  /** Pass True if the animation needs to be covered with a spoiler animation */
416
440
  has_spoiler?: boolean;
417
441
  /** Sends the message silently. Users will receive a notification with no sound. */
418
442
  disable_notification?: boolean;
419
443
  /** Protects the contents of the sent message from forwarding and saving */
420
444
  protect_content?: boolean;
445
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
446
+ message_effect_id?: string;
421
447
  /** Description of the message to reply to */
422
448
  reply_parameters?: ReplyParameters;
423
449
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -430,7 +456,7 @@ export type ApiMethods = {
430
456
  reply_to_message_id?: number;
431
457
  }): Message.AnimationMessage;
432
458
 
433
- /** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
459
+ /** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
434
460
  sendVoice(args: {
435
461
  /** Unique identifier of the business connection on behalf of which the message will be sent */
436
462
  business_connection_id?: string;
@@ -439,7 +465,7 @@ export type ApiMethods = {
439
465
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
440
466
  message_thread_id?: number;
441
467
  /** Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), 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. */
442
- voice: Buffer | ReadStream | string | string;
468
+ voice: Buffer | ReadStream | string;
443
469
  /** Voice message caption, 0-1024 characters after entities parsing */
444
470
  caption?: string;
445
471
  /** Mode for parsing entities in the voice message caption. See formatting options for more details. */
@@ -452,6 +478,8 @@ export type ApiMethods = {
452
478
  disable_notification?: boolean;
453
479
  /** Protects the contents of the sent message from forwarding and saving */
454
480
  protect_content?: boolean;
481
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
482
+ message_effect_id?: string;
455
483
  /** Description of the message to reply to */
456
484
  reply_parameters?: ReplyParameters;
457
485
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -474,7 +502,7 @@ export type ApiMethods = {
474
502
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
475
503
  message_thread_id?: number;
476
504
  /** Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported */
477
- video_note: Buffer | ReadStream | string | string;
505
+ video_note: Buffer | ReadStream | string;
478
506
  /** Duration of sent video in seconds */
479
507
  duration?: number;
480
508
  /** Video width and height, i.e. diameter of the video message */
@@ -485,6 +513,8 @@ export type ApiMethods = {
485
513
  disable_notification?: boolean;
486
514
  /** Protects the contents of the sent message from forwarding and saving */
487
515
  protect_content?: boolean;
516
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
517
+ message_effect_id?: string;
488
518
  /** Description of the message to reply to */
489
519
  reply_parameters?: ReplyParameters;
490
520
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -513,6 +543,8 @@ export type ApiMethods = {
513
543
  disable_notification?: boolean;
514
544
  /** Protects the contents of the sent messages from forwarding and saving */
515
545
  protect_content?: boolean;
546
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
547
+ message_effect_id?: string;
516
548
  /** Description of the message to reply to */
517
549
  reply_parameters?: ReplyParameters;
518
550
  /** @deprecated Use `reply_parameters` instead. */
@@ -548,6 +580,8 @@ export type ApiMethods = {
548
580
  disable_notification?: boolean;
549
581
  /** Protects the contents of the sent message from forwarding and saving */
550
582
  protect_content?: boolean;
583
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
584
+ message_effect_id?: string;
551
585
  /** Description of the message to reply to */
552
586
  reply_parameters?: ReplyParameters;
553
587
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -562,6 +596,8 @@ export type ApiMethods = {
562
596
 
563
597
  /** Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
564
598
  editMessageLiveLocation(args: {
599
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
600
+ business_connection_id?: string;
565
601
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
566
602
  chat_id?: number | string;
567
603
  /** Required if inline_message_id is not specified. Identifier of the message to edit */
@@ -586,6 +622,8 @@ export type ApiMethods = {
586
622
 
587
623
  /** Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned. */
588
624
  stopMessageLiveLocation(args: {
625
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
626
+ business_connection_id?: string;
589
627
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
590
628
  chat_id?: number | string;
591
629
  /** Required if inline_message_id is not specified. Identifier of the message with live location to stop */
@@ -624,6 +662,8 @@ export type ApiMethods = {
624
662
  disable_notification?: boolean;
625
663
  /** Protects the contents of the sent message from forwarding and saving */
626
664
  protect_content?: boolean;
665
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
666
+ message_effect_id?: string;
627
667
  /** Description of the message to reply to */
628
668
  reply_parameters?: ReplyParameters;
629
669
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -656,6 +696,8 @@ export type ApiMethods = {
656
696
  disable_notification?: boolean;
657
697
  /** Protects the contents of the sent message from forwarding and saving */
658
698
  protect_content?: boolean;
699
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
700
+ message_effect_id?: string;
659
701
  /** Description of the message to reply to */
660
702
  reply_parameters?: ReplyParameters;
661
703
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -708,6 +750,8 @@ export type ApiMethods = {
708
750
  disable_notification?: boolean;
709
751
  /** Protects the contents of the sent message from forwarding and saving */
710
752
  protect_content?: boolean;
753
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
754
+ message_effect_id?: string;
711
755
  /** Description of the message to reply to */
712
756
  reply_parameters?: ReplyParameters;
713
757
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -734,6 +778,8 @@ export type ApiMethods = {
734
778
  disable_notification?: boolean;
735
779
  /** Protects the contents of the sent message from forwarding */
736
780
  protect_content?: boolean;
781
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
782
+ message_effect_id?: string;
737
783
  /** Description of the message to reply to */
738
784
  reply_parameters?: ReplyParameters;
739
785
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -752,7 +798,7 @@ export type ApiMethods = {
752
798
 
753
799
  We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
754
800
  sendChatAction(args: {
755
- /** Unique identifier of the business connection on behalf of which the message will be sent */
801
+ /** Unique identifier of the business connection on behalf of which the action will be sent */
756
802
  business_connection_id?: string;
757
803
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
758
804
  chat_id: number | string;
@@ -1217,7 +1263,7 @@ export type ApiMethods = {
1217
1263
  business_connection_id: string;
1218
1264
  }): BusinessConnection;
1219
1265
 
1220
- /** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success. */
1266
+ /** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots/features#commands for more details about bot commands. Returns True on success. */
1221
1267
  setMyCommands(args: {
1222
1268
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
1223
1269
  commands: readonly BotCommand[];
@@ -1313,8 +1359,10 @@ export type ApiMethods = {
1313
1359
  for_channels?: boolean;
1314
1360
  }): ChatAdministratorRights;
1315
1361
 
1316
- /** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
1362
+ /** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
1317
1363
  editMessageText(args: {
1364
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1365
+ business_connection_id?: string;
1318
1366
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1319
1367
  chat_id?: number | string;
1320
1368
  /** Required if inline_message_id is not specified. Identifier of the message to edit */
@@ -1333,8 +1381,10 @@ export type ApiMethods = {
1333
1381
  reply_markup?: InlineKeyboardMarkup;
1334
1382
  }): (Update.Edited & Message.TextMessage) | true;
1335
1383
 
1336
- /** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
1384
+ /** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
1337
1385
  editMessageCaption(args: {
1386
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1387
+ business_connection_id?: string;
1338
1388
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1339
1389
  chat_id?: number | string;
1340
1390
  /** Required if inline_message_id is not specified. Identifier of the message to edit */
@@ -1347,12 +1397,16 @@ export type ApiMethods = {
1347
1397
  parse_mode?: ParseMode;
1348
1398
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
1349
1399
  caption_entities?: MessageEntity[];
1400
+ /** Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
1401
+ show_caption_above_media?: boolean;
1350
1402
  /** An object for an inline keyboard. */
1351
1403
  reply_markup?: InlineKeyboardMarkup;
1352
1404
  }): (Update.Edited & Message.CaptionableMessage) | true;
1353
1405
 
1354
- /** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
1406
+ /** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
1355
1407
  editMessageMedia(args: {
1408
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1409
+ business_connection_id?: string;
1356
1410
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1357
1411
  chat_id?: number | string;
1358
1412
  /** Required if inline_message_id is not specified. Identifier of the message to edit */
@@ -1365,8 +1419,10 @@ export type ApiMethods = {
1365
1419
  reply_markup?: InlineKeyboardMarkup;
1366
1420
  }): (Update.Edited & Message) | true;
1367
1421
 
1368
- /** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
1422
+ /** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
1369
1423
  editMessageReplyMarkup(args: {
1424
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1425
+ business_connection_id?: string;
1370
1426
  /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1371
1427
  chat_id?: number | string;
1372
1428
  /** Required if inline_message_id is not specified. Identifier of the message to edit */
@@ -1379,6 +1435,8 @@ export type ApiMethods = {
1379
1435
 
1380
1436
  /** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
1381
1437
  stopPoll(args: {
1438
+ /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1439
+ business_connection_id?: string;
1382
1440
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1383
1441
  chat_id: number | string;
1384
1442
  /** Identifier of the original message with the poll */
@@ -1421,13 +1479,15 @@ export type ApiMethods = {
1421
1479
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1422
1480
  message_thread_id?: number;
1423
1481
  /** Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL. */
1424
- sticker: Buffer | ReadStream | string | string;
1482
+ sticker: Buffer | ReadStream | string;
1425
1483
  /** Emoji associated with the sticker; only for just uploaded stickers */
1426
1484
  emoji?: string;
1427
1485
  /** Sends the message silently. Users will receive a notification with no sound. */
1428
1486
  disable_notification?: boolean;
1429
1487
  /** Protects the contents of the sent message from forwarding and saving */
1430
1488
  protect_content?: boolean;
1489
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
1490
+ message_effect_id?: string;
1431
1491
  /** Description of the message to reply to */
1432
1492
  reply_parameters?: ReplyParameters;
1433
1493
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -1448,7 +1508,7 @@ export type ApiMethods = {
1448
1508
 
1449
1509
  /** Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects. */
1450
1510
  getCustomEmojiStickers(args: {
1451
- /** List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1511
+ /** A list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1452
1512
  custom_emoji_ids: string[];
1453
1513
  }): Sticker[];
1454
1514
 
@@ -1488,18 +1548,6 @@ export type ApiMethods = {
1488
1548
  sticker: InputSticker;
1489
1549
  }): true;
1490
1550
 
1491
- /** Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success. */
1492
- replaceStickerInSet(args: {
1493
- /** User identifier of the sticker set owner */
1494
- user_id: number;
1495
- /** Sticker set name */
1496
- name: string;
1497
- /** File identifier of the replaced sticker */
1498
- old_sticker: string;
1499
- /** An object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.:x */
1500
- sticker: InputSticker;
1501
- }): true;
1502
-
1503
1551
  /** Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. */
1504
1552
  setStickerPositionInSet(args: {
1505
1553
  /** File identifier of the sticker */
@@ -1514,6 +1562,18 @@ export type ApiMethods = {
1514
1562
  sticker: string;
1515
1563
  }): true;
1516
1564
 
1565
+ /** Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success. */
1566
+ replaceStickerInSet(args: {
1567
+ /** User identifier of the sticker set owner */
1568
+ user_id: number;
1569
+ /** Sticker set name */
1570
+ name: string;
1571
+ /** File identifier of the replaced sticker */
1572
+ old_sticker: string;
1573
+ /** An object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.:x */
1574
+ sticker: InputSticker;
1575
+ }): true;
1576
+
1517
1577
  /** Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success. */
1518
1578
  setStickerEmojiList(args: {
1519
1579
  /** File identifier of the sticker */
@@ -1559,7 +1619,7 @@ export type ApiMethods = {
1559
1619
  /** User identifier of the sticker set owner */
1560
1620
  user_id: number;
1561
1621
  /** 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#animated-sticker-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-sticker-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 ». 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. */
1562
- thumbnail?: Buffer | ReadStream | string | string;
1622
+ thumbnail?: Buffer | ReadStream | string;
1563
1623
  /** 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 */
1564
1624
  format: "static" | "animated" | "video";
1565
1625
  }): true;
@@ -1611,13 +1671,13 @@ export type ApiMethods = {
1611
1671
  description: string;
1612
1672
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1613
1673
  payload: string;
1614
- /** Payment provider token, obtained via @BotFather */
1615
- provider_token: string;
1616
- /** Three-letter ISO 4217 currency code, see more on currencies */
1674
+ /** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
1675
+ provider_token?: string;
1676
+ /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
1617
1677
  currency: string;
1618
- /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
1678
+ /** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
1619
1679
  prices: readonly LabeledPrice[];
1620
- /** 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, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
1680
+ /** 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, 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. */
1621
1681
  max_tip_amount?: number;
1622
1682
  /** 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. */
1623
1683
  suggested_tip_amounts?: number[];
@@ -1633,24 +1693,26 @@ export type ApiMethods = {
1633
1693
  photo_width?: number;
1634
1694
  /** Photo height */
1635
1695
  photo_height?: number;
1636
- /** Pass True if you require the user's full name to complete the order */
1696
+ /** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
1637
1697
  need_name?: boolean;
1638
- /** Pass True if you require the user's phone number to complete the order */
1698
+ /** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
1639
1699
  need_phone_number?: boolean;
1640
- /** Pass True if you require the user's email address to complete the order */
1700
+ /** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
1641
1701
  need_email?: boolean;
1642
- /** Pass True if you require the user's shipping address to complete the order */
1702
+ /** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
1643
1703
  need_shipping_address?: boolean;
1644
- /** Pass True if the user's phone number should be sent to provider */
1704
+ /** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
1645
1705
  send_phone_number_to_provider?: boolean;
1646
- /** Pass True if the user's email address should be sent to provider */
1706
+ /** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
1647
1707
  send_email_to_provider?: boolean;
1648
- /** Pass True if the final price depends on the shipping method */
1708
+ /** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
1649
1709
  is_flexible?: boolean;
1650
1710
  /** Sends the message silently. Users will receive a notification with no sound. */
1651
1711
  disable_notification?: boolean;
1652
1712
  /** Protects the contents of the sent message from forwarding and saving */
1653
1713
  protect_content?: boolean;
1714
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
1715
+ message_effect_id?: string;
1654
1716
  /** Description of the message to reply to */
1655
1717
  reply_parameters?: ReplyParameters;
1656
1718
  /** An object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
@@ -1667,8 +1729,8 @@ export type ApiMethods = {
1667
1729
  description: string;
1668
1730
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1669
1731
  payload: string;
1670
- /** Payment provider token, obtained via BotFather */
1671
- provider_token: string;
1732
+ /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
1733
+ provider_token?: string;
1672
1734
  /** Three-letter ISO 4217 currency code, see more on currencies */
1673
1735
  currency: string;
1674
1736
  /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
@@ -1725,6 +1787,22 @@ export type ApiMethods = {
1725
1787
  error_message?: string;
1726
1788
  }): true;
1727
1789
 
1790
+ /** Refunds a successful payment in Telegram Stars. Returns True on success. */
1791
+ refundStarPayment(args: {
1792
+ /** Identifier of the user whose payment will be refunded */
1793
+ user_id: number;
1794
+ /** Telegram payment identifier */
1795
+ telegram_payment_charge_id: string;
1796
+ }): true;
1797
+
1798
+ /** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
1799
+ getStarTransactions(args: {
1800
+ /** Number of transactions to skip in the response */
1801
+ offset?: number;
1802
+ /** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
1803
+ limit?: number;
1804
+ }): StarTransactions;
1805
+
1728
1806
  /** Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
1729
1807
 
1730
1808
  Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. */
@@ -1749,9 +1827,11 @@ export type ApiMethods = {
1749
1827
  disable_notification?: boolean;
1750
1828
  /** Protects the contents of the sent message from forwarding and saving */
1751
1829
  protect_content?: boolean;
1830
+ /** Unique identifier of the message effect to be added to the message; for private chats only */
1831
+ message_effect_id?: string;
1752
1832
  /** Description of the message to reply to */
1753
1833
  reply_parameters?: ReplyParameters;
1754
- /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
1834
+ /** An object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. */
1755
1835
  reply_markup?: InlineKeyboardMarkup;
1756
1836
  /** @deprecated Use `reply_parameters` instead. */
1757
1837
  reply_to_message_id?: number;
@@ -1792,10 +1872,10 @@ export type ApiMethods = {
1792
1872
 
1793
1873
  /** This object describes a sticker to be added to a sticker set. */
1794
1874
  export interface InputSticker {
1795
- /** 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 */
1796
- format: "static" | "animated" | "video";
1797
1875
  /** 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 upload a new one using multipart/form-data. Animated and video stickers can't be uploaded via HTTP URL. */
1798
1876
  sticker: Buffer | ReadStream | string;
1877
+ /** 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 */
1878
+ format: "static" | "animated" | "video";
1799
1879
  /** List of 1-20 emoji associated with the sticker */
1800
1880
  emoji_list: string[];
1801
1881
  /** Position where the mask should be placed on faces. For “mask” stickers only. */
@@ -1825,6 +1905,8 @@ export interface InputMediaPhoto {
1825
1905
  media: Buffer | ReadStream | string;
1826
1906
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
1827
1907
  caption?: string;
1908
+ /** Pass True, if the caption must be shown above the message media */
1909
+ show_caption_above_media?: boolean;
1828
1910
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
1829
1911
  parse_mode?: ParseMode;
1830
1912
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1843,6 +1925,8 @@ export interface InputMediaVideo {
1843
1925
  thumbnail?: Buffer | ReadStream | string;
1844
1926
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
1845
1927
  caption?: string;
1928
+ /** Pass True, if the caption must be shown above the message media */
1929
+ show_caption_above_media?: boolean;
1846
1930
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
1847
1931
  parse_mode?: ParseMode;
1848
1932
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1869,6 +1953,8 @@ export interface InputMediaAnimation {
1869
1953
  thumbnail?: Buffer | ReadStream | string;
1870
1954
  /** Caption of the animation to be sent, 0-1024 characters after entities parsing */
1871
1955
  caption?: string;
1956
+ /** Pass True, if the caption must be shown above the message media */
1957
+ show_caption_above_media?: boolean;
1872
1958
  /** Mode for parsing entities in the animation caption. See formatting options for more details. */
1873
1959
  parse_mode?: ParseMode;
1874
1960
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -111,6 +111,8 @@ export interface InlineQueryResultPhoto {
111
111
  description?: string;
112
112
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
113
113
  caption?: string;
114
+ /** Pass True, if the caption must be shown above the message media */
115
+ show_caption_above_media?: boolean;
114
116
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
115
117
  parse_mode?: ParseMode;
116
118
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -142,6 +144,8 @@ export interface InlineQueryResultGif {
142
144
  title?: string;
143
145
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
144
146
  caption?: string;
147
+ /** Pass True, if the caption must be shown above the message media */
148
+ show_caption_above_media?: boolean;
145
149
  /** Mode for parsing entities in the caption. See formatting options for more details. */
146
150
  parse_mode?: ParseMode;
147
151
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -173,6 +177,8 @@ export interface InlineQueryResultMpeg4Gif {
173
177
  title?: string;
174
178
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
175
179
  caption?: string;
180
+ /** Pass True, if the caption must be shown above the message media */
181
+ show_caption_above_media?: boolean;
176
182
  /** Mode for parsing entities in the caption. See formatting options for more details. */
177
183
  parse_mode?: ParseMode;
178
184
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -200,6 +206,8 @@ export interface InlineQueryResultVideo {
200
206
  title: string;
201
207
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
202
208
  caption?: string;
209
+ /** Pass True, if the caption must be shown above the message media */
210
+ show_caption_above_media?: boolean;
203
211
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
204
212
  parse_mode?: ParseMode;
205
213
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -424,6 +432,8 @@ export interface InlineQueryResultCachedPhoto {
424
432
  description?: string;
425
433
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
426
434
  caption?: string;
435
+ /** Pass True, if the caption must be shown above the message media */
436
+ show_caption_above_media?: boolean;
427
437
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
428
438
  parse_mode?: ParseMode;
429
439
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -445,6 +455,8 @@ export interface InlineQueryResultCachedGif {
445
455
  title?: string;
446
456
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
447
457
  caption?: string;
458
+ /** Pass True, if the caption must be shown above the message media */
459
+ show_caption_above_media?: boolean;
448
460
  /** Mode for parsing entities in the caption. See formatting options for more details. */
449
461
  parse_mode?: ParseMode;
450
462
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -466,6 +478,8 @@ export interface InlineQueryResultCachedMpeg4Gif {
466
478
  title?: string;
467
479
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
468
480
  caption?: string;
481
+ /** Pass True, if the caption must be shown above the message media */
482
+ show_caption_above_media?: boolean;
469
483
  /** Mode for parsing entities in the caption. See formatting options for more details. */
470
484
  parse_mode?: ParseMode;
471
485
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -530,6 +544,8 @@ export interface InlineQueryResultCachedVideo {
530
544
  description?: string;
531
545
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
532
546
  caption?: string;
547
+ /** Pass True, if the caption must be shown above the message media */
548
+ show_caption_above_media?: boolean;
533
549
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
534
550
  parse_mode?: ParseMode;
535
551
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -660,13 +676,13 @@ export interface InputInvoiceMessageContent {
660
676
  description: string;
661
677
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
662
678
  payload: string;
663
- /** Payment provider token, obtained via BotFather */
664
- provider_token: string;
665
- /** Three-letter ISO 4217 currency code, see more on currencies */
679
+ /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
680
+ provider_token?: string;
681
+ /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
666
682
  currency: string;
667
- /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
683
+ /** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
668
684
  prices: LabeledPrice[];
669
- /** 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, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
685
+ /** 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, 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. */
670
686
  max_tip_amount?: number;
671
687
  /** An array of suggested amounts of tip 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. */
672
688
  suggested_tip_amounts?: number[];
@@ -680,19 +696,19 @@ export interface InputInvoiceMessageContent {
680
696
  photo_width?: number;
681
697
  /** Photo height */
682
698
  photo_height?: number;
683
- /** Pass True if you require the user's full name to complete the order */
699
+ /** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
684
700
  need_name?: boolean;
685
- /** Pass True if you require the user's phone number to complete the order */
701
+ /** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
686
702
  need_phone_number?: boolean;
687
- /** Pass True if you require the user's email address to complete the order */
703
+ /** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
688
704
  need_email?: boolean;
689
- /** Pass True if you require the user's shipping address to complete the order */
705
+ /** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
690
706
  need_shipping_address?: boolean;
691
- /** Pass True if the user's phone number should be sent to provider */
707
+ /** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
692
708
  send_phone_number_to_provider?: boolean;
693
- /** Pass True if the user's email address should be sent to provider */
709
+ /** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
694
710
  send_email_to_provider?: boolean;
695
- /** Pass True if the final price depends on the shipping method */
711
+ /** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
696
712
  is_flexible?: boolean;
697
713
  }
698
714
  /** Represents a result of an inline query that was chosen by the user and sent to their chat partner.
@@ -25,7 +25,7 @@ export interface Invoice {
25
25
  description: string;
26
26
  /** A unique bot deep-linking parameter that can be used to generate this invoice. */
27
27
  start_parameter: string;
28
- /** The three-letter ISO 4217 currency code. */
28
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. */
29
29
  currency: string;
30
30
  /**
31
31
  * The total price in the smallest units of the currency (integer, not float/double).
@@ -84,7 +84,7 @@ export interface ShippingOption {
84
84
  * This interface contains basic information about a successful payment.
85
85
  */
86
86
  export interface SuccessfulPayment {
87
- /** The three-letter ISO 4217 currency code. */
87
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. */
88
88
  currency: string;
89
89
  /**
90
90
  * The total price in the smallest units of the currency (integer, not float/double).
@@ -127,7 +127,7 @@ export interface PreCheckoutQuery {
127
127
  id: string;
128
128
  /** The user who sent the query. */
129
129
  from: User;
130
- /** The three-letter ISO 4217 currency code. */
130
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. */
131
131
  currency: string;
132
132
  /**
133
133
  * The total price in the smallest units of the currency (integer, not float/double).
@@ -143,3 +143,85 @@ export interface PreCheckoutQuery {
143
143
  /** The order information provided by the user. */
144
144
  order_info?: OrderInfo;
145
145
  }
146
+
147
+ /** This object describes the state of a revenue withdrawal operation. Currently, it can be one of
148
+ - RevenueWithdrawalStatePending
149
+ - RevenueWithdrawalStateSucceeded
150
+ - RevenueWithdrawalStateFailed */
151
+ export type RevenueWithdrawalState =
152
+ | RevenueWithdrawalStatePending
153
+ | RevenueWithdrawalStateSucceeded
154
+ | RevenueWithdrawalStateFailed;
155
+
156
+ /** The withdrawal is in progress. */
157
+ export interface RevenueWithdrawalStatePending {
158
+ /** Type of the state, always “pending” */
159
+ type: "pending";
160
+ }
161
+
162
+ /** The withdrawal succeeded. */
163
+ export interface RevenueWithdrawalStateSucceeded {
164
+ /** Type of the state, always “succeeded” */
165
+ type: "succeeded";
166
+ /** Date the withdrawal was completed in Unix time */
167
+ date: number;
168
+ /** An HTTPS URL that can be used to see transaction details */
169
+ url: string;
170
+ }
171
+
172
+ /** The withdrawal failed and the transaction was refunded. */
173
+ export interface RevenueWithdrawalStateFailed {
174
+ /** Type of the state, always “failed” */
175
+ type: "failed";
176
+ }
177
+
178
+ /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
179
+ - TransactionPartnerFragment
180
+ - TransactionPartnerUser
181
+ - TransactionPartnerOther */
182
+ export type TransactionPartner =
183
+ | TransactionPartnerFragment
184
+ | TransactionPartnerUser
185
+ | TransactionPartnerOther;
186
+
187
+ /** Describes a withdrawal transaction with Fragment. */
188
+ export interface TransactionPartnerFragment {
189
+ /** Type of the transaction partner, always “fragment” */
190
+ type: "fragment";
191
+ /** State of the transaction if the transaction is outgoing */
192
+ withdrawal_state?: RevenueWithdrawalState;
193
+ }
194
+
195
+ /** Describes a transaction with a user. */
196
+ export interface TransactionPartnerUser {
197
+ /** Type of the transaction partner, always “user” */
198
+ type: "user";
199
+ /** Information about the user */
200
+ user: User;
201
+ }
202
+
203
+ /** Describes a transaction with an unknown source or recipient. */
204
+ export interface TransactionPartnerOther {
205
+ /** Type of the transaction partner, always “other” */
206
+ type: "other";
207
+ }
208
+
209
+ /** Describes a Telegram Star transaction. */
210
+ export interface StarTransaction {
211
+ /** Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
212
+ id: string;
213
+ /** Number of Telegram Stars transferred by the transaction */
214
+ amount: number;
215
+ /** Date the transaction was created in Unix time */
216
+ date: number;
217
+ /** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */
218
+ source?: TransactionPartner;
219
+ /** Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions */
220
+ receiver?: TransactionPartner;
221
+ }
222
+
223
+ /** Contains a list of Telegram Star transactions. */
224
+ export interface StarTransactions {
225
+ /** The list of transactions */
226
+ transactions: StarTransaction[];
227
+ }
@@ -1,7 +1,7 @@
1
1
  import type { ChatAdministratorRights, User } from "./manageTypes";
2
2
  import type { MaybeInaccessibleMessage } from "./messageTypes";
3
3
 
4
- /** This object represents an inline keyboard that appears right next to the message it belongs to. */
4
+ /** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
5
5
  export interface InlineKeyboardMarkup {
6
6
  /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
7
7
  inline_keyboard: InlineKeyboardButton[][];
@@ -17,7 +17,7 @@ export declare namespace InlineKeyboardButton {
17
17
  url: string;
18
18
  }
19
19
  export interface CallbackButton extends AbstractInlineKeyboardButton {
20
- /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account. */
20
+ /** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes. */
21
21
  callback_data: string;
22
22
  }
23
23
  export interface WebAppButton extends AbstractInlineKeyboardButton {
@@ -51,7 +51,7 @@ export declare namespace InlineKeyboardButton {
51
51
  callback_game: CallbackGame;
52
52
  }
53
53
  export interface PayButton extends AbstractInlineKeyboardButton {
54
- /** Specify True, to send a Pay button.
54
+ /** Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
55
55
 
56
56
  NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
57
57
  pay: boolean;
@@ -171,7 +171,7 @@ export declare namespace KeyboardButton {
171
171
  }
172
172
  }
173
173
 
174
- /** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
174
+ /** 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. */
175
175
  export type KeyboardButton =
176
176
  | KeyboardButton.CommonButton
177
177
  | KeyboardButton.RequestUsersButton
@@ -47,12 +47,16 @@ export declare namespace Message {
47
47
  edit_date?: number;
48
48
  /** True, if the message can't be forwarded */
49
49
  has_protected_content?: true;
50
+ /** True, if the caption must be shown above the message media */
51
+ show_caption_above_media?: true;
50
52
  /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
51
53
  is_from_offline?: true;
52
54
  /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
53
55
  author_signature?: string;
54
56
  /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
55
57
  link_preview_options?: LinkPreviewOptions;
58
+ /** Unique identifier of the message effect added to the message */
59
+ effect_id?: string;
56
60
  /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
57
61
  reply_markup?: InlineKeyboardMarkup;
58
62
  }
@@ -307,7 +311,7 @@ Note that Telegram clients will display an **alert** to the user before opening
307
311
  Message entities can be nested, providing following restrictions are met:
308
312
  - If two entities have common characters, then one of them is fully contained inside another.
309
313
  - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
310
- - blockquote entities can't be nested.
314
+ - blockquote and expandable_blockquote entities can't be nested.
311
315
  - All other entities can't contain each other.
312
316
 
313
317
  Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username. Please note:
@@ -339,9 +343,15 @@ pre-formatted fixed-width code block written in the Python programming language
339
343
  ```
340
344
  >Block quotation started
341
345
  >Block quotation continued
342
- >The last line of the block quotation**
343
- >The second block quotation started right after the previous\r
344
- >The third block quotation started right after the previous
346
+ >Block quotation continued
347
+ >Block quotation continued
348
+ >The last line of the block quotation
349
+ ***>The second expandable block quotation started right after the previous
350
+ >It is separated from the previous block quotation by an empty bold entity
351
+ >Expandable block quotation continued
352
+ >Hidden by default part of the expandable block quotation started
353
+ >Expandable block quotation continued
354
+ >The last line of the expandable block quotation with the expandability mark
345
355
  ```
346
356
  Please note:
347
357
 
@@ -349,7 +359,7 @@ Please note:
349
359
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
350
360
  - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
351
361
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
352
- - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.
362
+ - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
353
363
  - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
354
364
  - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
355
365
 
@@ -370,6 +380,7 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
370
380
  <pre>pre-formatted fixed-width code block</pre>
371
381
  <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
372
382
  <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
383
+ <blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
373
384
  ```
374
385
  Please note:
375
386
 
@@ -401,14 +412,14 @@ pre-formatted fixed-width code block written in the Python programming language
401
412
  Please note:
402
413
 
403
414
  - Entities must not be nested, use parse mode MarkdownV2 instead.
404
- - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
415
+ - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
405
416
  - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
406
417
  - Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
407
418
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
408
419
 
409
420
  export declare namespace MessageEntity {
410
421
  interface AbstractMessageEntity {
411
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
422
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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), “custom_emoji” (for inline custom emoji stickers) */
412
423
  type: string;
413
424
  /** Offset in UTF-16 code units to the start of the entity */
414
425
  offset: number;
@@ -430,6 +441,7 @@ export declare namespace MessageEntity {
430
441
  | "strikethrough"
431
442
  | "spoiler"
432
443
  | "blockquote"
444
+ | "expandable_blockquote"
433
445
  | "code";
434
446
  }
435
447
  export interface PreMessageEntity extends AbstractMessageEntity {