@telegram.ts/types 1.12.0 → 1.13.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 +1 -1
- package/src/apiMethodsTypes.d.ts +7 -44
- package/src/manageTypes.d.ts +6 -4
- package/src/messageTypes.d.ts +5 -1
package/package.json
CHANGED
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -154,8 +154,6 @@ export type ApiMethods = {
|
|
|
154
154
|
| ReplyKeyboardMarkup
|
|
155
155
|
| ReplyKeyboardRemove
|
|
156
156
|
| ForceReply;
|
|
157
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
158
|
-
reply_to_message_id?: number;
|
|
159
157
|
}): Message.TextMessage;
|
|
160
158
|
|
|
161
159
|
/** Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned. */
|
|
@@ -220,8 +218,6 @@ export type ApiMethods = {
|
|
|
220
218
|
| ReplyKeyboardMarkup
|
|
221
219
|
| ReplyKeyboardRemove
|
|
222
220
|
| ForceReply;
|
|
223
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
224
|
-
reply_to_message_id?: number;
|
|
225
221
|
}): MessageId;
|
|
226
222
|
|
|
227
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, 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. */
|
|
@@ -276,8 +272,6 @@ export type ApiMethods = {
|
|
|
276
272
|
| ReplyKeyboardMarkup
|
|
277
273
|
| ReplyKeyboardRemove
|
|
278
274
|
| ForceReply;
|
|
279
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
280
|
-
reply_to_message_id?: number;
|
|
281
275
|
}): Message.PhotoMessage;
|
|
282
276
|
|
|
283
277
|
/** Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
|
@@ -320,8 +314,6 @@ export type ApiMethods = {
|
|
|
320
314
|
| ReplyKeyboardMarkup
|
|
321
315
|
| ReplyKeyboardRemove
|
|
322
316
|
| ForceReply;
|
|
323
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
324
|
-
reply_to_message_id?: number;
|
|
325
317
|
}): Message.AudioMessage;
|
|
326
318
|
|
|
327
319
|
/** 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. */
|
|
@@ -358,8 +350,6 @@ export type ApiMethods = {
|
|
|
358
350
|
| ReplyKeyboardMarkup
|
|
359
351
|
| ReplyKeyboardRemove
|
|
360
352
|
| ForceReply;
|
|
361
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
362
|
-
reply_to_message_id?: number;
|
|
363
353
|
}): Message.DocumentMessage;
|
|
364
354
|
|
|
365
355
|
/** 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. */
|
|
@@ -406,8 +396,6 @@ export type ApiMethods = {
|
|
|
406
396
|
| ReplyKeyboardMarkup
|
|
407
397
|
| ReplyKeyboardRemove
|
|
408
398
|
| ForceReply;
|
|
409
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
410
|
-
reply_to_message_id?: number;
|
|
411
399
|
}): Message.VideoMessage;
|
|
412
400
|
|
|
413
401
|
/** 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. */
|
|
@@ -452,8 +440,6 @@ export type ApiMethods = {
|
|
|
452
440
|
| ReplyKeyboardMarkup
|
|
453
441
|
| ReplyKeyboardRemove
|
|
454
442
|
| ForceReply;
|
|
455
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
456
|
-
reply_to_message_id?: number;
|
|
457
443
|
}): Message.AnimationMessage;
|
|
458
444
|
|
|
459
445
|
/** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
|
|
@@ -488,8 +474,6 @@ export type ApiMethods = {
|
|
|
488
474
|
| ReplyKeyboardMarkup
|
|
489
475
|
| ReplyKeyboardRemove
|
|
490
476
|
| ForceReply;
|
|
491
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
492
|
-
reply_to_message_id?: number;
|
|
493
477
|
}): Message.VoiceMessage;
|
|
494
478
|
|
|
495
479
|
/** Use this method to send video messages. On success, the sent Message is returned.
|
|
@@ -523,8 +507,6 @@ export type ApiMethods = {
|
|
|
523
507
|
| ReplyKeyboardMarkup
|
|
524
508
|
| ReplyKeyboardRemove
|
|
525
509
|
| ForceReply;
|
|
526
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
527
|
-
reply_to_message_id?: number;
|
|
528
510
|
}): Message.VideoNoteMessage;
|
|
529
511
|
|
|
530
512
|
/** 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. */
|
|
@@ -547,8 +529,6 @@ export type ApiMethods = {
|
|
|
547
529
|
message_effect_id?: string;
|
|
548
530
|
/** Description of the message to reply to */
|
|
549
531
|
reply_parameters?: ReplyParameters;
|
|
550
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
551
|
-
reply_to_message_id?: number;
|
|
552
532
|
}): Array<
|
|
553
533
|
| Message.AudioMessage
|
|
554
534
|
| Message.DocumentMessage
|
|
@@ -590,8 +570,6 @@ export type ApiMethods = {
|
|
|
590
570
|
| ReplyKeyboardMarkup
|
|
591
571
|
| ReplyKeyboardRemove
|
|
592
572
|
| ForceReply;
|
|
593
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
594
|
-
reply_to_message_id?: number;
|
|
595
573
|
}): Message.LocationMessage;
|
|
596
574
|
|
|
597
575
|
/** 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. */
|
|
@@ -702,8 +680,6 @@ export type ApiMethods = {
|
|
|
702
680
|
| ReplyKeyboardMarkup
|
|
703
681
|
| ReplyKeyboardRemove
|
|
704
682
|
| ForceReply;
|
|
705
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
706
|
-
reply_to_message_id?: number;
|
|
707
683
|
}): Message.VenueMessage;
|
|
708
684
|
|
|
709
685
|
/** Use this method to send phone contacts. On success, the sent Message is returned. */
|
|
@@ -736,8 +712,6 @@ export type ApiMethods = {
|
|
|
736
712
|
| ReplyKeyboardMarkup
|
|
737
713
|
| ReplyKeyboardRemove
|
|
738
714
|
| ForceReply;
|
|
739
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
740
|
-
reply_to_message_id?: number;
|
|
741
715
|
}): Message.ContactMessage;
|
|
742
716
|
|
|
743
717
|
/** Use this method to send a native poll. On success, the sent Message is returned. */
|
|
@@ -790,8 +764,6 @@ export type ApiMethods = {
|
|
|
790
764
|
| ReplyKeyboardMarkup
|
|
791
765
|
| ReplyKeyboardRemove
|
|
792
766
|
| ForceReply;
|
|
793
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
794
|
-
reply_to_message_id?: number;
|
|
795
767
|
}): Message.PollMessage;
|
|
796
768
|
|
|
797
769
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
|
|
@@ -818,8 +790,6 @@ export type ApiMethods = {
|
|
|
818
790
|
| ReplyKeyboardMarkup
|
|
819
791
|
| ReplyKeyboardRemove
|
|
820
792
|
| ForceReply;
|
|
821
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
822
|
-
reply_to_message_id?: number;
|
|
823
793
|
}): Message.DiceMessage;
|
|
824
794
|
|
|
825
795
|
/** Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
|
|
@@ -879,8 +849,7 @@ export type ApiMethods = {
|
|
|
879
849
|
file_id: string;
|
|
880
850
|
}): File;
|
|
881
851
|
|
|
882
|
-
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
|
|
883
|
-
* @deprecated Use `banChatMember` instead. */
|
|
852
|
+
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
884
853
|
kickChatMember: ApiMethods["banChatMember"];
|
|
885
854
|
|
|
886
855
|
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
@@ -1087,6 +1056,8 @@ export type ApiMethods = {
|
|
|
1087
1056
|
|
|
1088
1057
|
/** Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. */
|
|
1089
1058
|
pinChatMessage(args: {
|
|
1059
|
+
/** Unique identifier of the business connection on behalf of which the message will be pinned */
|
|
1060
|
+
business_connection_id?: string;
|
|
1090
1061
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1091
1062
|
chat_id: number | string;
|
|
1092
1063
|
/** Identifier of a message to pin */
|
|
@@ -1097,9 +1068,11 @@ export type ApiMethods = {
|
|
|
1097
1068
|
|
|
1098
1069
|
/** Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. */
|
|
1099
1070
|
unpinChatMessage(args: {
|
|
1071
|
+
/** Unique identifier of the business connection on behalf of which the message will be unpinned */
|
|
1072
|
+
business_connection_id?: string;
|
|
1100
1073
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1101
1074
|
chat_id: number | string;
|
|
1102
|
-
/** Identifier of
|
|
1075
|
+
/** Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. */
|
|
1103
1076
|
message_id?: number;
|
|
1104
1077
|
}): true;
|
|
1105
1078
|
|
|
@@ -1127,10 +1100,6 @@ export type ApiMethods = {
|
|
|
1127
1100
|
chat_id: number | string;
|
|
1128
1101
|
}): Array<ChatMemberOwner | ChatMemberAdministrator>;
|
|
1129
1102
|
|
|
1130
|
-
/** Use this method to get the number of members in a chat. Returns Int on success.
|
|
1131
|
-
* @deprecated Use `getChatMemberCount` instead. */
|
|
1132
|
-
getChatMembersCount: ApiMethods["getChatMemberCount"];
|
|
1133
|
-
|
|
1134
1103
|
/** Use this method to get the number of members in a chat. Returns Int on success. */
|
|
1135
1104
|
getChatMemberCount(args: {
|
|
1136
1105
|
/** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
|
|
@@ -1526,8 +1495,6 @@ export type ApiMethods = {
|
|
|
1526
1495
|
| ReplyKeyboardMarkup
|
|
1527
1496
|
| ReplyKeyboardRemove
|
|
1528
1497
|
| ForceReply;
|
|
1529
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
1530
|
-
reply_to_message_id?: number;
|
|
1531
1498
|
}): Message.StickerMessage;
|
|
1532
1499
|
|
|
1533
1500
|
/** Use this method to get a sticker set. On success, a StickerSet object is returned. */
|
|
@@ -1648,7 +1615,7 @@ export type ApiMethods = {
|
|
|
1648
1615
|
name: string;
|
|
1649
1616
|
/** User identifier of the sticker set owner */
|
|
1650
1617
|
user_id: number;
|
|
1651
|
-
/** 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#
|
|
1618
|
+
/** 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#animation-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-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. */
|
|
1652
1619
|
thumbnail?: Buffer | ReadStream | string;
|
|
1653
1620
|
/** 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 */
|
|
1654
1621
|
format: "static" | "animated" | "video";
|
|
@@ -1747,8 +1714,6 @@ export type ApiMethods = {
|
|
|
1747
1714
|
reply_parameters?: ReplyParameters;
|
|
1748
1715
|
/** An object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
|
|
1749
1716
|
reply_markup?: InlineKeyboardMarkup;
|
|
1750
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
1751
|
-
reply_to_message_id?: number;
|
|
1752
1717
|
}): Message.InvoiceMessage;
|
|
1753
1718
|
|
|
1754
1719
|
/** Use this method to create a link for an invoice. Returns the created invoice link as String on success. */
|
|
@@ -1863,8 +1828,6 @@ export type ApiMethods = {
|
|
|
1863
1828
|
reply_parameters?: ReplyParameters;
|
|
1864
1829
|
/** An object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. */
|
|
1865
1830
|
reply_markup?: InlineKeyboardMarkup;
|
|
1866
|
-
/** @deprecated Use `reply_parameters` instead. */
|
|
1867
|
-
reply_to_message_id?: number;
|
|
1868
1831
|
}): Message.GameMessage;
|
|
1869
1832
|
|
|
1870
1833
|
/** Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False. */
|
package/src/manageTypes.d.ts
CHANGED
|
@@ -60,7 +60,9 @@ export interface UserFromGetMe extends User {
|
|
|
60
60
|
/** True, if the bot supports inline queries. Returned only in getMe. */
|
|
61
61
|
supports_inline_queries: boolean;
|
|
62
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
|
|
63
|
+
can_connect_to_business: boolean;
|
|
64
|
+
/** True, if the bot has main Web App. Returned only in getMe. */
|
|
65
|
+
has_main_web_app: boolean;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
export declare namespace Chat {
|
|
@@ -240,7 +242,7 @@ export declare namespace ChatFullInfo {
|
|
|
240
242
|
/** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
|
|
241
243
|
type: "group";
|
|
242
244
|
/** Title, for supergroups, channels and group chats */
|
|
243
|
-
title
|
|
245
|
+
title: string;
|
|
244
246
|
/** Username, for private chats, supergroups and channels if available */
|
|
245
247
|
username?: undefined;
|
|
246
248
|
/** First name of the other party in a private chat */
|
|
@@ -331,7 +333,7 @@ export declare namespace ChatFullInfo {
|
|
|
331
333
|
/** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
|
|
332
334
|
type: "supergroup";
|
|
333
335
|
/** Title, for supergroups, channels and group chats */
|
|
334
|
-
title
|
|
336
|
+
title: string;
|
|
335
337
|
/** Username, for private chats, supergroups and channels if available */
|
|
336
338
|
username?: string;
|
|
337
339
|
/** First name of the other party in a private chat */
|
|
@@ -422,7 +424,7 @@ export declare namespace ChatFullInfo {
|
|
|
422
424
|
/** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
|
|
423
425
|
type: "channel";
|
|
424
426
|
/** Title, for supergroups, channels and group chats */
|
|
425
|
-
title
|
|
427
|
+
title: string;
|
|
426
428
|
/** Username, for private chats, supergroups and channels if available */
|
|
427
429
|
username?: string;
|
|
428
430
|
/** First name of the other party in a private chat */
|
package/src/messageTypes.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Chat, User } from "./manageTypes";
|
|
2
2
|
import type { InlineKeyboardMarkup } from "./markupTypes";
|
|
3
3
|
import type { PassportData } from "./passportTypes";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
Invoice,
|
|
6
|
+
RefundedPayment,
|
|
7
|
+
SuccessfulPayment,
|
|
8
|
+
} from "./invoiceTypes";
|
|
5
9
|
|
|
6
10
|
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
|
|
7
11
|
|