@grammyjs/types 3.18.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/manage.d.ts CHANGED
@@ -192,6 +192,10 @@ export declare namespace ChatFullInfo {
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
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 */
@@ -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 {
@@ -283,6 +285,10 @@ export declare namespace ChatFullInfo {
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
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 */
@@ -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 {
@@ -374,6 +378,10 @@ export declare namespace ChatFullInfo {
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
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 */
@@ -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 {
@@ -465,6 +471,10 @@ export declare namespace ChatFullInfo {
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
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 */
@@ -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
  }
package/methods.d.ts CHANGED
@@ -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;
@@ -1488,12 +1496,14 @@ 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;
1499
1509
  /** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
@@ -1663,7 +1673,7 @@ export type ApiMethods<F> = {
1663
1673
  ok: boolean;
1664
1674
  /** Required if ok is True. An array of available shipping options. */
1665
1675
  shipping_options?: readonly ShippingOption[];
1666
- /** 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. */
1667
1677
  error_message?: string;
1668
1678
  }): true;
1669
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. */
@@ -1832,6 +1842,10 @@ export interface InputMediaVideo<F> {
1832
1842
  media: F | string;
1833
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>. */
1834
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;
1835
1849
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
1836
1850
  caption?: string;
1837
1851
  /** Pass True, if the caption must be shown above the message media */
@@ -1934,6 +1948,10 @@ export interface InputPaidMediaVideo<F> {
1934
1948
  media: F | string;
1935
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 » */
1936
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;
1937
1955
  /** Video width */
1938
1956
  width?: number;
1939
1957
  /** Video height */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.18.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;