@telegram.ts/types 1.14.1 → 1.15.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  import type { ReadStream } from "node:fs";
2
+ import type { Buffer } from "node:buffer";
2
3
  import type {
3
4
  InlineQueryResult,
4
5
  InlineQueryResultsButton,
@@ -618,10 +619,12 @@ export type ApiMethods = {
618
619
  business_connection_id?: string;
619
620
  /** 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 */
620
621
  chat_id: number | string;
621
- /** The number of Telegram Stars that must be paid to buy access to the media */
622
+ /** The number of Telegram Stars that must be paid to buy access to the media; 1-2500 */
622
623
  star_count: number;
623
624
  /** An array describing the media to be sent; up to 10 items */
624
625
  media: InputPaidMedia[];
626
+ /** Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. */
627
+ payload?: string;
625
628
  /** Media caption, 0-1024 characters after entities parsing */
626
629
  caption?: string;
627
630
  /** Mode for parsing entities in the media caption. See formatting options for more details. */
@@ -177,6 +177,8 @@ export interface TransactionPartnerUser {
177
177
  invoice_payload?: string;
178
178
  /** Information about the paid media bought by the user */
179
179
  paid_media?: PaidMedia[];
180
+ /** Bot-specified paid media payload */
181
+ paid_media_payload?: string;
180
182
  }
181
183
 
182
184
  /** Describes a withdrawal transaction with Fragment. */
@@ -218,3 +220,11 @@ export interface StarTransactions {
218
220
  /** The list of transactions */
219
221
  transactions: StarTransaction[];
220
222
  }
223
+
224
+ /** This object contains information about a paid media purchase. */
225
+ export interface PaidMediaPurchased {
226
+ /** User who purchased the media */
227
+ from: User;
228
+ /** Bot-specified paid media payload */
229
+ paid_media_payload: string;
230
+ }
@@ -898,14 +898,16 @@ export interface ChatBoostSourceGiftCode {
898
898
  user: User;
899
899
  }
900
900
 
901
- /** 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. */
901
+ /** 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. */
902
902
  export interface ChatBoostSourceGiveaway {
903
903
  /** Source of the boost, always “giveaway” */
904
904
  source: "giveaway";
905
905
  /** Identifier of a message in the chat with the giveaway; the message could have been deleted already */
906
906
  giveaway_message_id: number;
907
- /** User that won the prize in the giveaway if any */
907
+ /** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
908
908
  user?: User;
909
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
910
+ prize_star_count?: number;
909
911
  /** True, if the giveaway was completed, but there was no user to win the prize */
910
912
  is_unclaimed?: true;
911
913
  }
@@ -1156,8 +1156,11 @@ export interface SharedUser {
1156
1156
  photo?: PhotoSize[];
1157
1157
  }
1158
1158
 
1159
- /** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
1160
- export interface GiveawayCreated {}
1159
+ /** This object represents a service message about the creation of a scheduled giveaway. */
1160
+ export interface GiveawayCreated {
1161
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1162
+ prize_star_count?: number;
1163
+ }
1161
1164
 
1162
1165
  /** This object represents a message about a scheduled giveaway. */
1163
1166
  export interface Giveaway {
@@ -1175,7 +1178,9 @@ export interface Giveaway {
1175
1178
  prize_description?: string;
1176
1179
  /** 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. */
1177
1180
  country_codes?: string[];
1178
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1181
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1182
+ prize_star_count?: number;
1183
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1179
1184
  premium_subscription_month_count?: number;
1180
1185
  }
1181
1186
 
@@ -1193,7 +1198,9 @@ export interface GiveawayWinners {
1193
1198
  winners: User[];
1194
1199
  /** The number of other chats the user had to join in order to be eligible for the giveaway */
1195
1200
  additional_chat_count?: number;
1196
- /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
1201
+ /** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
1202
+ prize_star_count?: number;
1203
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1197
1204
  premium_subscription_month_count?: number;
1198
1205
  /** Number of undistributed prizes */
1199
1206
  unclaimed_prize_count?: number;
@@ -1213,6 +1220,8 @@ export interface GiveawayCompleted {
1213
1220
  unclaimed_prize_count?: number;
1214
1221
  /** Message with the giveaway that was completed, if it wasn't deleted */
1215
1222
  giveaway_message?: Message;
1223
+ /** True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */
1224
+ is_star_giveaway?: true;
1216
1225
  }
1217
1226
 
1218
1227
  /** Describes the options used for link preview generation. */
@@ -1428,7 +1437,7 @@ export interface ReactionTypeCustomEmoji {
1428
1437
  /** Type of the reaction, always “custom_emoji” */
1429
1438
  type: "custom_emoji";
1430
1439
  /** Custom emoji identifier */
1431
- custom_emoji: string;
1440
+ custom_emoji_id: string;
1432
1441
  }
1433
1442
 
1434
1443
  /** The reaction is paid. */
@@ -17,7 +17,11 @@ import type {
17
17
  Poll,
18
18
  PollAnswer,
19
19
  } from "./messageTypes";
20
- import type { PreCheckoutQuery, ShippingQuery } from "./invoiceTypes";
20
+ import type {
21
+ PaidMediaPurchased,
22
+ PreCheckoutQuery,
23
+ ShippingQuery,
24
+ } from "./invoiceTypes";
21
25
 
22
26
  /**
23
27
  * Namespace used internally to define more accurate message update types.
@@ -164,4 +168,7 @@ export interface Update {
164
168
 
165
169
  /** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
166
170
  removed_chat_boost?: ChatBoostRemoved;
171
+
172
+ /** A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat */
173
+ purchased_paid_media?: PaidMediaPurchased;
167
174
  }