@grammyjs/types 3.17.0 → 3.19.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
@@ -55,8 +55,6 @@ export interface InlineQueryResultArticle {
55
55
  reply_markup?: InlineKeyboardMarkup;
56
56
  /** URL of the result */
57
57
  url?: string;
58
- /** Pass True if you don't want the URL to be shown in the message */
59
- hide_url?: boolean;
60
58
  /** Short description of the result */
61
59
  description?: string;
62
60
  /** Url of the thumbnail for the result */
@@ -103,7 +101,7 @@ export interface InlineQueryResultGif {
103
101
  type: "gif";
104
102
  /** Unique identifier for this result, 1-64 bytes */
105
103
  id: string;
106
- /** A valid URL for the GIF file. File size must not exceed 1MB */
104
+ /** A valid URL for the GIF file */
107
105
  gif_url: string;
108
106
  /** Width of the GIF */
109
107
  gif_width?: number;
@@ -136,7 +134,7 @@ export interface InlineQueryResultMpeg4Gif {
136
134
  type: "mpeg4_gif";
137
135
  /** Unique identifier for this result, 1-64 bytes */
138
136
  id: string;
139
- /** A valid URL for the MPEG4 file. File size must not exceed 1MB */
137
+ /** A valid URL for the MPEG4 file */
140
138
  mpeg4_url: string;
141
139
  /** Video width */
142
140
  mpeg4_width?: number;
package/manage.d.ts CHANGED
@@ -136,11 +136,11 @@ export declare namespace ChatFullInfo {
136
136
  type: "private";
137
137
  /** Title, for supergroups, channels and group chats */
138
138
  title?: undefined;
139
- /** Username, for private chats, supergroups and channels if available */
139
+ /** Username, for private chats, supergroups and channels if available */
140
140
  username?: string;
141
- /** First name of the other party in a private chat */
141
+ /** First name of the other party in a private chat */
142
142
  first_name: string;
143
- /** Last name of the other party in a private chat */
143
+ /** Last name of the other party in a private chat */
144
144
  last_name?: string;
145
145
  /** True, if the supergroup chat is a forum (has topics enabled) */
146
146
  is_forum?: undefined;
@@ -170,7 +170,7 @@ export declare namespace ChatFullInfo {
170
170
  profile_accent_color_id?: number;
171
171
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
172
172
  profile_background_custom_emoji_id?: string;
173
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
173
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
174
174
  emoji_status_custom_emoji_id?: string;
175
175
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
176
176
  emoji_status_expiration_date?: number;
@@ -186,17 +186,21 @@ export declare namespace ChatFullInfo {
186
186
  join_by_request?: undefined;
187
187
  /** Description, for groups, supergroups and channel chats */
188
188
  description?: undefined;
189
- /** Primary invite link, for groups, supergroups and channel chats */
189
+ /** Primary invite link, for groups, supergroups and channel chats */
190
190
  invite_link?: undefined;
191
191
  /** The most recent pinned message (by sending date) */
192
192
  pinned_message?: Message;
193
193
  /** Default chat member permissions, for groups and supergroups */
194
194
  permissions?: undefined;
195
+ /** True, if gifts can be sent to the chat */
196
+ can_send_gift?: true;
197
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
198
+ can_send_paid_media?: undefined;
195
199
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
196
200
  slow_mode_delay?: undefined;
197
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
201
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
198
202
  unrestrict_boost_count?: undefined;
199
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
203
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
200
204
  message_auto_delete_time?: number;
201
205
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
202
206
  has_aggressive_anti_spam_enabled?: undefined;
@@ -216,8 +220,6 @@ export declare namespace ChatFullInfo {
216
220
  linked_chat_id?: undefined;
217
221
  /** For supergroups, the location to which the supergroup is connected */
218
222
  location?: undefined;
219
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
220
- can_send_paid_media?: undefined;
221
223
  }
222
224
  /** Internal type for group chats */
223
225
  interface GroupChat {
@@ -227,11 +229,11 @@ export declare namespace ChatFullInfo {
227
229
  type: "group";
228
230
  /** Title, for supergroups, channels and group chats */
229
231
  title: string;
230
- /** Username, for private chats, supergroups and channels if available */
232
+ /** Username, for private chats, supergroups and channels if available */
231
233
  username?: undefined;
232
- /** First name of the other party in a private chat */
234
+ /** First name of the other party in a private chat */
233
235
  first_name?: undefined;
234
- /** Last name of the other party in a private chat */
236
+ /** Last name of the other party in a private chat */
235
237
  last_name?: undefined;
236
238
  /** True, if the supergroup chat is a forum (has topics enabled) */
237
239
  is_forum?: undefined;
@@ -261,7 +263,7 @@ export declare namespace ChatFullInfo {
261
263
  profile_accent_color_id?: number;
262
264
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
263
265
  profile_background_custom_emoji_id?: string;
264
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
266
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
265
267
  emoji_status_custom_emoji_id?: string;
266
268
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
267
269
  emoji_status_expiration_date?: number;
@@ -277,17 +279,21 @@ export declare namespace ChatFullInfo {
277
279
  join_by_request?: undefined;
278
280
  /** Description, for groups, supergroups and channel chats */
279
281
  description?: string;
280
- /** Primary invite link, for groups, supergroups and channel chats */
282
+ /** Primary invite link, for groups, supergroups and channel chats */
281
283
  invite_link?: string;
282
284
  /** The most recent pinned message (by sending date) */
283
285
  pinned_message?: Message;
284
286
  /** Default chat member permissions, for groups and supergroups */
285
287
  permissions?: ChatPermissions;
288
+ /** True, if gifts can be sent to the chat */
289
+ can_send_gift?: true;
290
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
291
+ can_send_paid_media?: undefined;
286
292
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
287
293
  slow_mode_delay?: undefined;
288
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
294
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
289
295
  unrestrict_boost_count?: undefined;
290
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
296
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
291
297
  message_auto_delete_time?: number;
292
298
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
293
299
  has_aggressive_anti_spam_enabled?: undefined;
@@ -307,8 +313,6 @@ export declare namespace ChatFullInfo {
307
313
  linked_chat_id?: undefined;
308
314
  /** For supergroups, the location to which the supergroup is connected */
309
315
  location?: undefined;
310
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
311
- can_send_paid_media?: undefined;
312
316
  }
313
317
  /** Internal type for supergroup chats */
314
318
  interface SupergroupChat {
@@ -318,11 +322,11 @@ export declare namespace ChatFullInfo {
318
322
  type: "supergroup";
319
323
  /** Title, for supergroups, channels and group chats */
320
324
  title: string;
321
- /** Username, for private chats, supergroups and channels if available */
325
+ /** Username, for private chats, supergroups and channels if available */
322
326
  username?: string;
323
- /** First name of the other party in a private chat */
327
+ /** First name of the other party in a private chat */
324
328
  first_name?: undefined;
325
- /** Last name of the other party in a private chat */
329
+ /** Last name of the other party in a private chat */
326
330
  last_name?: undefined;
327
331
  /** True, if the supergroup chat is a forum (has topics enabled) */
328
332
  is_forum?: true;
@@ -352,7 +356,7 @@ export declare namespace ChatFullInfo {
352
356
  profile_accent_color_id?: number;
353
357
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
354
358
  profile_background_custom_emoji_id?: string;
355
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
359
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
356
360
  emoji_status_custom_emoji_id?: string;
357
361
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
358
362
  emoji_status_expiration_date?: number;
@@ -368,17 +372,21 @@ export declare namespace ChatFullInfo {
368
372
  join_by_request?: true;
369
373
  /** Description, for groups, supergroups and channel chats */
370
374
  description?: string;
371
- /** Primary invite link, for groups, supergroups and channel chats */
375
+ /** Primary invite link, for groups, supergroups and channel chats */
372
376
  invite_link?: string;
373
377
  /** The most recent pinned message (by sending date) */
374
378
  pinned_message?: Message;
375
379
  /** Default chat member permissions, for groups and supergroups */
376
380
  permissions?: ChatPermissions;
381
+ /** True, if gifts can be sent to the chat */
382
+ can_send_gift?: true;
383
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
384
+ can_send_paid_media?: undefined;
377
385
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
378
386
  slow_mode_delay?: number;
379
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
387
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
380
388
  unrestrict_boost_count?: number;
381
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
389
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
382
390
  message_auto_delete_time?: number;
383
391
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
384
392
  has_aggressive_anti_spam_enabled?: true;
@@ -398,8 +406,6 @@ export declare namespace ChatFullInfo {
398
406
  linked_chat_id?: number;
399
407
  /** For supergroups, the location to which the supergroup is connected */
400
408
  location?: ChatLocation;
401
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
402
- can_send_paid_media?: undefined;
403
409
  }
404
410
  /** Internal type for channel chats */
405
411
  interface ChannelChat {
@@ -409,11 +415,11 @@ export declare namespace ChatFullInfo {
409
415
  type: "channel";
410
416
  /** Title, for supergroups, channels and group chats */
411
417
  title: string;
412
- /** Username, for private chats, supergroups and channels if available */
418
+ /** Username, for private chats, supergroups and channels if available */
413
419
  username?: string;
414
- /** First name of the other party in a private chat */
420
+ /** First name of the other party in a private chat */
415
421
  first_name?: undefined;
416
- /** Last name of the other party in a private chat */
422
+ /** Last name of the other party in a private chat */
417
423
  last_name?: undefined;
418
424
  /** True, if the supergroup chat is a forum (has topics enabled) */
419
425
  is_forum?: undefined;
@@ -443,7 +449,7 @@ export declare namespace ChatFullInfo {
443
449
  profile_accent_color_id?: number;
444
450
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
445
451
  profile_background_custom_emoji_id?: string;
446
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
452
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
447
453
  emoji_status_custom_emoji_id?: string;
448
454
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
449
455
  emoji_status_expiration_date?: number;
@@ -459,17 +465,21 @@ export declare namespace ChatFullInfo {
459
465
  join_by_request?: undefined;
460
466
  /** Description, for groups, supergroups and channel chats */
461
467
  description?: string;
462
- /** Primary invite link, for groups, supergroups and channel chats */
468
+ /** Primary invite link, for groups, supergroups and channel chats */
463
469
  invite_link?: string;
464
470
  /** The most recent pinned message (by sending date) */
465
471
  pinned_message?: Message;
466
472
  /** Default chat member permissions, for groups and supergroups */
467
473
  permissions?: undefined;
474
+ /** True, if gifts can be sent to the chat */
475
+ can_send_gift?: true;
476
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
477
+ can_send_paid_media?: true;
468
478
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
469
479
  slow_mode_delay?: undefined;
470
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
480
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
471
481
  unrestrict_boost_count?: undefined;
472
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
482
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
473
483
  message_auto_delete_time?: number;
474
484
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
475
485
  has_aggressive_anti_spam_enabled?: undefined;
@@ -489,8 +499,6 @@ export declare namespace ChatFullInfo {
489
499
  linked_chat_id?: number;
490
500
  /** For supergroups, the location to which the supergroup is connected */
491
501
  location?: undefined;
492
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
493
- can_send_paid_media?: true;
494
502
  }
495
503
  }
496
504
  /** This object contains full information about a chat. */
package/message.d.ts CHANGED
@@ -487,7 +487,7 @@ export interface ReplyParameters {
487
487
  /** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
488
488
  quote?: string;
489
489
  /** Mode for parsing entities in the quote. See formatting options for more details. */
490
- quote_parse_mode?: string;
490
+ quote_parse_mode?: ParseMode;
491
491
  /** A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */
492
492
  quote_entities?: MessageEntity[];
493
493
  /** Position of the quote in the original message in UTF-16 code units */
@@ -633,6 +633,10 @@ export interface Video {
633
633
  duration: number;
634
634
  /** Video thumbnail */
635
635
  thumbnail?: PhotoSize;
636
+ /** Available sizes of the cover of the video in the message */
637
+ cover?: PhotoSize[];
638
+ /** Timestamp in seconds from which the video will play in the message */
639
+ start_timestamp?: number;
636
640
  /** Original filename as defined by sender */
637
641
  file_name?: string;
638
642
  /** MIME type of the file as defined by sender */
@@ -702,7 +706,7 @@ export interface InputPollOption {
702
706
  /** Option text, 1-100 characters */
703
707
  text: string;
704
708
  /** Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed */
705
- text_parse_mode?: string;
709
+ text_parse_mode?: ParseMode;
706
710
  /** A list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode */
707
711
  text_entities?: MessageEntity[];
708
712
  }
@@ -905,7 +909,7 @@ export interface BackgroundTypeWallpaper {
905
909
  /** True, if the background moves slightly when the device is tilted */
906
910
  is_moving?: true;
907
911
  }
908
- /** The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
912
+ /** The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
909
913
  export interface BackgroundTypePattern {
910
914
  /** Type of the background, always “pattern” */
911
915
  type: "pattern";
package/methods.d.ts CHANGED
@@ -29,10 +29,10 @@ export type ApiMethods<F> = {
29
29
  timeout?: number;
30
30
  /** A list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
31
31
 
32
- Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. */
32
+ Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time. */
33
33
  allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
34
34
  }): Update[];
35
- /** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.
35
+ /** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
36
36
 
37
37
  If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
38
38
 
@@ -112,6 +112,8 @@ export type ApiMethods<F> = {
112
112
  message_thread_id?: number;
113
113
  /** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
114
114
  from_chat_id: number | string;
115
+ /** New start timestamp for the copied video in the message */
116
+ video_start_timestamp?: number;
115
117
  /** Sends the message silently. Users will receive a notification with no sound. */
116
118
  disable_notification?: boolean;
117
119
  /** Protects the contents of the forwarded message from forwarding and saving */
@@ -144,10 +146,12 @@ export type ApiMethods<F> = {
144
146
  from_chat_id: number | string;
145
147
  /** Message identifier in the chat specified in from_chat_id */
146
148
  message_id: number;
149
+ /** New start timestamp for the copied video in the message */
150
+ video_start_timestamp?: number;
147
151
  /** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
148
152
  caption?: string;
149
153
  /** Mode for parsing entities in the new caption. See formatting options for more details. */
150
- parse_mode?: string;
154
+ parse_mode?: ParseMode;
151
155
  /** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
152
156
  caption_entities?: MessageEntity[];
153
157
  /** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
@@ -311,6 +315,10 @@ export type ApiMethods<F> = {
311
315
  height?: number;
312
316
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
313
317
  thumbnail?: F;
318
+ /** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
319
+ cover?: F | string;
320
+ /** Start timestamp for the video in the message */
321
+ start_timestamp?: number;
314
322
  /** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
315
323
  caption?: string;
316
324
  /** Mode for parsing entities in the video caption. See formatting options for more details. */
@@ -557,7 +565,7 @@ export type ApiMethods<F> = {
557
565
  /** Media caption, 0-1024 characters after entities parsing */
558
566
  caption?: string;
559
567
  /** Mode for parsing entities in the media caption. See formatting options for more details. */
560
- parse_mode?: string;
568
+ parse_mode?: ParseMode;
561
569
  /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
562
570
  caption_entities?: MessageEntity[];
563
571
  /** Pass True, if the caption must be shown above the message media */
@@ -654,7 +662,7 @@ export type ApiMethods<F> = {
654
662
  /** Poll question, 1-300 characters */
655
663
  question: string;
656
664
  /** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */
657
- question_parse_mode?: string;
665
+ question_parse_mode?: ParseMode;
658
666
  /** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
659
667
  question_entities?: MessageEntity[];
660
668
  /** A list of 2-10 answer options */
@@ -734,7 +742,7 @@ export type ApiMethods<F> = {
734
742
  /** Unique identifier for the target message thread; for supergroups only */
735
743
  message_thread_id?: number;
736
744
  }): true;
737
- /** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. */
745
+ /** Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. */
738
746
  setMessageReaction(args: {
739
747
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
740
748
  chat_id: number | string;
@@ -1476,9 +1484,9 @@ export type ApiMethods<F> = {
1476
1484
  name: string;
1477
1485
  /** User identifier of the sticker set owner */
1478
1486
  user_id: number;
1479
- /** 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. */
1487
+ /** 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. */
1480
1488
  thumbnail?: F | string;
1481
- /** 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 */
1489
+ /** 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 */
1482
1490
  format: "static" | "animated" | "video";
1483
1491
  }): true;
1484
1492
  /** Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. */
@@ -1488,14 +1496,18 @@ export type ApiMethods<F> = {
1488
1496
  /** Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail. */
1489
1497
  custom_emoji_id?: string;
1490
1498
  }): true;
1491
- /** Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. */
1499
+ /** Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object. */
1492
1500
  getAvailableGifts(): Gifts;
1493
- /** Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success. */
1501
+ /** Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. */
1494
1502
  sendGift(args: {
1495
- /** Unique identifier of the target user that will receive the gift */
1496
- user_id: number;
1503
+ /** Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. */
1504
+ user_id?: number;
1505
+ /** Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift. */
1506
+ chat_id?: number | string;
1497
1507
  /** Identifier of the gift */
1498
1508
  gift_id: string;
1509
+ /** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
1510
+ pay_for_upgrade?: boolean;
1499
1511
  /** Text that will be shown along with the gift; 0-255 characters */
1500
1512
  text?: string;
1501
1513
  /** Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
@@ -1661,7 +1673,7 @@ export type ApiMethods<F> = {
1661
1673
  ok: boolean;
1662
1674
  /** Required if ok is True. An array of available shipping options. */
1663
1675
  shipping_options?: readonly ShippingOption[];
1664
- /** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. */
1676
+ /** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. Sorry, delivery to your desired address is unavailable). Telegram will display this message to the user. */
1665
1677
  error_message?: string;
1666
1678
  }): true;
1667
1679
  /** Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. */
@@ -1696,6 +1708,30 @@ export type ApiMethods<F> = {
1696
1708
  /** Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot. */
1697
1709
  is_canceled: boolean;
1698
1710
  }): true;
1711
+ /** Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. */
1712
+ verifyUser(args: {
1713
+ /** Unique identifier of the target user */
1714
+ user_id: number;
1715
+ /** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
1716
+ custom_description?: string;
1717
+ }): true;
1718
+ /** Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. */
1719
+ verifyChat(args: {
1720
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1721
+ chat_id: number | string;
1722
+ /** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
1723
+ custom_description?: string;
1724
+ }): true;
1725
+ /** Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success. */
1726
+ removeUserVerification(args: {
1727
+ /** Unique identifier of the target user */
1728
+ user_id: number;
1729
+ }): true;
1730
+ /** Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. */
1731
+ removeChatVerification(args: {
1732
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1733
+ chat_id: number | string;
1734
+ }): true;
1699
1735
  /** 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.
1700
1736
 
1701
1737
  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. */
@@ -1765,7 +1801,7 @@ export type ApiMethods<F> = {
1765
1801
  export interface InputSticker<F> {
1766
1802
  /** The added sticker. 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. Animated and video stickers can't be uploaded via HTTP URL. */
1767
1803
  sticker: F | string;
1768
- /** Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video */
1804
+ /** Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video */
1769
1805
  format: "static" | "animated" | "video";
1770
1806
  /** List of 1-20 emoji associated with the sticker */
1771
1807
  emoji_list: string[];
@@ -1806,6 +1842,10 @@ export interface InputMediaVideo<F> {
1806
1842
  media: F | string;
1807
1843
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
1808
1844
  thumbnail?: F;
1845
+ /** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
1846
+ cover?: F | string;
1847
+ /** Start timestamp for the video in the message */
1848
+ start_timestamp?: number;
1809
1849
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
1810
1850
  caption?: string;
1811
1851
  /** Pass True, if the caption must be shown above the message media */
@@ -1908,6 +1948,10 @@ export interface InputPaidMediaVideo<F> {
1908
1948
  media: F | string;
1909
1949
  /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
1910
1950
  thumbnail?: F | string;
1951
+ /** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
1952
+ cover?: F | string;
1953
+ /** Start timestamp for the video in the message */
1954
+ start_timestamp?: number;
1911
1955
  /** Video width */
1912
1956
  width?: number;
1913
1957
  /** Video height */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.17.0",
3
+ "version": "3.19.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -55,7 +55,7 @@ export interface ShippingOption {
55
55
  /** List of price portions */
56
56
  prices: LabeledPrice[];
57
57
  }
58
- /** This object contains basic information about a successful payment. */
58
+ /** This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. */
59
59
  export interface SuccessfulPayment {
60
60
  /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
61
61
  currency: string;
@@ -160,12 +160,13 @@ export interface AffiliateInfo {
160
160
  /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
161
161
 
162
162
  - TransactionPartnerUser
163
+ - TransactionPartnerChat
163
164
  - TransactionPartnerAffiliateProgram
164
165
  - TransactionPartnerFragment
165
166
  - TransactionPartnerTelegramAds
166
167
  - TransactionPartnerTelegramApi
167
168
  - TransactionPartnerOther */
168
- export type TransactionPartner = TransactionPartnerUser | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
169
+ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
169
170
  /** Describes a transaction with a user. */
170
171
  export interface TransactionPartnerUser {
171
172
  /** Type of the transaction partner, always “user” */
@@ -183,7 +184,16 @@ export interface TransactionPartnerUser {
183
184
  /** Bot-specified paid media payload */
184
185
  paid_media_payload?: string;
185
186
  /** The gift sent to the user by the bot */
186
- gift?: string;
187
+ gift?: Gift;
188
+ }
189
+ /** Describes a transaction with a chat. */
190
+ export interface TransactionPartnerChat {
191
+ /** Type of the transaction partner, always “chat” */
192
+ type: "chat";
193
+ /** Information about the chat */
194
+ chat: Chat;
195
+ /** The gift sent to the chat by the bot */
196
+ gift?: Gift;
187
197
  }
188
198
  /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
189
199
  export interface TransactionPartnerAffiliateProgram {
@@ -218,7 +228,7 @@ export interface TransactionPartnerOther {
218
228
  /** Type of the transaction partner, always “other” */
219
229
  type: "other";
220
230
  }
221
- /** Describes a Telegram Star transaction. */
231
+ /** Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. */
222
232
  export interface StarTransaction {
223
233
  /** 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. */
224
234
  id: string;
@@ -253,6 +263,8 @@ export interface Gift {
253
263
  sticker: Sticker;
254
264
  /** The number of Telegram Stars that must be paid to send the sticker */
255
265
  star_count: number;
266
+ /** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
267
+ upgrade_star_count?: number;
256
268
  /** The total number of the gifts of this type that can be sent; for limited gifts only */
257
269
  total_count?: number;
258
270
  /** The number of remaining gifts of this type that can be sent; for limited gifts only */