@grammyjs/types 3.22.2 → 3.24.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": "@grammyjs/types",
3
- "version": "3.22.2",
3
+ "version": "3.24.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/payment.d.ts CHANGED
@@ -259,6 +259,15 @@ export interface PaidMediaPurchased {
259
259
  /** Bot-specified paid media payload */
260
260
  paid_media_payload: string;
261
261
  }
262
+ /** This object describes the background of a gift. */
263
+ export interface GiftBackground {
264
+ /** Center color of the background in RGB format */
265
+ center_color: number;
266
+ /** Edge color of the background in RGB format */
267
+ edge_color: number;
268
+ /** Text color of the background in RGB format */
269
+ text_color: number;
270
+ }
262
271
  /** This object represents a gift that can be sent by the bot. */
263
272
  export interface Gift {
264
273
  /** Unique identifier of the gift */
@@ -267,14 +276,26 @@ export interface Gift {
267
276
  publisher_chat?: Chat;
268
277
  /** The sticker that represents the gift */
269
278
  sticker: Sticker;
279
+ /** Background of the gift */
280
+ background?: GiftBackground;
281
+ /** True, if the gift can only be purchased by Telegram Premium subscribers */
282
+ is_premium?: true;
283
+ /** True, if the gift can be used (after being upgraded) to customize a user's appearance */
284
+ has_colors?: true;
270
285
  /** The number of Telegram Stars that must be paid to send the sticker */
271
286
  star_count: number;
272
287
  /** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
273
288
  upgrade_star_count?: number;
274
- /** The total number of the gifts of this type that can be sent; for limited gifts only */
289
+ /** The total number of different unique gifts that can be obtained by upgrading the gift */
290
+ unique_gift_variant_count?: number;
291
+ /** The total number of gifts of this type that can be sent by all users; for limited gifts only */
275
292
  total_count?: number;
276
- /** The number of remaining gifts of this type that can be sent; for limited gifts only */
293
+ /** The number of remaining gifts of this type that can be sent by all users; for limited gifts only */
277
294
  remaining_count?: number;
295
+ /** The total number of gifts of this type that can be sent by the bot; for limited gifts only */
296
+ personal_total_count?: number;
297
+ /** The number of remaining gifts of this type that can be sent by the bot; for limited gifts only */
298
+ personal_remaining_count?: number;
278
299
  }
279
300
  /** This object represent a list of gifts. */
280
301
  export interface Gifts {
@@ -287,8 +308,10 @@ export interface UniqueGiftModel {
287
308
  name: string;
288
309
  /** The sticker that represents the unique gift */
289
310
  sticker: Sticker;
290
- /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
311
+ /** The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts. */
291
312
  rarity_per_mille: number;
313
+ /** Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”. */
314
+ rarity?: "uncommon" | "rare" | "epic" | "legendary";
292
315
  }
293
316
  /** This object describes the symbol shown on the pattern of a unique gift. */
294
317
  export interface UniqueGiftSymbol {
@@ -321,12 +344,18 @@ export interface UniqueGiftBackdrop {
321
344
  }
322
345
  /** This object describes a unique gift that was upgraded from a regular gift. */
323
346
  export interface UniqueGift {
347
+ /** Identifier of the regular gift from which the gift was upgraded */
348
+ gift_id: string;
324
349
  /** Human-readable name of the regular gift from which this unique gift was upgraded */
325
350
  base_name: string;
326
351
  /** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
327
352
  name: string;
328
353
  /** Information about the chat that published the gift */
329
354
  publisher_chat?: Chat;
355
+ /** True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers */
356
+ is_premium?: true;
357
+ /** True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram */
358
+ is_from_blockchain?: true;
330
359
  /** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
331
360
  number: number;
332
361
  /** Model of the gift */
@@ -335,6 +364,25 @@ export interface UniqueGift {
335
364
  symbol: UniqueGiftSymbol;
336
365
  /** Backdrop of the gift */
337
366
  backdrop: UniqueGiftBackdrop;
367
+ /** The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews */
368
+ colors?: UniqueGiftColors;
369
+ /** True, if the gift was used to craft another gift and isn't available anymore */
370
+ is_burned?: true;
371
+ }
372
+ /** This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift. */
373
+ export interface UniqueGiftColors {
374
+ /** Custom emoji identifier of the unique gift's model */
375
+ model_custom_emoji_id: string;
376
+ /** Custom emoji identifier of the unique gift's symbol */
377
+ symbol_custom_emoji_id: string;
378
+ /** Main color used in light themes; RGB format */
379
+ light_theme_main_color: number;
380
+ /** List of 1-3 additional colors used in light themes; RGB format */
381
+ light_theme_other_colors: number[];
382
+ /** Main color used in dark themes; RGB format */
383
+ dark_theme_main_color: number;
384
+ /** List of 1-3 additional colors used in dark themes; RGB format */
385
+ dark_theme_other_colors: number[];
338
386
  }
339
387
  /** Describes a service message about a regular gift that was sent or received. */
340
388
  export interface GiftInfo {
@@ -348,6 +396,10 @@ export interface GiftInfo {
348
396
  prepaid_upgrade_star_count?: number;
349
397
  /** True, if the gift can be upgraded to a unique gift */
350
398
  can_be_upgraded?: true;
399
+ /** True, if the gift's upgrade was purchased after the gift was sent */
400
+ is_upgrade_separate?: true;
401
+ /** Unique number reserved for this gift when upgraded. See the number field in UniqueGift */
402
+ unique_gift_number?: number;
351
403
  /** Text of the message that was added to the gift */
352
404
  text?: string;
353
405
  /** Special entities that appear in the text */
@@ -359,16 +411,18 @@ export interface GiftInfo {
359
411
  export interface UniqueGiftInfo {
360
412
  /** Information about the gift */
361
413
  gift: UniqueGift;
362
- /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users */
363
- origin: "upgrade" | "transfer" | "resale";
414
+ /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers */
415
+ origin: "upgrade" | "transfer" | "resale" | "gifted_upgrade" | "offer";
364
416
  /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
365
417
  owned_gift_id?: string;
366
418
  /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
367
419
  transfer_star_count?: number;
368
- /** For gifts bought from other users, the price paid for the gift */
369
- last_resale_star_count?: number;
420
+ /** For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. */
421
+ last_resale_currency?: "XTR" | "TON";
422
+ /** For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins */
423
+ last_resale_amount?: number;
370
424
  /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
371
- next_transfer_date?: string;
425
+ next_transfer_date?: number;
372
426
  }
373
427
  /** Describes a service message about a change in the price of paid messages within a chat. */
374
428
  export interface PaidMessagePriceChanged {
@@ -399,6 +453,8 @@ export interface OwnedGiftRegular {
399
453
  sender_user?: User;
400
454
  /** Date the gift was sent in Unix time */
401
455
  send_date: number;
456
+ /** Unique number reserved for this gift when upgraded. See the number field in UniqueGift */
457
+ unique_gift_number?: number;
402
458
  /** Text of the message that was added to the gift */
403
459
  text?: string;
404
460
  /** Special entities that appear in the text */
@@ -409,6 +465,8 @@ export interface OwnedGiftRegular {
409
465
  is_saved?: true;
410
466
  /** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
411
467
  can_be_upgraded?: true;
468
+ /** True, if the gift's upgrade was purchased after the gift was sent */
469
+ is_upgrade_separate?: true;
412
470
  /** True, if the gift was refunded and isn't available anymore */
413
471
  was_refunded?: true;
414
472
  /** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
@@ -435,7 +493,7 @@ export interface OwnedGiftUnique {
435
493
  /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
436
494
  transfer_star_count?: number;
437
495
  /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
438
- next_transfer_date?: string;
496
+ next_transfer_date?: number;
439
497
  }
440
498
  /** Contains the list of gifts received and owned by a user or a chat. */
441
499
  export interface OwnedGifts {
@@ -446,7 +504,7 @@ export interface OwnedGifts {
446
504
  /** Offset for the next request. If empty, then there are no more results */
447
505
  next_offset?: string;
448
506
  }
449
- /** Desribes price of a suggested post. */
507
+ /** Describes the price of a suggested post. */
450
508
  export interface SuggestedPostPrice {
451
509
  /** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
452
510
  currency: "XTR" | "TON";
package/settings.d.ts CHANGED
@@ -99,21 +99,21 @@ export interface BotCommandScopeAllChatAdministrators {
99
99
  export interface BotCommandScopeChat {
100
100
  /** Scope type, must be chat */
101
101
  type: "chat";
102
- /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
102
+ /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
103
103
  chat_id: number | string;
104
104
  }
105
105
  /** Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. */
106
106
  export interface BotCommandScopeChatAdministrators {
107
107
  /** Scope type, must be chat_administrators */
108
108
  type: "chat_administrators";
109
- /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
109
+ /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
110
110
  chat_id: number | string;
111
111
  }
112
112
  /** Represents the scope of bot commands, covering a specific member of a group or supergroup chat. */
113
113
  export interface BotCommandScopeChatMember {
114
114
  /** Scope type, must be chat_member */
115
115
  type: "chat_member";
116
- /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
116
+ /** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
117
117
  chat_id: number | string;
118
118
  /** Unique identifier of the target user */
119
119
  user_id: number;