@telegram.ts/types 1.7.0 → 1.8.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 +10 -7
- package/src/apiMethodsTypes.d.ts +91 -36
- package/src/manageTypes.d.ts +98 -20
- package/src/markupTypes.d.ts +14 -2
- package/src/messageTypes.d.ts +33 -11
- package/src/passportTypes.d.ts +8 -8
- package/src/updateTypes.d.ts +20 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegram.ts/types",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"types": "src/index.d.ts",
|
|
3
|
+
"version": "1.8.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/
|
|
16
|
+
"url": "https://github.com/telegramsjs/types/issues"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/
|
|
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
|
]
|
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
} from "./inlineTypes.ts";
|
|
6
6
|
import type {
|
|
7
7
|
BotCommand,
|
|
8
|
+
BusinessConnection,
|
|
8
9
|
ChatAdministratorRights,
|
|
9
10
|
ChatFromGetChat,
|
|
10
11
|
ChatInviteLink,
|
|
@@ -120,6 +121,8 @@ export type ApiMethods = {
|
|
|
120
121
|
|
|
121
122
|
/** Use this method to send text messages. On success, the sent Message is returned. */
|
|
122
123
|
sendMessage(args: {
|
|
124
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
125
|
+
business_connection_id?: string;
|
|
123
126
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
124
127
|
chat_id: number | string;
|
|
125
128
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -138,7 +141,7 @@ export type ApiMethods = {
|
|
|
138
141
|
protect_content?: boolean;
|
|
139
142
|
/** Description of the message to reply to */
|
|
140
143
|
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. */
|
|
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. */
|
|
142
145
|
reply_markup?:
|
|
143
146
|
| InlineKeyboardMarkup
|
|
144
147
|
| ReplyKeyboardMarkup
|
|
@@ -172,7 +175,7 @@ export type ApiMethods = {
|
|
|
172
175
|
message_thread_id?: number;
|
|
173
176
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
174
177
|
from_chat_id: number | string;
|
|
175
|
-
/**
|
|
178
|
+
/** 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
179
|
message_ids: number[];
|
|
177
180
|
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
178
181
|
disable_notification?: boolean;
|
|
@@ -202,7 +205,7 @@ export type ApiMethods = {
|
|
|
202
205
|
protect_content?: boolean;
|
|
203
206
|
/** Description of the message to reply to */
|
|
204
207
|
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. */
|
|
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. */
|
|
206
209
|
reply_markup?:
|
|
207
210
|
| InlineKeyboardMarkup
|
|
208
211
|
| ReplyKeyboardMarkup
|
|
@@ -220,7 +223,7 @@ export type ApiMethods = {
|
|
|
220
223
|
message_thread_id?: number;
|
|
221
224
|
/** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
|
|
222
225
|
from_chat_id: number | string;
|
|
223
|
-
/**
|
|
226
|
+
/** 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
227
|
message_ids: number[];
|
|
225
228
|
/** Sends the messages silently. Users will receive a notification with no sound. */
|
|
226
229
|
disable_notification?: boolean;
|
|
@@ -232,6 +235,8 @@ export type ApiMethods = {
|
|
|
232
235
|
|
|
233
236
|
/** Use this method to send photos. On success, the sent Message is returned. */
|
|
234
237
|
sendPhoto(args: {
|
|
238
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
239
|
+
business_connection_id?: string;
|
|
235
240
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
236
241
|
chat_id: number | string;
|
|
237
242
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -252,7 +257,7 @@ export type ApiMethods = {
|
|
|
252
257
|
protect_content?: boolean;
|
|
253
258
|
/** Description of the message to reply to */
|
|
254
259
|
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. */
|
|
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. */
|
|
256
261
|
reply_markup?:
|
|
257
262
|
| InlineKeyboardMarkup
|
|
258
263
|
| ReplyKeyboardMarkup
|
|
@@ -266,6 +271,8 @@ export type ApiMethods = {
|
|
|
266
271
|
|
|
267
272
|
For sending voice messages, use the sendVoice method instead. */
|
|
268
273
|
sendAudio(args: {
|
|
274
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
275
|
+
business_connection_id?: string;
|
|
269
276
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
270
277
|
chat_id: number | string;
|
|
271
278
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -292,7 +299,7 @@ export type ApiMethods = {
|
|
|
292
299
|
protect_content?: boolean;
|
|
293
300
|
/** Description of the message to reply to */
|
|
294
301
|
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. */
|
|
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. */
|
|
296
303
|
reply_markup?:
|
|
297
304
|
| InlineKeyboardMarkup
|
|
298
305
|
| ReplyKeyboardMarkup
|
|
@@ -304,6 +311,8 @@ export type ApiMethods = {
|
|
|
304
311
|
|
|
305
312
|
/** 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
313
|
sendDocument(args: {
|
|
314
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
315
|
+
business_connection_id?: string;
|
|
307
316
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
308
317
|
chat_id: number | string;
|
|
309
318
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -326,7 +335,7 @@ export type ApiMethods = {
|
|
|
326
335
|
protect_content?: boolean;
|
|
327
336
|
/** Description of the message to reply to */
|
|
328
337
|
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. */
|
|
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. */
|
|
330
339
|
reply_markup?:
|
|
331
340
|
| InlineKeyboardMarkup
|
|
332
341
|
| ReplyKeyboardMarkup
|
|
@@ -338,6 +347,8 @@ export type ApiMethods = {
|
|
|
338
347
|
|
|
339
348
|
/** 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
349
|
sendVideo(args: {
|
|
350
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
351
|
+
business_connection_id?: string;
|
|
341
352
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
342
353
|
chat_id: number | string;
|
|
343
354
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -368,7 +379,7 @@ export type ApiMethods = {
|
|
|
368
379
|
protect_content?: boolean;
|
|
369
380
|
/** Description of the message to reply to */
|
|
370
381
|
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. */
|
|
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. */
|
|
372
383
|
reply_markup?:
|
|
373
384
|
| InlineKeyboardMarkup
|
|
374
385
|
| ReplyKeyboardMarkup
|
|
@@ -380,6 +391,8 @@ export type ApiMethods = {
|
|
|
380
391
|
|
|
381
392
|
/** 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
393
|
sendAnimation(args: {
|
|
394
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
395
|
+
business_connection_id?: string;
|
|
383
396
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
384
397
|
chat_id: number | string;
|
|
385
398
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -408,7 +421,7 @@ export type ApiMethods = {
|
|
|
408
421
|
protect_content?: boolean;
|
|
409
422
|
/** Description of the message to reply to */
|
|
410
423
|
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. */
|
|
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. */
|
|
412
425
|
reply_markup?:
|
|
413
426
|
| InlineKeyboardMarkup
|
|
414
427
|
| ReplyKeyboardMarkup
|
|
@@ -420,6 +433,8 @@ export type ApiMethods = {
|
|
|
420
433
|
|
|
421
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. */
|
|
422
435
|
sendVoice(args: {
|
|
436
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
437
|
+
business_connection_id?: string;
|
|
423
438
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
424
439
|
chat_id: number | string;
|
|
425
440
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -440,7 +455,7 @@ export type ApiMethods = {
|
|
|
440
455
|
protect_content?: boolean;
|
|
441
456
|
/** Description of the message to reply to */
|
|
442
457
|
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. */
|
|
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. */
|
|
444
459
|
reply_markup?:
|
|
445
460
|
| InlineKeyboardMarkup
|
|
446
461
|
| ReplyKeyboardMarkup
|
|
@@ -453,6 +468,8 @@ export type ApiMethods = {
|
|
|
453
468
|
/** Use this method to send video messages. On success, the sent Message is returned.
|
|
454
469
|
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. */
|
|
455
470
|
sendVideoNote(args: {
|
|
471
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
472
|
+
business_connection_id?: string;
|
|
456
473
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
457
474
|
chat_id: number | string;
|
|
458
475
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -471,7 +488,7 @@ export type ApiMethods = {
|
|
|
471
488
|
protect_content?: boolean;
|
|
472
489
|
/** Description of the message to reply to */
|
|
473
490
|
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. */
|
|
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. */
|
|
475
492
|
reply_markup?:
|
|
476
493
|
| InlineKeyboardMarkup
|
|
477
494
|
| ReplyKeyboardMarkup
|
|
@@ -483,6 +500,8 @@ export type ApiMethods = {
|
|
|
483
500
|
|
|
484
501
|
/** 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
502
|
sendMediaGroup(args: {
|
|
503
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
504
|
+
business_connection_id?: string;
|
|
486
505
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
487
506
|
chat_id: number | string;
|
|
488
507
|
/** An array describing messages to be sent, must include 2-10 items */
|
|
@@ -508,6 +527,8 @@ export type ApiMethods = {
|
|
|
508
527
|
|
|
509
528
|
/** Use this method to send point on the map. On success, the sent Message is returned. */
|
|
510
529
|
sendLocation(args: {
|
|
530
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
531
|
+
business_connection_id?: string;
|
|
511
532
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
512
533
|
chat_id: number | string;
|
|
513
534
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -530,7 +551,7 @@ export type ApiMethods = {
|
|
|
530
551
|
protect_content?: boolean;
|
|
531
552
|
/** Description of the message to reply to */
|
|
532
553
|
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. */
|
|
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. */
|
|
534
555
|
reply_markup?:
|
|
535
556
|
| InlineKeyboardMarkup
|
|
536
557
|
| ReplyKeyboardMarkup
|
|
@@ -576,6 +597,8 @@ export type ApiMethods = {
|
|
|
576
597
|
|
|
577
598
|
/** Use this method to send information about a venue. On success, the sent Message is returned. */
|
|
578
599
|
sendVenue(args: {
|
|
600
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
601
|
+
business_connection_id?: string;
|
|
579
602
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
580
603
|
chat_id: number | string;
|
|
581
604
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -602,7 +625,7 @@ export type ApiMethods = {
|
|
|
602
625
|
protect_content?: boolean;
|
|
603
626
|
/** Description of the message to reply to */
|
|
604
627
|
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. */
|
|
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. */
|
|
606
629
|
reply_markup?:
|
|
607
630
|
| InlineKeyboardMarkup
|
|
608
631
|
| ReplyKeyboardMarkup
|
|
@@ -614,6 +637,8 @@ export type ApiMethods = {
|
|
|
614
637
|
|
|
615
638
|
/** Use this method to send phone contacts. On success, the sent Message is returned. */
|
|
616
639
|
sendContact(args: {
|
|
640
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
641
|
+
business_connection_id?: string;
|
|
617
642
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
618
643
|
chat_id: number | string;
|
|
619
644
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -632,7 +657,7 @@ export type ApiMethods = {
|
|
|
632
657
|
protect_content?: boolean;
|
|
633
658
|
/** Description of the message to reply to */
|
|
634
659
|
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. */
|
|
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. */
|
|
636
661
|
reply_markup?:
|
|
637
662
|
| InlineKeyboardMarkup
|
|
638
663
|
| ReplyKeyboardMarkup
|
|
@@ -644,6 +669,8 @@ export type ApiMethods = {
|
|
|
644
669
|
|
|
645
670
|
/** Use this method to send a native poll. On success, the sent Message is returned. */
|
|
646
671
|
sendPoll(args: {
|
|
672
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
673
|
+
business_connection_id?: string;
|
|
647
674
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
648
675
|
chat_id: number | string;
|
|
649
676
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -678,7 +705,7 @@ export type ApiMethods = {
|
|
|
678
705
|
protect_content?: boolean;
|
|
679
706
|
/** Description of the message to reply to */
|
|
680
707
|
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. */
|
|
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. */
|
|
682
709
|
reply_markup?:
|
|
683
710
|
| InlineKeyboardMarkup
|
|
684
711
|
| ReplyKeyboardMarkup
|
|
@@ -690,6 +717,8 @@ export type ApiMethods = {
|
|
|
690
717
|
|
|
691
718
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
|
|
692
719
|
sendDice(args: {
|
|
720
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
721
|
+
business_connection_id?: string;
|
|
693
722
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
694
723
|
chat_id: number | string;
|
|
695
724
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -702,7 +731,7 @@ export type ApiMethods = {
|
|
|
702
731
|
protect_content?: boolean;
|
|
703
732
|
/** Description of the message to reply to */
|
|
704
733
|
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. */
|
|
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. */
|
|
706
735
|
reply_markup?:
|
|
707
736
|
| InlineKeyboardMarkup
|
|
708
737
|
| ReplyKeyboardMarkup
|
|
@@ -718,6 +747,8 @@ export type ApiMethods = {
|
|
|
718
747
|
|
|
719
748
|
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
|
|
720
749
|
sendChatAction(args: {
|
|
750
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
751
|
+
business_connection_id?: string;
|
|
721
752
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
722
753
|
chat_id: number | string;
|
|
723
754
|
/** 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 +764,7 @@ export type ApiMethods = {
|
|
|
733
764
|
| "find_location"
|
|
734
765
|
| "record_video_note"
|
|
735
766
|
| "upload_video_note";
|
|
736
|
-
/** Unique identifier for the target message thread; supergroups only */
|
|
767
|
+
/** Unique identifier for the target message thread; for supergroups only */
|
|
737
768
|
message_thread_id?: number;
|
|
738
769
|
}): true;
|
|
739
770
|
|
|
@@ -743,7 +774,7 @@ export type ApiMethods = {
|
|
|
743
774
|
chat_id: number | string;
|
|
744
775
|
/** Identifier of the target message */
|
|
745
776
|
message_id: number;
|
|
746
|
-
/**
|
|
777
|
+
/** 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
778
|
reaction?: ReactionType[];
|
|
748
779
|
/** Pass True to set the reaction with a big animation */
|
|
749
780
|
is_big?: boolean;
|
|
@@ -829,19 +860,19 @@ export type ApiMethods = {
|
|
|
829
860
|
can_change_info?: boolean;
|
|
830
861
|
/** Pass True if the administrator can invite new users to the chat */
|
|
831
862
|
can_invite_users?: boolean;
|
|
832
|
-
/**
|
|
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 */
|
|
863
|
+
/** True if the administrator can post stories to the chat */
|
|
839
864
|
can_post_stories?: boolean;
|
|
840
|
-
/**
|
|
865
|
+
/** True if the administrator can edit stories posted by other users */
|
|
841
866
|
can_edit_stories?: boolean;
|
|
842
|
-
/**
|
|
867
|
+
/** True if the administrator can delete stories posted by other users */
|
|
843
868
|
can_delete_stories?: boolean;
|
|
844
|
-
/**
|
|
869
|
+
/** True if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
870
|
+
can_post_messages?: boolean;
|
|
871
|
+
/** True if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
872
|
+
can_edit_messages?: boolean;
|
|
873
|
+
/** True if the administrator can pin messages; for supergroups only */
|
|
874
|
+
can_pin_messages?: boolean;
|
|
875
|
+
/** True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
845
876
|
can_manage_topics?: boolean;
|
|
846
877
|
}): true;
|
|
847
878
|
|
|
@@ -1175,6 +1206,12 @@ export type ApiMethods = {
|
|
|
1175
1206
|
user_id: number;
|
|
1176
1207
|
}): UserChatBoosts;
|
|
1177
1208
|
|
|
1209
|
+
/** Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success. */
|
|
1210
|
+
getBusinessConnection(args: {
|
|
1211
|
+
/** Unique identifier of the business connection */
|
|
1212
|
+
business_connection_id: string;
|
|
1213
|
+
}): BusinessConnection;
|
|
1214
|
+
|
|
1178
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. */
|
|
1179
1216
|
setMyCommands(args: {
|
|
1180
1217
|
/** 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 +1403,19 @@ export type ApiMethods = {
|
|
|
1366
1403
|
deleteMessages(args: {
|
|
1367
1404
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1368
1405
|
chat_id: number | string;
|
|
1369
|
-
/**
|
|
1406
|
+
/** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1370
1407
|
message_ids: number[];
|
|
1371
1408
|
}): true;
|
|
1372
1409
|
|
|
1373
1410
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1374
1411
|
sendSticker(args: {
|
|
1412
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
1413
|
+
business_connection_id?: string;
|
|
1375
1414
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1376
1415
|
chat_id: number | string;
|
|
1377
1416
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
1378
1417
|
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 .
|
|
1418
|
+
/** 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
1419
|
sticker: Buffer | ReadStream | string | string;
|
|
1381
1420
|
/** Emoji associated with the sticker; only for just uploaded stickers */
|
|
1382
1421
|
emoji?: string;
|
|
@@ -1386,7 +1425,7 @@ export type ApiMethods = {
|
|
|
1386
1425
|
protect_content?: boolean;
|
|
1387
1426
|
/** Description of the message to reply to */
|
|
1388
1427
|
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. */
|
|
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. */
|
|
1390
1429
|
reply_markup?:
|
|
1391
1430
|
| InlineKeyboardMarkup
|
|
1392
1431
|
| ReplyKeyboardMarkup
|
|
@@ -1408,7 +1447,7 @@ export type ApiMethods = {
|
|
|
1408
1447
|
custom_emoji_ids: string[];
|
|
1409
1448
|
}): Sticker[];
|
|
1410
1449
|
|
|
1411
|
-
/** Use this method to upload a file with a sticker for later use in the createNewStickerSet
|
|
1450
|
+
/** 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
1451
|
uploadStickerFile(args: {
|
|
1413
1452
|
/** User identifier of sticker file owner */
|
|
1414
1453
|
user_id: number;
|
|
@@ -1428,15 +1467,13 @@ export type ApiMethods = {
|
|
|
1428
1467
|
title: string;
|
|
1429
1468
|
/** A list of 1-50 initial stickers to be added to the sticker set */
|
|
1430
1469
|
stickers: InputSticker[];
|
|
1431
|
-
/** Format of the sticker, must be one of “static”, “animated”, “video” */
|
|
1432
|
-
sticker_format: "static" | "animated" | "video";
|
|
1433
1470
|
/** Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created. */
|
|
1434
1471
|
sticker_type?: "regular" | "mask" | "custom_emoji";
|
|
1435
1472
|
/** 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
1473
|
needs_repainting?: boolean;
|
|
1437
1474
|
}): true;
|
|
1438
1475
|
|
|
1439
|
-
/** Use this method to add a new sticker to a set created by the bot.
|
|
1476
|
+
/** 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
1477
|
addStickerToSet(args: {
|
|
1441
1478
|
/** User identifier of sticker set owner */
|
|
1442
1479
|
user_id: number;
|
|
@@ -1446,6 +1483,18 @@ export type ApiMethods = {
|
|
|
1446
1483
|
sticker: InputSticker;
|
|
1447
1484
|
}): true;
|
|
1448
1485
|
|
|
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
|
+
|
|
1449
1498
|
/** Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. */
|
|
1450
1499
|
setStickerPositionInSet(args: {
|
|
1451
1500
|
/** File identifier of the sticker */
|
|
@@ -1506,6 +1555,8 @@ export type ApiMethods = {
|
|
|
1506
1555
|
user_id: number;
|
|
1507
1556
|
/** 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
1557
|
thumbnail?: Buffer | ReadStream | string | string;
|
|
1558
|
+
/** 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
|
+
format: "static" | "animated" | "video";
|
|
1509
1560
|
}): true;
|
|
1510
1561
|
|
|
1511
1562
|
/** Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. */
|
|
@@ -1681,6 +1732,8 @@ export type ApiMethods = {
|
|
|
1681
1732
|
|
|
1682
1733
|
/** Use this method to send a game. On success, the sent Message is returned. */
|
|
1683
1734
|
sendGame(args: {
|
|
1735
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
1736
|
+
business_connection_id?: string;
|
|
1684
1737
|
/** Unique identifier for the target chat */
|
|
1685
1738
|
chat_id: number;
|
|
1686
1739
|
/** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
|
|
@@ -1693,7 +1746,7 @@ export type ApiMethods = {
|
|
|
1693
1746
|
protect_content?: boolean;
|
|
1694
1747
|
/** Description of the message to reply to */
|
|
1695
1748
|
reply_parameters?: ReplyParameters;
|
|
1696
|
-
/** An object for an inline keyboard
|
|
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. */
|
|
1697
1750
|
reply_markup?: InlineKeyboardMarkup;
|
|
1698
1751
|
/** @deprecated Use `reply_parameters` instead. */
|
|
1699
1752
|
reply_to_message_id?: number;
|
|
@@ -1734,6 +1787,8 @@ export type ApiMethods = {
|
|
|
1734
1787
|
|
|
1735
1788
|
/** This object describes a sticker to be added to a sticker set. */
|
|
1736
1789
|
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";
|
|
1737
1792
|
/** 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
1793
|
sticker: Buffer | ReadStream | string;
|
|
1739
1794
|
/** List of 1-20 emoji associated with the sticker */
|
package/src/manageTypes.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
Message,
|
|
4
4
|
PhotoSize,
|
|
5
5
|
ReactionType,
|
|
6
|
+
Sticker,
|
|
6
7
|
} from "./messageTypes";
|
|
7
8
|
import type { Update } from "./updateTypes";
|
|
8
9
|
|
|
@@ -58,6 +59,8 @@ export interface UserFromGetMe extends User {
|
|
|
58
59
|
can_read_all_group_messages: boolean;
|
|
59
60
|
/** True, if the bot supports inline queries. Returned only in getMe. */
|
|
60
61
|
supports_inline_queries: boolean;
|
|
62
|
+
/** True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. */
|
|
63
|
+
can_connect_to_business?: boolean;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
export declare namespace Chat {
|
|
@@ -164,6 +167,16 @@ export declare namespace Chat {
|
|
|
164
167
|
GetChat,
|
|
165
168
|
NonGroupGetChat,
|
|
166
169
|
NonMultiUserGetChat {
|
|
170
|
+
/** For private chats, the date of birth of the user. Returned only in getChat. */
|
|
171
|
+
birthdate?: Birthdate;
|
|
172
|
+
/** For private chats with business accounts, the intro of the business. Returned only in getChat. */
|
|
173
|
+
business_intro?: BusinessIntro;
|
|
174
|
+
/** For private chats with business accounts, the location of the business. Returned only in getChat. */
|
|
175
|
+
business_location?: BusinessLocation;
|
|
176
|
+
/** For private chats with business accounts, the opening hours of the business. Returned only in getChat. */
|
|
177
|
+
business_opening_hours?: BusinessOpeningHours;
|
|
178
|
+
/** For private chats, the personal channel of the user. Returned only in getChat. */
|
|
179
|
+
personal_chat?: Chat.ChannelChat;
|
|
167
180
|
/** Bio of the other party in a private chat. Returned only in getChat. */
|
|
168
181
|
bio?: string;
|
|
169
182
|
/** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
|
|
@@ -295,19 +308,19 @@ export interface ChatAdministratorRights {
|
|
|
295
308
|
can_change_info: boolean;
|
|
296
309
|
/** True, if the user is allowed to invite new users to the chat */
|
|
297
310
|
can_invite_users: boolean;
|
|
298
|
-
/** True, if the administrator can post messages in the channel, or access channel statistics; channels only */
|
|
299
|
-
can_post_messages?: boolean;
|
|
300
|
-
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
|
|
301
|
-
can_edit_messages?: boolean;
|
|
302
|
-
/** True, if the user is allowed to pin messages; groups and supergroups only */
|
|
303
|
-
can_pin_messages?: boolean;
|
|
304
311
|
/** True, if the administrator can post stories to the chat */
|
|
305
|
-
can_post_stories
|
|
312
|
+
can_post_stories: boolean;
|
|
306
313
|
/** True, if the administrator can edit stories posted by other users */
|
|
307
|
-
can_edit_stories
|
|
314
|
+
can_edit_stories: boolean;
|
|
308
315
|
/** True, if the administrator can delete stories posted by other users; channels only */
|
|
309
|
-
can_delete_stories
|
|
310
|
-
/** True, if the
|
|
316
|
+
can_delete_stories: boolean;
|
|
317
|
+
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
318
|
+
can_post_messages?: boolean;
|
|
319
|
+
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
320
|
+
can_edit_messages?: boolean;
|
|
321
|
+
/** True, if the user is allowed to pin messages; for groups and supergroups only */
|
|
322
|
+
can_pin_messages?: boolean;
|
|
323
|
+
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
311
324
|
can_manage_topics?: boolean;
|
|
312
325
|
}
|
|
313
326
|
|
|
@@ -380,19 +393,19 @@ export interface ChatMemberAdministrator {
|
|
|
380
393
|
can_change_info: boolean;
|
|
381
394
|
/** True, if the user is allowed to invite new users to the chat */
|
|
382
395
|
can_invite_users: boolean;
|
|
383
|
-
/** True, if the administrator can post messages in the channel, or access channel statistics; channels only */
|
|
384
|
-
can_post_messages?: boolean;
|
|
385
|
-
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
|
|
386
|
-
can_edit_messages?: boolean;
|
|
387
|
-
/** True, if the user is allowed to pin messages; groups and supergroups only */
|
|
388
|
-
can_pin_messages?: boolean;
|
|
389
396
|
/** True, if the administrator can post stories to the chat */
|
|
390
|
-
can_post_stories
|
|
397
|
+
can_post_stories: boolean;
|
|
391
398
|
/** True, if the administrator can edit stories posted by other users */
|
|
392
|
-
can_edit_stories
|
|
399
|
+
can_edit_stories: boolean;
|
|
393
400
|
/** True, if the administrator can delete stories posted by other users */
|
|
394
|
-
can_delete_stories
|
|
395
|
-
/** True, if the
|
|
401
|
+
can_delete_stories: boolean;
|
|
402
|
+
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
403
|
+
can_post_messages?: boolean;
|
|
404
|
+
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
405
|
+
can_edit_messages?: boolean;
|
|
406
|
+
/** True, if the user is allowed to pin messages; for groups and supergroups only */
|
|
407
|
+
can_pin_messages?: boolean;
|
|
408
|
+
/** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
396
409
|
can_manage_topics?: boolean;
|
|
397
410
|
/** Custom title for this user */
|
|
398
411
|
custom_title?: string;
|
|
@@ -512,6 +525,45 @@ export interface ChatPermissions {
|
|
|
512
525
|
can_manage_topics?: boolean;
|
|
513
526
|
}
|
|
514
527
|
|
|
528
|
+
export interface Birthdate {
|
|
529
|
+
/** Day of the user's birth; 1-31 */
|
|
530
|
+
day: number;
|
|
531
|
+
/** Month of the user's birth; 1-12 */
|
|
532
|
+
month: number;
|
|
533
|
+
/** Year of the user's birth */
|
|
534
|
+
year?: number;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface BusinessIntro {
|
|
538
|
+
/** Title text of the business intro */
|
|
539
|
+
title?: string;
|
|
540
|
+
/** Message text of the business intro */
|
|
541
|
+
message?: string;
|
|
542
|
+
/** Sticker of the business intro */
|
|
543
|
+
sticker?: Sticker;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export interface BusinessLocation {
|
|
547
|
+
/** Address of the business */
|
|
548
|
+
address: string;
|
|
549
|
+
/** Location of the business */
|
|
550
|
+
location?: Location;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export interface BusinessOpeningHoursInterval {
|
|
554
|
+
/** The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 24 60 */
|
|
555
|
+
opening_minute: number;
|
|
556
|
+
/** The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 24 60 */
|
|
557
|
+
closing_minute: number;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export interface BusinessOpeningHours {
|
|
561
|
+
/** Unique name of the time zone for which the opening hours are defined */
|
|
562
|
+
time_zone_name: string;
|
|
563
|
+
/** List of time intervals describing business opening hours */
|
|
564
|
+
opening_hours: BusinessOpeningHoursInterval[];
|
|
565
|
+
}
|
|
566
|
+
|
|
515
567
|
/** Represents a location to which a chat is connected. */
|
|
516
568
|
export interface ChatLocation {
|
|
517
569
|
/** The location to which the supergroup is connected. Can't be a live location. */
|
|
@@ -611,3 +663,29 @@ export interface UserChatBoosts {
|
|
|
611
663
|
/** The list of boosts added to the chat by the user */
|
|
612
664
|
boosts: ChatBoost[];
|
|
613
665
|
}
|
|
666
|
+
|
|
667
|
+
/** Describes the connection of the bot with a business account. */
|
|
668
|
+
export interface BusinessConnection {
|
|
669
|
+
/** Unique identifier of the business connection */
|
|
670
|
+
id: string;
|
|
671
|
+
/** Business account user that created the business connection */
|
|
672
|
+
user: User;
|
|
673
|
+
/** Identifier of a private chat with the user who created the business connection. */
|
|
674
|
+
user_chat_id: number;
|
|
675
|
+
/** Date the connection was established in Unix time */
|
|
676
|
+
date: number;
|
|
677
|
+
/** True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours */
|
|
678
|
+
can_reply: boolean;
|
|
679
|
+
/** True, if the connection is active */
|
|
680
|
+
is_enabled: boolean;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/** This object is received when messages are deleted from a connected business account. */
|
|
684
|
+
export interface BusinessMessagesDeleted {
|
|
685
|
+
/** Unique identifier of the business connection */
|
|
686
|
+
business_connection_id: string;
|
|
687
|
+
/** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
|
|
688
|
+
chat: Chat.PrivateChat;
|
|
689
|
+
/** A JSON-serialized list of identifiers of deleted messages in the chat of the business account */
|
|
690
|
+
message_ids: number[];
|
|
691
|
+
}
|
package/src/markupTypes.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ export interface WebAppInfo {
|
|
|
222
222
|
url: string;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/** This object defines the criteria used to request suitable users.
|
|
225
|
+
/** This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. */
|
|
226
226
|
export interface KeyboardButtonRequestUsers {
|
|
227
227
|
/** Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message */
|
|
228
228
|
request_id: number;
|
|
@@ -232,9 +232,15 @@ export interface KeyboardButtonRequestUsers {
|
|
|
232
232
|
user_is_premium?: boolean;
|
|
233
233
|
/** The maximum number of users to be selected; 1-10. Defaults to 1. */
|
|
234
234
|
max_quantity?: boolean;
|
|
235
|
+
/** Pass True to request the users' first and last name */
|
|
236
|
+
request_name?: boolean;
|
|
237
|
+
/** Pass True to request the users' username */
|
|
238
|
+
request_username?: boolean;
|
|
239
|
+
/** Pass True to request the users' photo */
|
|
240
|
+
request_photo?: boolean;
|
|
235
241
|
}
|
|
236
242
|
|
|
237
|
-
/** This object defines the criteria used to request a suitable chat.
|
|
243
|
+
/** This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate */
|
|
238
244
|
export interface KeyboardButtonRequestChat {
|
|
239
245
|
/** Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message */
|
|
240
246
|
request_id: number;
|
|
@@ -252,4 +258,10 @@ export interface KeyboardButtonRequestChat {
|
|
|
252
258
|
bot_administrator_rights?: ChatAdministratorRights;
|
|
253
259
|
/** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
|
|
254
260
|
bot_is_member?: boolean;
|
|
261
|
+
/** Pass True to request the chat's title */
|
|
262
|
+
request_title?: boolean;
|
|
263
|
+
/** Pass True to request the chat's username */
|
|
264
|
+
request_username?: boolean;
|
|
265
|
+
/** Pass True to request the chat's photo */
|
|
266
|
+
request_photo?: boolean;
|
|
255
267
|
}
|
package/src/messageTypes.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare namespace Message {
|
|
|
17
17
|
sender_chat?: Chat;
|
|
18
18
|
/** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
|
|
19
19
|
date: number;
|
|
20
|
+
/** Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. */
|
|
21
|
+
business_connection_id?: string;
|
|
20
22
|
/** Chat the message belongs to */
|
|
21
23
|
chat: Chat;
|
|
22
24
|
/** True, if the message is sent to a forum topic */
|
|
@@ -25,6 +27,8 @@ export declare namespace Message {
|
|
|
25
27
|
export interface CommonMessage extends ServiceMessage {
|
|
26
28
|
/** If the sender of the message boosted the chat, the number of boosts added by the user */
|
|
27
29
|
sender_boost_count?: number;
|
|
30
|
+
/** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */
|
|
31
|
+
sender_business_bot?: User;
|
|
28
32
|
/** Information about the original message for forwarded messages */
|
|
29
33
|
forward_origin?: MessageOrigin;
|
|
30
34
|
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
@@ -43,6 +47,8 @@ export declare namespace Message {
|
|
|
43
47
|
edit_date?: number;
|
|
44
48
|
/** True, if the message can't be forwarded */
|
|
45
49
|
has_protected_content?: true;
|
|
50
|
+
/** 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
|
+
is_from_offline?: true;
|
|
46
52
|
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
47
53
|
author_signature?: string;
|
|
48
54
|
/** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
|
|
@@ -518,9 +524,9 @@ export interface ExternalReplyInfo {
|
|
|
518
524
|
export interface ReplyParameters {
|
|
519
525
|
/** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
|
|
520
526
|
message_id: number;
|
|
521
|
-
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername) */
|
|
527
|
+
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account. */
|
|
522
528
|
chat_id?: number | string;
|
|
523
|
-
/** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. */
|
|
529
|
+
/** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. Always True for messages sent on behalf of a business account. */
|
|
524
530
|
allow_sending_without_reply?: boolean;
|
|
525
531
|
/** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
|
|
526
532
|
quote?: string;
|
|
@@ -789,10 +795,10 @@ export interface Poll {
|
|
|
789
795
|
|
|
790
796
|
/** This object represents a point on the map. */
|
|
791
797
|
export interface Location {
|
|
792
|
-
/** Longitude as defined by sender */
|
|
793
|
-
longitude: number;
|
|
794
798
|
/** Latitude as defined by sender */
|
|
795
799
|
latitude: number;
|
|
800
|
+
/** Longitude as defined by sender */
|
|
801
|
+
longitude: number;
|
|
796
802
|
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
|
|
797
803
|
horizontal_accuracy?: number;
|
|
798
804
|
/** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
|
|
@@ -885,16 +891,22 @@ export interface ChatBoostAdded {
|
|
|
885
891
|
export interface UsersShared {
|
|
886
892
|
/** Identifier of the request */
|
|
887
893
|
request_id: number;
|
|
888
|
-
/**
|
|
889
|
-
|
|
894
|
+
/** Information about users shared with the bot. */
|
|
895
|
+
users: SharedUser[];
|
|
890
896
|
}
|
|
891
897
|
|
|
892
|
-
/** This object contains information about
|
|
898
|
+
/** This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */
|
|
893
899
|
export interface ChatShared {
|
|
894
900
|
/** Identifier of the request */
|
|
895
901
|
request_id: number;
|
|
896
902
|
/** Identifier of the shared chat. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
|
|
897
903
|
chat_id: number;
|
|
904
|
+
/** Title of the chat, if the title was requested by the bot. */
|
|
905
|
+
title?: string;
|
|
906
|
+
/** Username of the chat, if the username was requested by the bot and available. */
|
|
907
|
+
username?: string;
|
|
908
|
+
/** Available sizes of the chat photo, if the photo was requested by the bot */
|
|
909
|
+
photo?: PhotoSize[];
|
|
898
910
|
}
|
|
899
911
|
|
|
900
912
|
/** This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. */
|
|
@@ -928,6 +940,20 @@ export interface VideoChatParticipantsInvited {
|
|
|
928
940
|
users: User[];
|
|
929
941
|
}
|
|
930
942
|
|
|
943
|
+
/** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button. */
|
|
944
|
+
export interface SharedUser {
|
|
945
|
+
/** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
|
|
946
|
+
user_id: number;
|
|
947
|
+
/** First name of the user, if the name was requested by the bot */
|
|
948
|
+
first_name?: string;
|
|
949
|
+
/** Last name of the user, if the name was requested by the bot */
|
|
950
|
+
last_name?: string;
|
|
951
|
+
/** Username of the user, if the username was requested by the bot */
|
|
952
|
+
username?: string;
|
|
953
|
+
/** Available sizes of the chat photo, if the photo was requested by the bot */
|
|
954
|
+
photo?: PhotoSize[];
|
|
955
|
+
}
|
|
956
|
+
|
|
931
957
|
/** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
|
|
932
958
|
export interface GiveawayCreated {}
|
|
933
959
|
|
|
@@ -1049,10 +1075,6 @@ export interface StickerSet {
|
|
|
1049
1075
|
title: string;
|
|
1050
1076
|
/** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
|
|
1051
1077
|
sticker_type: "regular" | "mask" | "custom_emoji";
|
|
1052
|
-
/** True, if the sticker set contains animated stickers */
|
|
1053
|
-
is_animated: boolean;
|
|
1054
|
-
/** True, if the sticker set contains video stickers */
|
|
1055
|
-
is_video: boolean;
|
|
1056
1078
|
/** List of all set stickers */
|
|
1057
1079
|
stickers: Sticker[];
|
|
1058
1080
|
/** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
|
package/src/passportTypes.d.ts
CHANGED
|
@@ -35,21 +35,21 @@ export interface EncryptedPassportElement {
|
|
|
35
35
|
| "temporary_registration"
|
|
36
36
|
| "phone_number"
|
|
37
37
|
| "email";
|
|
38
|
-
/** Base64-encoded encrypted Telegram Passport element data provided by the user
|
|
38
|
+
/** Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
39
39
|
data?: string;
|
|
40
|
-
/** User's verified phone number
|
|
40
|
+
/** User's verified phone number; available only for type "phone_number". */
|
|
41
41
|
phone_number?: string;
|
|
42
|
-
/** User's verified email address
|
|
42
|
+
/** User's verified email address; available only for type "email". */
|
|
43
43
|
email?: string;
|
|
44
|
-
/** Array of encrypted files with documents provided by the user
|
|
44
|
+
/** Array of encrypted files with documents provided by the user; This array is available only for types "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". The files can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
45
45
|
files?: PassportFile[];
|
|
46
|
-
/** Encrypted file with the front side of the document, provided by the user
|
|
46
|
+
/** Encrypted file with the front side of the document, provided by the user; This file is available only for types "passport", "driver_license", "identity_card", and "internal_passport". It can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
47
47
|
front_side?: PassportFile;
|
|
48
|
-
/** Encrypted file with the reverse side of the document, provided by the user
|
|
48
|
+
/** Encrypted file with the reverse side of the document, provided by the user; This file is available only for types "driver_license" and "identity_card". It can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
49
49
|
reverse_side?: PassportFile;
|
|
50
|
-
/** Encrypted file with the selfie of the user holding a document, provided by the user. This file is available for types "passport", "driver_license", "identity_card", and "internal_passport". It can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
50
|
+
/** Encrypted file with the selfie of the user holding a document, provided by the user. This file is available if requested for types "passport", "driver_license", "identity_card", and "internal_passport". It can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
51
51
|
selfie?: PassportFile;
|
|
52
|
-
/** Array of encrypted files with translated versions of documents provided by the user
|
|
52
|
+
/** Array of encrypted files with translated versions of documents provided by the user; This array is available only for types "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". The
|
|
53
53
|
|
|
54
54
|
files can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
55
55
|
translation?: PassportFile[];
|
package/src/updateTypes.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ChosenInlineResult, InlineQuery } from "./inlineTypes";
|
|
2
2
|
import type {
|
|
3
|
+
User,
|
|
3
4
|
Chat,
|
|
4
5
|
ChatJoinRequest,
|
|
5
6
|
ChatMemberUpdated,
|
|
6
7
|
ChatBoostRemoved,
|
|
7
8
|
ChatBoostUpdated,
|
|
8
|
-
|
|
9
|
+
BusinessConnection,
|
|
10
|
+
BusinessMessagesDeleted,
|
|
9
11
|
} from "./manageTypes";
|
|
10
12
|
import type { CallbackQuery } from "./markupTypes";
|
|
11
13
|
import type {
|
|
@@ -21,6 +23,11 @@ import type { PreCheckoutQuery, ShippingQuery } from "./invoiceTypes";
|
|
|
21
23
|
* Namespace used internally to define more accurate message update types.
|
|
22
24
|
*/
|
|
23
25
|
export declare namespace Update {
|
|
26
|
+
/** Internal type holding properties that message updates in private chats share. */
|
|
27
|
+
interface Private {
|
|
28
|
+
chat: Chat.PrivateChat;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* Internal type holding properties that message updates in channels share.
|
|
26
33
|
*/
|
|
@@ -79,6 +86,18 @@ export interface Update {
|
|
|
79
86
|
*/
|
|
80
87
|
edited_channel_post?: Message & Update.Edited & Update.Channel;
|
|
81
88
|
|
|
89
|
+
/** The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot */
|
|
90
|
+
business_connection?: BusinessConnection;
|
|
91
|
+
|
|
92
|
+
/** New non-service message from a connected business account */
|
|
93
|
+
business_message?: Message & Update.Private;
|
|
94
|
+
|
|
95
|
+
/** New version of a message from a connected business account */
|
|
96
|
+
edited_business_message?: Message & Update.Edited & Update.Private;
|
|
97
|
+
|
|
98
|
+
/** Messages were deleted from a connected business account */
|
|
99
|
+
deleted_business_messages?: BusinessMessagesDeleted;
|
|
100
|
+
|
|
82
101
|
/** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. */
|
|
83
102
|
message_reaction?: MessageReactionUpdated;
|
|
84
103
|
|