@telegram.ts/types 1.8.0 → 1.10.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.8.0",
3
+ "version": "1.10.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",
@@ -7,9 +7,9 @@ import type {
7
7
  BotCommand,
8
8
  BusinessConnection,
9
9
  ChatAdministratorRights,
10
- ChatFromGetChat,
11
10
  ChatInviteLink,
12
11
  ChatMember,
12
+ ChatFullInfo,
13
13
  ChatMemberAdministrator,
14
14
  ChatMemberOwner,
15
15
  ChatPermissions,
@@ -28,6 +28,7 @@ import type {
28
28
  import type {
29
29
  File,
30
30
  GameHighScore,
31
+ InputPollOption,
31
32
  LinkPreviewOptions,
32
33
  MaskPosition,
33
34
  Message,
@@ -139,9 +140,11 @@ export type ApiMethods = {
139
140
  disable_notification?: boolean;
140
141
  /** Protects the contents of the sent message from forwarding and saving */
141
142
  protect_content?: boolean;
143
+ /** Unique identifier of the message effect to be added to the message */
144
+ message_effect_id?: string;
142
145
  /** Description of the message to reply to */
143
146
  reply_parameters?: ReplyParameters;
144
- /** 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. Not supported for messages sent on behalf of a business account. */
147
+ /** 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. */
145
148
  reply_markup?:
146
149
  | InlineKeyboardMarkup
147
150
  | ReplyKeyboardMarkup
@@ -199,13 +202,15 @@ export type ApiMethods = {
199
202
  parse_mode?: string;
200
203
  /** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
201
204
  caption_entities?: MessageEntity[];
205
+ /** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
206
+ show_caption_above_media?: boolean;
202
207
  /** Sends the message silently. Users will receive a notification with no sound. */
203
208
  disable_notification?: boolean;
204
209
  /** Protects the contents of the sent message from forwarding and saving */
205
210
  protect_content?: boolean;
206
211
  /** Description of the message to reply to */
207
212
  reply_parameters?: ReplyParameters;
208
- /** 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. Not supported for messages sent on behalf of a business account. */
213
+ /** 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. */
209
214
  reply_markup?:
210
215
  | InlineKeyboardMarkup
211
216
  | ReplyKeyboardMarkup
@@ -242,22 +247,26 @@ export type ApiMethods = {
242
247
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
243
248
  message_thread_id?: number;
244
249
  /** 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. */
245
- photo: Buffer | ReadStream | string | string;
250
+ photo: Buffer | ReadStream | string;
246
251
  /** Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing */
247
252
  caption?: string;
248
253
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
249
254
  parse_mode?: ParseMode;
250
255
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
251
256
  caption_entities?: MessageEntity[];
257
+ /** Pass True, if the caption must be shown above the message media */
258
+ show_caption_above_media?: boolean;
252
259
  /** Pass True if the photo needs to be covered with a spoiler animation */
253
260
  has_spoiler?: boolean;
254
261
  /** Sends the message silently. Users will receive a notification with no sound. */
255
262
  disable_notification?: boolean;
256
263
  /** Protects the contents of the sent message from forwarding and saving */
257
264
  protect_content?: boolean;
265
+ /** Unique identifier of the message effect to be added to the message */
266
+ message_effect_id?: string;
258
267
  /** Description of the message to reply to */
259
268
  reply_parameters?: ReplyParameters;
260
- /** 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. Not supported for messages sent on behalf of a business account. */
269
+ /** 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. */
261
270
  reply_markup?:
262
271
  | InlineKeyboardMarkup
263
272
  | ReplyKeyboardMarkup
@@ -278,7 +287,7 @@ export type ApiMethods = {
278
287
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
279
288
  message_thread_id?: number;
280
289
  /** 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. */
281
- audio: Buffer | ReadStream | string | string;
290
+ audio: Buffer | ReadStream | string;
282
291
  /** Audio caption, 0-1024 characters after entities parsing */
283
292
  caption?: string;
284
293
  /** Mode for parsing entities in the audio caption. See formatting options for more details. */
@@ -297,9 +306,11 @@ export type ApiMethods = {
297
306
  disable_notification?: boolean;
298
307
  /** Protects the contents of the sent message from forwarding and saving */
299
308
  protect_content?: boolean;
309
+ /** Unique identifier of the message effect to be added to the message */
310
+ message_effect_id?: string;
300
311
  /** Description of the message to reply to */
301
312
  reply_parameters?: ReplyParameters;
302
- /** 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. Not supported for messages sent on behalf of a business account. */
313
+ /** 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. */
303
314
  reply_markup?:
304
315
  | InlineKeyboardMarkup
305
316
  | ReplyKeyboardMarkup
@@ -318,7 +329,7 @@ export type ApiMethods = {
318
329
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
319
330
  message_thread_id?: number;
320
331
  /** 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. */
321
- document: Buffer | ReadStream | string | string;
332
+ document: Buffer | ReadStream | string;
322
333
  /** 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>. */
323
334
  thumbnail?: Buffer | ReadStream | string;
324
335
  /** Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing */
@@ -333,9 +344,11 @@ export type ApiMethods = {
333
344
  disable_notification?: boolean;
334
345
  /** Protects the contents of the sent message from forwarding and saving */
335
346
  protect_content?: boolean;
347
+ /** Unique identifier of the message effect to be added to the message */
348
+ message_effect_id?: string;
336
349
  /** Description of the message to reply to */
337
350
  reply_parameters?: ReplyParameters;
338
- /** 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. Not supported for messages sent on behalf of a business account. */
351
+ /** 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. */
339
352
  reply_markup?:
340
353
  | InlineKeyboardMarkup
341
354
  | ReplyKeyboardMarkup
@@ -354,7 +367,7 @@ export type ApiMethods = {
354
367
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
355
368
  message_thread_id?: number;
356
369
  /** 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. */
357
- video: Buffer | ReadStream | string | string;
370
+ video: Buffer | ReadStream | string;
358
371
  /** Duration of sent video in seconds */
359
372
  duration?: number;
360
373
  /** Video width */
@@ -369,6 +382,8 @@ export type ApiMethods = {
369
382
  parse_mode?: ParseMode;
370
383
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
371
384
  caption_entities?: MessageEntity[];
385
+ /** Pass True, if the caption must be shown above the message media */
386
+ show_caption_above_media?: boolean;
372
387
  /** Pass True if the video needs to be covered with a spoiler animation */
373
388
  has_spoiler?: boolean;
374
389
  /** Pass True if the uploaded video is suitable for streaming */
@@ -377,9 +392,11 @@ export type ApiMethods = {
377
392
  disable_notification?: boolean;
378
393
  /** Protects the contents of the sent message from forwarding and saving */
379
394
  protect_content?: boolean;
395
+ /** Unique identifier of the message effect to be added to the message */
396
+ message_effect_id?: string;
380
397
  /** Description of the message to reply to */
381
398
  reply_parameters?: ReplyParameters;
382
- /** 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. Not supported for messages sent on behalf of a business account. */
399
+ /** 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. */
383
400
  reply_markup?:
384
401
  | InlineKeyboardMarkup
385
402
  | ReplyKeyboardMarkup
@@ -398,7 +415,7 @@ export type ApiMethods = {
398
415
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
399
416
  message_thread_id?: number;
400
417
  /** 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. */
401
- animation: Buffer | ReadStream | string | string;
418
+ animation: Buffer | ReadStream | string;
402
419
  /** Duration of sent animation in seconds */
403
420
  duration?: number;
404
421
  /** Animation width */
@@ -413,15 +430,19 @@ export type ApiMethods = {
413
430
  parse_mode?: ParseMode;
414
431
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
415
432
  caption_entities?: MessageEntity[];
433
+ /** Pass True, if the caption must be shown above the message media */
434
+ show_caption_above_media?: boolean;
416
435
  /** Pass True if the animation needs to be covered with a spoiler animation */
417
436
  has_spoiler?: boolean;
418
437
  /** Sends the message silently. Users will receive a notification with no sound. */
419
438
  disable_notification?: boolean;
420
439
  /** Protects the contents of the sent message from forwarding and saving */
421
440
  protect_content?: boolean;
441
+ /** Unique identifier of the message effect to be added to the message */
442
+ message_effect_id?: string;
422
443
  /** Description of the message to reply to */
423
444
  reply_parameters?: ReplyParameters;
424
- /** 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. Not supported for messages sent on behalf of a business account. */
445
+ /** 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. */
425
446
  reply_markup?:
426
447
  | InlineKeyboardMarkup
427
448
  | ReplyKeyboardMarkup
@@ -431,7 +452,7 @@ export type ApiMethods = {
431
452
  reply_to_message_id?: number;
432
453
  }): Message.AnimationMessage;
433
454
 
434
- /** 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. */
455
+ /** 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. */
435
456
  sendVoice(args: {
436
457
  /** Unique identifier of the business connection on behalf of which the message will be sent */
437
458
  business_connection_id?: string;
@@ -440,7 +461,7 @@ export type ApiMethods = {
440
461
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
441
462
  message_thread_id?: number;
442
463
  /** 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. */
443
- voice: Buffer | ReadStream | string | string;
464
+ voice: Buffer | ReadStream | string;
444
465
  /** Voice message caption, 0-1024 characters after entities parsing */
445
466
  caption?: string;
446
467
  /** Mode for parsing entities in the voice message caption. See formatting options for more details. */
@@ -453,9 +474,11 @@ export type ApiMethods = {
453
474
  disable_notification?: boolean;
454
475
  /** Protects the contents of the sent message from forwarding and saving */
455
476
  protect_content?: boolean;
477
+ /** Unique identifier of the message effect to be added to the message */
478
+ message_effect_id?: string;
456
479
  /** Description of the message to reply to */
457
480
  reply_parameters?: ReplyParameters;
458
- /** 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. Not supported for messages sent on behalf of a business account. */
481
+ /** 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. */
459
482
  reply_markup?:
460
483
  | InlineKeyboardMarkup
461
484
  | ReplyKeyboardMarkup
@@ -475,7 +498,7 @@ export type ApiMethods = {
475
498
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
476
499
  message_thread_id?: number;
477
500
  /** 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 */
478
- video_note: Buffer | ReadStream | string | string;
501
+ video_note: Buffer | ReadStream | string;
479
502
  /** Duration of sent video in seconds */
480
503
  duration?: number;
481
504
  /** Video width and height, i.e. diameter of the video message */
@@ -486,9 +509,11 @@ export type ApiMethods = {
486
509
  disable_notification?: boolean;
487
510
  /** Protects the contents of the sent message from forwarding and saving */
488
511
  protect_content?: boolean;
512
+ /** Unique identifier of the message effect to be added to the message */
513
+ message_effect_id?: string;
489
514
  /** Description of the message to reply to */
490
515
  reply_parameters?: ReplyParameters;
491
- /** 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. Not supported for messages sent on behalf of a business account. */
516
+ /** 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. */
492
517
  reply_markup?:
493
518
  | InlineKeyboardMarkup
494
519
  | ReplyKeyboardMarkup
@@ -514,6 +539,8 @@ export type ApiMethods = {
514
539
  disable_notification?: boolean;
515
540
  /** Protects the contents of the sent messages from forwarding and saving */
516
541
  protect_content?: boolean;
542
+ /** Unique identifier of the message effect to be added to the message */
543
+ message_effect_id?: string;
517
544
  /** Description of the message to reply to */
518
545
  reply_parameters?: ReplyParameters;
519
546
  /** @deprecated Use `reply_parameters` instead. */
@@ -539,7 +566,7 @@ export type ApiMethods = {
539
566
  longitude: number;
540
567
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
541
568
  horizontal_accuracy?: number;
542
- /** Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. */
569
+ /** Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
543
570
  live_period?: number;
544
571
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
545
572
  heading?: number;
@@ -549,9 +576,11 @@ export type ApiMethods = {
549
576
  disable_notification?: boolean;
550
577
  /** Protects the contents of the sent message from forwarding and saving */
551
578
  protect_content?: boolean;
579
+ /** Unique identifier of the message effect to be added to the message */
580
+ message_effect_id?: string;
552
581
  /** Description of the message to reply to */
553
582
  reply_parameters?: ReplyParameters;
554
- /** 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. Not supported for messages sent on behalf of a business account. */
583
+ /** 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. */
555
584
  reply_markup?:
556
585
  | InlineKeyboardMarkup
557
586
  | ReplyKeyboardMarkup
@@ -573,6 +602,8 @@ export type ApiMethods = {
573
602
  latitude: number;
574
603
  /** Longitude of new location */
575
604
  longitude: number;
605
+ /** New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged */
606
+ live_period?: number;
576
607
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
577
608
  horizontal_accuracy?: number;
578
609
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
@@ -623,9 +654,11 @@ export type ApiMethods = {
623
654
  disable_notification?: boolean;
624
655
  /** Protects the contents of the sent message from forwarding and saving */
625
656
  protect_content?: boolean;
657
+ /** Unique identifier of the message effect to be added to the message */
658
+ message_effect_id?: string;
626
659
  /** Description of the message to reply to */
627
660
  reply_parameters?: ReplyParameters;
628
- /** 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. Not supported for messages sent on behalf of a business account. */
661
+ /** 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. */
629
662
  reply_markup?:
630
663
  | InlineKeyboardMarkup
631
664
  | ReplyKeyboardMarkup
@@ -655,9 +688,11 @@ export type ApiMethods = {
655
688
  disable_notification?: boolean;
656
689
  /** Protects the contents of the sent message from forwarding and saving */
657
690
  protect_content?: boolean;
691
+ /** Unique identifier of the message effect to be added to the message */
692
+ message_effect_id?: string;
658
693
  /** Description of the message to reply to */
659
694
  reply_parameters?: ReplyParameters;
660
- /** 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. Not supported for messages sent on behalf of a business account. */
695
+ /** 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. */
661
696
  reply_markup?:
662
697
  | InlineKeyboardMarkup
663
698
  | ReplyKeyboardMarkup
@@ -677,8 +712,12 @@ export type ApiMethods = {
677
712
  message_thread_id?: number;
678
713
  /** Poll question, 1-300 characters */
679
714
  question: string;
680
- /** A list of answer options, 2-10 strings 1-100 characters each */
681
- options: readonly string[];
715
+ /** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */
716
+ question_parse_mode?: string;
717
+ /** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
718
+ question_entities?: MessageEntity[];
719
+ /** A list of 2-10 answer options */
720
+ options: InputPollOption[];
682
721
  /** True, if the poll needs to be anonymous, defaults to True */
683
722
  is_anonymous?: boolean;
684
723
  /** Poll type, “quiz” or “regular”, defaults to “regular” */
@@ -691,7 +730,7 @@ export type ApiMethods = {
691
730
  explanation?: string;
692
731
  /** Mode for parsing entities in the explanation. See formatting options for more details. */
693
732
  explanation_parse_mode?: ParseMode;
694
- /** A list of special entities that appear in the poll explanation, which can be specified instead of parse_mode */
733
+ /** A list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode */
695
734
  explanation_entities?: MessageEntity[];
696
735
  /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */
697
736
  open_period?: number;
@@ -703,9 +742,11 @@ export type ApiMethods = {
703
742
  disable_notification?: boolean;
704
743
  /** Protects the contents of the sent message from forwarding and saving */
705
744
  protect_content?: boolean;
745
+ /** Unique identifier of the message effect to be added to the message */
746
+ message_effect_id?: string;
706
747
  /** Description of the message to reply to */
707
748
  reply_parameters?: ReplyParameters;
708
- /** 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. Not supported for messages sent on behalf of a business account. */
749
+ /** 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. */
709
750
  reply_markup?:
710
751
  | InlineKeyboardMarkup
711
752
  | ReplyKeyboardMarkup
@@ -729,9 +770,11 @@ export type ApiMethods = {
729
770
  disable_notification?: boolean;
730
771
  /** Protects the contents of the sent message from forwarding */
731
772
  protect_content?: boolean;
773
+ /** Unique identifier of the message effect to be added to the message */
774
+ message_effect_id?: string;
732
775
  /** Description of the message to reply to */
733
776
  reply_parameters?: ReplyParameters;
734
- /** 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. Not supported for messages sent on behalf of a business account. */
777
+ /** 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. */
735
778
  reply_markup?:
736
779
  | InlineKeyboardMarkup
737
780
  | ReplyKeyboardMarkup
@@ -747,7 +790,7 @@ export type ApiMethods = {
747
790
 
748
791
  We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
749
792
  sendChatAction(args: {
750
- /** Unique identifier of the business connection on behalf of which the message will be sent */
793
+ /** Unique identifier of the business connection on behalf of which the action will be sent */
751
794
  business_connection_id?: string;
752
795
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
753
796
  chat_id: number | string;
@@ -862,7 +905,7 @@ export type ApiMethods = {
862
905
  can_invite_users?: boolean;
863
906
  /** True if the administrator can post stories to the chat */
864
907
  can_post_stories?: boolean;
865
- /** True if the administrator can edit stories posted by other users */
908
+ /** Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
866
909
  can_edit_stories?: boolean;
867
910
  /** True if the administrator can delete stories posted by other users */
868
911
  can_delete_stories?: boolean;
@@ -1034,11 +1077,11 @@ export type ApiMethods = {
1034
1077
  chat_id: number | string;
1035
1078
  }): true;
1036
1079
 
1037
- /** Use this method to get up to date information about the chat. Returns a Chat object on success. */
1080
+ /** Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. */
1038
1081
  getChat(args: {
1039
1082
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
1040
1083
  chat_id: number | string;
1041
- }): ChatFromGetChat;
1084
+ }): ChatFullInfo;
1042
1085
 
1043
1086
  /** Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects. */
1044
1087
  getChatAdministrators(args: {
@@ -1212,7 +1255,7 @@ export type ApiMethods = {
1212
1255
  business_connection_id: string;
1213
1256
  }): BusinessConnection;
1214
1257
 
1215
- /** 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. */
1258
+ /** 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. */
1216
1259
  setMyCommands(args: {
1217
1260
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
1218
1261
  commands: readonly BotCommand[];
@@ -1342,6 +1385,8 @@ export type ApiMethods = {
1342
1385
  parse_mode?: ParseMode;
1343
1386
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
1344
1387
  caption_entities?: MessageEntity[];
1388
+ /** Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
1389
+ show_caption_above_media?: boolean;
1345
1390
  /** An object for an inline keyboard. */
1346
1391
  reply_markup?: InlineKeyboardMarkup;
1347
1392
  }): (Update.Edited & Message.CaptionableMessage) | true;
@@ -1416,16 +1461,18 @@ export type ApiMethods = {
1416
1461
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1417
1462
  message_thread_id?: number;
1418
1463
  /** 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. */
1419
- sticker: Buffer | ReadStream | string | string;
1464
+ sticker: Buffer | ReadStream | string;
1420
1465
  /** Emoji associated with the sticker; only for just uploaded stickers */
1421
1466
  emoji?: string;
1422
1467
  /** Sends the message silently. Users will receive a notification with no sound. */
1423
1468
  disable_notification?: boolean;
1424
1469
  /** Protects the contents of the sent message from forwarding and saving */
1425
1470
  protect_content?: boolean;
1471
+ /** Unique identifier of the message effect to be added to the message */
1472
+ message_effect_id?: string;
1426
1473
  /** Description of the message to reply to */
1427
1474
  reply_parameters?: ReplyParameters;
1428
- /** 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. Not supported for messages sent on behalf of a business account. */
1475
+ /** 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. */
1429
1476
  reply_markup?:
1430
1477
  | InlineKeyboardMarkup
1431
1478
  | ReplyKeyboardMarkup
@@ -1443,7 +1490,7 @@ export type ApiMethods = {
1443
1490
 
1444
1491
  /** Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects. */
1445
1492
  getCustomEmojiStickers(args: {
1446
- /** List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1493
+ /** A list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1447
1494
  custom_emoji_ids: string[];
1448
1495
  }): Sticker[];
1449
1496
 
@@ -1483,18 +1530,6 @@ export type ApiMethods = {
1483
1530
  sticker: InputSticker;
1484
1531
  }): true;
1485
1532
 
1486
- /** 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. */
1487
- replaceStickerInSet(args: {
1488
- /** User identifier of the sticker set owner */
1489
- user_id: number;
1490
- /** Sticker set name */
1491
- name: string;
1492
- /** File identifier of the replaced sticker */
1493
- old_sticker: string;
1494
- /** 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 */
1495
- sticker: InputSticker;
1496
- }): true;
1497
-
1498
1533
  /** Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. */
1499
1534
  setStickerPositionInSet(args: {
1500
1535
  /** File identifier of the sticker */
@@ -1509,6 +1544,18 @@ export type ApiMethods = {
1509
1544
  sticker: string;
1510
1545
  }): true;
1511
1546
 
1547
+ /** 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. */
1548
+ replaceStickerInSet(args: {
1549
+ /** User identifier of the sticker set owner */
1550
+ user_id: number;
1551
+ /** Sticker set name */
1552
+ name: string;
1553
+ /** File identifier of the replaced sticker */
1554
+ old_sticker: string;
1555
+ /** 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 */
1556
+ sticker: InputSticker;
1557
+ }): true;
1558
+
1512
1559
  /** 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. */
1513
1560
  setStickerEmojiList(args: {
1514
1561
  /** File identifier of the sticker */
@@ -1554,7 +1601,7 @@ export type ApiMethods = {
1554
1601
  /** User identifier of the sticker set owner */
1555
1602
  user_id: number;
1556
1603
  /** 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. */
1557
- thumbnail?: Buffer | ReadStream | string | string;
1604
+ thumbnail?: Buffer | ReadStream | string;
1558
1605
  /** 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 */
1559
1606
  format: "static" | "animated" | "video";
1560
1607
  }): true;
@@ -1606,13 +1653,13 @@ export type ApiMethods = {
1606
1653
  description: string;
1607
1654
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1608
1655
  payload: string;
1609
- /** Payment provider token, obtained via @BotFather */
1610
- provider_token: string;
1611
- /** Three-letter ISO 4217 currency code, see more on currencies */
1656
+ /** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
1657
+ provider_token?: string;
1658
+ /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
1612
1659
  currency: string;
1613
- /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
1660
+ /** 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. */
1614
1661
  prices: readonly LabeledPrice[];
1615
- /** 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 */
1662
+ /** 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. */
1616
1663
  max_tip_amount?: number;
1617
1664
  /** 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. */
1618
1665
  suggested_tip_amounts?: number[];
@@ -1628,24 +1675,26 @@ export type ApiMethods = {
1628
1675
  photo_width?: number;
1629
1676
  /** Photo height */
1630
1677
  photo_height?: number;
1631
- /** Pass True if you require the user's full name to complete the order */
1678
+ /** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
1632
1679
  need_name?: boolean;
1633
- /** Pass True if you require the user's phone number to complete the order */
1680
+ /** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
1634
1681
  need_phone_number?: boolean;
1635
- /** Pass True if you require the user's email address to complete the order */
1682
+ /** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
1636
1683
  need_email?: boolean;
1637
- /** Pass True if you require the user's shipping address to complete the order */
1684
+ /** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
1638
1685
  need_shipping_address?: boolean;
1639
- /** Pass True if the user's phone number should be sent to provider */
1686
+ /** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
1640
1687
  send_phone_number_to_provider?: boolean;
1641
- /** Pass True if the user's email address should be sent to provider */
1688
+ /** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
1642
1689
  send_email_to_provider?: boolean;
1643
- /** Pass True if the final price depends on the shipping method */
1690
+ /** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
1644
1691
  is_flexible?: boolean;
1645
1692
  /** Sends the message silently. Users will receive a notification with no sound. */
1646
1693
  disable_notification?: boolean;
1647
1694
  /** Protects the contents of the sent message from forwarding and saving */
1648
1695
  protect_content?: boolean;
1696
+ /** Unique identifier of the message effect to be added to the message */
1697
+ message_effect_id?: string;
1649
1698
  /** Description of the message to reply to */
1650
1699
  reply_parameters?: ReplyParameters;
1651
1700
  /** 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. */
@@ -1662,8 +1711,8 @@ export type ApiMethods = {
1662
1711
  description: string;
1663
1712
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1664
1713
  payload: string;
1665
- /** Payment provider token, obtained via BotFather */
1666
- provider_token: string;
1714
+ /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
1715
+ provider_token?: string;
1667
1716
  /** Three-letter ISO 4217 currency code, see more on currencies */
1668
1717
  currency: string;
1669
1718
  /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
@@ -1720,6 +1769,14 @@ export type ApiMethods = {
1720
1769
  error_message?: string;
1721
1770
  }): true;
1722
1771
 
1772
+ /** Refunds a successful payment in Telegram Stars. Returns True on success. */
1773
+ refundStarPayment(args: {
1774
+ /** Identifier of the user whose payment will be refunded */
1775
+ user_id: number;
1776
+ /** Telegram payment identifier */
1777
+ telegram_payment_charge_id: string;
1778
+ }): true;
1779
+
1723
1780
  /** 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.
1724
1781
 
1725
1782
  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. */
@@ -1744,9 +1801,11 @@ export type ApiMethods = {
1744
1801
  disable_notification?: boolean;
1745
1802
  /** Protects the contents of the sent message from forwarding and saving */
1746
1803
  protect_content?: boolean;
1804
+ /** Unique identifier of the message effect to be added to the message */
1805
+ message_effect_id?: string;
1747
1806
  /** Description of the message to reply to */
1748
1807
  reply_parameters?: ReplyParameters;
1749
- /** 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. Not supported for messages sent on behalf of a business account. */
1808
+ /** 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. */
1750
1809
  reply_markup?: InlineKeyboardMarkup;
1751
1810
  /** @deprecated Use `reply_parameters` instead. */
1752
1811
  reply_to_message_id?: number;
@@ -1787,10 +1846,10 @@ export type ApiMethods = {
1787
1846
 
1788
1847
  /** This object describes a sticker to be added to a sticker set. */
1789
1848
  export interface InputSticker {
1790
- /** 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 */
1791
- format: "static" | "animated" | "video";
1792
1849
  /** 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. */
1793
1850
  sticker: Buffer | ReadStream | string;
1851
+ /** 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 */
1852
+ format: "static" | "animated" | "video";
1794
1853
  /** List of 1-20 emoji associated with the sticker */
1795
1854
  emoji_list: string[];
1796
1855
  /** Position where the mask should be placed on faces. For “mask” stickers only. */
@@ -1820,6 +1879,8 @@ export interface InputMediaPhoto {
1820
1879
  media: Buffer | ReadStream | string;
1821
1880
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
1822
1881
  caption?: string;
1882
+ /** Pass True, if the caption must be shown above the message media */
1883
+ show_caption_above_media?: boolean;
1823
1884
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
1824
1885
  parse_mode?: ParseMode;
1825
1886
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1838,6 +1899,8 @@ export interface InputMediaVideo {
1838
1899
  thumbnail?: Buffer | ReadStream | string;
1839
1900
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
1840
1901
  caption?: string;
1902
+ /** Pass True, if the caption must be shown above the message media */
1903
+ show_caption_above_media?: boolean;
1841
1904
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
1842
1905
  parse_mode?: ParseMode;
1843
1906
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1864,6 +1927,8 @@ export interface InputMediaAnimation {
1864
1927
  thumbnail?: Buffer | ReadStream | string;
1865
1928
  /** Caption of the animation to be sent, 0-1024 characters after entities parsing */
1866
1929
  caption?: string;
1930
+ /** Pass True, if the caption must be shown above the message media */
1931
+ show_caption_above_media?: boolean;
1867
1932
  /** Mode for parsing entities in the animation caption. See formatting options for more details. */
1868
1933
  parse_mode?: ParseMode;
1869
1934
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */