@telegram.ts/types 1.7.0 → 1.9.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,9 +1,9 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.7.0",
4
- "description": "@telegram.ts/types: Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
- "main": "src/index.js",
6
- "types": "src/index.d.ts",
3
+ "version": "1.9.0",
4
+ "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
7
  "keywords": [
8
8
  "telegramsjs",
9
9
  "telegram",
@@ -13,16 +13,19 @@
13
13
  ],
14
14
  "license": "MIT",
15
15
  "bugs": {
16
- "url": "https://github.com/Sempai-07/telegram-ts-types/issues"
16
+ "url": "https://github.com/telegramsjs/types/issues"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/Sempai-07/telegram-ts-types.git"
20
+ "url": "git+https://github.com/telegramsjs/types.git"
21
21
  },
22
22
  "devDependencies": {
23
- "@types/node": "18.16.1"
23
+ "@types/node": "^18.16.1"
24
24
  },
25
25
  "files": [
26
+ "LICENSE",
27
+ "README.md",
28
+ "package.json",
26
29
  "src/*.d.ts",
27
30
  "src/index.js"
28
31
  ]
@@ -5,10 +5,11 @@ import type {
5
5
  } from "./inlineTypes.ts";
6
6
  import type {
7
7
  BotCommand,
8
+ BusinessConnection,
8
9
  ChatAdministratorRights,
9
- ChatFromGetChat,
10
10
  ChatInviteLink,
11
11
  ChatMember,
12
+ ChatFullInfo,
12
13
  ChatMemberAdministrator,
13
14
  ChatMemberOwner,
14
15
  ChatPermissions,
@@ -27,6 +28,7 @@ import type {
27
28
  import type {
28
29
  File,
29
30
  GameHighScore,
31
+ InputPollOption,
30
32
  LinkPreviewOptions,
31
33
  MaskPosition,
32
34
  Message,
@@ -120,6 +122,8 @@ export type ApiMethods = {
120
122
 
121
123
  /** Use this method to send text messages. On success, the sent Message is returned. */
122
124
  sendMessage(args: {
125
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
126
+ business_connection_id?: string;
123
127
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
124
128
  chat_id: number | string;
125
129
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -138,7 +142,7 @@ export type ApiMethods = {
138
142
  protect_content?: boolean;
139
143
  /** Description of the message to reply to */
140
144
  reply_parameters?: ReplyParameters;
141
- /** 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. */
145
+ /** 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. */
142
146
  reply_markup?:
143
147
  | InlineKeyboardMarkup
144
148
  | ReplyKeyboardMarkup
@@ -172,7 +176,7 @@ export type ApiMethods = {
172
176
  message_thread_id?: number;
173
177
  /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
174
178
  from_chat_id: number | string;
175
- /** Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
179
+ /** A list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
176
180
  message_ids: number[];
177
181
  /** Sends the messages silently. Users will receive a notification with no sound. */
178
182
  disable_notification?: boolean;
@@ -202,7 +206,7 @@ export type ApiMethods = {
202
206
  protect_content?: boolean;
203
207
  /** Description of the message to reply to */
204
208
  reply_parameters?: ReplyParameters;
205
- /** 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
+ /** 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. */
206
210
  reply_markup?:
207
211
  | InlineKeyboardMarkup
208
212
  | ReplyKeyboardMarkup
@@ -220,7 +224,7 @@ export type ApiMethods = {
220
224
  message_thread_id?: number;
221
225
  /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
222
226
  from_chat_id: number | string;
223
- /** Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
227
+ /** A list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
224
228
  message_ids: number[];
225
229
  /** Sends the messages silently. Users will receive a notification with no sound. */
226
230
  disable_notification?: boolean;
@@ -232,6 +236,8 @@ export type ApiMethods = {
232
236
 
233
237
  /** Use this method to send photos. On success, the sent Message is returned. */
234
238
  sendPhoto(args: {
239
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
240
+ business_connection_id?: string;
235
241
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
236
242
  chat_id: number | string;
237
243
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -252,7 +258,7 @@ export type ApiMethods = {
252
258
  protect_content?: boolean;
253
259
  /** Description of the message to reply to */
254
260
  reply_parameters?: ReplyParameters;
255
- /** 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. */
261
+ /** 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. */
256
262
  reply_markup?:
257
263
  | InlineKeyboardMarkup
258
264
  | ReplyKeyboardMarkup
@@ -262,10 +268,10 @@ export type ApiMethods = {
262
268
  reply_to_message_id?: number;
263
269
  }): Message.PhotoMessage;
264
270
 
265
- /** 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.
266
-
267
- For sending voice messages, use the sendVoice method instead. */
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. */
268
272
  sendAudio(args: {
273
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
274
+ business_connection_id?: string;
269
275
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
270
276
  chat_id: number | string;
271
277
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -292,7 +298,7 @@ export type ApiMethods = {
292
298
  protect_content?: boolean;
293
299
  /** Description of the message to reply to */
294
300
  reply_parameters?: ReplyParameters;
295
- /** 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. */
301
+ /** 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. */
296
302
  reply_markup?:
297
303
  | InlineKeyboardMarkup
298
304
  | ReplyKeyboardMarkup
@@ -304,6 +310,8 @@ export type ApiMethods = {
304
310
 
305
311
  /** Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. */
306
312
  sendDocument(args: {
313
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
314
+ business_connection_id?: string;
307
315
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
308
316
  chat_id: number | string;
309
317
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -326,7 +334,7 @@ export type ApiMethods = {
326
334
  protect_content?: boolean;
327
335
  /** Description of the message to reply to */
328
336
  reply_parameters?: ReplyParameters;
329
- /** 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. */
337
+ /** 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. */
330
338
  reply_markup?:
331
339
  | InlineKeyboardMarkup
332
340
  | ReplyKeyboardMarkup
@@ -338,6 +346,8 @@ export type ApiMethods = {
338
346
 
339
347
  /** Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. */
340
348
  sendVideo(args: {
349
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
350
+ business_connection_id?: string;
341
351
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
342
352
  chat_id: number | string;
343
353
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -368,7 +378,7 @@ export type ApiMethods = {
368
378
  protect_content?: boolean;
369
379
  /** Description of the message to reply to */
370
380
  reply_parameters?: ReplyParameters;
371
- /** 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. */
381
+ /** 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. */
372
382
  reply_markup?:
373
383
  | InlineKeyboardMarkup
374
384
  | ReplyKeyboardMarkup
@@ -380,6 +390,8 @@ export type ApiMethods = {
380
390
 
381
391
  /** Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. */
382
392
  sendAnimation(args: {
393
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
394
+ business_connection_id?: string;
383
395
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
384
396
  chat_id: number | string;
385
397
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -408,7 +420,7 @@ export type ApiMethods = {
408
420
  protect_content?: boolean;
409
421
  /** Description of the message to reply to */
410
422
  reply_parameters?: ReplyParameters;
411
- /** 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. */
423
+ /** 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. */
412
424
  reply_markup?:
413
425
  | InlineKeyboardMarkup
414
426
  | ReplyKeyboardMarkup
@@ -420,6 +432,8 @@ export type ApiMethods = {
420
432
 
421
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. */
422
434
  sendVoice(args: {
435
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
436
+ business_connection_id?: string;
423
437
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
424
438
  chat_id: number | string;
425
439
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -440,7 +454,7 @@ export type ApiMethods = {
440
454
  protect_content?: boolean;
441
455
  /** Description of the message to reply to */
442
456
  reply_parameters?: ReplyParameters;
443
- /** 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. */
457
+ /** 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. */
444
458
  reply_markup?:
445
459
  | InlineKeyboardMarkup
446
460
  | ReplyKeyboardMarkup
@@ -453,6 +467,8 @@ export type ApiMethods = {
453
467
  /** Use this method to send video messages. On success, the sent Message is returned.
454
468
  As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. */
455
469
  sendVideoNote(args: {
470
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
471
+ business_connection_id?: string;
456
472
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
457
473
  chat_id: number | string;
458
474
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -471,7 +487,7 @@ export type ApiMethods = {
471
487
  protect_content?: boolean;
472
488
  /** Description of the message to reply to */
473
489
  reply_parameters?: ReplyParameters;
474
- /** 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. */
490
+ /** 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. */
475
491
  reply_markup?:
476
492
  | InlineKeyboardMarkup
477
493
  | ReplyKeyboardMarkup
@@ -483,6 +499,8 @@ export type ApiMethods = {
483
499
 
484
500
  /** Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned. */
485
501
  sendMediaGroup(args: {
502
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
503
+ business_connection_id?: string;
486
504
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
487
505
  chat_id: number | string;
488
506
  /** An array describing messages to be sent, must include 2-10 items */
@@ -508,6 +526,8 @@ export type ApiMethods = {
508
526
 
509
527
  /** Use this method to send point on the map. On success, the sent Message is returned. */
510
528
  sendLocation(args: {
529
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
530
+ business_connection_id?: string;
511
531
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
512
532
  chat_id: number | string;
513
533
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -518,7 +538,7 @@ export type ApiMethods = {
518
538
  longitude: number;
519
539
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
520
540
  horizontal_accuracy?: number;
521
- /** Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. */
541
+ /** 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. */
522
542
  live_period?: number;
523
543
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
524
544
  heading?: number;
@@ -530,7 +550,7 @@ export type ApiMethods = {
530
550
  protect_content?: boolean;
531
551
  /** Description of the message to reply to */
532
552
  reply_parameters?: ReplyParameters;
533
- /** 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. */
553
+ /** 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. */
534
554
  reply_markup?:
535
555
  | InlineKeyboardMarkup
536
556
  | ReplyKeyboardMarkup
@@ -552,6 +572,8 @@ export type ApiMethods = {
552
572
  latitude: number;
553
573
  /** Longitude of new location */
554
574
  longitude: number;
575
+ /** 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 */
576
+ live_period?: number;
555
577
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
556
578
  horizontal_accuracy?: number;
557
579
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
@@ -576,6 +598,8 @@ export type ApiMethods = {
576
598
 
577
599
  /** Use this method to send information about a venue. On success, the sent Message is returned. */
578
600
  sendVenue(args: {
601
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
602
+ business_connection_id?: string;
579
603
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
580
604
  chat_id: number | string;
581
605
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -602,7 +626,7 @@ export type ApiMethods = {
602
626
  protect_content?: boolean;
603
627
  /** Description of the message to reply to */
604
628
  reply_parameters?: ReplyParameters;
605
- /** 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. */
629
+ /** 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. */
606
630
  reply_markup?:
607
631
  | InlineKeyboardMarkup
608
632
  | ReplyKeyboardMarkup
@@ -614,6 +638,8 @@ export type ApiMethods = {
614
638
 
615
639
  /** Use this method to send phone contacts. On success, the sent Message is returned. */
616
640
  sendContact(args: {
641
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
642
+ business_connection_id?: string;
617
643
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
618
644
  chat_id: number | string;
619
645
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -632,7 +658,7 @@ export type ApiMethods = {
632
658
  protect_content?: boolean;
633
659
  /** Description of the message to reply to */
634
660
  reply_parameters?: ReplyParameters;
635
- /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
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. */
636
662
  reply_markup?:
637
663
  | InlineKeyboardMarkup
638
664
  | ReplyKeyboardMarkup
@@ -644,14 +670,20 @@ export type ApiMethods = {
644
670
 
645
671
  /** Use this method to send a native poll. On success, the sent Message is returned. */
646
672
  sendPoll(args: {
673
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
674
+ business_connection_id?: string;
647
675
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
648
676
  chat_id: number | string;
649
677
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
650
678
  message_thread_id?: number;
651
679
  /** Poll question, 1-300 characters */
652
680
  question: string;
653
- /** A list of answer options, 2-10 strings 1-100 characters each */
654
- options: readonly string[];
681
+ /** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */
682
+ question_parse_mode?: string;
683
+ /** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
684
+ question_entities?: MessageEntity[];
685
+ /** A list of 2-10 answer options */
686
+ options: InputPollOption[];
655
687
  /** True, if the poll needs to be anonymous, defaults to True */
656
688
  is_anonymous?: boolean;
657
689
  /** Poll type, “quiz” or “regular”, defaults to “regular” */
@@ -664,7 +696,7 @@ export type ApiMethods = {
664
696
  explanation?: string;
665
697
  /** Mode for parsing entities in the explanation. See formatting options for more details. */
666
698
  explanation_parse_mode?: ParseMode;
667
- /** A list of special entities that appear in the poll explanation, which can be specified instead of parse_mode */
699
+ /** A list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode */
668
700
  explanation_entities?: MessageEntity[];
669
701
  /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */
670
702
  open_period?: number;
@@ -678,7 +710,7 @@ export type ApiMethods = {
678
710
  protect_content?: boolean;
679
711
  /** Description of the message to reply to */
680
712
  reply_parameters?: ReplyParameters;
681
- /** 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. */
713
+ /** 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. */
682
714
  reply_markup?:
683
715
  | InlineKeyboardMarkup
684
716
  | ReplyKeyboardMarkup
@@ -690,6 +722,8 @@ export type ApiMethods = {
690
722
 
691
723
  /** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
692
724
  sendDice(args: {
725
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
726
+ business_connection_id?: string;
693
727
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
694
728
  chat_id: number | string;
695
729
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -702,7 +736,7 @@ export type ApiMethods = {
702
736
  protect_content?: boolean;
703
737
  /** Description of the message to reply to */
704
738
  reply_parameters?: ReplyParameters;
705
- /** 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. */
739
+ /** 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. */
706
740
  reply_markup?:
707
741
  | InlineKeyboardMarkup
708
742
  | ReplyKeyboardMarkup
@@ -718,6 +752,8 @@ export type ApiMethods = {
718
752
 
719
753
  We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
720
754
  sendChatAction(args: {
755
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
756
+ business_connection_id?: string;
721
757
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
722
758
  chat_id: number | string;
723
759
  /** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. */
@@ -733,7 +769,7 @@ export type ApiMethods = {
733
769
  | "find_location"
734
770
  | "record_video_note"
735
771
  | "upload_video_note";
736
- /** Unique identifier for the target message thread; supergroups only */
772
+ /** Unique identifier for the target message thread; for supergroups only */
737
773
  message_thread_id?: number;
738
774
  }): true;
739
775
 
@@ -743,7 +779,7 @@ export type ApiMethods = {
743
779
  chat_id: number | string;
744
780
  /** Identifier of the target message */
745
781
  message_id: number;
746
- /** New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
782
+ /** A list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
747
783
  reaction?: ReactionType[];
748
784
  /** Pass True to set the reaction with a big animation */
749
785
  is_big?: boolean;
@@ -829,19 +865,19 @@ export type ApiMethods = {
829
865
  can_change_info?: boolean;
830
866
  /** Pass True if the administrator can invite new users to the chat */
831
867
  can_invite_users?: boolean;
832
- /** Pass True if the administrator can post messages in the channel, or access channel statistics; channels only */
833
- can_post_messages?: boolean;
834
- /** Pass True if the administrator can edit messages of other users and can pin messages; channels only */
835
- can_edit_messages?: boolean;
836
- /** Pass True if the administrator can pin messages, supergroups only */
837
- can_pin_messages?: boolean;
838
- /** Pass True if the administrator can post stories to the chat */
868
+ /** True if the administrator can post stories to the chat */
839
869
  can_post_stories?: boolean;
840
- /** Pass True if the administrator can edit stories posted by other users */
870
+ /** 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 */
841
871
  can_edit_stories?: boolean;
842
- /** Pass True if the administrator can delete stories posted by other users */
872
+ /** True if the administrator can delete stories posted by other users */
843
873
  can_delete_stories?: boolean;
844
- /** Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only */
874
+ /** True if the administrator can post messages in the channel, or access channel statistics; for channels only */
875
+ can_post_messages?: boolean;
876
+ /** True if the administrator can edit messages of other users and can pin messages; for channels only */
877
+ can_edit_messages?: boolean;
878
+ /** True if the administrator can pin messages; for supergroups only */
879
+ can_pin_messages?: boolean;
880
+ /** True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
845
881
  can_manage_topics?: boolean;
846
882
  }): true;
847
883
 
@@ -1003,11 +1039,11 @@ export type ApiMethods = {
1003
1039
  chat_id: number | string;
1004
1040
  }): true;
1005
1041
 
1006
- /** Use this method to get up to date information about the chat. Returns a Chat object on success. */
1042
+ /** Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. */
1007
1043
  getChat(args: {
1008
1044
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
1009
1045
  chat_id: number | string;
1010
- }): ChatFromGetChat;
1046
+ }): ChatFullInfo;
1011
1047
 
1012
1048
  /** Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects. */
1013
1049
  getChatAdministrators(args: {
@@ -1175,6 +1211,12 @@ export type ApiMethods = {
1175
1211
  user_id: number;
1176
1212
  }): UserChatBoosts;
1177
1213
 
1214
+ /** Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success. */
1215
+ getBusinessConnection(args: {
1216
+ /** Unique identifier of the business connection */
1217
+ business_connection_id: string;
1218
+ }): BusinessConnection;
1219
+
1178
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. */
1179
1221
  setMyCommands(args: {
1180
1222
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
@@ -1366,17 +1408,19 @@ export type ApiMethods = {
1366
1408
  deleteMessages(args: {
1367
1409
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1368
1410
  chat_id: number | string;
1369
- /** Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted */
1411
+ /** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
1370
1412
  message_ids: number[];
1371
1413
  }): true;
1372
1414
 
1373
1415
  /** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
1374
1416
  sendSticker(args: {
1417
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
1418
+ business_connection_id?: string;
1375
1419
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1376
1420
  chat_id: number | string;
1377
1421
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1378
1422
  message_thread_id?: number;
1379
- /** 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 or .TGS sticker using multipart/form-data. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. */
1423
+ /** 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. */
1380
1424
  sticker: Buffer | ReadStream | string | string;
1381
1425
  /** Emoji associated with the sticker; only for just uploaded stickers */
1382
1426
  emoji?: string;
@@ -1386,7 +1430,7 @@ export type ApiMethods = {
1386
1430
  protect_content?: boolean;
1387
1431
  /** Description of the message to reply to */
1388
1432
  reply_parameters?: ReplyParameters;
1389
- /** 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. */
1433
+ /** 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. */
1390
1434
  reply_markup?:
1391
1435
  | InlineKeyboardMarkup
1392
1436
  | ReplyKeyboardMarkup
@@ -1408,7 +1452,7 @@ export type ApiMethods = {
1408
1452
  custom_emoji_ids: string[];
1409
1453
  }): Sticker[];
1410
1454
 
1411
- /** Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success. */
1455
+ /** Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success. */
1412
1456
  uploadStickerFile(args: {
1413
1457
  /** User identifier of sticker file owner */
1414
1458
  user_id: number;
@@ -1428,15 +1472,13 @@ export type ApiMethods = {
1428
1472
  title: string;
1429
1473
  /** A list of 1-50 initial stickers to be added to the sticker set */
1430
1474
  stickers: InputSticker[];
1431
- /** Format of the sticker, must be one of “static”, “animated”, “video” */
1432
- sticker_format: "static" | "animated" | "video";
1433
1475
  /** Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created. */
1434
1476
  sticker_type?: "regular" | "mask" | "custom_emoji";
1435
1477
  /** Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only */
1436
1478
  needs_repainting?: boolean;
1437
1479
  }): true;
1438
1480
 
1439
- /** Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success. */
1481
+ /** Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success. */
1440
1482
  addStickerToSet(args: {
1441
1483
  /** User identifier of sticker set owner */
1442
1484
  user_id: number;
@@ -1446,6 +1488,18 @@ export type ApiMethods = {
1446
1488
  sticker: InputSticker;
1447
1489
  }): true;
1448
1490
 
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
+
1449
1503
  /** Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. */
1450
1504
  setStickerPositionInSet(args: {
1451
1505
  /** File identifier of the sticker */
@@ -1506,6 +1560,8 @@ export type ApiMethods = {
1506
1560
  user_id: number;
1507
1561
  /** 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. */
1508
1562
  thumbnail?: Buffer | ReadStream | string | string;
1563
+ /** 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
+ format: "static" | "animated" | "video";
1509
1565
  }): true;
1510
1566
 
1511
1567
  /** Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. */
@@ -1681,6 +1737,8 @@ export type ApiMethods = {
1681
1737
 
1682
1738
  /** Use this method to send a game. On success, the sent Message is returned. */
1683
1739
  sendGame(args: {
1740
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
1741
+ business_connection_id?: string;
1684
1742
  /** Unique identifier for the target chat */
1685
1743
  chat_id: number;
1686
1744
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -1693,7 +1751,7 @@ export type ApiMethods = {
1693
1751
  protect_content?: boolean;
1694
1752
  /** Description of the message to reply to */
1695
1753
  reply_parameters?: ReplyParameters;
1696
- /** 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. */
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. */
1697
1755
  reply_markup?: InlineKeyboardMarkup;
1698
1756
  /** @deprecated Use `reply_parameters` instead. */
1699
1757
  reply_to_message_id?: number;
@@ -1734,6 +1792,8 @@ export type ApiMethods = {
1734
1792
 
1735
1793
  /** This object describes a sticker to be added to a sticker set. */
1736
1794
  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";
1737
1797
  /** 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. */
1738
1798
  sticker: Buffer | ReadStream | string;
1739
1799
  /** List of 1-20 emoji associated with the sticker */
@@ -318,7 +318,7 @@ export interface InlineQueryResultLocation {
318
318
  title: string;
319
319
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
320
320
  horizontal_accuracy?: number;
321
- /** Period in seconds for which the location can be updated, should be between 60 and 86400. */
321
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
322
322
  live_period?: number;
323
323
  /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
324
324
  heading?: number;
@@ -615,7 +615,7 @@ export interface InputLocationMessageContent {
615
615
  longitude: number;
616
616
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
617
617
  horizontal_accuracy?: number;
618
- /** Period in seconds for which the location can be updated, should be between 60 and 86400. */
618
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
619
619
  live_period?: number;
620
620
  /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
621
621
  heading?: number;