@grammyjs/types 3.13.0 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/inline.d.ts CHANGED
@@ -621,7 +621,7 @@ export interface InputInvoiceMessageContent {
621
621
  title: string;
622
622
  /** Product description, 1-255 characters */
623
623
  description: string;
624
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
624
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
625
625
  payload: string;
626
626
  /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
627
627
  provider_token?: string;
package/manage.d.ts CHANGED
@@ -535,6 +535,10 @@ export interface ChatInviteLink {
535
535
  member_limit?: number;
536
536
  /** Number of pending join requests created using this link */
537
537
  pending_join_request_count?: number;
538
+ /** The number of seconds the subscription will be active for before the next payment */
539
+ subscription_period?: number;
540
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link */
541
+ subscription_price?: number;
538
542
  }
539
543
  /** Represents the rights of an administrator in a chat. */
540
544
  export interface ChatAdministratorRights {
@@ -842,14 +846,16 @@ export interface ChatBoostSourceGiftCode {
842
846
  /** User for which the gift code was created */
843
847
  user: User;
844
848
  }
845
- /** The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
849
+ /** The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways. */
846
850
  export interface ChatBoostSourceGiveaway {
847
851
  /** Source of the boost, always “giveaway” */
848
852
  source: "giveaway";
849
853
  /** Identifier of a message in the chat with the giveaway; the message could have been deleted already */
850
854
  giveaway_message_id: number;
851
- /** User that won the prize in the giveaway if any */
855
+ /** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
852
856
  user?: User;
857
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
858
+ prize_star_count?: number;
853
859
  /** True, if the giveaway was completed, but there was no user to win the prize */
854
860
  is_unclaimed?: true;
855
861
  }
package/message.d.ts CHANGED
@@ -1020,8 +1020,10 @@ export interface VideoChatParticipantsInvited {
1020
1020
  /** New members that were invited to the video chat */
1021
1021
  users: User[];
1022
1022
  }
1023
- /** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
1023
+ /** This object represents a service message about the creation of a scheduled giveaway. */
1024
1024
  export interface GiveawayCreated {
1025
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1026
+ prize_star_count?: number;
1025
1027
  }
1026
1028
  /** This object represents a message about a scheduled giveaway. */
1027
1029
  export interface Giveaway {
@@ -1039,7 +1041,9 @@ export interface Giveaway {
1039
1041
  prize_description?: string;
1040
1042
  /** A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. */
1041
1043
  country_codes?: string[];
1042
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1044
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1045
+ prize_star_count?: number;
1046
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1043
1047
  premium_subscription_month_count?: number;
1044
1048
  }
1045
1049
  /** This object represents a message about the completion of a giveaway with public winners. */
@@ -1056,7 +1060,9 @@ export interface GiveawayWinners {
1056
1060
  winners: User[];
1057
1061
  /** The number of other chats the user had to join in order to be eligible for the giveaway */
1058
1062
  additional_chat_count?: number;
1059
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1063
+ /** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
1064
+ prize_star_count?: number;
1065
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1060
1066
  premium_subscription_month_count?: number;
1061
1067
  /** Number of undistributed prizes */
1062
1068
  unclaimed_prize_count?: number;
@@ -1075,6 +1081,8 @@ export interface GiveawayCompleted {
1075
1081
  unclaimed_prize_count?: number;
1076
1082
  /** Message with the giveaway that was completed, if it wasn't deleted */
1077
1083
  giveaway_message?: Message;
1084
+ /** True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */
1085
+ is_star_giveaway?: true;
1078
1086
  }
1079
1087
  /** Describes the options used for link preview generation. */
1080
1088
  export interface LinkPreviewOptions {
package/methods.d.ts CHANGED
@@ -527,10 +527,12 @@ export type ApiMethods<F> = {
527
527
  business_connection_id?: string;
528
528
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. */
529
529
  chat_id: number | string;
530
- /** The number of Telegram Stars that must be paid to buy access to the media */
530
+ /** The number of Telegram Stars that must be paid to buy access to the media; 1-2500 */
531
531
  star_count: number;
532
532
  /** An array describing the media to be sent; up to 10 items */
533
533
  media: InputPaidMedia<F>[];
534
+ /** Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. */
535
+ payload?: string;
534
536
  /** Media caption, 0-1024 characters after entities parsing */
535
537
  caption?: string;
536
538
  /** Mode for parsing entities in the media caption. See formatting options for more details. */
@@ -672,7 +674,7 @@ export type ApiMethods<F> = {
672
674
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
673
675
  message_thread_id?: number;
674
676
  /** Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲" */
675
- emoji?: string;
677
+ emoji?: (string & Record<never, never>) | "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰";
676
678
  /** Sends the message silently. Users will receive a notification with no sound. */
677
679
  disable_notification?: boolean;
678
680
  /** Protects the contents of the sent message from forwarding */
@@ -1479,7 +1481,7 @@ export type ApiMethods<F> = {
1479
1481
  title: string;
1480
1482
  /** Product description, 1-255 characters */
1481
1483
  description: string;
1482
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1484
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
1483
1485
  payload: string;
1484
1486
  /** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
1485
1487
  provider_token?: string;
@@ -1536,7 +1538,7 @@ export type ApiMethods<F> = {
1536
1538
  title: string;
1537
1539
  /** Product description, 1-255 characters */
1538
1540
  description: string;
1539
- /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
1541
+ /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
1540
1542
  payload: string;
1541
1543
  /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
1542
1544
  provider_token?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -155,6 +155,8 @@ export interface TransactionPartnerUser {
155
155
  invoice_payload?: string;
156
156
  /** Information about the paid media bought by the user */
157
157
  paid_media?: PaidMedia[];
158
+ /** Bot-specified paid media payload */
159
+ paid_media_payload?: string;
158
160
  }
159
161
  /** Describes a withdrawal transaction with Fragment. */
160
162
  export interface TransactionPartnerFragment {
@@ -191,3 +193,10 @@ export interface StarTransactions {
191
193
  /** The list of transactions */
192
194
  transactions: StarTransaction[];
193
195
  }
196
+ /** This object contains information about a paid media purchase. */
197
+ export interface PaidMediaPurchased {
198
+ /** User who purchased the media */
199
+ from: User;
200
+ /** Bot-specified paid media payload */
201
+ paid_media_payload: string;
202
+ }
package/update.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { ChosenInlineResult, InlineQuery } from "./inline.js";
2
2
  import type { BusinessConnection, BusinessMessagesDeleted, Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
3
3
  import type { CallbackQuery } from "./markup.js";
4
4
  import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
5
- import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
5
+ import type { PaidMediaPurchased, PreCheckoutQuery, ShippingQuery } from "./payment.js";
6
6
  /** Internal namespace used to make some message types more accurate */
7
7
  export declare namespace Update {
8
8
  /** Internal type holding properties that message updates in private chats share. */
@@ -73,4 +73,6 @@ export interface Update {
73
73
  chat_boost?: ChatBoostUpdated;
74
74
  /** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
75
75
  removed_chat_boost?: ChatBoostRemoved;
76
+ /** A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat */
77
+ purchased_paid_media?: PaidMediaPurchased;
76
78
  }