@mtcute/core 0.27.2 → 0.27.4

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.
Files changed (139) hide show
  1. package/client.cjs +80 -68
  2. package/client.js +80 -68
  3. package/highlevel/base.cjs +4 -0
  4. package/highlevel/base.d.cts +1 -0
  5. package/highlevel/base.d.ts +1 -0
  6. package/highlevel/base.js +4 -0
  7. package/highlevel/client.d.cts +484 -420
  8. package/highlevel/client.d.ts +484 -420
  9. package/highlevel/methods/files/download-iterable.cjs +4 -0
  10. package/highlevel/methods/files/download-iterable.d.cts +11 -1
  11. package/highlevel/methods/files/download-iterable.d.ts +11 -1
  12. package/highlevel/methods/files/download-iterable.js +4 -0
  13. package/highlevel/methods/files/download-stream.cjs +14 -0
  14. package/highlevel/methods/files/download-stream.d.cts +13 -2
  15. package/highlevel/methods/files/download-stream.d.ts +13 -2
  16. package/highlevel/methods/files/download-stream.js +14 -0
  17. package/highlevel/methods/gifts/get-star-gift-upgrade-options.cjs +30 -0
  18. package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +12 -0
  19. package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +12 -0
  20. package/highlevel/methods/gifts/get-star-gift-upgrade-options.js +25 -0
  21. package/highlevel/methods/gifts/resolve-star-gift-offer.cjs +17 -0
  22. package/highlevel/methods/gifts/resolve-star-gift-offer.d.cts +18 -0
  23. package/highlevel/methods/gifts/resolve-star-gift-offer.d.ts +18 -0
  24. package/highlevel/methods/gifts/resolve-star-gift-offer.js +12 -0
  25. package/highlevel/methods/gifts/send-star-gift-offer.cjs +26 -0
  26. package/highlevel/methods/gifts/send-star-gift-offer.d.cts +26 -0
  27. package/highlevel/methods/gifts/send-star-gift-offer.d.ts +26 -0
  28. package/highlevel/methods/gifts/send-star-gift-offer.js +21 -0
  29. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.cjs +2 -5
  30. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.cts +2 -2
  31. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.ts +2 -2
  32. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.js +2 -5
  33. package/highlevel/methods/premium/_normalize-stars-amount.cjs +18 -0
  34. package/highlevel/methods/premium/_normalize-stars-amount.d.cts +12 -0
  35. package/highlevel/methods/premium/_normalize-stars-amount.d.ts +12 -0
  36. package/highlevel/methods/premium/_normalize-stars-amount.js +13 -0
  37. package/highlevel/methods.d.cts +23 -18
  38. package/highlevel/methods.d.ts +23 -18
  39. package/highlevel/types/media/document-utils.cjs +1 -1
  40. package/highlevel/types/media/document-utils.js +1 -1
  41. package/highlevel/types/media/voice.cjs +6 -1
  42. package/highlevel/types/media/voice.d.cts +4 -1
  43. package/highlevel/types/media/voice.d.ts +4 -1
  44. package/highlevel/types/media/voice.js +6 -1
  45. package/highlevel/types/messages/message-action.cjs +27 -4
  46. package/highlevel/types/messages/message-action.d.cts +28 -1
  47. package/highlevel/types/messages/message-action.d.ts +28 -1
  48. package/highlevel/types/messages/message-action.js +27 -4
  49. package/highlevel/types/premium/saved-star-gift.cjs +4 -0
  50. package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
  51. package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
  52. package/highlevel/types/premium/saved-star-gift.js +4 -0
  53. package/highlevel/types/premium/star-gift-unique.cjs +8 -0
  54. package/highlevel/types/premium/star-gift-unique.d.cts +4 -0
  55. package/highlevel/types/premium/star-gift-unique.d.ts +4 -0
  56. package/highlevel/types/premium/star-gift-unique.js +8 -0
  57. package/highlevel/types/premium/star-gift.cjs +12 -3
  58. package/highlevel/types/premium/star-gift.d.cts +5 -0
  59. package/highlevel/types/premium/star-gift.d.ts +5 -0
  60. package/highlevel/types/premium/star-gift.js +12 -3
  61. package/highlevel/types/premium/stars-transaction.cjs +6 -0
  62. package/highlevel/types/premium/stars-transaction.d.cts +6 -0
  63. package/highlevel/types/premium/stars-transaction.d.ts +6 -0
  64. package/highlevel/types/premium/stars-transaction.js +6 -0
  65. package/highlevel/updates/manager.cjs +7 -0
  66. package/highlevel/updates/manager.js +7 -0
  67. package/methods.cjs +40 -34
  68. package/methods.js +23 -17
  69. package/network/middlewares/internal-errors.cjs +5 -0
  70. package/network/middlewares/internal-errors.js +5 -0
  71. package/network/network-manager.cjs +1 -1
  72. package/network/network-manager.js +1 -1
  73. package/package.json +2 -2
  74. package/utils/binary/compat.cjs +12 -0
  75. package/utils/binary/compat.js +12 -0
  76. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.cjs +0 -0
  77. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.cts +0 -0
  78. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.ts +0 -0
  79. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.js +0 -0
  80. /package/highlevel/methods/{premium → gifts}/accept-star-gift.cjs +0 -0
  81. /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.cts +0 -0
  82. /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.ts +0 -0
  83. /package/highlevel/methods/{premium → gifts}/accept-star-gift.js +0 -0
  84. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.cjs +0 -0
  85. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.cts +0 -0
  86. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.ts +0 -0
  87. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.js +0 -0
  88. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.cjs +0 -0
  89. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.cts +0 -0
  90. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.ts +0 -0
  91. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.js +0 -0
  92. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.cjs +0 -0
  93. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.cts +0 -0
  94. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.ts +0 -0
  95. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.js +0 -0
  96. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.cjs +0 -0
  97. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.cts +0 -0
  98. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.ts +0 -0
  99. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.js +0 -0
  100. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.cjs +0 -0
  101. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.cts +0 -0
  102. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.ts +0 -0
  103. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.js +0 -0
  104. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.cjs +0 -0
  105. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.cts +0 -0
  106. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.ts +0 -0
  107. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.js +0 -0
  108. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.cjs +0 -0
  109. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.cts +0 -0
  110. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.ts +0 -0
  111. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.js +0 -0
  112. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.cjs +0 -0
  113. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.cts +0 -0
  114. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.ts +0 -0
  115. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.js +0 -0
  116. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.cjs +0 -0
  117. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.cts +0 -0
  118. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.ts +0 -0
  119. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.js +0 -0
  120. /package/highlevel/methods/{premium → gifts}/pin-star-gift.cjs +0 -0
  121. /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.cts +0 -0
  122. /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.ts +0 -0
  123. /package/highlevel/methods/{premium → gifts}/pin-star-gift.js +0 -0
  124. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.cjs +0 -0
  125. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.cts +0 -0
  126. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.ts +0 -0
  127. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.js +0 -0
  128. /package/highlevel/methods/{premium → gifts}/send-star-gift.cjs +0 -0
  129. /package/highlevel/methods/{premium → gifts}/send-star-gift.d.cts +0 -0
  130. /package/highlevel/methods/{premium → gifts}/send-star-gift.d.ts +0 -0
  131. /package/highlevel/methods/{premium → gifts}/send-star-gift.js +0 -0
  132. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.cjs +0 -0
  133. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.cts +0 -0
  134. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.ts +0 -0
  135. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.js +0 -0
  136. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.cjs +0 -0
  137. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.cts +0 -0
  138. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.ts +0 -0
  139. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.js +0 -0
@@ -7,6 +7,8 @@ import { ITelegramClient } from './client.types.js';
7
7
  import { LogOutResult } from './methods/auth/log-out.js';
8
8
  import { CreateGroupResult } from './methods/chats/create-group.js';
9
9
  import { GetForumTopicsOffset, getForumTopics } from './methods/forums/get-forum-topics.js';
10
+ import { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/gifts/get-resale-star-gifts.js';
11
+ import { StarGiftUpgradeOptions } from './methods/gifts/get-star-gift-upgrade-options.js';
10
12
  import { GetInviteLinksOffset, getInviteLinks } from './methods/invite-links/get-invite-links.js';
11
13
  import { DeleteMessagesParams } from './methods/messages/delete-messages.js';
12
14
  import { ForwardMessageOptions } from './methods/messages/forward-messages.js';
@@ -20,8 +22,8 @@ import { CommonSendParams } from './methods/messages/send-common.js';
20
22
  import { SendCopyGroupParams } from './methods/messages/send-copy-group.js';
21
23
  import { SendCopyParams } from './methods/messages/send-copy.js';
22
24
  import { QuoteParamsFrom } from './methods/messages/send-quote.js';
25
+ import { InputStarsAmount } from './methods/premium/_normalize-stars-amount.js';
23
26
  import { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
24
- import { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/premium/get-resale-star-gifts.js';
25
27
  import { CanSendStoryResult } from './methods/stories/can-send-story.js';
26
28
  import { ITelegramStorageProvider } from './storage/provider.js';
27
29
  import { AllStories, ArrayPaginated, ArrayPaginatedWithMeta, ArrayWithTotal, Audio, Boost, BoostSlot, BoostStats, BotChatJoinRequestUpdate, BotCommands, BotReactionCountUpdate, BotReactionUpdate, BotStoppedUpdate, BusinessCallbackQuery, BusinessChatLink, BusinessConnection, BusinessMessage, BusinessWorkHoursDay, CallbackQuery, Chat, ChatEvent, ChatInviteLink, ChatInviteLinkMember, ChatJoinRequestUpdate, ChatlistPreview, ChatMember, ChatMemberUpdate, ChatPreview, ChosenInlineResult, CollectibleInfo, DeleteBusinessMessageUpdate, DeleteMessageUpdate, DeleteStoryUpdate, Dialog, FactCheck, FileDownloadLocation, FileDownloadParameters, ForumTopic, FullChat, FullUser, GameHighScore, HistoryReadUpdate, InlineCallbackQuery, InlineQuery, InputChatEventFilters, InputDialogFolder, InputDocumentId, InputFileLike, InputInlineResult, InputMediaAudio, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStarGift, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, Peer, PeerReaction, PeerSettings, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SavedStarGift, SentCode, StarGift, StarGiftUnique, StarGiftValue, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStatusUpdate, UserTypingUpdate, WebPageMedia, WebviewResult } from './types/index.js';
@@ -31,12 +33,12 @@ import { InputStringSessionData } from './utils/string-session.js';
31
33
  import { Emitter } from '@fuman/utils';
32
34
  import { getChatEventLog } from './methods/chats/get-chat-event-log.js';
33
35
  import { getChatMembers } from './methods/chats/get-chat-members.js';
36
+ import { getSavedStarGifts } from './methods/gifts/get-saved-star-gifts.js';
34
37
  import { getInviteLinkMembers } from './methods/invite-links/get-invite-link-members.js';
35
38
  import { sendMediaGroup } from './methods/messages/send-media-group.js';
36
39
  import { sendMedia } from './methods/messages/send-media.js';
37
40
  import { sendText } from './methods/messages/send-text.js';
38
41
  import { getBoosts } from './methods/premium/get-boosts.js';
39
- import { getSavedStarGifts } from './methods/premium/get-saved-star-gifts.js';
40
42
  import { getStarsTransactions } from './methods/premium/get-stars-transactions.js';
41
43
  import { getAllStories } from './methods/stories/get-all-stories.js';
42
44
  import { getProfileStories } from './methods/stories/get-profile-stories.js';
@@ -2033,7 +2035,16 @@ export interface TelegramClient extends ITelegramClient {
2033
2035
  *
2034
2036
  * @param params Download parameters
2035
2037
  */
2036
- downloadAsIterable(input: FileDownloadLocation, params?: FileDownloadParameters): AsyncIterableIterator<Uint8Array>;
2038
+ downloadAsIterable(input: FileDownloadLocation, params?: FileDownloadParameters & {
2039
+ /**
2040
+ * A function to apply backpressure to the download.
2041
+ *
2042
+ * If the consumer isn't keeping up, the function is supposed to return a promise that resolves when the consumer is ready to receive more data.
2043
+ *
2044
+ * Note that this function will likely get called multiple times simultaneously, since the download is parallelized.
2045
+ */
2046
+ throttle?: (chunkSize: number) => MaybePromise<void>;
2047
+ }): AsyncIterableIterator<Uint8Array>;
2037
2048
  /**
2038
2049
  * Download a remote file as a Node.js Readable stream.
2039
2050
  *
@@ -2043,14 +2054,25 @@ export interface TelegramClient extends ITelegramClient {
2043
2054
  */
2044
2055
  downloadAsNodeStream(location: FileDownloadLocation, params?: FileDownloadParameters): import('node:stream').Readable;
2045
2056
  /**
2046
- * Download a file and return it as a `@fuman/io` stream,
2057
+ * Download a file and return it as a Web Stream,
2047
2058
  * streaming file contents.
2048
2059
  *
2049
2060
  * **Available**: ✅ both users and bots
2050
2061
  *
2051
2062
  * @param params File download parameters
2052
2063
  */
2053
- downloadAsStream(location: FileDownloadLocation, params?: FileDownloadParameters): ReadableStream<Uint8Array>;
2064
+ downloadAsStream(location: FileDownloadLocation, params?: FileDownloadParameters & {
2065
+ /**
2066
+ * If passed, the maximum number of bytes that can be buffered in the stream.
2067
+ *
2068
+ * If the consumer isn't keeping up, the stream will pause until the buffer is below this limit.
2069
+ *
2070
+ * Note that this parameter is not guaranteed to be strictly the maximum number of bytes
2071
+ * buffered at once, since the underlying download is parallelized, and is treated merely as a hint.
2072
+ * The actual number of bytes buffered at once can be as much as `partSize * numWorkers`
2073
+ */
2074
+ highWaterMark?: number;
2075
+ }): ReadableStream<Uint8Array>;
2054
2076
  /**
2055
2077
  * Normalize a {@link InputFileLike} to `InputFile`,
2056
2078
  * uploading it if needed.
@@ -2378,194 +2400,501 @@ export interface TelegramClient extends ITelegramClient {
2378
2400
  */
2379
2401
  shouldDispatch?: true;
2380
2402
  }): Promise<Message>;
2403
+ _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
2381
2404
  /**
2382
- * Create an additional invite link for the chat.
2383
- *
2384
- * You must be an administrator and have appropriate rights.
2405
+ * Accept, hide or convert a star gift.
2385
2406
  *
2386
2407
  * **Available**: 👤 users only
2387
2408
  *
2388
- * @param chatId Chat ID
2389
- * @param params
2409
+ * @returns Whether the action was successful
2390
2410
  */
2391
- createInviteLink(chatId: InputPeerLike, params?: {
2392
- /**
2393
- * Date when this link will expire.
2394
- * If `number` is passed, UNIX time in ms is expected.
2395
- */
2396
- expires?: number | Date;
2397
- /**
2398
- * Maximum number of users that can be members of this chat
2399
- * at the same time after joining using this link.
2400
- *
2401
- * Integer in range `[1, 99999]` or `Infinity`
2402
- *
2403
- * @default `Infinity`
2404
- */
2405
- usageLimit?: number;
2411
+ acceptStarGift(params: {
2412
+ /** Input star gift to accept */
2413
+ gift: InputStarGift;
2406
2414
  /**
2407
- * Whether users to be joined via this link need to be
2408
- * approved by an admin
2415
+ * Action to perform on the gift.
2416
+ * - `save` - save the gift to your profile
2417
+ * - `hide` - hide the gift from your profile
2418
+ * - `convert` - convert the gift to stars (can't be undone)
2409
2419
  */
2410
- withApproval?: boolean;
2420
+ action: 'save' | 'hide' | 'convert';
2421
+ }): Promise<boolean>;
2422
+ buyResaleGift(params: {
2423
+ /** Slug of the star gift to buy */
2424
+ slug: string;
2425
+ /** ID of the user to buy the gift for */
2426
+ recipient: InputPeerLike;
2411
2427
  /**
2412
- * When a pricing plan is passed, this link will become a paid subscription link
2413
- *
2414
- * Currently the only allowed `.period` is 1 month, i.e. `2592000`
2428
+ * Whether to dispatch the new message event
2429
+ * to the client's update handler.
2415
2430
  */
2416
- subscriptionPricing?: tl.TypeStarsSubscriptionPricing;
2417
- }): Promise<ChatInviteLink>;
2431
+ shouldDispatch?: true;
2432
+ /** Whether to use TON currency for payment */
2433
+ ton?: boolean;
2434
+ }): Promise<Message | null>;
2418
2435
  /**
2419
- * Edit an invite link. You can only edit non-primary
2420
- * invite links.
2421
- *
2422
- * Only pass the fields that you want to modify.
2423
- *
2436
+ * Get a list of star gifts up for resale
2424
2437
  * **Available**: 👤 users only
2425
2438
  *
2426
- * @param chatId Chat ID
2427
- * @param link Invite link to edit
2428
- * @param params
2429
- * @returns Modified invite link
2430
2439
  */
2431
- editInviteLink(params: {
2432
- /** Chat ID */
2433
- chatId: InputPeerLike;
2434
- /** Invite link to edit */
2435
- link: string | ChatInviteLink;
2436
- /**
2437
- * Date when this link will expire.
2438
- * If `number` is passed, UNIX time in ms is expected.
2439
- */
2440
- expires?: number | Date;
2440
+ getStarGiftResaleOptions(params: {
2441
+ /** ID of the gift to get resale options for */
2442
+ giftId: tl.Long;
2441
2443
  /**
2442
- * Maximum number of users that can be members of this chat
2443
- * at the same time after joining using this link.
2444
+ * Sorting attribute
2444
2445
  *
2445
- * Integer in range `[1, 99999]` or `Infinity`,
2446
+ * - `price`: Sort by price
2447
+ * - `num`: Sort by its unique number
2446
2448
  */
2447
- usageLimit?: number;
2449
+ sort?: 'price' | 'num';
2448
2450
  /**
2449
- * Whether users to be joined via this link need to be
2450
- * approved by an admin
2451
+ * Hash of the `attributes` field, as returned by the server in the first response
2451
2452
  */
2452
- withApproval?: boolean;
2453
- }): Promise<ChatInviteLink>;
2453
+ attributesHash?: Long;
2454
+ /** Attributes to filter for */
2455
+ attributes?: tl.TypeStarGiftAttributeId[] | InputStarGiftAttributeIds;
2456
+ /** Offset for pagination */
2457
+ offset?: string;
2458
+ /** Limit for pagination */
2459
+ limit?: number;
2460
+ }): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
2461
+ /** Get one or more saved star gifts by their IDs */
2462
+ getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
2454
2463
  /**
2455
- * Generate a new primary invite link for a chat,
2456
- * old primary link is revoked.
2457
- *
2458
- * > **Note**: each administrator has their own primary invite link,
2459
- * > and bots by default don't have one.
2464
+ * Get a list of saved star gifts of a user/channel
2460
2465
  *
2466
+ * Note that filters currently only work for channels
2461
2467
  * **Available**: 👤 users only
2462
2468
  *
2463
- * @param chatId Chat IDs
2464
2469
  */
2465
- exportInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2470
+ getSavedStarGifts(params: {
2471
+ /** Peer to get saved gifts from */
2472
+ owner: InputPeerLike;
2473
+ /** Whether to exclude hidden gifts */
2474
+ excludeHidden?: boolean;
2475
+ /** Whether to exclude publicly visible gifts */
2476
+ excludePublic?: boolean;
2477
+ /** Whether to exclude gifts with unlimited availability */
2478
+ excludeUnlimited?: boolean;
2479
+ /** Whether to exclude unique gifts */
2480
+ excludeUnique?: boolean;
2481
+ /** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
2482
+ excludeUnupgradable?: boolean;
2483
+ /** Whether to exclude gifts that can be upgraded */
2484
+ excludeUpgradable?: boolean;
2485
+ /** Whether to exclude "hosted" gifts (i.e. those that are actually stored on the TON blockchain) */
2486
+ excludeHosted?: boolean;
2487
+ /** Whether to only return gifts with peer color available */
2488
+ peerColorAvailable?: boolean;
2489
+ /** ID of the collection to get gifts from */
2490
+ collectionId?: number;
2491
+ /** Whether to sort by value */
2492
+ sortByValue?: boolean;
2493
+ /** Offset for pagination */
2494
+ offset?: string;
2495
+ /** Limit for pagination */
2496
+ limit?: number;
2497
+ }): Promise<ArrayPaginated<SavedStarGift, string>>;
2466
2498
  /**
2467
- * Iterate over users who have joined
2468
- * the chat with the given invite link.
2469
- *
2499
+ * Get the list of available star gifts.
2470
2500
  * **Available**: 👤 users only
2471
2501
  *
2472
- * @param chatId Chat ID
2473
- * @param params Additional params
2474
2502
  */
2475
- getInviteLinkMembers(chatId: InputPeerLike, params?: {
2476
- /**
2477
- * Invite link for which to get members
2478
- */
2479
- link?: string | ChatInviteLink;
2480
- /**
2481
- * Maximum number of users to return
2482
- *
2483
- * @default 100
2484
- */
2485
- limit?: number;
2486
- /**
2487
- * Offset request/join date used as an anchor for pagination.
2488
- */
2489
- offsetDate?: Date | number;
2490
- /**
2491
- * Offset user used as an anchor for pagination
2492
- */
2493
- offsetUser?: tl.TypeInputUser;
2494
- /**
2495
- * Whether to get users who have requested to join
2496
- * the chat but weren't accepted yet
2497
- */
2498
- requested?: boolean;
2499
- /**
2500
- * Search for a user in the pending join requests list
2501
- * (if passed, {@link requested} is assumed to be true)
2502
- *
2503
- * Doesn't work when {@link link} is set (Telegram limitation)
2504
- */
2505
- requestedSearch?: string;
2506
- }): Promise<ArrayPaginated<ChatInviteLinkMember, {
2507
- date: number;
2508
- user: tl.TypeInputUser;
2509
- }>>;
2503
+ getStarGiftOptions(): Promise<StarGift[]>;
2510
2504
  /**
2511
- * Get detailed information about an invite link
2512
- *
2505
+ * Get a list of all possible attributes when upgrading a given star gift
2506
+ */
2507
+ getStarGiftUpgradeOptions(giftId: tl.Long): Promise<StarGiftUpgradeOptions>;
2508
+ /**
2509
+ * Get the value of a unique star gift
2513
2510
  * **Available**: 👤 users only
2514
2511
  *
2515
- * @param chatId Chat ID
2516
- * @param link The invite link
2517
2512
  */
2518
- getInviteLink(chatId: InputPeerLike, link: string): Promise<ChatInviteLink>;
2513
+ getStarGiftValue(params: {
2514
+ /** Slug of the star gift */
2515
+ slug: string;
2516
+ }): Promise<StarGiftValue>;
2517
+ getStarGiftWithdrawalUrl(params: {
2518
+ /** The star gift to withdraw */
2519
+ gift: InputStarGift;
2520
+ /** 2FA password */
2521
+ password: string;
2522
+ }): Promise<string>;
2519
2523
  /**
2520
- * Get invite links created by some administrator in the chat.
2521
- *
2522
- * As an administrator you can only get your own links
2523
- * (i.e. `adminId = "self"`), as a creator you can get
2524
- * any other admin's links.
2524
+ * Get information about a unique star gift by its slug
2525
+ * **Available**: 👤 users only
2525
2526
  *
2527
+ */
2528
+ getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
2529
+ /**
2530
+ * Iterate over saved star gifts of a user,
2531
+ * wrapper over {@link getSavedStarGifts}
2526
2532
  * **Available**: 👤 users only
2527
2533
  *
2528
- * @param chatId Chat ID
2529
- * @param adminId Admin who created the links
2530
- * @param params
2531
2534
  */
2532
- getInviteLinks(chatId: InputPeerLike, params?: {
2535
+ iterSavedStarGifts(params: Parameters<typeof getSavedStarGifts>[1] & {
2533
2536
  /**
2534
- * Only return this admin's links.
2537
+ * Number of gifts to fetch per request
2535
2538
  *
2536
- * @default `"self"`
2537
- */
2538
- admin?: InputPeerLike;
2539
- /**
2540
- * Whether to fetch revoked invite links
2539
+ * @default 100
2541
2540
  */
2542
- revoked?: boolean;
2541
+ chunkSize?: number;
2543
2542
  /**
2544
- * Limit the number of invite links to be fetched.
2543
+ * Total number of gifts to fetch
2545
2544
  *
2546
- * @default 100
2545
+ * @default Infinity
2547
2546
  */
2548
2547
  limit?: number;
2549
- /**
2550
- * Offset for pagination.
2551
- */
2552
- offset?: GetInviteLinksOffset;
2553
- }): Promise<ArrayPaginated<ChatInviteLink, GetInviteLinksOffset>>;
2548
+ }): AsyncIterableIterator<SavedStarGift>;
2554
2549
  /**
2555
- * Get primary invite link of a chat
2556
- *
2550
+ * Toggles whether one or more star gift is pinned to the top of the list
2557
2551
  * **Available**: 👤 users only
2558
2552
  *
2559
- * @param chatId Chat ID
2560
2553
  */
2561
- getPrimaryInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2554
+ togglePinnedStarGifts(params: {
2555
+ /** One or more gifts to pin */
2556
+ gifts: MaybeArray<InputStarGift>;
2557
+ /** Peer where the gift is sent */
2558
+ peer: InputPeerLike;
2559
+ }): Promise<void>;
2562
2560
  /**
2563
- * Approve or decline multiple join requests to a chat.
2564
- * **Available**: 👤 users only
2561
+ * Pay for other user's star gift upgrade.
2565
2562
  *
2566
- */
2567
- hideAllJoinRequests(params: {
2568
- /** Chat/channel ID */
2563
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2564
+ * > as this method hides the actual invoice and payment form from the user.
2565
+ * > For GUI clients, you should refer to the method's source code and
2566
+ * > present the payment form to the user.
2567
+ *
2568
+ * **Available**: 👤 users only
2569
+ *
2570
+ * @returns Service message about the payment for the upgrade, if one was generated.
2571
+ */
2572
+ prepayStarGiftUpgrade(params: {
2573
+ peer: InputPeerLike;
2574
+ /** Prepaid upgrade hash, taken from `SavedStarGift.prepaidUpgradeHash` */
2575
+ hash: string;
2576
+ /**
2577
+ * Whether to dispatch the new message event
2578
+ * to the client's update handler.
2579
+ */
2580
+ shouldDispatch?: true;
2581
+ }): Promise<Message | null>;
2582
+ /**
2583
+ * Accept or decline a purchase offer for a star gift
2584
+ *
2585
+ * @returns The generated service message
2586
+ */
2587
+ resolveStarGiftOffer(options: {
2588
+ /** ID of the message containing the offer */
2589
+ message: number;
2590
+ /** Whether to accept or decline the offer */
2591
+ action: 'accept' | 'decline';
2592
+ /**
2593
+ * Whether to dispatch the new message event
2594
+ * to the client's update handler.
2595
+ */
2596
+ shouldDispatch?: true;
2597
+ }): Promise<Message>;
2598
+ /**
2599
+ * Create a purchase offer for a unique star gift
2600
+ * @param client
2601
+ * @param params
2602
+ */
2603
+ sendStarGiftOffer(params: {
2604
+ /** ID of the peer to send the offer to */
2605
+ peerId: InputPeerLike;
2606
+ /** Slug of the star gift to create an offer for */
2607
+ slug: string;
2608
+ /** Amount of stars to offer */
2609
+ price: InputStarsAmount;
2610
+ /** Duration of the offer in seconds */
2611
+ duration: number;
2612
+ /** When the recipient has paid messages enabled, the maximum number of stars that you are willing to spend */
2613
+ allowPaidMessages?: tl.Long;
2614
+ /**
2615
+ * Whether to dispatch the new message event
2616
+ * to the client's update handler.
2617
+ */
2618
+ shouldDispatch?: true;
2619
+ }): Promise<Message>;
2620
+ /**
2621
+ * Send a star gift to a user.
2622
+ *
2623
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2624
+ * > as this method hides the actual invoice and payment form from the user.
2625
+ * > For GUI clients, you should refer to the method's source code and
2626
+ * > present the payment form to the user.
2627
+ *
2628
+ * **Available**: 👤 users only
2629
+ *
2630
+ * @returns Service message about the sent gift, if one was generated.
2631
+ */
2632
+ sendStarGift(params: {
2633
+ /** ID of the peer to send the gift to */
2634
+ peerId: InputPeerLike;
2635
+ /** ID of the gift to send */
2636
+ gift: Long | StarGift;
2637
+ /**
2638
+ * Whether to send the gift anonymously
2639
+ * (i.e. if the recipient chooses to display the gift
2640
+ * on their profile, your name won't be visible)
2641
+ */
2642
+ anonymous?: boolean;
2643
+ /** Message to send along with the gift */
2644
+ message?: InputText;
2645
+ /** Whether to automatically upgrade the gift to a unique star gift */
2646
+ withUpgrade?: boolean;
2647
+ /**
2648
+ * Whether to dispatch the new message event
2649
+ * to the client's update handler.
2650
+ */
2651
+ shouldDispatch?: true;
2652
+ }): Promise<Message | null>;
2653
+ /** Set resale price for an owned star gift */
2654
+ setResaleStarGiftPrice(params: {
2655
+ /** Star gift to update the price of */
2656
+ gift: InputStarGift;
2657
+ /**
2658
+ * New price of the gift (in stars), or `null` to unlist
2659
+ */
2660
+ price: InputStarsAmount | null;
2661
+ }): Promise<void>;
2662
+ /**
2663
+ * Transfer a unique star gift.
2664
+ *
2665
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2666
+ * > as this method hides the actual invoice and payment form from the user.
2667
+ * > For GUI clients, you should refer to the method's source code and
2668
+ * > present the payment form to the user.
2669
+ *
2670
+ * **Available**: 👤 users only
2671
+ *
2672
+ * @returns Service message about the transferred gift, if one was generated.
2673
+ */
2674
+ transferStarGift(params: {
2675
+ /** Star gift to transfer */
2676
+ gift: InputStarGift;
2677
+ /** ID of the user to transfer the gift to */
2678
+ recipient: InputPeerLike;
2679
+ /**
2680
+ * Whether to dispatch the new message event
2681
+ * to the client's update handler.
2682
+ */
2683
+ shouldDispatch?: true;
2684
+ }): Promise<Message | null>;
2685
+ /**
2686
+ * Upgrades a star gift to a unique gift.
2687
+ *
2688
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2689
+ * > as this method hides the actual invoice and payment form from the user.
2690
+ * > For GUI clients, you should refer to the method's source code and
2691
+ * > present the payment form to the user.
2692
+ *
2693
+ * **Available**: 👤 users only
2694
+ *
2695
+ * @returns Service message about the upgraded gift, if one was generated.
2696
+ */
2697
+ upgradeStarGift(params: {
2698
+ gift: InputStarGift;
2699
+ /**
2700
+ * Whether to retain the original details of the gift
2701
+ * (like sender, recipient, date, message)
2702
+ */
2703
+ keepOriginalDetails?: boolean;
2704
+ /**
2705
+ * Whether to dispatch the new message event
2706
+ * to the client's update handler.
2707
+ */
2708
+ shouldDispatch?: true;
2709
+ }): Promise<Message | null>;
2710
+ /**
2711
+ * Create an additional invite link for the chat.
2712
+ *
2713
+ * You must be an administrator and have appropriate rights.
2714
+ *
2715
+ * **Available**: 👤 users only
2716
+ *
2717
+ * @param chatId Chat ID
2718
+ * @param params
2719
+ */
2720
+ createInviteLink(chatId: InputPeerLike, params?: {
2721
+ /**
2722
+ * Date when this link will expire.
2723
+ * If `number` is passed, UNIX time in ms is expected.
2724
+ */
2725
+ expires?: number | Date;
2726
+ /**
2727
+ * Maximum number of users that can be members of this chat
2728
+ * at the same time after joining using this link.
2729
+ *
2730
+ * Integer in range `[1, 99999]` or `Infinity`
2731
+ *
2732
+ * @default `Infinity`
2733
+ */
2734
+ usageLimit?: number;
2735
+ /**
2736
+ * Whether users to be joined via this link need to be
2737
+ * approved by an admin
2738
+ */
2739
+ withApproval?: boolean;
2740
+ /**
2741
+ * When a pricing plan is passed, this link will become a paid subscription link
2742
+ *
2743
+ * Currently the only allowed `.period` is 1 month, i.e. `2592000`
2744
+ */
2745
+ subscriptionPricing?: tl.TypeStarsSubscriptionPricing;
2746
+ }): Promise<ChatInviteLink>;
2747
+ /**
2748
+ * Edit an invite link. You can only edit non-primary
2749
+ * invite links.
2750
+ *
2751
+ * Only pass the fields that you want to modify.
2752
+ *
2753
+ * **Available**: 👤 users only
2754
+ *
2755
+ * @param chatId Chat ID
2756
+ * @param link Invite link to edit
2757
+ * @param params
2758
+ * @returns Modified invite link
2759
+ */
2760
+ editInviteLink(params: {
2761
+ /** Chat ID */
2762
+ chatId: InputPeerLike;
2763
+ /** Invite link to edit */
2764
+ link: string | ChatInviteLink;
2765
+ /**
2766
+ * Date when this link will expire.
2767
+ * If `number` is passed, UNIX time in ms is expected.
2768
+ */
2769
+ expires?: number | Date;
2770
+ /**
2771
+ * Maximum number of users that can be members of this chat
2772
+ * at the same time after joining using this link.
2773
+ *
2774
+ * Integer in range `[1, 99999]` or `Infinity`,
2775
+ */
2776
+ usageLimit?: number;
2777
+ /**
2778
+ * Whether users to be joined via this link need to be
2779
+ * approved by an admin
2780
+ */
2781
+ withApproval?: boolean;
2782
+ }): Promise<ChatInviteLink>;
2783
+ /**
2784
+ * Generate a new primary invite link for a chat,
2785
+ * old primary link is revoked.
2786
+ *
2787
+ * > **Note**: each administrator has their own primary invite link,
2788
+ * > and bots by default don't have one.
2789
+ *
2790
+ * **Available**: 👤 users only
2791
+ *
2792
+ * @param chatId Chat IDs
2793
+ */
2794
+ exportInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2795
+ /**
2796
+ * Iterate over users who have joined
2797
+ * the chat with the given invite link.
2798
+ *
2799
+ * **Available**: 👤 users only
2800
+ *
2801
+ * @param chatId Chat ID
2802
+ * @param params Additional params
2803
+ */
2804
+ getInviteLinkMembers(chatId: InputPeerLike, params?: {
2805
+ /**
2806
+ * Invite link for which to get members
2807
+ */
2808
+ link?: string | ChatInviteLink;
2809
+ /**
2810
+ * Maximum number of users to return
2811
+ *
2812
+ * @default 100
2813
+ */
2814
+ limit?: number;
2815
+ /**
2816
+ * Offset request/join date used as an anchor for pagination.
2817
+ */
2818
+ offsetDate?: Date | number;
2819
+ /**
2820
+ * Offset user used as an anchor for pagination
2821
+ */
2822
+ offsetUser?: tl.TypeInputUser;
2823
+ /**
2824
+ * Whether to get users who have requested to join
2825
+ * the chat but weren't accepted yet
2826
+ */
2827
+ requested?: boolean;
2828
+ /**
2829
+ * Search for a user in the pending join requests list
2830
+ * (if passed, {@link requested} is assumed to be true)
2831
+ *
2832
+ * Doesn't work when {@link link} is set (Telegram limitation)
2833
+ */
2834
+ requestedSearch?: string;
2835
+ }): Promise<ArrayPaginated<ChatInviteLinkMember, {
2836
+ date: number;
2837
+ user: tl.TypeInputUser;
2838
+ }>>;
2839
+ /**
2840
+ * Get detailed information about an invite link
2841
+ *
2842
+ * **Available**: 👤 users only
2843
+ *
2844
+ * @param chatId Chat ID
2845
+ * @param link The invite link
2846
+ */
2847
+ getInviteLink(chatId: InputPeerLike, link: string): Promise<ChatInviteLink>;
2848
+ /**
2849
+ * Get invite links created by some administrator in the chat.
2850
+ *
2851
+ * As an administrator you can only get your own links
2852
+ * (i.e. `adminId = "self"`), as a creator you can get
2853
+ * any other admin's links.
2854
+ *
2855
+ * **Available**: 👤 users only
2856
+ *
2857
+ * @param chatId Chat ID
2858
+ * @param adminId Admin who created the links
2859
+ * @param params
2860
+ */
2861
+ getInviteLinks(chatId: InputPeerLike, params?: {
2862
+ /**
2863
+ * Only return this admin's links.
2864
+ *
2865
+ * @default `"self"`
2866
+ */
2867
+ admin?: InputPeerLike;
2868
+ /**
2869
+ * Whether to fetch revoked invite links
2870
+ */
2871
+ revoked?: boolean;
2872
+ /**
2873
+ * Limit the number of invite links to be fetched.
2874
+ *
2875
+ * @default 100
2876
+ */
2877
+ limit?: number;
2878
+ /**
2879
+ * Offset for pagination.
2880
+ */
2881
+ offset?: GetInviteLinksOffset;
2882
+ }): Promise<ArrayPaginated<ChatInviteLink, GetInviteLinksOffset>>;
2883
+ /**
2884
+ * Get primary invite link of a chat
2885
+ *
2886
+ * **Available**: 👤 users only
2887
+ *
2888
+ * @param chatId Chat ID
2889
+ */
2890
+ getPrimaryInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2891
+ /**
2892
+ * Approve or decline multiple join requests to a chat.
2893
+ * **Available**: 👤 users only
2894
+ *
2895
+ */
2896
+ hideAllJoinRequests(params: {
2897
+ /** Chat/channel ID */
2569
2898
  chatId: InputPeerLike;
2570
2899
  /** Whether to approve or decline the join requests */
2571
2900
  action: 'approve' | 'decline';
@@ -3902,36 +4231,17 @@ export interface TelegramClient extends ITelegramClient {
3902
4231
  /**
3903
4232
  * Cancel the code that was sent to verify an email to use as 2FA recovery method
3904
4233
  * **Available**: 👤 users only
3905
- *
3906
- */
3907
- cancelPasswordEmail(): Promise<void>;
3908
- /**
3909
- * Remove 2FA password from your account
3910
- *
3911
- * **Available**: 👤 users only
3912
- *
3913
- * @param password 2FA password as plaintext
3914
- */
3915
- removeCloudPassword(password: string): Promise<void>;
3916
- _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
3917
- /**
3918
- * Accept, hide or convert a star gift.
3919
- *
3920
- * **Available**: 👤 users only
3921
- *
3922
- * @returns Whether the action was successful
3923
- */
3924
- acceptStarGift(params: {
3925
- /** Input star gift to accept */
3926
- gift: InputStarGift;
3927
- /**
3928
- * Action to perform on the gift.
3929
- * - `save` - save the gift to your profile
3930
- * - `hide` - hide the gift from your profile
3931
- * - `convert` - convert the gift to stars (can't be undone)
3932
- */
3933
- action: 'save' | 'hide' | 'convert';
3934
- }): Promise<boolean>;
4234
+ *
4235
+ */
4236
+ cancelPasswordEmail(): Promise<void>;
4237
+ /**
4238
+ * Remove 2FA password from your account
4239
+ *
4240
+ * **Available**: 👤 users only
4241
+ *
4242
+ * @param password 2FA password as plaintext
4243
+ */
4244
+ removeCloudPassword(password: string): Promise<void>;
3935
4245
  /**
3936
4246
  * Boost a given channel
3937
4247
  *
@@ -3940,19 +4250,6 @@ export interface TelegramClient extends ITelegramClient {
3940
4250
  * @param peerId Peer ID to boost
3941
4251
  */
3942
4252
  applyBoost(peerId: InputPeerLike): Promise<void>;
3943
- buyResaleGift(params: {
3944
- /** Slug of the star gift to buy */
3945
- slug: string;
3946
- /** ID of the user to buy the gift for */
3947
- recipient: InputPeerLike;
3948
- /**
3949
- * Whether to dispatch the new message event
3950
- * to the client's update handler.
3951
- */
3952
- shouldDispatch?: true;
3953
- /** Whether to use TON currency for payment */
3954
- ton?: boolean;
3955
- }): Promise<Message | null>;
3956
4253
  /**
3957
4254
  * Check if the current user can apply boost to some channel
3958
4255
  *
@@ -4048,90 +4345,6 @@ export interface TelegramClient extends ITelegramClient {
4048
4345
  *
4049
4346
  */
4050
4347
  getMyBoostSlots(): Promise<BoostSlot[]>;
4051
- /**
4052
- * Get a list of star gifts up for resale
4053
- * **Available**: 👤 users only
4054
- *
4055
- */
4056
- getStarGiftResaleOptions(params: {
4057
- /** ID of the gift to get resale options for */
4058
- giftId: tl.Long;
4059
- /**
4060
- * Sorting attribute
4061
- *
4062
- * - `price`: Sort by price
4063
- * - `num`: Sort by its unique number
4064
- */
4065
- sort?: 'price' | 'num';
4066
- /**
4067
- * Hash of the `attributes` field, as returned by the server in the first response
4068
- */
4069
- attributesHash?: Long;
4070
- /** Attributes to filter for */
4071
- attributes?: tl.TypeStarGiftAttributeId[] | InputStarGiftAttributeIds;
4072
- /** Offset for pagination */
4073
- offset?: string;
4074
- /** Limit for pagination */
4075
- limit?: number;
4076
- }): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
4077
- /** Get one or more saved star gifts by their IDs */
4078
- getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
4079
- /**
4080
- * Get a list of saved star gifts of a user/channel
4081
- *
4082
- * Note that filters currently only work for channels
4083
- * **Available**: 👤 users only
4084
- *
4085
- */
4086
- getSavedStarGifts(params: {
4087
- /** Peer to get saved gifts from */
4088
- owner: InputPeerLike;
4089
- /** Whether to exclude hidden gifts */
4090
- excludeHidden?: boolean;
4091
- /** Whether to exclude publicly visible gifts */
4092
- excludePublic?: boolean;
4093
- /** Whether to exclude gifts with unlimited availability */
4094
- excludeUnlimited?: boolean;
4095
- /** Whether to exclude unique gifts */
4096
- excludeUnique?: boolean;
4097
- /** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
4098
- excludeUnupgradable?: boolean;
4099
- /** Whether to exclude gifts that can be upgraded */
4100
- excludeUpgradable?: boolean;
4101
- /** Whether to exclude "hosted" gifts (i.e. those that are actually stored on the TON blockchain) */
4102
- excludeHosted?: boolean;
4103
- /** Whether to only return gifts with peer color available */
4104
- peerColorAvailable?: boolean;
4105
- /** ID of the collection to get gifts from */
4106
- collectionId?: number;
4107
- /** Whether to sort by value */
4108
- sortByValue?: boolean;
4109
- /** Offset for pagination */
4110
- offset?: string;
4111
- /** Limit for pagination */
4112
- limit?: number;
4113
- }): Promise<ArrayPaginated<SavedStarGift, string>>;
4114
- /**
4115
- * Get the list of available star gifts.
4116
- * **Available**: 👤 users only
4117
- *
4118
- */
4119
- getStarGiftOptions(): Promise<StarGift[]>;
4120
- /**
4121
- * Get the value of a unique star gift
4122
- * **Available**: 👤 users only
4123
- *
4124
- */
4125
- getStarGiftValue(params: {
4126
- /** Slug of the star gift */
4127
- slug: string;
4128
- }): Promise<StarGiftValue>;
4129
- getStarGiftWithdrawalUrl(params: {
4130
- /** The star gift to withdraw */
4131
- gift: InputStarGift;
4132
- /** 2FA password */
4133
- password: string;
4134
- }): Promise<string>;
4135
4348
  /**
4136
4349
  * Get Telegram Stars transactions for a given peer.
4137
4350
  *
@@ -4167,12 +4380,6 @@ export interface TelegramClient extends ITelegramClient {
4167
4380
  */
4168
4381
  limit?: number;
4169
4382
  }): Promise<StarsStatus>;
4170
- /**
4171
- * Get information about a unique star gift by its slug
4172
- * **Available**: 👤 users only
4173
- *
4174
- */
4175
- getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
4176
4383
  /**
4177
4384
  * Iterate over boosters of a channel.
4178
4385
  *
@@ -4195,26 +4402,6 @@ export interface TelegramClient extends ITelegramClient {
4195
4402
  */
4196
4403
  chunkSize?: number;
4197
4404
  }): AsyncIterableIterator<Boost>;
4198
- /**
4199
- * Iterate over saved star gifts of a user,
4200
- * wrapper over {@link getSavedStarGifts}
4201
- * **Available**: 👤 users only
4202
- *
4203
- */
4204
- iterSavedStarGifts(params: Parameters<typeof getSavedStarGifts>[1] & {
4205
- /**
4206
- * Number of gifts to fetch per request
4207
- *
4208
- * @default 100
4209
- */
4210
- chunkSize?: number;
4211
- /**
4212
- * Total number of gifts to fetch
4213
- *
4214
- * @default Infinity
4215
- */
4216
- limit?: number;
4217
- }): AsyncIterableIterator<SavedStarGift>;
4218
4405
  /**
4219
4406
  * Iterate over Telegram Stars transactions for a given peer.
4220
4407
  *
@@ -4243,72 +4430,6 @@ export interface TelegramClient extends ITelegramClient {
4243
4430
  */
4244
4431
  chunkSize?: number;
4245
4432
  }): AsyncIterableIterator<StarsTransaction>;
4246
- /**
4247
- * Toggles whether one or more star gift is pinned to the top of the list
4248
- * **Available**: 👤 users only
4249
- *
4250
- */
4251
- togglePinnedStarGifts(params: {
4252
- /** One or more gifts to pin */
4253
- gifts: MaybeArray<InputStarGift>;
4254
- /** Peer where the gift is sent */
4255
- peer: InputPeerLike;
4256
- }): Promise<void>;
4257
- /**
4258
- * Pay for other user's star gift upgrade.
4259
- *
4260
- * > **Note**: this method is not indended to be used by full-fledged clients,
4261
- * > as this method hides the actual invoice and payment form from the user.
4262
- * > For GUI clients, you should refer to the method's source code and
4263
- * > present the payment form to the user.
4264
- *
4265
- * **Available**: 👤 users only
4266
- *
4267
- * @returns Service message about the payment for the upgrade, if one was generated.
4268
- */
4269
- prepayStarGiftUpgrade(params: {
4270
- peer: InputPeerLike;
4271
- /** Prepaid upgrade hash, taken from `SavedStarGift.prepaidUpgradeHash` */
4272
- hash: string;
4273
- /**
4274
- * Whether to dispatch the new message event
4275
- * to the client's update handler.
4276
- */
4277
- shouldDispatch?: true;
4278
- }): Promise<Message | null>;
4279
- /**
4280
- * Send a star gift to a user.
4281
- *
4282
- * > **Note**: this method is not indended to be used by full-fledged clients,
4283
- * > as this method hides the actual invoice and payment form from the user.
4284
- * > For GUI clients, you should refer to the method's source code and
4285
- * > present the payment form to the user.
4286
- *
4287
- * **Available**: 👤 users only
4288
- *
4289
- * @returns Service message about the sent gift, if one was generated.
4290
- */
4291
- sendStarGift(params: {
4292
- /** ID of the peer to send the gift to */
4293
- peerId: InputPeerLike;
4294
- /** ID of the gift to send */
4295
- gift: Long | StarGift;
4296
- /**
4297
- * Whether to send the gift anonymously
4298
- * (i.e. if the recipient chooses to display the gift
4299
- * on their profile, your name won't be visible)
4300
- */
4301
- anonymous?: boolean;
4302
- /** Message to send along with the gift */
4303
- message?: InputText;
4304
- /** Whether to automatically upgrade the gift to a unique star gift */
4305
- withUpgrade?: boolean;
4306
- /**
4307
- * Whether to dispatch the new message event
4308
- * to the client's update handler.
4309
- */
4310
- shouldDispatch?: true;
4311
- }): Promise<Message | null>;
4312
4433
  /**
4313
4434
  * Set current user's business introduction.
4314
4435
  *
@@ -4347,63 +4468,6 @@ export interface TelegramClient extends ITelegramClient {
4347
4468
  /** Business work intervals, raw intervals */
4348
4469
  intervals: tl.TypeBusinessWeeklyOpen[];
4349
4470
  })) | null): Promise<void>;
4350
- /** Set resale price for an owned star gift */
4351
- setResaleStarGiftPrice(params: {
4352
- /** Star gift to update the price of */
4353
- gift: InputStarGift;
4354
- /**
4355
- * New price of the gift (in stars), or `null` to unlist
4356
- */
4357
- price: tl.Long | number | tl.TypeStarsAmount | null;
4358
- }): Promise<void>;
4359
- /**
4360
- * Transfer a unique star gift.
4361
- *
4362
- * > **Note**: this method is not indended to be used by full-fledged clients,
4363
- * > as this method hides the actual invoice and payment form from the user.
4364
- * > For GUI clients, you should refer to the method's source code and
4365
- * > present the payment form to the user.
4366
- *
4367
- * **Available**: 👤 users only
4368
- *
4369
- * @returns Service message about the transferred gift, if one was generated.
4370
- */
4371
- transferStarGift(params: {
4372
- /** Star gift to transfer */
4373
- gift: InputStarGift;
4374
- /** ID of the user to transfer the gift to */
4375
- recipient: InputPeerLike;
4376
- /**
4377
- * Whether to dispatch the new message event
4378
- * to the client's update handler.
4379
- */
4380
- shouldDispatch?: true;
4381
- }): Promise<Message | null>;
4382
- /**
4383
- * Upgrades a star gift to a unique gift.
4384
- *
4385
- * > **Note**: this method is not indended to be used by full-fledged clients,
4386
- * > as this method hides the actual invoice and payment form from the user.
4387
- * > For GUI clients, you should refer to the method's source code and
4388
- * > present the payment form to the user.
4389
- *
4390
- * **Available**: 👤 users only
4391
- *
4392
- * @returns Service message about the upgraded gift, if one was generated.
4393
- */
4394
- upgradeStarGift(params: {
4395
- gift: InputStarGift;
4396
- /**
4397
- * Whether to retain the original details of the gift
4398
- * (like sender, recipient, date, message)
4399
- */
4400
- keepOriginalDetails?: boolean;
4401
- /**
4402
- * Whether to dispatch the new message event
4403
- * to the client's update handler.
4404
- */
4405
- shouldDispatch?: true;
4406
- }): Promise<Message | null>;
4407
4471
  /**
4408
4472
  * Add a sticker to a sticker set.
4409
4473
  *