@grammyjs/types 3.9.0 → 3.10.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
@@ -214,6 +214,8 @@ export declare namespace ChatFullInfo {
214
214
  linked_chat_id?: undefined;
215
215
  /** For supergroups, the location to which the supergroup is connected */
216
216
  location?: undefined;
217
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
218
+ can_send_paid_media?: undefined;
217
219
  }
218
220
  /** Internal type for group chats */
219
221
  interface GroupChat {
@@ -303,6 +305,8 @@ export declare namespace ChatFullInfo {
303
305
  linked_chat_id?: undefined;
304
306
  /** For supergroups, the location to which the supergroup is connected */
305
307
  location?: undefined;
308
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
309
+ can_send_paid_media?: undefined;
306
310
  }
307
311
  /** Internal type for supergroup chats */
308
312
  interface SupergroupChat {
@@ -392,6 +396,8 @@ export declare namespace ChatFullInfo {
392
396
  linked_chat_id?: number;
393
397
  /** For supergroups, the location to which the supergroup is connected */
394
398
  location?: ChatLocation;
399
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
400
+ can_send_paid_media?: undefined;
395
401
  }
396
402
  /** Internal type for channel chats */
397
403
  interface ChannelChat {
@@ -481,6 +487,8 @@ export declare namespace ChatFullInfo {
481
487
  linked_chat_id?: number;
482
488
  /** For supergroups, the location to which the supergroup is connected */
483
489
  location?: undefined;
490
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
491
+ can_send_paid_media?: true;
484
492
  }
485
493
  }
486
494
  /** This object contains full information about a chat. */
package/message.d.ts CHANGED
@@ -84,8 +84,9 @@ export declare namespace Message {
84
84
  type DiceMessage = CommonMessage & MsgWith<"dice">;
85
85
  type GameMessage = CommonMessage & MsgWith<"game">;
86
86
  type PollMessage = CommonMessage & MsgWith<"poll">;
87
- type LocationMessage = CommonMessage & MsgWith<"location">;
88
87
  type VenueMessage = LocationMessage & MsgWith<"venue">;
88
+ type LocationMessage = CommonMessage & MsgWith<"location">;
89
+ type PaidMediaMessage = CommonMessage & MsgWith<"paid_media">;
89
90
  type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
90
91
  type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
91
92
  type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
@@ -162,6 +163,8 @@ export interface Message extends Message.MediaMessage {
162
163
  venue?: Venue;
163
164
  /** Message is a shared location, information about the location */
164
165
  location?: Location;
166
+ /** Message contains paid media; information about the paid media */
167
+ paid_media?: PaidMediaInfo;
165
168
  /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
166
169
  new_chat_members?: User[];
167
170
  /** A member was removed from the group, information about them (this member may be the bot itself) */
@@ -462,6 +465,8 @@ export interface ExternalReplyInfo {
462
465
  invoice?: Invoice;
463
466
  /** Message is a shared location, information about the location */
464
467
  location?: Location;
468
+ /** Message contains paid media; information about the paid media */
469
+ paid_media?: PaidMediaInfo;
465
470
  /** Message is a native poll, information about the poll */
466
471
  poll?: Poll;
467
472
  /** Message is a venue, information about the venue */
@@ -754,6 +759,44 @@ export interface Location {
754
759
  /** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
755
760
  proximity_alert_radius?: number;
756
761
  }
762
+ /** Describes the paid media added to a message. */
763
+ export interface PaidMediaInfo {
764
+ /** The number of Telegram Stars that must be paid to buy access to the media */
765
+ star_count: number;
766
+ /** Information about the paid media */
767
+ paid_media: PaidMedia[];
768
+ }
769
+ /** This object describes paid media. Currently, it can be one of
770
+
771
+ - PaidMediaPreview
772
+ - PaidMediaPhoto
773
+ - PaidMediaVideo */
774
+ export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;
775
+ /** The paid media isn't available before the payment. */
776
+ export interface PaidMediaPreview {
777
+ /** Type of the paid media, always “preview” */
778
+ type: "preview";
779
+ /** Media width as defined by the sender */
780
+ width?: number;
781
+ /** Media height as defined by the sender */
782
+ height?: number;
783
+ /** Duration of the media in seconds as defined by the sender */
784
+ duration?: number;
785
+ }
786
+ /** The paid media is a photo. */
787
+ export interface PaidMediaPhoto {
788
+ /** Type of the paid media, always “photo” */
789
+ type: "photo";
790
+ /** The photo */
791
+ photo: PhotoSize[];
792
+ }
793
+ /** The paid media is a video. */
794
+ export interface PaidMediaVideo {
795
+ /** Type of the paid media, always “video” */
796
+ type: "video";
797
+ /** The video */
798
+ video: Video;
799
+ }
757
800
  /** This object represents a venue. */
758
801
  export interface Venue {
759
802
  /** Venue location. Can't be a live location */
package/methods.d.ts CHANGED
@@ -133,7 +133,7 @@ export type ApiMethods<F> = {
133
133
  /** Protects the contents of the forwarded messages from forwarding and saving */
134
134
  protect_content?: boolean;
135
135
  }): MessageId[];
136
- /** Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
136
+ /** Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
137
137
  copyMessage(args: {
138
138
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
139
139
  chat_id: number | string;
@@ -162,7 +162,7 @@ export type ApiMethods<F> = {
162
162
  /** @deprecated Use `reply_parameters` instead. */
163
163
  reply_to_message_id?: number;
164
164
  }): MessageId;
165
- /** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
165
+ /** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
166
166
  copyMessages(args: {
167
167
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
168
168
  chat_id: number | string;
@@ -521,6 +521,31 @@ export type ApiMethods<F> = {
521
521
  /** An object for a new inline keyboard. */
522
522
  reply_markup?: InlineKeyboardMarkup;
523
523
  }): (Update.Edited & Message.LocationMessage) | true;
524
+ /** Use this method to send paid media to channel chats. On success, the sent Message is returned. */
525
+ sendPaidMedia(args: {
526
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
527
+ chat_id: number | string;
528
+ /** The number of Telegram Stars that must be paid to buy access to the media */
529
+ star_count: number;
530
+ /** An array describing the media to be sent; up to 10 items */
531
+ media: InputPaidMedia<F>[];
532
+ /** Media caption, 0-1024 characters after entities parsing */
533
+ caption?: string;
534
+ /** Mode for parsing entities in the media caption. See formatting options for more details. */
535
+ parse_mode?: string;
536
+ /** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
537
+ caption_entities?: MessageEntity[];
538
+ /** Pass True, if the caption must be shown above the message media */
539
+ show_caption_above_media?: boolean;
540
+ /** Sends the message silently. Users will receive a notification with no sound. */
541
+ disable_notification?: boolean;
542
+ /** Protects the contents of the sent message from forwarding and saving */
543
+ protect_content?: boolean;
544
+ /** Description of the message to reply to */
545
+ reply_parameters?: ReplyParameters;
546
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user */
547
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
548
+ }): Message.PaidMediaMessage;
524
549
  /** Use this method to send information about a venue. On success, the sent Message is returned. */
525
550
  sendVenue(args: {
526
551
  /** Unique identifier of the business connection on behalf of which the message will be sent */
@@ -1746,4 +1771,33 @@ export interface InputMediaDocument<F> {
1746
1771
  /** Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. */
1747
1772
  disable_content_type_detection?: boolean;
1748
1773
  }
1774
+ /** This object describes the paid media to be sent. Currently, it can be one of
1775
+
1776
+ - InputPaidMediaPhoto
1777
+ - InputPaidMediaVideo */
1778
+ export type InputPaidMedia<F> = InputMediaPhoto<F> | InputPaidMediaVideo<F>;
1779
+ /** The paid media to send is a photo. */
1780
+ export interface InputPaidMediaPhoto<F> {
1781
+ /** Type of the media, must be photo */
1782
+ type: "photo";
1783
+ /** File to send. 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. More information on Sending Files » */
1784
+ media: F | string;
1785
+ }
1786
+ /** The paid media to send is a video. */
1787
+ export interface InputPaidMediaVideo<F> {
1788
+ /** Type of the media, must be video */
1789
+ type: "video";
1790
+ /** File to send. 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. More information on Sending Files » */
1791
+ media: F | string;
1792
+ /** 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 » */
1793
+ thumbnail?: F | string;
1794
+ /** Video width */
1795
+ width?: number;
1796
+ /** Video height */
1797
+ height?: number;
1798
+ /** Video duration in seconds */
1799
+ duration?: number;
1800
+ /** Pass True if the uploaded video is suitable for streaming */
1801
+ supports_streaming?: boolean;
1802
+ }
1749
1803
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -126,10 +126,20 @@ export interface RevenueWithdrawalStateFailed {
126
126
  }
127
127
  /** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
128
128
 
129
- - TransactionPartnerFragment
130
129
  - TransactionPartnerUser
130
+ - TransactionPartnerFragment
131
+ - TransactionPartnerTelegramAds
131
132
  - TransactionPartnerOther */
132
- export type TransactionPartner = TransactionPartnerFragment | TransactionPartnerUser | TransactionPartnerOther;
133
+ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther;
134
+ /** Describes a transaction with a user. */
135
+ export interface TransactionPartnerUser {
136
+ /** Type of the transaction partner, always “user” */
137
+ type: "user";
138
+ /** Information about the user */
139
+ user: User;
140
+ /** Bot-specified invoice payload */
141
+ invoice_payload?: string;
142
+ }
133
143
  /** Describes a withdrawal transaction with Fragment. */
134
144
  export interface TransactionPartnerFragment {
135
145
  /** Type of the transaction partner, always “fragment” */
@@ -137,12 +147,10 @@ export interface TransactionPartnerFragment {
137
147
  /** State of the transaction if the transaction is outgoing */
138
148
  withdrawal_state?: RevenueWithdrawalState;
139
149
  }
140
- /** Describes a transaction with a user. */
141
- export interface TransactionPartnerUser {
142
- /** Type of the transaction partner, always “user” */
143
- type: "user";
144
- /** Information about the user */
145
- user: User;
150
+ /** Describes a withdrawal transaction to the Telegram Ads platform. */
151
+ export interface TransactionPartnerTelegramAds {
152
+ /** Type of the transaction partner, always “telegram_ads” */
153
+ type: "telegram_ads";
146
154
  }
147
155
  /** Describes a transaction with an unknown source or recipient. */
148
156
  export interface TransactionPartnerOther {
package/settings.d.ts CHANGED
@@ -32,7 +32,7 @@ export interface MenuButtonWebApp {
32
32
  type: "web_app";
33
33
  /** Text on the button */
34
34
  text: string;
35
- /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. */
35
+ /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. */
36
36
  web_app: WebAppInfo;
37
37
  }
38
38
  /** Describes that no specific value for the menu button was set. */