@grammyjs/types 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/inline.d.ts CHANGED
@@ -86,6 +86,8 @@ export interface InlineQueryResultPhoto {
86
86
  description?: string;
87
87
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
88
88
  caption?: string;
89
+ /** Pass True, if the caption must be shown above the message media */
90
+ show_caption_above_media?: boolean;
89
91
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
90
92
  parse_mode?: ParseMode;
91
93
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -117,6 +119,8 @@ export interface InlineQueryResultGif {
117
119
  title?: string;
118
120
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
119
121
  caption?: string;
122
+ /** Pass True, if the caption must be shown above the message media */
123
+ show_caption_above_media?: boolean;
120
124
  /** Mode for parsing entities in the caption. See formatting options for more details. */
121
125
  parse_mode?: ParseMode;
122
126
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -148,6 +152,8 @@ export interface InlineQueryResultMpeg4Gif {
148
152
  title?: string;
149
153
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
150
154
  caption?: string;
155
+ /** Pass True, if the caption must be shown above the message media */
156
+ show_caption_above_media?: boolean;
151
157
  /** Mode for parsing entities in the caption. See formatting options for more details. */
152
158
  parse_mode?: ParseMode;
153
159
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -175,6 +181,8 @@ export interface InlineQueryResultVideo {
175
181
  title: string;
176
182
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
177
183
  caption?: string;
184
+ /** Pass True, if the caption must be shown above the message media */
185
+ show_caption_above_media?: boolean;
178
186
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
179
187
  parse_mode?: ParseMode;
180
188
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -385,6 +393,8 @@ export interface InlineQueryResultCachedPhoto {
385
393
  description?: string;
386
394
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
387
395
  caption?: string;
396
+ /** Pass True, if the caption must be shown above the message media */
397
+ show_caption_above_media?: boolean;
388
398
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
389
399
  parse_mode?: ParseMode;
390
400
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -406,6 +416,8 @@ export interface InlineQueryResultCachedGif {
406
416
  title?: string;
407
417
  /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
408
418
  caption?: string;
419
+ /** Pass True, if the caption must be shown above the message media */
420
+ show_caption_above_media?: boolean;
409
421
  /** Mode for parsing entities in the caption. See formatting options for more details. */
410
422
  parse_mode?: ParseMode;
411
423
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -427,6 +439,8 @@ export interface InlineQueryResultCachedMpeg4Gif {
427
439
  title?: string;
428
440
  /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
429
441
  caption?: string;
442
+ /** Pass True, if the caption must be shown above the message media */
443
+ show_caption_above_media?: boolean;
430
444
  /** Mode for parsing entities in the caption. See formatting options for more details. */
431
445
  parse_mode?: ParseMode;
432
446
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -486,6 +500,8 @@ export interface InlineQueryResultCachedVideo {
486
500
  description?: string;
487
501
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
488
502
  caption?: string;
503
+ /** Pass True, if the caption must be shown above the message media */
504
+ show_caption_above_media?: boolean;
489
505
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
490
506
  parse_mode?: ParseMode;
491
507
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -607,13 +623,13 @@ export interface InputInvoiceMessageContent {
607
623
  description: string;
608
624
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
609
625
  payload: string;
610
- /** Payment provider token, obtained via BotFather */
611
- provider_token: string;
612
- /** Three-letter ISO 4217 currency code, see more on currencies */
626
+ /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
627
+ provider_token?: string;
628
+ /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
613
629
  currency: string;
614
- /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
630
+ /** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
615
631
  prices: LabeledPrice[];
616
- /** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0 */
632
+ /** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0. Not supported for payments in Telegram Stars. */
617
633
  max_tip_amount?: number;
618
634
  /** An array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
619
635
  suggested_tip_amounts?: number[];
@@ -627,19 +643,19 @@ export interface InputInvoiceMessageContent {
627
643
  photo_width?: number;
628
644
  /** Photo height */
629
645
  photo_height?: number;
630
- /** Pass True if you require the user's full name to complete the order */
646
+ /** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
631
647
  need_name?: boolean;
632
- /** Pass True if you require the user's phone number to complete the order */
648
+ /** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
633
649
  need_phone_number?: boolean;
634
- /** Pass True if you require the user's email address to complete the order */
650
+ /** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
635
651
  need_email?: boolean;
636
- /** Pass True if you require the user's shipping address to complete the order */
652
+ /** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
637
653
  need_shipping_address?: boolean;
638
- /** Pass True if the user's phone number should be sent to provider */
654
+ /** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
639
655
  send_phone_number_to_provider?: boolean;
640
- /** Pass True if the user's email address should be sent to provider */
656
+ /** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
641
657
  send_email_to_provider?: boolean;
642
- /** Pass True if the final price depends on the shipping method */
658
+ /** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
643
659
  is_flexible?: boolean;
644
660
  }
645
661
  /** Represents a result of an inline query that was chosen by the user and sent to their chat partner.
package/markup.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ChatAdministratorRights, User } from "./manage.js";
2
2
  import type { MaybeInaccessibleMessage } from "./message.js";
3
- /** This object represents an inline keyboard that appears right next to the message it belongs to. */
3
+ /** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
4
4
  export interface InlineKeyboardMarkup {
5
5
  /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
6
6
  inline_keyboard: InlineKeyboardButton[][];
@@ -47,7 +47,7 @@ export declare namespace InlineKeyboardButton {
47
47
  callback_game: CallbackGame;
48
48
  }
49
49
  interface PayButton extends AbstractInlineKeyboardButton {
50
- /** Specify True, to send a Pay button.
50
+ /** Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
51
51
 
52
52
  NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
53
53
  pay: boolean;
@@ -151,7 +151,7 @@ export declare namespace KeyboardButton {
151
151
  web_app: WebAppInfo;
152
152
  }
153
153
  }
154
- /** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
154
+ /** This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text. */
155
155
  export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
156
156
  /** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
157
157
  export interface KeyboardButtonPollType {
package/message.d.ts CHANGED
@@ -45,12 +45,16 @@ export declare namespace Message {
45
45
  edit_date?: number;
46
46
  /** True, if the message can't be forwarded */
47
47
  has_protected_content?: true;
48
+ /** True, if the caption must be shown above the message media */
49
+ show_caption_above_media?: true;
48
50
  /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
49
51
  is_from_offline?: true;
50
52
  /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
51
53
  author_signature?: string;
52
54
  /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
53
55
  link_preview_options?: LinkPreviewOptions;
56
+ /** Unique identifier of the message effect added to the message */
57
+ effect_id?: string;
54
58
  /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
55
59
  reply_markup?: InlineKeyboardMarkup;
56
60
  }
@@ -263,7 +267,7 @@ Note that Telegram clients will display an **alert** to the user before opening
263
267
  Message entities can be nested, providing following restrictions are met:
264
268
  - If two entities have common characters, then one of them is fully contained inside another.
265
269
  - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
266
- - blockquote entities can't be nested.
270
+ - blockquote and expandable_blockquote entities can't be nested.
267
271
  - All other entities can't contain each other.
268
272
 
269
273
  Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username. Please note:
@@ -295,9 +299,15 @@ pre-formatted fixed-width code block written in the Python programming language
295
299
  `​`​`
296
300
  >Block quotation started
297
301
  >Block quotation continued
298
- >The last line of the block quotation**
299
- >The second block quotation started right after the previous\r
300
- >The third block quotation started right after the previous
302
+ >Block quotation continued
303
+ >Block quotation continued
304
+ >The last line of the block quotation
305
+ ***>The second expandable block quotation started right after the previous
306
+ >It is separated from the previous block quotation by an empty bold entity
307
+ >Expandable block quotation continued
308
+ >Hidden by default part of the expandable block quotation started
309
+ >Expandable block quotation continued
310
+ >The last line of the expandable block quotation with the expandability mark||
301
311
  ```
302
312
  Please note:
303
313
 
@@ -305,7 +315,7 @@ Please note:
305
315
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
306
316
  - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
307
317
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
308
- - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.
318
+ - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
309
319
  - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
310
320
  - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
311
321
 
@@ -326,6 +336,7 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
326
336
  <pre>pre-formatted fixed-width code block</pre>
327
337
  <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
328
338
  <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
339
+ <blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
329
340
  ```
330
341
  Please note:
331
342
 
@@ -357,13 +368,13 @@ pre-formatted fixed-width code block written in the Python programming language
357
368
  Please note:
358
369
 
359
370
  - Entities must not be nested, use parse mode MarkdownV2 instead.
360
- - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
371
+ - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
361
372
  - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
362
373
  - Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
363
374
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
364
375
  export declare namespace MessageEntity {
365
376
  interface AbstractMessageEntity {
366
- /** 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), “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) */
377
+ /** 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) */
367
378
  type: string;
368
379
  /** Offset in UTF-16 code units to the start of the entity */
369
380
  offset: number;
@@ -371,7 +382,7 @@ export declare namespace MessageEntity {
371
382
  length: number;
372
383
  }
373
384
  interface CommonMessageEntity extends AbstractMessageEntity {
374
- type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "code";
385
+ type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "expandable_blockquote" | "code";
375
386
  }
376
387
  interface PreMessageEntity extends AbstractMessageEntity {
377
388
  type: "pre";
package/methods.d.ts CHANGED
@@ -93,6 +93,8 @@ export type ApiMethods<F> = {
93
93
  disable_notification?: boolean;
94
94
  /** Protects the contents of the sent message from forwarding and saving */
95
95
  protect_content?: boolean;
96
+ /** Unique identifier of the message effect to be added to the message */
97
+ message_effect_id?: string;
96
98
  /** Description of the message to reply to */
97
99
  reply_parameters?: ReplyParameters;
98
100
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -146,6 +148,8 @@ export type ApiMethods<F> = {
146
148
  parse_mode?: string;
147
149
  /** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
148
150
  caption_entities?: MessageEntity[];
151
+ /** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
152
+ show_caption_above_media?: boolean;
149
153
  /** Sends the message silently. Users will receive a notification with no sound. */
150
154
  disable_notification?: boolean;
151
155
  /** Protects the contents of the sent message from forwarding and saving */
@@ -190,12 +194,16 @@ export type ApiMethods<F> = {
190
194
  parse_mode?: ParseMode;
191
195
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
192
196
  caption_entities?: MessageEntity[];
197
+ /** Pass True, if the caption must be shown above the message media */
198
+ show_caption_above_media?: boolean;
193
199
  /** Pass True if the photo needs to be covered with a spoiler animation */
194
200
  has_spoiler?: boolean;
195
201
  /** Sends the message silently. Users will receive a notification with no sound. */
196
202
  disable_notification?: boolean;
197
203
  /** Protects the contents of the sent message from forwarding and saving */
198
204
  protect_content?: boolean;
205
+ /** Unique identifier of the message effect to be added to the message */
206
+ message_effect_id?: string;
199
207
  /** Description of the message to reply to */
200
208
  reply_parameters?: ReplyParameters;
201
209
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -233,6 +241,8 @@ export type ApiMethods<F> = {
233
241
  disable_notification?: boolean;
234
242
  /** Protects the contents of the sent message from forwarding and saving */
235
243
  protect_content?: boolean;
244
+ /** Unique identifier of the message effect to be added to the message */
245
+ message_effect_id?: string;
236
246
  /** Description of the message to reply to */
237
247
  reply_parameters?: ReplyParameters;
238
248
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -264,6 +274,8 @@ export type ApiMethods<F> = {
264
274
  disable_notification?: boolean;
265
275
  /** Protects the contents of the sent message from forwarding and saving */
266
276
  protect_content?: boolean;
277
+ /** Unique identifier of the message effect to be added to the message */
278
+ message_effect_id?: string;
267
279
  /** Description of the message to reply to */
268
280
  reply_parameters?: ReplyParameters;
269
281
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -295,6 +307,8 @@ export type ApiMethods<F> = {
295
307
  parse_mode?: ParseMode;
296
308
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
297
309
  caption_entities?: MessageEntity[];
310
+ /** Pass True, if the caption must be shown above the message media */
311
+ show_caption_above_media?: boolean;
298
312
  /** Pass True if the video needs to be covered with a spoiler animation */
299
313
  has_spoiler?: boolean;
300
314
  /** Pass True if the uploaded video is suitable for streaming */
@@ -303,6 +317,8 @@ export type ApiMethods<F> = {
303
317
  disable_notification?: boolean;
304
318
  /** Protects the contents of the sent message from forwarding and saving */
305
319
  protect_content?: boolean;
320
+ /** Unique identifier of the message effect to be added to the message */
321
+ message_effect_id?: string;
306
322
  /** Description of the message to reply to */
307
323
  reply_parameters?: ReplyParameters;
308
324
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -334,12 +350,16 @@ export type ApiMethods<F> = {
334
350
  parse_mode?: ParseMode;
335
351
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
336
352
  caption_entities?: MessageEntity[];
353
+ /** Pass True, if the caption must be shown above the message media */
354
+ show_caption_above_media?: boolean;
337
355
  /** Pass True if the animation needs to be covered with a spoiler animation */
338
356
  has_spoiler?: boolean;
339
357
  /** Sends the message silently. Users will receive a notification with no sound. */
340
358
  disable_notification?: boolean;
341
359
  /** Protects the contents of the sent message from forwarding and saving */
342
360
  protect_content?: boolean;
361
+ /** Unique identifier of the message effect to be added to the message */
362
+ message_effect_id?: string;
343
363
  /** Description of the message to reply to */
344
364
  reply_parameters?: ReplyParameters;
345
365
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -369,6 +389,8 @@ export type ApiMethods<F> = {
369
389
  disable_notification?: boolean;
370
390
  /** Protects the contents of the sent message from forwarding and saving */
371
391
  protect_content?: boolean;
392
+ /** Unique identifier of the message effect to be added to the message */
393
+ message_effect_id?: string;
372
394
  /** Description of the message to reply to */
373
395
  reply_parameters?: ReplyParameters;
374
396
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -397,6 +419,8 @@ export type ApiMethods<F> = {
397
419
  disable_notification?: boolean;
398
420
  /** Protects the contents of the sent message from forwarding and saving */
399
421
  protect_content?: boolean;
422
+ /** Unique identifier of the message effect to be added to the message */
423
+ message_effect_id?: string;
400
424
  /** Description of the message to reply to */
401
425
  reply_parameters?: ReplyParameters;
402
426
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -418,6 +442,8 @@ export type ApiMethods<F> = {
418
442
  disable_notification?: boolean;
419
443
  /** Protects the contents of the sent messages from forwarding and saving */
420
444
  protect_content?: boolean;
445
+ /** Unique identifier of the message effect to be added to the message */
446
+ message_effect_id?: string;
421
447
  /** Description of the message to reply to */
422
448
  reply_parameters?: ReplyParameters;
423
449
  /** @deprecated Use `reply_parameters` instead. */
@@ -447,6 +473,8 @@ export type ApiMethods<F> = {
447
473
  disable_notification?: boolean;
448
474
  /** Protects the contents of the sent message from forwarding and saving */
449
475
  protect_content?: boolean;
476
+ /** Unique identifier of the message effect to be added to the message */
477
+ message_effect_id?: string;
450
478
  /** Description of the message to reply to */
451
479
  reply_parameters?: ReplyParameters;
452
480
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -516,6 +544,8 @@ export type ApiMethods<F> = {
516
544
  disable_notification?: boolean;
517
545
  /** Protects the contents of the sent message from forwarding and saving */
518
546
  protect_content?: boolean;
547
+ /** Unique identifier of the message effect to be added to the message */
548
+ message_effect_id?: string;
519
549
  /** Description of the message to reply to */
520
550
  reply_parameters?: ReplyParameters;
521
551
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -543,6 +573,8 @@ export type ApiMethods<F> = {
543
573
  disable_notification?: boolean;
544
574
  /** Protects the contents of the sent message from forwarding and saving */
545
575
  protect_content?: boolean;
576
+ /** Unique identifier of the message effect to be added to the message */
577
+ message_effect_id?: string;
546
578
  /** Description of the message to reply to */
547
579
  reply_parameters?: ReplyParameters;
548
580
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -590,6 +622,8 @@ export type ApiMethods<F> = {
590
622
  disable_notification?: boolean;
591
623
  /** Protects the contents of the sent message from forwarding and saving */
592
624
  protect_content?: boolean;
625
+ /** Unique identifier of the message effect to be added to the message */
626
+ message_effect_id?: string;
593
627
  /** Description of the message to reply to */
594
628
  reply_parameters?: ReplyParameters;
595
629
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -611,6 +645,8 @@ export type ApiMethods<F> = {
611
645
  disable_notification?: boolean;
612
646
  /** Protects the contents of the sent message from forwarding */
613
647
  protect_content?: boolean;
648
+ /** Unique identifier of the message effect to be added to the message */
649
+ message_effect_id?: string;
614
650
  /** Description of the message to reply to */
615
651
  reply_parameters?: ReplyParameters;
616
652
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -1023,7 +1059,7 @@ export type ApiMethods<F> = {
1023
1059
  /** Unique identifier of the business connection */
1024
1060
  business_connection_id: string;
1025
1061
  }): BusinessConnection;
1026
- /** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success. */
1062
+ /** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots/features#commands for more details about bot commands. Returns True on success. */
1027
1063
  setMyCommands(args: {
1028
1064
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
1029
1065
  commands: readonly BotCommand[];
@@ -1139,6 +1175,8 @@ export type ApiMethods<F> = {
1139
1175
  parse_mode?: ParseMode;
1140
1176
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
1141
1177
  caption_entities?: MessageEntity[];
1178
+ /** Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
1179
+ show_caption_above_media?: boolean;
1142
1180
  /** An object for an inline keyboard. */
1143
1181
  reply_markup?: InlineKeyboardMarkup;
1144
1182
  }): (Update.Edited & Message.CaptionableMessage) | true;
@@ -1214,6 +1252,8 @@ export type ApiMethods<F> = {
1214
1252
  disable_notification?: boolean;
1215
1253
  /** Protects the contents of the sent message from forwarding and saving */
1216
1254
  protect_content?: boolean;
1255
+ /** Unique identifier of the message effect to be added to the message */
1256
+ message_effect_id?: string;
1217
1257
  /** Description of the message to reply to */
1218
1258
  reply_parameters?: ReplyParameters;
1219
1259
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
@@ -1375,13 +1415,13 @@ export type ApiMethods<F> = {
1375
1415
  description: string;
1376
1416
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1377
1417
  payload: string;
1378
- /** Payment provider token, obtained via @BotFather */
1379
- provider_token: string;
1380
- /** Three-letter ISO 4217 currency code, see more on currencies */
1418
+ /** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
1419
+ provider_token?: string;
1420
+ /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
1381
1421
  currency: string;
1382
- /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
1422
+ /** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
1383
1423
  prices: readonly LabeledPrice[];
1384
- /** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0 */
1424
+ /** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0. Not supported for payments in Telegram Stars. */
1385
1425
  max_tip_amount?: number;
1386
1426
  /** An array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
1387
1427
  suggested_tip_amounts?: number[];
@@ -1397,24 +1437,26 @@ export type ApiMethods<F> = {
1397
1437
  photo_width?: number;
1398
1438
  /** Photo height */
1399
1439
  photo_height?: number;
1400
- /** Pass True if you require the user's full name to complete the order */
1440
+ /** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
1401
1441
  need_name?: boolean;
1402
- /** Pass True if you require the user's phone number to complete the order */
1442
+ /** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
1403
1443
  need_phone_number?: boolean;
1404
- /** Pass True if you require the user's email address to complete the order */
1444
+ /** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
1405
1445
  need_email?: boolean;
1406
- /** Pass True if you require the user's shipping address to complete the order */
1446
+ /** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
1407
1447
  need_shipping_address?: boolean;
1408
- /** Pass True if the user's phone number should be sent to provider */
1448
+ /** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
1409
1449
  send_phone_number_to_provider?: boolean;
1410
- /** Pass True if the user's email address should be sent to provider */
1450
+ /** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
1411
1451
  send_email_to_provider?: boolean;
1412
- /** Pass True if the final price depends on the shipping method */
1452
+ /** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
1413
1453
  is_flexible?: boolean;
1414
1454
  /** Sends the message silently. Users will receive a notification with no sound. */
1415
1455
  disable_notification?: boolean;
1416
1456
  /** Protects the contents of the sent message from forwarding and saving */
1417
1457
  protect_content?: boolean;
1458
+ /** Unique identifier of the message effect to be added to the message */
1459
+ message_effect_id?: string;
1418
1460
  /** Description of the message to reply to */
1419
1461
  reply_parameters?: ReplyParameters;
1420
1462
  /** 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. */
@@ -1430,8 +1472,8 @@ export type ApiMethods<F> = {
1430
1472
  description: string;
1431
1473
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1432
1474
  payload: string;
1433
- /** Payment provider token, obtained via BotFather */
1434
- provider_token: string;
1475
+ /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
1476
+ provider_token?: string;
1435
1477
  /** Three-letter ISO 4217 currency code, see more on currencies */
1436
1478
  currency: string;
1437
1479
  /** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
@@ -1485,6 +1527,13 @@ export type ApiMethods<F> = {
1485
1527
  /** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
1486
1528
  error_message?: string;
1487
1529
  }): true;
1530
+ /** Refunds a successful payment in Telegram Stars. Returns True on success. */
1531
+ refundStarPayment(args: {
1532
+ /** Identifier of the user whose payment will be refunded */
1533
+ user_id: number;
1534
+ /** Telegram payment identifier */
1535
+ telegram_payment_charge_id: string;
1536
+ }): true;
1488
1537
  /** 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.
1489
1538
 
1490
1539
  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. */
@@ -1508,6 +1557,8 @@ export type ApiMethods<F> = {
1508
1557
  disable_notification?: boolean;
1509
1558
  /** Protects the contents of the sent message from forwarding and saving */
1510
1559
  protect_content?: boolean;
1560
+ /** Unique identifier of the message effect to be added to the message */
1561
+ message_effect_id?: string;
1511
1562
  /** Description of the message to reply to */
1512
1563
  reply_parameters?: ReplyParameters;
1513
1564
  /** 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. */
@@ -1574,6 +1625,8 @@ export interface InputMediaPhoto<F> {
1574
1625
  media: F | string;
1575
1626
  /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
1576
1627
  caption?: string;
1628
+ /** Pass True, if the caption must be shown above the message media */
1629
+ show_caption_above_media?: boolean;
1577
1630
  /** Mode for parsing entities in the photo caption. See formatting options for more details. */
1578
1631
  parse_mode?: ParseMode;
1579
1632
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1591,6 +1644,8 @@ export interface InputMediaVideo<F> {
1591
1644
  thumbnail?: F;
1592
1645
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
1593
1646
  caption?: string;
1647
+ /** Pass True, if the caption must be shown above the message media */
1648
+ show_caption_above_media?: boolean;
1594
1649
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
1595
1650
  parse_mode?: ParseMode;
1596
1651
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
@@ -1616,6 +1671,8 @@ export interface InputMediaAnimation<F> {
1616
1671
  thumbnail?: F;
1617
1672
  /** Caption of the animation to be sent, 0-1024 characters after entities parsing */
1618
1673
  caption?: string;
1674
+ /** Pass True, if the caption must be shown above the message media */
1675
+ show_caption_above_media?: boolean;
1619
1676
  /** Mode for parsing entities in the animation caption. See formatting options for more details. */
1620
1677
  parse_mode?: ParseMode;
1621
1678
  /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface Invoice {
14
14
  description: string;
15
15
  /** Unique bot deep-linking parameter that can be used to generate this invoice */
16
16
  start_parameter: string;
17
- /** Three-letter ISO 4217 currency code */
17
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
18
18
  currency: string;
19
19
  /** 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). */
20
20
  total_amount: number;
@@ -56,7 +56,7 @@ export interface ShippingOption {
56
56
  }
57
57
  /** This object contains basic information about a successful payment. */
58
58
  export interface SuccessfulPayment {
59
- /** Three-letter ISO 4217 currency code */
59
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
60
60
  currency: string;
61
61
  /** 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). */
62
62
  total_amount: number;
@@ -88,7 +88,7 @@ export interface PreCheckoutQuery {
88
88
  id: string;
89
89
  /** User who sent the query */
90
90
  from: User;
91
- /** Three-letter ISO 4217 currency code */
91
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
92
92
  currency: string;
93
93
  /** 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). */
94
94
  total_amount: number;