@telegram.ts/types 1.10.0 → 1.12.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 +2 -1
- package/src/apiMethodsTypes.d.ts +111 -24
- package/src/botCommandTypes.d.ts +1 -4
- package/src/invoiceTypes.d.ts +154 -82
- package/src/manageTypes.d.ts +8 -0
- package/src/markupTypes.d.ts +1 -1
- package/src/messageTypes.d.ts +51 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegram.ts/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"api",
|
|
12
12
|
"types"
|
|
13
13
|
],
|
|
14
|
+
"homepage": "https://telegramsjs.vercel.app/",
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"bugs": {
|
|
16
17
|
"url": "https://github.com/telegramsjs/types/issues"
|
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -43,7 +43,11 @@ import type {
|
|
|
43
43
|
StickerSet,
|
|
44
44
|
} from "./messageTypes.ts";
|
|
45
45
|
import type { PassportElementError } from "./passportTypes.ts";
|
|
46
|
-
import type {
|
|
46
|
+
import type {
|
|
47
|
+
LabeledPrice,
|
|
48
|
+
ShippingOption,
|
|
49
|
+
StarTransactions,
|
|
50
|
+
} from "./invoiceTypes.ts";
|
|
47
51
|
import type {
|
|
48
52
|
BotCommandScope,
|
|
49
53
|
BotDescription,
|
|
@@ -140,7 +144,7 @@ export type ApiMethods = {
|
|
|
140
144
|
disable_notification?: boolean;
|
|
141
145
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
142
146
|
protect_content?: boolean;
|
|
143
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
147
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
144
148
|
message_effect_id?: string;
|
|
145
149
|
/** Description of the message to reply to */
|
|
146
150
|
reply_parameters?: ReplyParameters;
|
|
@@ -186,7 +190,7 @@ export type ApiMethods = {
|
|
|
186
190
|
protect_content?: boolean;
|
|
187
191
|
}): MessageId[];
|
|
188
192
|
|
|
189
|
-
/** Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
|
|
193
|
+
/** Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
|
|
190
194
|
copyMessage(args: {
|
|
191
195
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
192
196
|
chat_id: number | string;
|
|
@@ -220,7 +224,7 @@ export type ApiMethods = {
|
|
|
220
224
|
reply_to_message_id?: number;
|
|
221
225
|
}): MessageId;
|
|
222
226
|
|
|
223
|
-
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages,
|
|
227
|
+
/** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
|
|
224
228
|
copyMessages(args: {
|
|
225
229
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
226
230
|
chat_id: number | string;
|
|
@@ -262,7 +266,7 @@ export type ApiMethods = {
|
|
|
262
266
|
disable_notification?: boolean;
|
|
263
267
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
264
268
|
protect_content?: boolean;
|
|
265
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
269
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
266
270
|
message_effect_id?: string;
|
|
267
271
|
/** Description of the message to reply to */
|
|
268
272
|
reply_parameters?: ReplyParameters;
|
|
@@ -306,7 +310,7 @@ export type ApiMethods = {
|
|
|
306
310
|
disable_notification?: boolean;
|
|
307
311
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
308
312
|
protect_content?: boolean;
|
|
309
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
313
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
310
314
|
message_effect_id?: string;
|
|
311
315
|
/** Description of the message to reply to */
|
|
312
316
|
reply_parameters?: ReplyParameters;
|
|
@@ -344,7 +348,7 @@ export type ApiMethods = {
|
|
|
344
348
|
disable_notification?: boolean;
|
|
345
349
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
346
350
|
protect_content?: boolean;
|
|
347
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
351
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
348
352
|
message_effect_id?: string;
|
|
349
353
|
/** Description of the message to reply to */
|
|
350
354
|
reply_parameters?: ReplyParameters;
|
|
@@ -392,7 +396,7 @@ export type ApiMethods = {
|
|
|
392
396
|
disable_notification?: boolean;
|
|
393
397
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
394
398
|
protect_content?: boolean;
|
|
395
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
399
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
396
400
|
message_effect_id?: string;
|
|
397
401
|
/** Description of the message to reply to */
|
|
398
402
|
reply_parameters?: ReplyParameters;
|
|
@@ -438,7 +442,7 @@ export type ApiMethods = {
|
|
|
438
442
|
disable_notification?: boolean;
|
|
439
443
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
440
444
|
protect_content?: boolean;
|
|
441
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
445
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
442
446
|
message_effect_id?: string;
|
|
443
447
|
/** Description of the message to reply to */
|
|
444
448
|
reply_parameters?: ReplyParameters;
|
|
@@ -474,7 +478,7 @@ export type ApiMethods = {
|
|
|
474
478
|
disable_notification?: boolean;
|
|
475
479
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
476
480
|
protect_content?: boolean;
|
|
477
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
481
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
478
482
|
message_effect_id?: string;
|
|
479
483
|
/** Description of the message to reply to */
|
|
480
484
|
reply_parameters?: ReplyParameters;
|
|
@@ -509,7 +513,7 @@ export type ApiMethods = {
|
|
|
509
513
|
disable_notification?: boolean;
|
|
510
514
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
511
515
|
protect_content?: boolean;
|
|
512
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
516
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
513
517
|
message_effect_id?: string;
|
|
514
518
|
/** Description of the message to reply to */
|
|
515
519
|
reply_parameters?: ReplyParameters;
|
|
@@ -539,7 +543,7 @@ export type ApiMethods = {
|
|
|
539
543
|
disable_notification?: boolean;
|
|
540
544
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
541
545
|
protect_content?: boolean;
|
|
542
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
546
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
543
547
|
message_effect_id?: string;
|
|
544
548
|
/** Description of the message to reply to */
|
|
545
549
|
reply_parameters?: ReplyParameters;
|
|
@@ -576,7 +580,7 @@ export type ApiMethods = {
|
|
|
576
580
|
disable_notification?: boolean;
|
|
577
581
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
578
582
|
protect_content?: boolean;
|
|
579
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
583
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
580
584
|
message_effect_id?: string;
|
|
581
585
|
/** Description of the message to reply to */
|
|
582
586
|
reply_parameters?: ReplyParameters;
|
|
@@ -592,6 +596,8 @@ export type ApiMethods = {
|
|
|
592
596
|
|
|
593
597
|
/** Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
594
598
|
editMessageLiveLocation(args: {
|
|
599
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
600
|
+
business_connection_id?: string;
|
|
595
601
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
596
602
|
chat_id?: number | string;
|
|
597
603
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -616,6 +622,8 @@ export type ApiMethods = {
|
|
|
616
622
|
|
|
617
623
|
/** Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
618
624
|
stopMessageLiveLocation(args: {
|
|
625
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
626
|
+
business_connection_id?: string;
|
|
619
627
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
620
628
|
chat_id?: number | string;
|
|
621
629
|
/** Required if inline_message_id is not specified. Identifier of the message with live location to stop */
|
|
@@ -626,6 +634,36 @@ export type ApiMethods = {
|
|
|
626
634
|
reply_markup?: InlineKeyboardMarkup;
|
|
627
635
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
628
636
|
|
|
637
|
+
/** Use this method to send paid media to channel chats. On success, the sent Message is returned. */
|
|
638
|
+
sendPaidMedia(args: {
|
|
639
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
640
|
+
chat_id: number | string;
|
|
641
|
+
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
642
|
+
star_count: number;
|
|
643
|
+
/** An array describing the media to be sent; up to 10 items */
|
|
644
|
+
media: InputPaidMedia[];
|
|
645
|
+
/** Media caption, 0-1024 characters after entities parsing */
|
|
646
|
+
caption?: string;
|
|
647
|
+
/** Mode for parsing entities in the media caption. See formatting options for more details. */
|
|
648
|
+
parse_mode?: string;
|
|
649
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
650
|
+
caption_entities?: MessageEntity[];
|
|
651
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
652
|
+
show_caption_above_media?: boolean;
|
|
653
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
654
|
+
disable_notification?: boolean;
|
|
655
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
656
|
+
protect_content?: boolean;
|
|
657
|
+
/** Description of the message to reply to */
|
|
658
|
+
reply_parameters?: ReplyParameters;
|
|
659
|
+
/** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user */
|
|
660
|
+
reply_markup?:
|
|
661
|
+
| InlineKeyboardMarkup
|
|
662
|
+
| ReplyKeyboardMarkup
|
|
663
|
+
| ReplyKeyboardRemove
|
|
664
|
+
| ForceReply;
|
|
665
|
+
}): Message.PaidMediaMessage;
|
|
666
|
+
|
|
629
667
|
/** Use this method to send information about a venue. On success, the sent Message is returned. */
|
|
630
668
|
sendVenue(args: {
|
|
631
669
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -654,7 +692,7 @@ export type ApiMethods = {
|
|
|
654
692
|
disable_notification?: boolean;
|
|
655
693
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
656
694
|
protect_content?: boolean;
|
|
657
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
695
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
658
696
|
message_effect_id?: string;
|
|
659
697
|
/** Description of the message to reply to */
|
|
660
698
|
reply_parameters?: ReplyParameters;
|
|
@@ -688,7 +726,7 @@ export type ApiMethods = {
|
|
|
688
726
|
disable_notification?: boolean;
|
|
689
727
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
690
728
|
protect_content?: boolean;
|
|
691
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
729
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
692
730
|
message_effect_id?: string;
|
|
693
731
|
/** Description of the message to reply to */
|
|
694
732
|
reply_parameters?: ReplyParameters;
|
|
@@ -742,7 +780,7 @@ export type ApiMethods = {
|
|
|
742
780
|
disable_notification?: boolean;
|
|
743
781
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
744
782
|
protect_content?: boolean;
|
|
745
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
783
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
746
784
|
message_effect_id?: string;
|
|
747
785
|
/** Description of the message to reply to */
|
|
748
786
|
reply_parameters?: ReplyParameters;
|
|
@@ -770,7 +808,7 @@ export type ApiMethods = {
|
|
|
770
808
|
disable_notification?: boolean;
|
|
771
809
|
/** Protects the contents of the sent message from forwarding */
|
|
772
810
|
protect_content?: boolean;
|
|
773
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
811
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
774
812
|
message_effect_id?: string;
|
|
775
813
|
/** Description of the message to reply to */
|
|
776
814
|
reply_parameters?: ReplyParameters;
|
|
@@ -1351,8 +1389,10 @@ export type ApiMethods = {
|
|
|
1351
1389
|
for_channels?: boolean;
|
|
1352
1390
|
}): ChatAdministratorRights;
|
|
1353
1391
|
|
|
1354
|
-
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1392
|
+
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1355
1393
|
editMessageText(args: {
|
|
1394
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1395
|
+
business_connection_id?: string;
|
|
1356
1396
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1357
1397
|
chat_id?: number | string;
|
|
1358
1398
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1371,8 +1411,10 @@ export type ApiMethods = {
|
|
|
1371
1411
|
reply_markup?: InlineKeyboardMarkup;
|
|
1372
1412
|
}): (Update.Edited & Message.TextMessage) | true;
|
|
1373
1413
|
|
|
1374
|
-
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1414
|
+
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1375
1415
|
editMessageCaption(args: {
|
|
1416
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1417
|
+
business_connection_id?: string;
|
|
1376
1418
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1377
1419
|
chat_id?: number | string;
|
|
1378
1420
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1391,8 +1433,10 @@ export type ApiMethods = {
|
|
|
1391
1433
|
reply_markup?: InlineKeyboardMarkup;
|
|
1392
1434
|
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
1393
1435
|
|
|
1394
|
-
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1436
|
+
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1395
1437
|
editMessageMedia(args: {
|
|
1438
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1439
|
+
business_connection_id?: string;
|
|
1396
1440
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1397
1441
|
chat_id?: number | string;
|
|
1398
1442
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1405,8 +1449,10 @@ export type ApiMethods = {
|
|
|
1405
1449
|
reply_markup?: InlineKeyboardMarkup;
|
|
1406
1450
|
}): (Update.Edited & Message) | true;
|
|
1407
1451
|
|
|
1408
|
-
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1452
|
+
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1409
1453
|
editMessageReplyMarkup(args: {
|
|
1454
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1455
|
+
business_connection_id?: string;
|
|
1410
1456
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1411
1457
|
chat_id?: number | string;
|
|
1412
1458
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1419,6 +1465,8 @@ export type ApiMethods = {
|
|
|
1419
1465
|
|
|
1420
1466
|
/** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
|
|
1421
1467
|
stopPoll(args: {
|
|
1468
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1469
|
+
business_connection_id?: string;
|
|
1422
1470
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1423
1471
|
chat_id: number | string;
|
|
1424
1472
|
/** Identifier of the original message with the poll */
|
|
@@ -1468,7 +1516,7 @@ export type ApiMethods = {
|
|
|
1468
1516
|
disable_notification?: boolean;
|
|
1469
1517
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1470
1518
|
protect_content?: boolean;
|
|
1471
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1519
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1472
1520
|
message_effect_id?: string;
|
|
1473
1521
|
/** Description of the message to reply to */
|
|
1474
1522
|
reply_parameters?: ReplyParameters;
|
|
@@ -1693,7 +1741,7 @@ export type ApiMethods = {
|
|
|
1693
1741
|
disable_notification?: boolean;
|
|
1694
1742
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1695
1743
|
protect_content?: boolean;
|
|
1696
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1744
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1697
1745
|
message_effect_id?: string;
|
|
1698
1746
|
/** Description of the message to reply to */
|
|
1699
1747
|
reply_parameters?: ReplyParameters;
|
|
@@ -1777,6 +1825,14 @@ export type ApiMethods = {
|
|
|
1777
1825
|
telegram_payment_charge_id: string;
|
|
1778
1826
|
}): true;
|
|
1779
1827
|
|
|
1828
|
+
/** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
|
|
1829
|
+
getStarTransactions(args: {
|
|
1830
|
+
/** Number of transactions to skip in the response */
|
|
1831
|
+
offset?: number;
|
|
1832
|
+
/** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
1833
|
+
limit?: number;
|
|
1834
|
+
}): StarTransactions;
|
|
1835
|
+
|
|
1780
1836
|
/** Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
|
1781
1837
|
|
|
1782
1838
|
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. */
|
|
@@ -1801,7 +1857,7 @@ export type ApiMethods = {
|
|
|
1801
1857
|
disable_notification?: boolean;
|
|
1802
1858
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1803
1859
|
protect_content?: boolean;
|
|
1804
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1860
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1805
1861
|
message_effect_id?: string;
|
|
1806
1862
|
/** Description of the message to reply to */
|
|
1807
1863
|
reply_parameters?: ReplyParameters;
|
|
@@ -1982,3 +2038,34 @@ export interface InputMediaDocument {
|
|
|
1982
2038
|
/** Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. */
|
|
1983
2039
|
disable_content_type_detection?: boolean;
|
|
1984
2040
|
}
|
|
2041
|
+
|
|
2042
|
+
/** This object describes the paid media to be sent. Currently, it can be one of
|
|
2043
|
+
- InputPaidMediaPhoto
|
|
2044
|
+
- InputPaidMediaVideo */
|
|
2045
|
+
export type InputPaidMedia = InputMediaPhoto | InputPaidMediaVideo;
|
|
2046
|
+
|
|
2047
|
+
/** The paid media to send is a photo. */
|
|
2048
|
+
export interface InputPaidMediaPhoto {
|
|
2049
|
+
/** Type of the media, must be photo */
|
|
2050
|
+
type: "photo";
|
|
2051
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » */
|
|
2052
|
+
media: Buffer | ReadStream | string;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
/** The paid media to send is a video. */
|
|
2056
|
+
export interface InputPaidMediaVideo {
|
|
2057
|
+
/** Type of the media, must be video */
|
|
2058
|
+
type: "video";
|
|
2059
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » */
|
|
2060
|
+
media: Buffer | ReadStream | string;
|
|
2061
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2062
|
+
thumbnail?: Buffer | ReadStream | string;
|
|
2063
|
+
/** Video width */
|
|
2064
|
+
width?: number;
|
|
2065
|
+
/** Video height */
|
|
2066
|
+
height?: number;
|
|
2067
|
+
/** Video duration in seconds */
|
|
2068
|
+
duration?: number;
|
|
2069
|
+
/** Pass True if the uploaded video is suitable for streaming */
|
|
2070
|
+
supports_streaming?: boolean;
|
|
2071
|
+
}
|
package/src/botCommandTypes.d.ts
CHANGED
|
@@ -56,10 +56,7 @@ export interface MenuButtonWebApp {
|
|
|
56
56
|
type: "web_app";
|
|
57
57
|
/** The text on the button. */
|
|
58
58
|
text: string;
|
|
59
|
-
/**
|
|
60
|
-
* The description of the Web App that will be launched when the user presses the button.
|
|
61
|
-
* The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
|
|
62
|
-
*/
|
|
59
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. */
|
|
63
60
|
web_app: WebAppInfo;
|
|
64
61
|
}
|
|
65
62
|
|
package/src/invoiceTypes.d.ts
CHANGED
|
@@ -1,145 +1,217 @@
|
|
|
1
1
|
import type { User } from "./manageTypes";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This interface represents a labeled portion of the price for goods or services.
|
|
5
|
-
*/
|
|
3
|
+
/** This object represents a portion of the price for goods or services. */
|
|
6
4
|
export interface LabeledPrice {
|
|
7
|
-
/**
|
|
5
|
+
/** Portion label */
|
|
8
6
|
label: string;
|
|
9
|
-
/**
|
|
10
|
-
* The price of the product in the smallest units of the currency (integer, not float/double).
|
|
11
|
-
* For example, for a price of US$ 1.45, the amount would be 145.
|
|
12
|
-
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
13
|
-
* (2 for the majority of currencies).
|
|
14
|
-
*/
|
|
7
|
+
/** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
15
8
|
amount: number;
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
/**
|
|
19
|
-
* This interface contains basic information about an invoice.
|
|
20
|
-
*/
|
|
11
|
+
/** This object contains basic information about an invoice. */
|
|
21
12
|
export interface Invoice {
|
|
22
|
-
/**
|
|
13
|
+
/** Product name */
|
|
23
14
|
title: string;
|
|
24
|
-
/**
|
|
15
|
+
/** Product description */
|
|
25
16
|
description: string;
|
|
26
|
-
/**
|
|
17
|
+
/** Unique bot deep-linking parameter that can be used to generate this invoice */
|
|
27
18
|
start_parameter: string;
|
|
28
|
-
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
|
19
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
29
20
|
currency: string;
|
|
30
|
-
/**
|
|
31
|
-
* The total price in the smallest units of the currency (integer, not float/double).
|
|
32
|
-
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
33
|
-
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
34
|
-
* (2 for the majority of currencies).
|
|
35
|
-
*/
|
|
21
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
36
22
|
total_amount: number;
|
|
37
23
|
}
|
|
38
24
|
|
|
39
|
-
/**
|
|
40
|
-
* This interface represents a shipping address.
|
|
41
|
-
*/
|
|
25
|
+
/** This object represents a shipping address. */
|
|
42
26
|
export interface ShippingAddress {
|
|
43
|
-
/**
|
|
27
|
+
/** Two-letter ISO 3166-1 alpha-2 country code */
|
|
44
28
|
country_code: string;
|
|
45
|
-
/**
|
|
29
|
+
/** State, if applicable */
|
|
46
30
|
state: string;
|
|
47
|
-
/**
|
|
31
|
+
/** City */
|
|
48
32
|
city: string;
|
|
49
|
-
/**
|
|
33
|
+
/** First line for the address */
|
|
50
34
|
street_line1: string;
|
|
51
|
-
/**
|
|
35
|
+
/** Second line for the address */
|
|
52
36
|
street_line2: string;
|
|
53
|
-
/**
|
|
37
|
+
/** Address post code */
|
|
54
38
|
post_code: string;
|
|
55
39
|
}
|
|
56
40
|
|
|
57
|
-
/**
|
|
58
|
-
* This interface represents information about an order.
|
|
59
|
-
*/
|
|
41
|
+
/** This object represents information about an order. */
|
|
60
42
|
export interface OrderInfo {
|
|
61
|
-
/**
|
|
43
|
+
/** User name */
|
|
62
44
|
name?: string;
|
|
63
|
-
/**
|
|
45
|
+
/** User's phone number */
|
|
64
46
|
phone_number?: string;
|
|
65
|
-
/**
|
|
47
|
+
/** User email */
|
|
66
48
|
email?: string;
|
|
67
|
-
/**
|
|
49
|
+
/** User shipping address */
|
|
68
50
|
shipping_address?: ShippingAddress;
|
|
69
51
|
}
|
|
70
52
|
|
|
71
|
-
/**
|
|
72
|
-
* This interface represents a shipping option.
|
|
73
|
-
*/
|
|
53
|
+
/** This object represents one shipping option. */
|
|
74
54
|
export interface ShippingOption {
|
|
75
|
-
/**
|
|
55
|
+
/** Shipping option identifier */
|
|
76
56
|
id: string;
|
|
77
|
-
/**
|
|
57
|
+
/** Option title */
|
|
78
58
|
title: string;
|
|
79
|
-
/**
|
|
59
|
+
/** List of price portions */
|
|
80
60
|
prices: LabeledPrice[];
|
|
81
61
|
}
|
|
82
62
|
|
|
83
|
-
/**
|
|
84
|
-
* This interface contains basic information about a successful payment.
|
|
85
|
-
*/
|
|
63
|
+
/** This object contains basic information about a successful payment. */
|
|
86
64
|
export interface SuccessfulPayment {
|
|
87
|
-
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
|
65
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
88
66
|
currency: string;
|
|
89
|
-
/**
|
|
90
|
-
* The total price in the smallest units of the currency (integer, not float/double).
|
|
91
|
-
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
92
|
-
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
93
|
-
* (2 for the majority of currencies).
|
|
94
|
-
*/
|
|
67
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
95
68
|
total_amount: number;
|
|
96
|
-
/**
|
|
69
|
+
/** Bot specified invoice payload */
|
|
97
70
|
invoice_payload: string;
|
|
98
|
-
/**
|
|
71
|
+
/** Identifier of the shipping option chosen by the user */
|
|
99
72
|
shipping_option_id?: string;
|
|
100
|
-
/**
|
|
73
|
+
/** Order information provided by the user */
|
|
101
74
|
order_info?: OrderInfo;
|
|
102
|
-
/**
|
|
75
|
+
/** Telegram payment identifier */
|
|
103
76
|
telegram_payment_charge_id: string;
|
|
104
|
-
/**
|
|
77
|
+
/** Provider payment identifier */
|
|
105
78
|
provider_payment_charge_id: string;
|
|
106
79
|
}
|
|
107
80
|
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
*/
|
|
81
|
+
/** This object contains basic information about a refunded payment. */
|
|
82
|
+
export interface RefundedPayment {
|
|
83
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR” */
|
|
84
|
+
currency: string;
|
|
85
|
+
/** Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
86
|
+
total_amount: number;
|
|
87
|
+
/** Bot-specified invoice payload */
|
|
88
|
+
invoice_payload: string;
|
|
89
|
+
/** Telegram payment identifier */
|
|
90
|
+
telegram_payment_charge_id: string;
|
|
91
|
+
/** Provider payment identifier */
|
|
92
|
+
provider_payment_charge_id?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** This object contains information about an incoming shipping query. */
|
|
111
96
|
export interface ShippingQuery {
|
|
112
|
-
/**
|
|
97
|
+
/** Unique query identifier */
|
|
113
98
|
id: string;
|
|
114
|
-
/**
|
|
99
|
+
/** User who sent the query */
|
|
115
100
|
from: User;
|
|
116
|
-
/**
|
|
101
|
+
/** Bot specified invoice payload */
|
|
117
102
|
invoice_payload: string;
|
|
118
|
-
/**
|
|
103
|
+
/** User specified shipping address */
|
|
119
104
|
shipping_address: ShippingAddress;
|
|
120
105
|
}
|
|
121
106
|
|
|
122
|
-
/**
|
|
123
|
-
* This interface contains information about an incoming pre-checkout query.
|
|
124
|
-
*/
|
|
107
|
+
/** This object contains information about an incoming pre-checkout query. */
|
|
125
108
|
export interface PreCheckoutQuery {
|
|
126
|
-
/**
|
|
109
|
+
/** Unique query identifier */
|
|
127
110
|
id: string;
|
|
128
|
-
/**
|
|
111
|
+
/** User who sent the query */
|
|
129
112
|
from: User;
|
|
130
|
-
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
|
|
113
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
131
114
|
currency: string;
|
|
132
|
-
/**
|
|
133
|
-
* The total price in the smallest units of the currency (integer, not float/double).
|
|
134
|
-
* For example, for a price of US$ 1.45, the total_amount would be 145.
|
|
135
|
-
* See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
|
|
136
|
-
* (2 for the majority of currencies).
|
|
137
|
-
*/
|
|
115
|
+
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
138
116
|
total_amount: number;
|
|
139
|
-
/**
|
|
117
|
+
/** Bot specified invoice payload */
|
|
140
118
|
invoice_payload: string;
|
|
141
|
-
/**
|
|
119
|
+
/** Identifier of the shipping option chosen by the user */
|
|
142
120
|
shipping_option_id?: string;
|
|
143
|
-
/**
|
|
121
|
+
/** Order information provided by the user */
|
|
144
122
|
order_info?: OrderInfo;
|
|
145
123
|
}
|
|
124
|
+
|
|
125
|
+
/** This object describes the state of a revenue withdrawal operation. Currently, it can be one of
|
|
126
|
+
|
|
127
|
+
- RevenueWithdrawalStatePending
|
|
128
|
+
- RevenueWithdrawalStateSucceeded
|
|
129
|
+
- RevenueWithdrawalStateFailed */
|
|
130
|
+
export type RevenueWithdrawalState =
|
|
131
|
+
| RevenueWithdrawalStatePending
|
|
132
|
+
| RevenueWithdrawalStateSucceeded
|
|
133
|
+
| RevenueWithdrawalStateFailed;
|
|
134
|
+
|
|
135
|
+
/** The withdrawal is in progress. */
|
|
136
|
+
export interface RevenueWithdrawalStatePending {
|
|
137
|
+
/** Type of the state, always “pending” */
|
|
138
|
+
type: "pending";
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The withdrawal succeeded. */
|
|
142
|
+
export interface RevenueWithdrawalStateSucceeded {
|
|
143
|
+
/** Type of the state, always “succeeded” */
|
|
144
|
+
type: "succeeded";
|
|
145
|
+
/** Date the withdrawal was completed in Unix time */
|
|
146
|
+
date: number;
|
|
147
|
+
/** An HTTPS URL that can be used to see transaction details */
|
|
148
|
+
url: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** The withdrawal failed and the transaction was refunded. */
|
|
152
|
+
export interface RevenueWithdrawalStateFailed {
|
|
153
|
+
/** Type of the state, always “failed” */
|
|
154
|
+
type: "failed";
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
158
|
+
|
|
159
|
+
- TransactionPartnerUser
|
|
160
|
+
- TransactionPartnerFragment
|
|
161
|
+
- TransactionPartnerTelegramAds
|
|
162
|
+
- TransactionPartnerOther */
|
|
163
|
+
export type TransactionPartner =
|
|
164
|
+
| TransactionPartnerUser
|
|
165
|
+
| TransactionPartnerFragment
|
|
166
|
+
| TransactionPartnerTelegramAds
|
|
167
|
+
| TransactionPartnerOther;
|
|
168
|
+
|
|
169
|
+
/** Describes a transaction with a user. */
|
|
170
|
+
export interface TransactionPartnerUser {
|
|
171
|
+
/** Type of the transaction partner, always “user” */
|
|
172
|
+
type: "user";
|
|
173
|
+
/** Information about the user */
|
|
174
|
+
user: User;
|
|
175
|
+
/** Bot-specified invoice payload */
|
|
176
|
+
invoice_payload?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Describes a withdrawal transaction with Fragment. */
|
|
180
|
+
export interface TransactionPartnerFragment {
|
|
181
|
+
/** Type of the transaction partner, always “fragment” */
|
|
182
|
+
type: "fragment";
|
|
183
|
+
/** State of the transaction if the transaction is outgoing */
|
|
184
|
+
withdrawal_state?: RevenueWithdrawalState;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Describes a withdrawal transaction to the Telegram Ads platform. */
|
|
188
|
+
export interface TransactionPartnerTelegramAds {
|
|
189
|
+
/** Type of the transaction partner, always “telegram_ads” */
|
|
190
|
+
type: "telegram_ads";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Describes a transaction with an unknown source or recipient. */
|
|
194
|
+
export interface TransactionPartnerOther {
|
|
195
|
+
/** Type of the transaction partner, always “other” */
|
|
196
|
+
type: "other";
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Describes a Telegram Star transaction. */
|
|
200
|
+
export interface StarTransaction {
|
|
201
|
+
/** Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
|
|
202
|
+
id: string;
|
|
203
|
+
/** Number of Telegram Stars transferred by the transaction */
|
|
204
|
+
amount: number;
|
|
205
|
+
/** Date the transaction was created in Unix time */
|
|
206
|
+
date: number;
|
|
207
|
+
/** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */
|
|
208
|
+
source?: TransactionPartner;
|
|
209
|
+
/** Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions */
|
|
210
|
+
receiver?: TransactionPartner;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Contains a list of Telegram Star transactions. */
|
|
214
|
+
export interface StarTransactions {
|
|
215
|
+
/** The list of transactions */
|
|
216
|
+
transactions: StarTransaction[];
|
|
217
|
+
}
|
package/src/manageTypes.d.ts
CHANGED
|
@@ -230,6 +230,8 @@ export declare namespace ChatFullInfo {
|
|
|
230
230
|
linked_chat_id?: undefined;
|
|
231
231
|
/** For supergroups, the location to which the supergroup is connected */
|
|
232
232
|
location?: undefined;
|
|
233
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
234
|
+
can_send_paid_media?: undefined;
|
|
233
235
|
}
|
|
234
236
|
/** Internal type for group chats */
|
|
235
237
|
export interface GroupChat {
|
|
@@ -319,6 +321,8 @@ export declare namespace ChatFullInfo {
|
|
|
319
321
|
linked_chat_id?: undefined;
|
|
320
322
|
/** For supergroups, the location to which the supergroup is connected */
|
|
321
323
|
location?: undefined;
|
|
324
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
325
|
+
can_send_paid_media?: undefined;
|
|
322
326
|
}
|
|
323
327
|
/** Internal type for supergroup chats */
|
|
324
328
|
export interface SupergroupChat {
|
|
@@ -408,6 +412,8 @@ export declare namespace ChatFullInfo {
|
|
|
408
412
|
linked_chat_id?: number;
|
|
409
413
|
/** For supergroups, the location to which the supergroup is connected */
|
|
410
414
|
location?: ChatLocation;
|
|
415
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
416
|
+
can_send_paid_media?: undefined;
|
|
411
417
|
}
|
|
412
418
|
/** Internal type for channel chats */
|
|
413
419
|
export interface ChannelChat {
|
|
@@ -497,6 +503,8 @@ export declare namespace ChatFullInfo {
|
|
|
497
503
|
linked_chat_id?: number;
|
|
498
504
|
/** For supergroups, the location to which the supergroup is connected */
|
|
499
505
|
location?: undefined;
|
|
506
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
507
|
+
can_send_paid_media?: undefined;
|
|
500
508
|
}
|
|
501
509
|
}
|
|
502
510
|
|
package/src/markupTypes.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
17
17
|
url: string;
|
|
18
18
|
}
|
|
19
19
|
export interface CallbackButton extends AbstractInlineKeyboardButton {
|
|
20
|
-
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
|
|
20
|
+
/** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes. */
|
|
21
21
|
callback_data: string;
|
|
22
22
|
}
|
|
23
23
|
export interface WebAppButton extends AbstractInlineKeyboardButton {
|
package/src/messageTypes.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export declare namespace Message {
|
|
|
88
88
|
export type GameMessage = CommonMessage & MsgWith<"game">;
|
|
89
89
|
export type PollMessage = CommonMessage & MsgWith<"poll">;
|
|
90
90
|
export type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
91
|
+
export type PaidMediaMessage = CommonMessage & MsgWith<"paid_media">;
|
|
91
92
|
export type VenueMessage = LocationMessage & MsgWith<"venue">;
|
|
92
93
|
export type NewChatMembersMessage = ServiceMessage &
|
|
93
94
|
MsgWith<"new_chat_members">;
|
|
@@ -113,6 +114,8 @@ export declare namespace Message {
|
|
|
113
114
|
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
|
|
114
115
|
export type SuccessfulPaymentMessage = ServiceMessage &
|
|
115
116
|
MsgWith<"successful_payment">;
|
|
117
|
+
export type RefundedPaymentMessage = ServiceMessage &
|
|
118
|
+
MsgWith<"refunded_payment">;
|
|
116
119
|
export type UsersSharedMessage = ServiceMessage & MsgWith<"users_shared">;
|
|
117
120
|
export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">;
|
|
118
121
|
export type ConnectedWebsiteMessage = ServiceMessage &
|
|
@@ -192,6 +195,8 @@ export interface Message extends Message.MediaMessage {
|
|
|
192
195
|
venue?: Venue;
|
|
193
196
|
/** Message is a shared location, information about the location */
|
|
194
197
|
location?: Location;
|
|
198
|
+
/** Message contains paid media; information about the paid media */
|
|
199
|
+
paid_media?: PaidMediaInfo;
|
|
195
200
|
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
196
201
|
new_chat_members?: User[];
|
|
197
202
|
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
@@ -220,6 +225,8 @@ export interface Message extends Message.MediaMessage {
|
|
|
220
225
|
invoice?: Invoice;
|
|
221
226
|
/** Message is a service message about a successful payment, information about the payment. More about payments » */
|
|
222
227
|
successful_payment?: SuccessfulPayment;
|
|
228
|
+
/** Message is a service message about a refunded payment, information about the payment. More about payments » */
|
|
229
|
+
refunded_payment?: RefundedPayment;
|
|
223
230
|
/** Service message: users were shared with the bot */
|
|
224
231
|
users_shared?: UsersShared;
|
|
225
232
|
/** Service message: a chat was shared with the bot */
|
|
@@ -530,6 +537,8 @@ export interface ExternalReplyInfo {
|
|
|
530
537
|
invoice?: Invoice;
|
|
531
538
|
/** Message is a shared location, information about the location */
|
|
532
539
|
location?: Location;
|
|
540
|
+
/** Message contains paid media; information about the paid media */
|
|
541
|
+
paid_media?: PaidMediaInfo;
|
|
533
542
|
/** Message is a native poll, information about the poll */
|
|
534
543
|
poll?: Poll;
|
|
535
544
|
/** Message is a venue, information about the venue */
|
|
@@ -839,6 +848,48 @@ export interface Location {
|
|
|
839
848
|
proximity_alert_radius?: number;
|
|
840
849
|
}
|
|
841
850
|
|
|
851
|
+
/** Describes the paid media added to a message. */
|
|
852
|
+
export interface PaidMediaInfo {
|
|
853
|
+
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
854
|
+
star_count: number;
|
|
855
|
+
/** Information about the paid media */
|
|
856
|
+
paid_media: PaidMedia[];
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/** This object describes paid media. Currently, it can be one of
|
|
860
|
+
- PaidMediaPreview
|
|
861
|
+
- PaidMediaPhoto
|
|
862
|
+
- PaidMediaVideo */
|
|
863
|
+
export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;
|
|
864
|
+
|
|
865
|
+
/** The paid media isn't available before the payment. */
|
|
866
|
+
export interface PaidMediaPreview {
|
|
867
|
+
/** Type of the paid media, always “preview” */
|
|
868
|
+
type: "preview";
|
|
869
|
+
/** Media width as defined by the sender */
|
|
870
|
+
width?: number;
|
|
871
|
+
/** Media height as defined by the sender */
|
|
872
|
+
height?: number;
|
|
873
|
+
/** Duration of the media in seconds as defined by the sender */
|
|
874
|
+
duration?: number;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/** The paid media is a photo. */
|
|
878
|
+
export interface PaidMediaPhoto {
|
|
879
|
+
/** Type of the paid media, always “photo” */
|
|
880
|
+
type: "photo";
|
|
881
|
+
/** The photo */
|
|
882
|
+
photo: PhotoSize[];
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/** The paid media is a video. */
|
|
886
|
+
export interface PaidMediaVideo {
|
|
887
|
+
/** Type of the paid media, always “video” */
|
|
888
|
+
type: "video";
|
|
889
|
+
/** The video */
|
|
890
|
+
video: Video;
|
|
891
|
+
}
|
|
892
|
+
|
|
842
893
|
/** This object represents a venue. */
|
|
843
894
|
export interface Venue {
|
|
844
895
|
/** Venue location. Can't be a live location */
|