@telegram.ts/types 1.12.1 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.12.1",
3
+ "version": "1.14.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",
@@ -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. */
@@ -636,6 +614,8 @@ export type ApiMethods = {
636
614
 
637
615
  /** Use this method to send paid media to channel chats. On success, the sent Message is returned. */
638
616
  sendPaidMedia(args: {
617
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
618
+ business_connection_id?: string;
639
619
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
640
620
  chat_id: number | string;
641
621
  /** The number of Telegram Stars that must be paid to buy access to the media */
@@ -702,8 +682,6 @@ export type ApiMethods = {
702
682
  | ReplyKeyboardMarkup
703
683
  | ReplyKeyboardRemove
704
684
  | ForceReply;
705
- /** @deprecated Use `reply_parameters` instead. */
706
- reply_to_message_id?: number;
707
685
  }): Message.VenueMessage;
708
686
 
709
687
  /** Use this method to send phone contacts. On success, the sent Message is returned. */
@@ -736,8 +714,6 @@ export type ApiMethods = {
736
714
  | ReplyKeyboardMarkup
737
715
  | ReplyKeyboardRemove
738
716
  | ForceReply;
739
- /** @deprecated Use `reply_parameters` instead. */
740
- reply_to_message_id?: number;
741
717
  }): Message.ContactMessage;
742
718
 
743
719
  /** Use this method to send a native poll. On success, the sent Message is returned. */
@@ -790,8 +766,6 @@ export type ApiMethods = {
790
766
  | ReplyKeyboardMarkup
791
767
  | ReplyKeyboardRemove
792
768
  | ForceReply;
793
- /** @deprecated Use `reply_parameters` instead. */
794
- reply_to_message_id?: number;
795
769
  }): Message.PollMessage;
796
770
 
797
771
  /** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
@@ -818,8 +792,6 @@ export type ApiMethods = {
818
792
  | ReplyKeyboardMarkup
819
793
  | ReplyKeyboardRemove
820
794
  | ForceReply;
821
- /** @deprecated Use `reply_parameters` instead. */
822
- reply_to_message_id?: number;
823
795
  }): Message.DiceMessage;
824
796
 
825
797
  /** 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 +851,7 @@ export type ApiMethods = {
879
851
  file_id: string;
880
852
  }): File;
881
853
 
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. */
854
+ /** 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
855
  kickChatMember: ApiMethods["banChatMember"];
885
856
 
886
857
  /** 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. */
@@ -1031,6 +1002,28 @@ export type ApiMethods = {
1031
1002
  creates_join_request?: boolean;
1032
1003
  }): ChatInviteLink;
1033
1004
 
1005
+ /** Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. */
1006
+ createChatSubscriptionInviteLink(args: {
1007
+ /** Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) */
1008
+ chat_id: number | string;
1009
+ /** Invite link name; 0-32 characters */
1010
+ name?: string;
1011
+ /** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days) */
1012
+ subscription_period: number;
1013
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 */
1014
+ subscription_price: number;
1015
+ }): ChatInviteLink;
1016
+
1017
+ /** Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object. */
1018
+ editChatSubscriptionInviteLink(args: {
1019
+ /** Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) */
1020
+ chat_id: number | string;
1021
+ /** The invite link to edit */
1022
+ invite_link: string;
1023
+ /** Invite link name; 0-32 characters */
1024
+ name?: string;
1025
+ }): ChatInviteLink;
1026
+
1034
1027
  /** Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. */
1035
1028
  revokeChatInviteLink(args: {
1036
1029
  /** Unique identifier of the target chat or username of the target channel (in the format @channelusername) */
@@ -1087,6 +1080,8 @@ export type ApiMethods = {
1087
1080
 
1088
1081
  /** 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
1082
  pinChatMessage(args: {
1083
+ /** Unique identifier of the business connection on behalf of which the message will be pinned */
1084
+ business_connection_id?: string;
1090
1085
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1091
1086
  chat_id: number | string;
1092
1087
  /** Identifier of a message to pin */
@@ -1097,9 +1092,11 @@ export type ApiMethods = {
1097
1092
 
1098
1093
  /** 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
1094
  unpinChatMessage(args: {
1095
+ /** Unique identifier of the business connection on behalf of which the message will be unpinned */
1096
+ business_connection_id?: string;
1100
1097
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1101
1098
  chat_id: number | string;
1102
- /** Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. */
1099
+ /** 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
1100
  message_id?: number;
1104
1101
  }): true;
1105
1102
 
@@ -1127,10 +1124,6 @@ export type ApiMethods = {
1127
1124
  chat_id: number | string;
1128
1125
  }): Array<ChatMemberOwner | ChatMemberAdministrator>;
1129
1126
 
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
1127
  /** Use this method to get the number of members in a chat. Returns Int on success. */
1135
1128
  getChatMemberCount(args: {
1136
1129
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
@@ -1526,8 +1519,6 @@ export type ApiMethods = {
1526
1519
  | ReplyKeyboardMarkup
1527
1520
  | ReplyKeyboardRemove
1528
1521
  | ForceReply;
1529
- /** @deprecated Use `reply_parameters` instead. */
1530
- reply_to_message_id?: number;
1531
1522
  }): Message.StickerMessage;
1532
1523
 
1533
1524
  /** Use this method to get a sticker set. On success, a StickerSet object is returned. */
@@ -1648,7 +1639,7 @@ export type ApiMethods = {
1648
1639
  name: string;
1649
1640
  /** User identifier of the sticker set owner */
1650
1641
  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#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. */
1642
+ /** 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
1643
  thumbnail?: Buffer | ReadStream | string;
1653
1644
  /** 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
1645
  format: "static" | "animated" | "video";
@@ -1747,8 +1738,6 @@ export type ApiMethods = {
1747
1738
  reply_parameters?: ReplyParameters;
1748
1739
  /** 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
1740
  reply_markup?: InlineKeyboardMarkup;
1750
- /** @deprecated Use `reply_parameters` instead. */
1751
- reply_to_message_id?: number;
1752
1741
  }): Message.InvoiceMessage;
1753
1742
 
1754
1743
  /** Use this method to create a link for an invoice. Returns the created invoice link as String on success. */
@@ -1863,8 +1852,6 @@ export type ApiMethods = {
1863
1852
  reply_parameters?: ReplyParameters;
1864
1853
  /** 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
1854
  reply_markup?: InlineKeyboardMarkup;
1866
- /** @deprecated Use `reply_parameters` instead. */
1867
- reply_to_message_id?: number;
1868
1855
  }): Message.GameMessage;
1869
1856
 
1870
1857
  /** 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. */
@@ -1,4 +1,5 @@
1
1
  import type { User } from "./manageTypes";
2
+ import type { PaidMedia } from "./messageTypes";
2
3
 
3
4
  /** This object represents a portion of the price for goods or services. */
4
5
  export interface LabeledPrice {
@@ -174,6 +175,8 @@ export interface TransactionPartnerUser {
174
175
  user: User;
175
176
  /** Bot-specified invoice payload */
176
177
  invoice_payload?: string;
178
+ /** Information about the paid media bought by the user */
179
+ paid_media?: PaidMedia[];
177
180
  }
178
181
 
179
182
  /** Describes a withdrawal transaction with Fragment. */
@@ -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?: boolean;
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?: string;
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?: string;
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?: string;
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 */
@@ -688,6 +690,8 @@ export interface ChatMemberMember {
688
690
  status: "member";
689
691
  /** Information about the user */
690
692
  user: User;
693
+ /** Date when the user's subscription will expire; Unix time */
694
+ until_date?: number;
691
695
  }
692
696
 
693
697
  /** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
@@ -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 { Invoice, RefundedPayment, SuccessfulPayment } from "./invoiceTypes";
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
 
@@ -1331,8 +1335,12 @@ export interface File {
1331
1335
 
1332
1336
  /** This object describes the type of a reaction. Currently, it can be one of
1333
1337
  - ReactionTypeEmoji
1334
- - ReactionTypeCustomEmoji */
1335
- export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
1338
+ - ReactionTypeCustomEmoji
1339
+ - ReactionTypePaid */
1340
+ export type ReactionType =
1341
+ | ReactionTypeEmoji
1342
+ | ReactionTypeCustomEmoji
1343
+ | ReactionTypePaid;
1336
1344
 
1337
1345
  /** The reaction is based on an emoji. */
1338
1346
  export interface ReactionTypeEmoji {
@@ -1423,6 +1431,12 @@ export interface ReactionTypeCustomEmoji {
1423
1431
  custom_emoji: string;
1424
1432
  }
1425
1433
 
1434
+ /** The reaction is paid. */
1435
+ export interface ReactionTypePaid {
1436
+ /** Type of the reaction, always “paid” */
1437
+ type: "paid";
1438
+ }
1439
+
1426
1440
  /** Represents a reaction added to a message along with the number of times it was added. */
1427
1441
  export interface ReactionCount {
1428
1442
  /** Type of the reaction */