@grammyjs/types 3.13.0 → 3.15.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/inline.d.ts CHANGED
@@ -621,7 +621,7 @@ export interface InputInvoiceMessageContent {
621
621
  title: string;
622
622
  /** Product description, 1-255 characters */
623
623
  description: string;
624
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
624
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
625
625
  payload: string;
626
626
  /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
627
627
  provider_token?: string;
package/manage.d.ts CHANGED
@@ -535,6 +535,10 @@ export interface ChatInviteLink {
535
535
  member_limit?: number;
536
536
  /** Number of pending join requests created using this link */
537
537
  pending_join_request_count?: number;
538
+ /** The number of seconds the subscription will be active for before the next payment */
539
+ subscription_period?: number;
540
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link */
541
+ subscription_price?: number;
538
542
  }
539
543
  /** Represents the rights of an administrator in a chat. */
540
544
  export interface ChatAdministratorRights {
@@ -842,14 +846,16 @@ export interface ChatBoostSourceGiftCode {
842
846
  /** User for which the gift code was created */
843
847
  user: User;
844
848
  }
845
- /** The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
849
+ /** The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways. */
846
850
  export interface ChatBoostSourceGiveaway {
847
851
  /** Source of the boost, always “giveaway” */
848
852
  source: "giveaway";
849
853
  /** Identifier of a message in the chat with the giveaway; the message could have been deleted already */
850
854
  giveaway_message_id: number;
851
- /** User that won the prize in the giveaway if any */
855
+ /** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
852
856
  user?: User;
857
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
858
+ prize_star_count?: number;
853
859
  /** True, if the giveaway was completed, but there was no user to win the prize */
854
860
  is_unclaimed?: true;
855
861
  }
package/markup.d.ts CHANGED
@@ -40,6 +40,10 @@ export declare namespace InlineKeyboardButton {
40
40
  /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
41
41
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
42
42
  }
43
+ interface CopyTextButtonButton extends AbstractInlineKeyboardButton {
44
+ /** Description of the button that copies the specified text to the clipboard. */
45
+ copy_text: CopyTextButton;
46
+ }
43
47
  interface GameButton extends AbstractInlineKeyboardButton {
44
48
  /** Description of the game that will be launched when the user presses the button.
45
49
 
@@ -54,7 +58,7 @@ export declare namespace InlineKeyboardButton {
54
58
  }
55
59
  }
56
60
  /** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
57
- export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.SwitchInlineChosenChatButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton;
61
+ export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.SwitchInlineChosenChatButton | InlineKeyboardButton.CopyTextButtonButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton;
58
62
  /** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
59
63
  Telegram apps support these buttons as of version 5.7. */
60
64
  export interface LoginUrl {
@@ -184,6 +188,11 @@ export interface ForceReply {
184
188
  /** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. */
185
189
  selective?: boolean;
186
190
  }
191
+ /** This object represents an inline keyboard button that copies specified text to the clipboard. */
192
+ export interface CopyTextButton {
193
+ /** The text to be copied to the clipboard; 1-256 characters */
194
+ text: string;
195
+ }
187
196
  /** Describes a Web App. */
188
197
  export interface WebAppInfo {
189
198
  /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
package/message.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { Invoice, RefundedPayment, SuccessfulPayment } from "./payment.js";
5
5
  type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
6
6
  export declare namespace Message {
7
7
  interface ServiceMessage {
8
- /** Unique message identifier inside this chat */
8
+ /** Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
9
9
  message_id: number;
10
10
  /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
11
11
  message_thread_id?: number;
@@ -245,7 +245,7 @@ export interface Message extends Message.MediaMessage {
245
245
  }
246
246
  /** This object represents a unique message identifier. */
247
247
  export interface MessageId {
248
- /** Unique message identifier */
248
+ /** Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
249
249
  message_id: number;
250
250
  }
251
251
  /** Describes an inline message sent by a Web App on behalf of a user. */
@@ -381,7 +381,7 @@ Please note:
381
381
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
382
382
  export declare namespace MessageEntity {
383
383
  interface AbstractMessageEntity {
384
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
384
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
385
385
  type: string;
386
386
  /** Offset in UTF-16 code units to the start of the entity */
387
387
  offset: number;
@@ -1020,8 +1020,10 @@ export interface VideoChatParticipantsInvited {
1020
1020
  /** New members that were invited to the video chat */
1021
1021
  users: User[];
1022
1022
  }
1023
- /** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
1023
+ /** This object represents a service message about the creation of a scheduled giveaway. */
1024
1024
  export interface GiveawayCreated {
1025
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1026
+ prize_star_count?: number;
1025
1027
  }
1026
1028
  /** This object represents a message about a scheduled giveaway. */
1027
1029
  export interface Giveaway {
@@ -1039,7 +1041,9 @@ export interface Giveaway {
1039
1041
  prize_description?: string;
1040
1042
  /** A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. */
1041
1043
  country_codes?: string[];
1042
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1044
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1045
+ prize_star_count?: number;
1046
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1043
1047
  premium_subscription_month_count?: number;
1044
1048
  }
1045
1049
  /** This object represents a message about the completion of a giveaway with public winners. */
@@ -1056,7 +1060,9 @@ export interface GiveawayWinners {
1056
1060
  winners: User[];
1057
1061
  /** The number of other chats the user had to join in order to be eligible for the giveaway */
1058
1062
  additional_chat_count?: number;
1059
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1063
+ /** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
1064
+ prize_star_count?: number;
1065
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1060
1066
  premium_subscription_month_count?: number;
1061
1067
  /** Number of undistributed prizes */
1062
1068
  unclaimed_prize_count?: number;
@@ -1075,6 +1081,8 @@ export interface GiveawayCompleted {
1075
1081
  unclaimed_prize_count?: number;
1076
1082
  /** Message with the giveaway that was completed, if it wasn't deleted */
1077
1083
  giveaway_message?: Message;
1084
+ /** True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */
1085
+ is_star_giveaway?: true;
1078
1086
  }
1079
1087
  /** Describes the options used for link preview generation. */
1080
1088
  export interface LinkPreviewOptions {
package/methods.d.ts CHANGED
@@ -94,6 +94,8 @@ export type ApiMethods<F> = {
94
94
  disable_notification?: boolean;
95
95
  /** Protects the contents of the sent message from forwarding and saving */
96
96
  protect_content?: boolean;
97
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
98
+ allow_paid_broadcast?: boolean;
97
99
  /** Unique identifier of the message effect to be added to the message; for private chats only */
98
100
  message_effect_id?: string;
99
101
  /** Description of the message to reply to */
@@ -155,6 +157,8 @@ export type ApiMethods<F> = {
155
157
  disable_notification?: boolean;
156
158
  /** Protects the contents of the sent message from forwarding and saving */
157
159
  protect_content?: boolean;
160
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
161
+ allow_paid_broadcast?: boolean;
158
162
  /** Description of the message to reply to */
159
163
  reply_parameters?: ReplyParameters;
160
164
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
@@ -203,6 +207,8 @@ export type ApiMethods<F> = {
203
207
  disable_notification?: boolean;
204
208
  /** Protects the contents of the sent message from forwarding and saving */
205
209
  protect_content?: boolean;
210
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
211
+ allow_paid_broadcast?: boolean;
206
212
  /** Unique identifier of the message effect to be added to the message; for private chats only */
207
213
  message_effect_id?: string;
208
214
  /** Description of the message to reply to */
@@ -242,6 +248,8 @@ export type ApiMethods<F> = {
242
248
  disable_notification?: boolean;
243
249
  /** Protects the contents of the sent message from forwarding and saving */
244
250
  protect_content?: boolean;
251
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
252
+ allow_paid_broadcast?: boolean;
245
253
  /** Unique identifier of the message effect to be added to the message; for private chats only */
246
254
  message_effect_id?: string;
247
255
  /** Description of the message to reply to */
@@ -275,6 +283,8 @@ export type ApiMethods<F> = {
275
283
  disable_notification?: boolean;
276
284
  /** Protects the contents of the sent message from forwarding and saving */
277
285
  protect_content?: boolean;
286
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
287
+ allow_paid_broadcast?: boolean;
278
288
  /** Unique identifier of the message effect to be added to the message; for private chats only */
279
289
  message_effect_id?: string;
280
290
  /** Description of the message to reply to */
@@ -318,6 +328,8 @@ export type ApiMethods<F> = {
318
328
  disable_notification?: boolean;
319
329
  /** Protects the contents of the sent message from forwarding and saving */
320
330
  protect_content?: boolean;
331
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
332
+ allow_paid_broadcast?: boolean;
321
333
  /** Unique identifier of the message effect to be added to the message; for private chats only */
322
334
  message_effect_id?: string;
323
335
  /** Description of the message to reply to */
@@ -359,6 +371,8 @@ export type ApiMethods<F> = {
359
371
  disable_notification?: boolean;
360
372
  /** Protects the contents of the sent message from forwarding and saving */
361
373
  protect_content?: boolean;
374
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
375
+ allow_paid_broadcast?: boolean;
362
376
  /** Unique identifier of the message effect to be added to the message; for private chats only */
363
377
  message_effect_id?: string;
364
378
  /** Description of the message to reply to */
@@ -390,6 +404,8 @@ export type ApiMethods<F> = {
390
404
  disable_notification?: boolean;
391
405
  /** Protects the contents of the sent message from forwarding and saving */
392
406
  protect_content?: boolean;
407
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
408
+ allow_paid_broadcast?: boolean;
393
409
  /** Unique identifier of the message effect to be added to the message; for private chats only */
394
410
  message_effect_id?: string;
395
411
  /** Description of the message to reply to */
@@ -420,6 +436,8 @@ export type ApiMethods<F> = {
420
436
  disable_notification?: boolean;
421
437
  /** Protects the contents of the sent message from forwarding and saving */
422
438
  protect_content?: boolean;
439
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
440
+ allow_paid_broadcast?: boolean;
423
441
  /** Unique identifier of the message effect to be added to the message; for private chats only */
424
442
  message_effect_id?: string;
425
443
  /** Description of the message to reply to */
@@ -435,14 +453,16 @@ export type ApiMethods<F> = {
435
453
  business_connection_id?: string;
436
454
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
437
455
  chat_id: number | string;
438
- /** An array describing messages to be sent, must include 2-10 items */
439
456
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
440
457
  message_thread_id?: number;
458
+ /** An array describing messages to be sent, must include 2-10 items */
441
459
  media: ReadonlyArray<InputMediaAudio<F> | InputMediaDocument<F> | InputMediaPhoto<F> | InputMediaVideo<F>>;
442
460
  /** Sends the messages silently. Users will receive a notification with no sound. */
443
461
  disable_notification?: boolean;
444
462
  /** Protects the contents of the sent messages from forwarding and saving */
445
463
  protect_content?: boolean;
464
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
465
+ allow_paid_broadcast?: boolean;
446
466
  /** Unique identifier of the message effect to be added to the message; for private chats only */
447
467
  message_effect_id?: string;
448
468
  /** Description of the message to reply to */
@@ -474,6 +494,8 @@ export type ApiMethods<F> = {
474
494
  disable_notification?: boolean;
475
495
  /** Protects the contents of the sent message from forwarding and saving */
476
496
  protect_content?: boolean;
497
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
498
+ allow_paid_broadcast?: boolean;
477
499
  /** Unique identifier of the message effect to be added to the message; for private chats only */
478
500
  message_effect_id?: string;
479
501
  /** Description of the message to reply to */
@@ -527,10 +549,12 @@ export type ApiMethods<F> = {
527
549
  business_connection_id?: string;
528
550
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. */
529
551
  chat_id: number | string;
530
- /** The number of Telegram Stars that must be paid to buy access to the media */
552
+ /** The number of Telegram Stars that must be paid to buy access to the media; 1-2500 */
531
553
  star_count: number;
532
554
  /** An array describing the media to be sent; up to 10 items */
533
555
  media: InputPaidMedia<F>[];
556
+ /** Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. */
557
+ payload?: string;
534
558
  /** Media caption, 0-1024 characters after entities parsing */
535
559
  caption?: string;
536
560
  /** Mode for parsing entities in the media caption. See formatting options for more details. */
@@ -543,6 +567,8 @@ export type ApiMethods<F> = {
543
567
  disable_notification?: boolean;
544
568
  /** Protects the contents of the sent message from forwarding and saving */
545
569
  protect_content?: boolean;
570
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
571
+ allow_paid_broadcast?: boolean;
546
572
  /** Description of the message to reply to */
547
573
  reply_parameters?: ReplyParameters;
548
574
  /** 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 */
@@ -576,6 +602,8 @@ export type ApiMethods<F> = {
576
602
  disable_notification?: boolean;
577
603
  /** Protects the contents of the sent message from forwarding and saving */
578
604
  protect_content?: boolean;
605
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
606
+ allow_paid_broadcast?: boolean;
579
607
  /** Unique identifier of the message effect to be added to the message; for private chats only */
580
608
  message_effect_id?: string;
581
609
  /** Description of the message to reply to */
@@ -605,6 +633,8 @@ export type ApiMethods<F> = {
605
633
  disable_notification?: boolean;
606
634
  /** Protects the contents of the sent message from forwarding and saving */
607
635
  protect_content?: boolean;
636
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
637
+ allow_paid_broadcast?: boolean;
608
638
  /** Unique identifier of the message effect to be added to the message; for private chats only */
609
639
  message_effect_id?: string;
610
640
  /** Description of the message to reply to */
@@ -654,6 +684,8 @@ export type ApiMethods<F> = {
654
684
  disable_notification?: boolean;
655
685
  /** Protects the contents of the sent message from forwarding and saving */
656
686
  protect_content?: boolean;
687
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
688
+ allow_paid_broadcast?: boolean;
657
689
  /** Unique identifier of the message effect to be added to the message; for private chats only */
658
690
  message_effect_id?: string;
659
691
  /** Description of the message to reply to */
@@ -672,11 +704,13 @@ export type ApiMethods<F> = {
672
704
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
673
705
  message_thread_id?: number;
674
706
  /** Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲" */
675
- emoji?: string;
707
+ emoji?: (string & Record<never, never>) | "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰";
676
708
  /** Sends the message silently. Users will receive a notification with no sound. */
677
709
  disable_notification?: boolean;
678
710
  /** Protects the contents of the sent message from forwarding */
679
711
  protect_content?: boolean;
712
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
713
+ allow_paid_broadcast?: boolean;
680
714
  /** Unique identifier of the message effect to be added to the message; for private chats only */
681
715
  message_effect_id?: string;
682
716
  /** Description of the message to reply to */
@@ -1240,7 +1274,7 @@ export type ApiMethods<F> = {
1240
1274
  /** An object for an inline keyboard. */
1241
1275
  reply_markup?: InlineKeyboardMarkup;
1242
1276
  }): (Update.Edited & Message.CaptionableMessage) | true;
1243
- /** 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. */
1277
+ /** Use this method to edit animation, audio, document, photo, or video messages, or to add media to text 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. */
1244
1278
  editMessageMedia(args: {
1245
1279
  /** Unique identifier of the business connection on behalf of which the message to be edited was sent */
1246
1280
  business_connection_id?: string;
@@ -1318,6 +1352,8 @@ export type ApiMethods<F> = {
1318
1352
  disable_notification?: boolean;
1319
1353
  /** Protects the contents of the sent message from forwarding and saving */
1320
1354
  protect_content?: boolean;
1355
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
1356
+ allow_paid_broadcast?: boolean;
1321
1357
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1322
1358
  message_effect_id?: string;
1323
1359
  /** Description of the message to reply to */
@@ -1479,7 +1515,7 @@ export type ApiMethods<F> = {
1479
1515
  title: string;
1480
1516
  /** Product description, 1-255 characters */
1481
1517
  description: string;
1482
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1518
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
1483
1519
  payload: string;
1484
1520
  /** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
1485
1521
  provider_token?: string;
@@ -1521,6 +1557,8 @@ export type ApiMethods<F> = {
1521
1557
  disable_notification?: boolean;
1522
1558
  /** Protects the contents of the sent message from forwarding and saving */
1523
1559
  protect_content?: boolean;
1560
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
1561
+ allow_paid_broadcast?: boolean;
1524
1562
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1525
1563
  message_effect_id?: string;
1526
1564
  /** Description of the message to reply to */
@@ -1536,7 +1574,7 @@ export type ApiMethods<F> = {
1536
1574
  title: string;
1537
1575
  /** Product description, 1-255 characters */
1538
1576
  description: string;
1539
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1577
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
1540
1578
  payload: string;
1541
1579
  /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
1542
1580
  provider_token?: string;
@@ -1630,6 +1668,8 @@ export type ApiMethods<F> = {
1630
1668
  disable_notification?: boolean;
1631
1669
  /** Protects the contents of the sent message from forwarding and saving */
1632
1670
  protect_content?: boolean;
1671
+ /** Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */
1672
+ allow_paid_broadcast?: boolean;
1633
1673
  /** Unique identifier of the message effect to be added to the message; for private chats only */
1634
1674
  message_effect_id?: string;
1635
1675
  /** Description of the message to reply to */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.13.0",
3
+ "version": "3.15.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "types"
16
16
  ],
17
17
  "scripts": {
18
- "prepare": "deno task backport"
18
+ "prepare": "deno task build"
19
19
  },
20
20
  "author": "KnorpelSenf",
21
21
  "types": "mod.d.ts",
package/payment.d.ts CHANGED
@@ -143,8 +143,9 @@ export interface RevenueWithdrawalStateFailed {
143
143
  - TransactionPartnerUser
144
144
  - TransactionPartnerFragment
145
145
  - TransactionPartnerTelegramAds
146
+ - TransactionPartnerTelegramApi
146
147
  - TransactionPartnerOther */
147
- export type TransactionPartner = TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther;
148
+ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
148
149
  /** Describes a transaction with a user. */
149
150
  export interface TransactionPartnerUser {
150
151
  /** Type of the transaction partner, always “user” */
@@ -155,6 +156,8 @@ export interface TransactionPartnerUser {
155
156
  invoice_payload?: string;
156
157
  /** Information about the paid media bought by the user */
157
158
  paid_media?: PaidMedia[];
159
+ /** Bot-specified paid media payload */
160
+ paid_media_payload?: string;
158
161
  }
159
162
  /** Describes a withdrawal transaction with Fragment. */
160
163
  export interface TransactionPartnerFragment {
@@ -168,6 +171,13 @@ export interface TransactionPartnerTelegramAds {
168
171
  /** Type of the transaction partner, always “telegram_ads” */
169
172
  type: "telegram_ads";
170
173
  }
174
+ /** Describes a transaction with payment for paid broadcasting. */
175
+ export interface TransactionPartnerTelegramApi {
176
+ /** Type of the transaction partner, always “telegram_api” */
177
+ type: "telegram_api";
178
+ /** The number of successful requests that exceeded regular limits and were therefore billed */
179
+ request_count: number;
180
+ }
171
181
  /** Describes a transaction with an unknown source or recipient. */
172
182
  export interface TransactionPartnerOther {
173
183
  /** Type of the transaction partner, always “other” */
@@ -175,7 +185,7 @@ export interface TransactionPartnerOther {
175
185
  }
176
186
  /** Describes a Telegram Star transaction. */
177
187
  export interface StarTransaction {
178
- /** 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. */
188
+ /** Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
179
189
  id: string;
180
190
  /** Number of Telegram Stars transferred by the transaction */
181
191
  amount: number;
@@ -191,3 +201,10 @@ export interface StarTransactions {
191
201
  /** The list of transactions */
192
202
  transactions: StarTransaction[];
193
203
  }
204
+ /** This object contains information about a paid media purchase. */
205
+ export interface PaidMediaPurchased {
206
+ /** User who purchased the media */
207
+ from: User;
208
+ /** Bot-specified paid media payload */
209
+ paid_media_payload: string;
210
+ }
package/update.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { ChosenInlineResult, InlineQuery } from "./inline.js";
2
2
  import type { BusinessConnection, BusinessMessagesDeleted, Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
3
3
  import type { CallbackQuery } from "./markup.js";
4
4
  import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
5
- import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
5
+ import type { PaidMediaPurchased, PreCheckoutQuery, ShippingQuery } from "./payment.js";
6
6
  /** Internal namespace used to make some message types more accurate */
7
7
  export declare namespace Update {
8
8
  /** Internal type holding properties that message updates in private chats share. */
@@ -73,4 +73,6 @@ export interface Update {
73
73
  chat_boost?: ChatBoostUpdated;
74
74
  /** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
75
75
  removed_chat_boost?: ChatBoostRemoved;
76
+ /** A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat */
77
+ purchased_paid_media?: PaidMediaPurchased;
76
78
  }