@mtcute/core 0.27.1 → 0.27.3

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 (145) hide show
  1. package/client.cjs +92 -68
  2. package/client.js +93 -69
  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 +497 -412
  8. package/highlevel/client.d.ts +497 -412
  9. package/highlevel/client.test.d.cts +1 -0
  10. package/highlevel/client.test.d.ts +1 -0
  11. package/highlevel/methods/contacts/set-contact-note.cjs +21 -0
  12. package/highlevel/methods/contacts/set-contact-note.js +16 -0
  13. package/highlevel/methods/files/download-chunk.cjs +63 -0
  14. package/highlevel/methods/files/download-chunk.d.cts +29 -0
  15. package/highlevel/methods/files/download-chunk.d.ts +29 -0
  16. package/highlevel/methods/files/download-chunk.js +58 -0
  17. package/highlevel/methods/files/download-chunk.test.d.cts +1 -0
  18. package/highlevel/methods/files/download-chunk.test.d.ts +1 -0
  19. package/highlevel/methods/files/download-iterable.cjs +39 -23
  20. package/highlevel/methods/files/download-iterable.d.cts +6 -0
  21. package/highlevel/methods/files/download-iterable.d.ts +6 -0
  22. package/highlevel/methods/files/download-iterable.js +33 -17
  23. package/highlevel/methods/forums/reorder-pinned-forum-topics.cjs +2 -2
  24. package/highlevel/methods/forums/reorder-pinned-forum-topics.js +3 -3
  25. package/highlevel/methods/forums/toggle-forum-topic-closed.cjs +2 -2
  26. package/highlevel/methods/forums/toggle-forum-topic-closed.js +3 -3
  27. package/highlevel/methods/forums/toggle-forum-topic-pinned.cjs +2 -2
  28. package/highlevel/methods/forums/toggle-forum-topic-pinned.js +3 -3
  29. package/highlevel/methods/gifts/get-star-gift-upgrade-options.cjs +30 -0
  30. package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +12 -0
  31. package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +12 -0
  32. package/highlevel/methods/gifts/get-star-gift-upgrade-options.js +25 -0
  33. package/highlevel/methods/gifts/resolve-star-gift-offer.cjs +17 -0
  34. package/highlevel/methods/gifts/resolve-star-gift-offer.d.cts +18 -0
  35. package/highlevel/methods/gifts/resolve-star-gift-offer.d.ts +18 -0
  36. package/highlevel/methods/gifts/resolve-star-gift-offer.js +12 -0
  37. package/highlevel/methods/gifts/send-star-gift-offer.cjs +26 -0
  38. package/highlevel/methods/gifts/send-star-gift-offer.d.cts +26 -0
  39. package/highlevel/methods/gifts/send-star-gift-offer.d.ts +26 -0
  40. package/highlevel/methods/gifts/send-star-gift-offer.js +21 -0
  41. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.cjs +2 -5
  42. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.cts +2 -2
  43. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.ts +2 -2
  44. package/highlevel/methods/{premium → gifts}/set-gift-resale-price.js +2 -5
  45. package/highlevel/methods/premium/_normalize-stars-amount.cjs +18 -0
  46. package/highlevel/methods/premium/_normalize-stars-amount.d.cts +12 -0
  47. package/highlevel/methods/premium/_normalize-stars-amount.d.ts +12 -0
  48. package/highlevel/methods/premium/_normalize-stars-amount.js +13 -0
  49. package/highlevel/methods.d.cts +26 -18
  50. package/highlevel/methods.d.ts +26 -18
  51. package/highlevel/types/messages/message-action.cjs +27 -4
  52. package/highlevel/types/messages/message-action.d.cts +28 -1
  53. package/highlevel/types/messages/message-action.d.ts +28 -1
  54. package/highlevel/types/messages/message-action.js +27 -4
  55. package/highlevel/types/premium/saved-star-gift.cjs +4 -0
  56. package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
  57. package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
  58. package/highlevel/types/premium/saved-star-gift.js +4 -0
  59. package/highlevel/types/premium/star-gift-unique.cjs +8 -0
  60. package/highlevel/types/premium/star-gift-unique.d.cts +4 -0
  61. package/highlevel/types/premium/star-gift-unique.d.ts +4 -0
  62. package/highlevel/types/premium/star-gift-unique.js +8 -0
  63. package/highlevel/types/premium/star-gift.cjs +17 -4
  64. package/highlevel/types/premium/star-gift.d.cts +8 -1
  65. package/highlevel/types/premium/star-gift.d.ts +8 -1
  66. package/highlevel/types/premium/star-gift.js +17 -4
  67. package/highlevel/types/premium/stars-transaction.cjs +6 -0
  68. package/highlevel/types/premium/stars-transaction.d.cts +6 -0
  69. package/highlevel/types/premium/stars-transaction.d.ts +6 -0
  70. package/highlevel/types/premium/stars-transaction.js +6 -0
  71. package/highlevel/updates/manager.cjs +7 -0
  72. package/highlevel/updates/manager.js +7 -0
  73. package/methods.cjs +45 -34
  74. package/methods.js +29 -18
  75. package/network/middlewares/internal-errors.cjs +5 -0
  76. package/network/middlewares/internal-errors.js +5 -0
  77. package/network/network-manager.cjs +1 -1
  78. package/network/network-manager.js +1 -1
  79. package/package.json +2 -2
  80. package/utils/binary/compat.cjs +12 -0
  81. package/utils/binary/compat.js +12 -0
  82. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.cjs +0 -0
  83. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.cts +0 -0
  84. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.ts +0 -0
  85. /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.js +0 -0
  86. /package/highlevel/methods/{premium → gifts}/accept-star-gift.cjs +0 -0
  87. /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.cts +0 -0
  88. /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.ts +0 -0
  89. /package/highlevel/methods/{premium → gifts}/accept-star-gift.js +0 -0
  90. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.cjs +0 -0
  91. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.cts +0 -0
  92. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.ts +0 -0
  93. /package/highlevel/methods/{premium → gifts}/buy-resale-gift.js +0 -0
  94. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.cjs +0 -0
  95. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.cts +0 -0
  96. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.ts +0 -0
  97. /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.js +0 -0
  98. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.cjs +0 -0
  99. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.cts +0 -0
  100. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.ts +0 -0
  101. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.js +0 -0
  102. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.cjs +0 -0
  103. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.cts +0 -0
  104. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.ts +0 -0
  105. /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.js +0 -0
  106. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.cjs +0 -0
  107. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.cts +0 -0
  108. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.ts +0 -0
  109. /package/highlevel/methods/{premium → gifts}/get-star-gift-options.js +0 -0
  110. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.cjs +0 -0
  111. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.cts +0 -0
  112. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.ts +0 -0
  113. /package/highlevel/methods/{premium → gifts}/get-star-gift-value.js +0 -0
  114. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.cjs +0 -0
  115. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.cts +0 -0
  116. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.ts +0 -0
  117. /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.js +0 -0
  118. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.cjs +0 -0
  119. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.cts +0 -0
  120. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.ts +0 -0
  121. /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.js +0 -0
  122. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.cjs +0 -0
  123. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.cts +0 -0
  124. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.ts +0 -0
  125. /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.js +0 -0
  126. /package/highlevel/methods/{premium → gifts}/pin-star-gift.cjs +0 -0
  127. /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.cts +0 -0
  128. /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.ts +0 -0
  129. /package/highlevel/methods/{premium → gifts}/pin-star-gift.js +0 -0
  130. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.cjs +0 -0
  131. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.cts +0 -0
  132. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.ts +0 -0
  133. /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.js +0 -0
  134. /package/highlevel/methods/{premium → gifts}/send-star-gift.cjs +0 -0
  135. /package/highlevel/methods/{premium → gifts}/send-star-gift.d.cts +0 -0
  136. /package/highlevel/methods/{premium → gifts}/send-star-gift.d.ts +0 -0
  137. /package/highlevel/methods/{premium → gifts}/send-star-gift.js +0 -0
  138. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.cjs +0 -0
  139. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.cts +0 -0
  140. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.ts +0 -0
  141. /package/highlevel/methods/{premium → gifts}/transfer-star-gift.js +0 -0
  142. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.cjs +0 -0
  143. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.cts +0 -0
  144. /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.ts +0 -0
  145. /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';
@@ -169,7 +171,7 @@ export interface TelegramClient extends ITelegramClient {
169
171
  * When you log out, you can immediately log back in using
170
172
  * the same {@link TelegramClient} instance.
171
173
  *
172
- * **Available**: both users and bots
174
+ * **Available**: 👤 users only
173
175
  *
174
176
  * @returns On success, `true` is returned
175
177
  */
@@ -231,7 +233,7 @@ export interface TelegramClient extends ITelegramClient {
231
233
  /**
232
234
  * Authorize a bot using its token issued by [@BotFather](//t.me/BotFather)
233
235
  *
234
- * **Available**: both users and bots
236
+ * **Available**: 👤 users only
235
237
  *
236
238
  * @param token Bot token issued by BotFather
237
239
  * @returns Bot's {@link User} object
@@ -297,7 +299,7 @@ export interface TelegramClient extends ITelegramClient {
297
299
  * > **Note**: Using this method assumes that you
298
300
  * > are using a test DC in `primaryDc` parameter.
299
301
  *
300
- * **Available**: both users and bots
302
+ * **Available**: 👤 users only
301
303
  *
302
304
  * @param params Additional parameters
303
305
  */
@@ -328,9 +330,9 @@ export interface TelegramClient extends ITelegramClient {
328
330
  * All parameters are `MaybeDynamic<T>`, meaning you
329
331
  * can either supply `T`, or a function that returns `MaybePromise<T>`
330
332
  *
331
- * This method is intended for simple and fast use in automated
332
- * scripts and bots. If you are developing a custom client,
333
- * you'll probably need to use other auth methods.
333
+ * This method is intended for *interactive* login.
334
+ * If you are building some kind of headless service, you will most likely
335
+ * want to use the underlying authorization methods directly.
334
336
  * **Available**: ✅ both users and bots
335
337
  *
336
338
  */
@@ -412,7 +414,7 @@ export interface TelegramClient extends ITelegramClient {
412
414
  /**
413
415
  * Send an answer to a callback query.
414
416
  *
415
- * **Available**: 🤖 bots only
417
+ * **Available**: 👤 users only
416
418
  *
417
419
  * @param queryId ID of the callback query, or the query itself
418
420
  * @param params Parameters of the answer
@@ -452,7 +454,7 @@ export interface TelegramClient extends ITelegramClient {
452
454
  /**
453
455
  * Answer an inline query.
454
456
  *
455
- * **Available**: 🤖 bots only
457
+ * **Available**: 👤 users only
456
458
  *
457
459
  * @param queryId Inline query ID
458
460
  * @param results Results of the query
@@ -538,7 +540,7 @@ export interface TelegramClient extends ITelegramClient {
538
540
  /**
539
541
  * Answer a pre-checkout query.
540
542
  *
541
- * **Available**: 🤖 bots only
543
+ * **Available**: 👤 users only
542
544
  *
543
545
  * @param queryId Pre-checkout query ID
544
546
  */
@@ -552,7 +554,7 @@ export interface TelegramClient extends ITelegramClient {
552
554
  * Does the same as passing `null` to {@link setMyCommands}
553
555
  *
554
556
  * Learn more about scopes in the [Bot API docs](https://core.telegram.org/bots/api#botcommandscope)
555
- * **Available**: 🤖 bots only
557
+ * **Available**: 👤 users only
556
558
  *
557
559
  */
558
560
  deleteMyCommands(params?: {
@@ -569,7 +571,7 @@ export interface TelegramClient extends ITelegramClient {
569
571
  }): Promise<void>;
570
572
  /**
571
573
  * Gets information about a bot the current uzer owns (or the current bot)
572
- * **Available**: both users and bots
574
+ * **Available**: 👤 users only
573
575
  *
574
576
  */
575
577
  getBotInfo(params: {
@@ -586,7 +588,7 @@ export interface TelegramClient extends ITelegramClient {
586
588
  }): Promise<tl.bots.RawBotInfo>;
587
589
  /**
588
590
  * Fetches the menu button set for the given user.
589
- * **Available**: 🤖 bots only
591
+ * **Available**: 👤 users only
590
592
  *
591
593
  */
592
594
  getBotMenuButton(user: InputPeerLike): Promise<tl.TypeBotMenuButton>;
@@ -632,7 +634,7 @@ export interface TelegramClient extends ITelegramClient {
632
634
  }): Promise<tl.messages.TypeBotCallbackAnswer>;
633
635
  /**
634
636
  * Get high scores of a game
635
- * **Available**: 🤖 bots only
637
+ * **Available**: 👤 users only
636
638
  *
637
639
  */
638
640
  getGameHighScores(params: InputMessageId & {
@@ -642,7 +644,7 @@ export interface TelegramClient extends ITelegramClient {
642
644
  /**
643
645
  * Get high scores of a game from an inline message
644
646
  *
645
- * **Available**: 🤖 bots only
647
+ * **Available**: 👤 users only
646
648
  *
647
649
  * @param messageId ID of the inline message containing the game
648
650
  * @param userId ID of the user to find high scores for
@@ -653,7 +655,7 @@ export interface TelegramClient extends ITelegramClient {
653
655
  * and user language. If they are not set, empty set is returned.
654
656
  *
655
657
  * Learn more about scopes in the [Bot API docs](https://core.telegram.org/bots/api#botcommandscope)
656
- * **Available**: 🤖 bots only
658
+ * **Available**: 👤 users only
657
659
  *
658
660
  */
659
661
  getMyCommands(params?: {
@@ -744,7 +746,7 @@ export interface TelegramClient extends ITelegramClient {
744
746
  /**
745
747
  * Prepare an inline message result to be sent later via the
746
748
  * `shareMessage` [mini-app api method](https://core.telegram.org/bots/webapps#initializing-mini-apps).
747
- * **Available**: 🤖 bots only
749
+ * **Available**: 👤 users only
748
750
  *
749
751
  */
750
752
  prepareInlineMessage(params: {
@@ -773,7 +775,7 @@ export interface TelegramClient extends ITelegramClient {
773
775
  }): Promise<tl.messages.TypeBotPreparedInlineMessage>;
774
776
  /**
775
777
  * Sets information about a bot the current uzer owns (or the current bot)
776
- * **Available**: both users and bots
778
+ * **Available**: 👤 users only
777
779
  *
778
780
  */
779
781
  setBotInfo(params: {
@@ -796,14 +798,14 @@ export interface TelegramClient extends ITelegramClient {
796
798
  }): Promise<void>;
797
799
  /**
798
800
  * Sets a menu button for the given user.
799
- * **Available**: 🤖 bots only
801
+ * **Available**: 👤 users only
800
802
  *
801
803
  */
802
804
  setBotMenuButton(user: InputPeerLike, button: tl.TypeBotMenuButton): Promise<void>;
803
805
  /**
804
806
  * Set a score of a user in a game
805
807
  *
806
- * **Available**: 🤖 bots only
808
+ * **Available**: 👤 users only
807
809
  *
808
810
  * @param params
809
811
  * @returns The modified message
@@ -833,7 +835,7 @@ export interface TelegramClient extends ITelegramClient {
833
835
  * Set a score of a user in a game contained in
834
836
  * an inline message
835
837
  *
836
- * **Available**: 🤖 bots only
838
+ * **Available**: 👤 users only
837
839
  *
838
840
  * @param params
839
841
  */
@@ -859,7 +861,7 @@ export interface TelegramClient extends ITelegramClient {
859
861
  * Set or delete commands for the current bot and the given scope
860
862
  *
861
863
  * Learn more about scopes in the [Bot API docs](https://core.telegram.org/bots/api#botcommandscope)
862
- * **Available**: 🤖 bots only
864
+ * **Available**: 👤 users only
863
865
  *
864
866
  */
865
867
  setMyCommands(params: {
@@ -882,7 +884,7 @@ export interface TelegramClient extends ITelegramClient {
882
884
  }): Promise<void>;
883
885
  /**
884
886
  * Sets the default chat permissions for the bot in the supergroup or channel.
885
- * **Available**: 🤖 bots only
887
+ * **Available**: 👤 users only
886
888
  *
887
889
  */
888
890
  setMyDefaultRights(params: {
@@ -936,7 +938,7 @@ export interface TelegramClient extends ITelegramClient {
936
938
  * When banning a channel, the user won't be able to use
937
939
  * any of their channels to post until the ban is lifted.
938
940
  *
939
- * **Available**: both users and bots
941
+ * **Available**: 👤 users only
940
942
  *
941
943
  * @returns Service message about removed user, if one was generated.
942
944
  */
@@ -1042,7 +1044,7 @@ export interface TelegramClient extends ITelegramClient {
1042
1044
  *
1043
1045
  * You must be an administrator and have the appropriate permissions.
1044
1046
  *
1045
- * **Available**: both users and bots
1047
+ * **Available**: 👤 users only
1046
1048
  *
1047
1049
  * @param chatId Chat ID or username
1048
1050
  */
@@ -1095,7 +1097,7 @@ export interface TelegramClient extends ITelegramClient {
1095
1097
  }): Promise<void>;
1096
1098
  /**
1097
1099
  * Edit supergroup/channel admin rights of a user.
1098
- * **Available**: both users and bots
1100
+ * **Available**: 👤 users only
1099
1101
  *
1100
1102
  */
1101
1103
  editAdminRights(params: {
@@ -1170,7 +1172,7 @@ export interface TelegramClient extends ITelegramClient {
1170
1172
  /**
1171
1173
  * Get information about a single chat member
1172
1174
  *
1173
- * **Available**: both users and bots
1175
+ * **Available**: 👤 users only
1174
1176
  *
1175
1177
  * @param chatId Chat ID or username
1176
1178
  * @param userId User ID, username, phone number, `"me"` or `"self"`
@@ -1187,7 +1189,7 @@ export interface TelegramClient extends ITelegramClient {
1187
1189
  *
1188
1190
  * You can retrieve up to 200 members at once
1189
1191
  *
1190
- * **Available**: both users and bots
1192
+ * **Available**: 👤 users only
1191
1193
  *
1192
1194
  * @param chatId Chat ID or username
1193
1195
  * @param params Additional parameters
@@ -1385,7 +1387,7 @@ export interface TelegramClient extends ITelegramClient {
1385
1387
  /**
1386
1388
  * Leave a group chat, supergroup or channel
1387
1389
  *
1388
- * **Available**: both users and bots
1390
+ * **Available**: 👤 users only
1389
1391
  *
1390
1392
  * @param chatId Chat ID or username
1391
1393
  */
@@ -1441,7 +1443,7 @@ export interface TelegramClient extends ITelegramClient {
1441
1443
  reorderUsernames(peerId: InputPeerLike, order: string[]): Promise<void>;
1442
1444
  /**
1443
1445
  * Restrict a user in a supergroup.
1444
- * **Available**: both users and bots
1446
+ * **Available**: 👤 users only
1445
1447
  *
1446
1448
  */
1447
1449
  restrictChatMember(params: {
@@ -1507,8 +1509,6 @@ export interface TelegramClient extends ITelegramClient {
1507
1509
  /**
1508
1510
  * Whether to set this color for the profile
1509
1511
  * header instead of chat name/replies.
1510
- *
1511
- * Currently only available for the current user.
1512
1512
  */
1513
1513
  forProfile?: boolean;
1514
1514
  }): Promise<void>;
@@ -1517,7 +1517,7 @@ export interface TelegramClient extends ITelegramClient {
1517
1517
  *
1518
1518
  * You must be an administrator in the chat and have appropriate permissions.
1519
1519
  *
1520
- * **Available**: both users and bots
1520
+ * **Available**: 👤 users only
1521
1521
  *
1522
1522
  * @param chatId Chat ID or username
1523
1523
  * @param restrictions
@@ -1532,7 +1532,7 @@ export interface TelegramClient extends ITelegramClient {
1532
1532
  *
1533
1533
  * You must be an administrator and have the appropriate permissions.
1534
1534
  *
1535
- * **Available**: both users and bots
1535
+ * **Available**: 👤 users only
1536
1536
  *
1537
1537
  * @param chatId Chat ID or username
1538
1538
  * @param description New chat description, 0-255 characters
@@ -1542,7 +1542,7 @@ export interface TelegramClient extends ITelegramClient {
1542
1542
  * Set a new chat photo or video.
1543
1543
  *
1544
1544
  * You must be an administrator and have the appropriate permissions.
1545
- * **Available**: both users and bots
1545
+ * **Available**: 👤 users only
1546
1546
  *
1547
1547
  */
1548
1548
  setChatPhoto(params: {
@@ -1563,7 +1563,7 @@ export interface TelegramClient extends ITelegramClient {
1563
1563
  *
1564
1564
  * You must be an administrator and have the appropriate permissions.
1565
1565
  *
1566
- * **Available**: both users and bots
1566
+ * **Available**: 👤 users only
1567
1567
  *
1568
1568
  * @param chatId Chat ID or username
1569
1569
  * @param title New chat title, 1-255 characters
@@ -1669,7 +1669,7 @@ export interface TelegramClient extends ITelegramClient {
1669
1669
  * just allows the user to join the chat again, if they want.
1670
1670
  *
1671
1671
  * This method acts as a no-op in case a legacy group is passed.
1672
- * **Available**: both users and bots
1672
+ * **Available**: 👤 users only
1673
1673
  *
1674
1674
  */
1675
1675
  unbanChatMember(params: {
@@ -1685,7 +1685,7 @@ export interface TelegramClient extends ITelegramClient {
1685
1685
  * just allows the user to join the chat again, if they want.
1686
1686
  *
1687
1687
  * This method acts as a no-op in case a legacy group is passed.
1688
- * **Available**: both users and bots
1688
+ * **Available**: 👤 users only
1689
1689
  *
1690
1690
  */
1691
1691
  unrestrictChatMember(params: {
@@ -1721,6 +1721,10 @@ export interface TelegramClient extends ITelegramClient {
1721
1721
  * @default false
1722
1722
  */
1723
1723
  sharePhone?: boolean;
1724
+ /**
1725
+ * Note to the contact
1726
+ */
1727
+ note?: InputText;
1724
1728
  }): Promise<User>;
1725
1729
  /**
1726
1730
  * Delete one or more contacts from your Telegram contacts list
@@ -1747,6 +1751,13 @@ export interface TelegramClient extends ITelegramClient {
1747
1751
  * @param contacts List of contacts
1748
1752
  */
1749
1753
  importContacts(contacts: PartialOnly<Omit<tl.RawInputPhoneContact, '_'>, 'clientId'>[]): Promise<tl.contacts.RawImportedContacts>;
1754
+ /**
1755
+ * Set a note for a contact
1756
+ *
1757
+ * @param userId ID of the user to set the note for
1758
+ * @param note Note text
1759
+ */
1760
+ setContactNote(userId: InputPeerLike, note: InputText): Promise<void>;
1750
1761
  /**
1751
1762
  * Create a folder from given parameters
1752
1763
  *
@@ -1971,6 +1982,35 @@ export interface TelegramClient extends ITelegramClient {
1971
1982
  * @param params File download parameters
1972
1983
  */
1973
1984
  downloadAsBuffer(location: FileDownloadLocation, params?: FileDownloadParameters): Promise<Uint8Array>;
1985
+ /**
1986
+ * Download a single chunk of a file, using [`precise`](https://core.telegram.org/api/files#downloading-files) download mode
1987
+ *
1988
+ * **Available**: 👤 users only
1989
+ *
1990
+ * @param params Download parameters
1991
+ */
1992
+ downloadChunk(params: {
1993
+ /** File from which to download a chunk */
1994
+ location: FileDownloadLocation;
1995
+ /**
1996
+ * DC id from which the file will be downloaded.
1997
+ *
1998
+ * If provided DC is not the one storing the file,
1999
+ * redirection will be handled automatically.
2000
+ */
2001
+ dcId?: number;
2002
+ /** Offset of the chunk in bytes */
2003
+ offset: number;
2004
+ /**
2005
+ * Number of bytes to download (starting from the offset)
2006
+ *
2007
+ * Max 1MB (1048576)
2008
+ */
2009
+ limit: number;
2010
+ maxRetryCount?: number;
2011
+ floodSleepThreshold?: number;
2012
+ abortSignal?: AbortSignal;
2013
+ }): Promise<Uint8Array>;
1974
2014
  /**
1975
2015
  * Download a remote file to a local file (only for Node.js).
1976
2016
  * Promise will resolve once the download is complete.
@@ -1981,6 +2021,11 @@ export interface TelegramClient extends ITelegramClient {
1981
2021
  * @param params File download parameters
1982
2022
  */
1983
2023
  downloadToFile(filename: string, location: FileDownloadLocation, params?: FileDownloadParameters): Promise<void>;
2024
+ _normalizeFileDownloadLocation(input: FileDownloadLocation): Promise<{
2025
+ location: tl.TypeInputFileLocation | tl.TypeInputWebFileLocation | Uint8Array<ArrayBufferLike>;
2026
+ dcId?: number;
2027
+ fileSize?: number;
2028
+ }>;
1984
2029
  /**
1985
2030
  * Download a file and return it as an iterable, which yields file contents
1986
2031
  * in chunks of a given size. Order of the chunks is guaranteed to be
@@ -2024,7 +2069,7 @@ export interface TelegramClient extends ITelegramClient {
2024
2069
  /**
2025
2070
  * Normalize an {@link InputMediaLike} to `InputMedia`,
2026
2071
  * uploading the file if needed.
2027
- * **Available**: both users and bots
2072
+ * **Available**: 👤 users only
2028
2073
  *
2029
2074
  */
2030
2075
  _normalizeInputMedia(media: InputMediaLike, params?: {
@@ -2114,7 +2159,7 @@ export interface TelegramClient extends ITelegramClient {
2114
2159
  * the returned object will act like a message media
2115
2160
  * and contain fields like File ID.
2116
2161
  *
2117
- * **Available**: both users and bots
2162
+ * **Available**: 👤 users only
2118
2163
  *
2119
2164
  * @param media Media to upload
2120
2165
  * @param [params={}] Upload parameters
@@ -2128,8 +2173,6 @@ export interface TelegramClient extends ITelegramClient {
2128
2173
  *
2129
2174
  * Only admins with `manageTopics` permission can do this.
2130
2175
  *
2131
- * **Available**: ✅ both users and bots
2132
- *
2133
2176
  * @returns Service message for the created topic
2134
2177
  */
2135
2178
  createForumTopic(params: {
@@ -2161,8 +2204,6 @@ export interface TelegramClient extends ITelegramClient {
2161
2204
  /**
2162
2205
  * Delete a forum topic and all its history
2163
2206
  *
2164
- * **Available**: ✅ both users and bots
2165
- *
2166
2207
  * @param chat Chat or user ID, username, phone number, `"me"` or `"self"`
2167
2208
  * @param topicId ID of the topic (i.e. its top message ID)
2168
2209
  */
@@ -2178,8 +2219,6 @@ export interface TelegramClient extends ITelegramClient {
2178
2219
  *
2179
2220
  * Only admins with `manageTopics` permission can do this.
2180
2221
  *
2181
- * **Available**: ✅ both users and bots
2182
- *
2183
2222
  * @param chatId Chat ID or username
2184
2223
  * @param topicId ID of the topic (i.e. its top message ID)
2185
2224
  * @returns Service message about the modification
@@ -2205,20 +2244,20 @@ export interface TelegramClient extends ITelegramClient {
2205
2244
  * to the client's update handler.
2206
2245
  */
2207
2246
  shouldDispatch?: true;
2247
+ /** Whether to (un)close the topic */
2248
+ closed?: boolean;
2249
+ /** Whether to (un)hide the topic */
2250
+ hidden?: boolean;
2208
2251
  }): Promise<Message>;
2209
2252
  /**
2210
2253
  * Get forum topics by their IDs
2211
2254
  *
2212
- * **Available**: 👤 users only
2213
- *
2214
2255
  * @param chatId Chat ID or username
2215
2256
  */
2216
2257
  getForumTopicsById(chatId: InputPeerLike, ids: MaybeArray<number>): Promise<ForumTopic[]>;
2217
2258
  /**
2218
2259
  * Get forum topics
2219
2260
  *
2220
- * **Available**: 👤 users only
2221
- *
2222
2261
  * @param chatId Chat ID or username
2223
2262
  */
2224
2263
  getForumTopics(chatId: InputPeerLike, params?: {
@@ -2260,8 +2299,6 @@ export interface TelegramClient extends ITelegramClient {
2260
2299
  * Reorder pinned forum topics
2261
2300
  *
2262
2301
  * Only admins with `manageTopics` permission can do this.
2263
- * **Available**: 👤 users only
2264
- *
2265
2302
  */
2266
2303
  reorderPinnedForumTopics(params: {
2267
2304
  /** Chat ID or username */
@@ -2280,8 +2317,6 @@ export interface TelegramClient extends ITelegramClient {
2280
2317
  *
2281
2318
  * Only admins with `manageTopics` permission can do this.
2282
2319
  *
2283
- * **Available**: ✅ both users and bots
2284
- *
2285
2320
  * @returns Service message about the modification
2286
2321
  */
2287
2322
  toggleForumTopicClosed(parmas: {
@@ -2301,8 +2336,6 @@ export interface TelegramClient extends ITelegramClient {
2301
2336
  * Toggle whether a topic in a forum is pinned
2302
2337
  *
2303
2338
  * Only admins with `manageTopics` permission can do this.
2304
- * **Available**: 👤 users only
2305
- *
2306
2339
  */
2307
2340
  toggleForumTopicPinned(params: {
2308
2341
  /** Chat ID or username */
@@ -2332,7 +2365,7 @@ export interface TelegramClient extends ITelegramClient {
2332
2365
  *
2333
2366
  * Only admins with `manageTopics` permission can do this.
2334
2367
  *
2335
- * **Available**: both users and bots
2368
+ * **Available**: 👤 users only
2336
2369
  *
2337
2370
  * @returns Service message about the modification
2338
2371
  */
@@ -2347,99 +2380,406 @@ export interface TelegramClient extends ITelegramClient {
2347
2380
  */
2348
2381
  shouldDispatch?: true;
2349
2382
  }): Promise<Message>;
2383
+ _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
2350
2384
  /**
2351
- * Create an additional invite link for the chat.
2352
- *
2353
- * You must be an administrator and have appropriate rights.
2385
+ * Accept, hide or convert a star gift.
2354
2386
  *
2355
- * **Available**: both users and bots
2387
+ * **Available**: 👤 users only
2356
2388
  *
2357
- * @param chatId Chat ID
2358
- * @param params
2389
+ * @returns Whether the action was successful
2359
2390
  */
2360
- createInviteLink(chatId: InputPeerLike, params?: {
2361
- /**
2362
- * Date when this link will expire.
2363
- * If `number` is passed, UNIX time in ms is expected.
2364
- */
2365
- expires?: number | Date;
2366
- /**
2367
- * Maximum number of users that can be members of this chat
2368
- * at the same time after joining using this link.
2369
- *
2370
- * Integer in range `[1, 99999]` or `Infinity`
2371
- *
2372
- * @default `Infinity`
2373
- */
2374
- usageLimit?: number;
2391
+ acceptStarGift(params: {
2392
+ /** Input star gift to accept */
2393
+ gift: InputStarGift;
2375
2394
  /**
2376
- * Whether users to be joined via this link need to be
2377
- * approved by an admin
2395
+ * Action to perform on the gift.
2396
+ * - `save` - save the gift to your profile
2397
+ * - `hide` - hide the gift from your profile
2398
+ * - `convert` - convert the gift to stars (can't be undone)
2378
2399
  */
2379
- withApproval?: boolean;
2400
+ action: 'save' | 'hide' | 'convert';
2401
+ }): Promise<boolean>;
2402
+ buyResaleGift(params: {
2403
+ /** Slug of the star gift to buy */
2404
+ slug: string;
2405
+ /** ID of the user to buy the gift for */
2406
+ recipient: InputPeerLike;
2380
2407
  /**
2381
- * When a pricing plan is passed, this link will become a paid subscription link
2382
- *
2383
- * Currently the only allowed `.period` is 1 month, i.e. `2592000`
2408
+ * Whether to dispatch the new message event
2409
+ * to the client's update handler.
2384
2410
  */
2385
- subscriptionPricing?: tl.TypeStarsSubscriptionPricing;
2386
- }): Promise<ChatInviteLink>;
2411
+ shouldDispatch?: true;
2412
+ /** Whether to use TON currency for payment */
2413
+ ton?: boolean;
2414
+ }): Promise<Message | null>;
2387
2415
  /**
2388
- * Edit an invite link. You can only edit non-primary
2389
- * invite links.
2390
- *
2391
- * Only pass the fields that you want to modify.
2392
- *
2393
- * **Available**: ✅ both users and bots
2416
+ * Get a list of star gifts up for resale
2417
+ * **Available**: 👤 users only
2394
2418
  *
2395
- * @param chatId Chat ID
2396
- * @param link Invite link to edit
2397
- * @param params
2398
- * @returns Modified invite link
2399
2419
  */
2400
- editInviteLink(params: {
2401
- /** Chat ID */
2402
- chatId: InputPeerLike;
2403
- /** Invite link to edit */
2404
- link: string | ChatInviteLink;
2405
- /**
2406
- * Date when this link will expire.
2407
- * If `number` is passed, UNIX time in ms is expected.
2408
- */
2409
- expires?: number | Date;
2420
+ getStarGiftResaleOptions(params: {
2421
+ /** ID of the gift to get resale options for */
2422
+ giftId: tl.Long;
2410
2423
  /**
2411
- * Maximum number of users that can be members of this chat
2412
- * at the same time after joining using this link.
2424
+ * Sorting attribute
2413
2425
  *
2414
- * Integer in range `[1, 99999]` or `Infinity`,
2426
+ * - `price`: Sort by price
2427
+ * - `num`: Sort by its unique number
2415
2428
  */
2416
- usageLimit?: number;
2429
+ sort?: 'price' | 'num';
2417
2430
  /**
2418
- * Whether users to be joined via this link need to be
2419
- * approved by an admin
2431
+ * Hash of the `attributes` field, as returned by the server in the first response
2420
2432
  */
2421
- withApproval?: boolean;
2422
- }): Promise<ChatInviteLink>;
2433
+ attributesHash?: Long;
2434
+ /** Attributes to filter for */
2435
+ attributes?: tl.TypeStarGiftAttributeId[] | InputStarGiftAttributeIds;
2436
+ /** Offset for pagination */
2437
+ offset?: string;
2438
+ /** Limit for pagination */
2439
+ limit?: number;
2440
+ }): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
2441
+ /** Get one or more saved star gifts by their IDs */
2442
+ getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
2423
2443
  /**
2424
- * Generate a new primary invite link for a chat,
2425
- * old primary link is revoked.
2426
- *
2427
- * > **Note**: each administrator has their own primary invite link,
2428
- * > and bots by default don't have one.
2444
+ * Get a list of saved star gifts of a user/channel
2429
2445
  *
2430
- * **Available**: both users and bots
2446
+ * Note that filters currently only work for channels
2447
+ * **Available**: 👤 users only
2431
2448
  *
2432
- * @param chatId Chat IDs
2433
2449
  */
2434
- exportInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2450
+ getSavedStarGifts(params: {
2451
+ /** Peer to get saved gifts from */
2452
+ owner: InputPeerLike;
2453
+ /** Whether to exclude hidden gifts */
2454
+ excludeHidden?: boolean;
2455
+ /** Whether to exclude publicly visible gifts */
2456
+ excludePublic?: boolean;
2457
+ /** Whether to exclude gifts with unlimited availability */
2458
+ excludeUnlimited?: boolean;
2459
+ /** Whether to exclude unique gifts */
2460
+ excludeUnique?: boolean;
2461
+ /** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
2462
+ excludeUnupgradable?: boolean;
2463
+ /** Whether to exclude gifts that can be upgraded */
2464
+ excludeUpgradable?: boolean;
2465
+ /** Whether to exclude "hosted" gifts (i.e. those that are actually stored on the TON blockchain) */
2466
+ excludeHosted?: boolean;
2467
+ /** Whether to only return gifts with peer color available */
2468
+ peerColorAvailable?: boolean;
2469
+ /** ID of the collection to get gifts from */
2470
+ collectionId?: number;
2471
+ /** Whether to sort by value */
2472
+ sortByValue?: boolean;
2473
+ /** Offset for pagination */
2474
+ offset?: string;
2475
+ /** Limit for pagination */
2476
+ limit?: number;
2477
+ }): Promise<ArrayPaginated<SavedStarGift, string>>;
2435
2478
  /**
2436
- * Iterate over users who have joined
2437
- * the chat with the given invite link.
2479
+ * Get the list of available star gifts.
2480
+ * **Available**: 👤 users only
2438
2481
  *
2482
+ */
2483
+ getStarGiftOptions(): Promise<StarGift[]>;
2484
+ /**
2485
+ * Get a list of all possible attributes when upgrading a given star gift
2486
+ */
2487
+ getStarGiftUpgradeOptions(giftId: tl.Long): Promise<StarGiftUpgradeOptions>;
2488
+ /**
2489
+ * Get the value of a unique star gift
2439
2490
  * **Available**: 👤 users only
2440
2491
  *
2441
- * @param chatId Chat ID
2442
- * @param params Additional params
2492
+ */
2493
+ getStarGiftValue(params: {
2494
+ /** Slug of the star gift */
2495
+ slug: string;
2496
+ }): Promise<StarGiftValue>;
2497
+ getStarGiftWithdrawalUrl(params: {
2498
+ /** The star gift to withdraw */
2499
+ gift: InputStarGift;
2500
+ /** 2FA password */
2501
+ password: string;
2502
+ }): Promise<string>;
2503
+ /**
2504
+ * Get information about a unique star gift by its slug
2505
+ * **Available**: 👤 users only
2506
+ *
2507
+ */
2508
+ getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
2509
+ /**
2510
+ * Iterate over saved star gifts of a user,
2511
+ * wrapper over {@link getSavedStarGifts}
2512
+ * **Available**: 👤 users only
2513
+ *
2514
+ */
2515
+ iterSavedStarGifts(params: Parameters<typeof getSavedStarGifts>[1] & {
2516
+ /**
2517
+ * Number of gifts to fetch per request
2518
+ *
2519
+ * @default 100
2520
+ */
2521
+ chunkSize?: number;
2522
+ /**
2523
+ * Total number of gifts to fetch
2524
+ *
2525
+ * @default Infinity
2526
+ */
2527
+ limit?: number;
2528
+ }): AsyncIterableIterator<SavedStarGift>;
2529
+ /**
2530
+ * Toggles whether one or more star gift is pinned to the top of the list
2531
+ * **Available**: 👤 users only
2532
+ *
2533
+ */
2534
+ togglePinnedStarGifts(params: {
2535
+ /** One or more gifts to pin */
2536
+ gifts: MaybeArray<InputStarGift>;
2537
+ /** Peer where the gift is sent */
2538
+ peer: InputPeerLike;
2539
+ }): Promise<void>;
2540
+ /**
2541
+ * Pay for other user's star gift upgrade.
2542
+ *
2543
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2544
+ * > as this method hides the actual invoice and payment form from the user.
2545
+ * > For GUI clients, you should refer to the method's source code and
2546
+ * > present the payment form to the user.
2547
+ *
2548
+ * **Available**: 👤 users only
2549
+ *
2550
+ * @returns Service message about the payment for the upgrade, if one was generated.
2551
+ */
2552
+ prepayStarGiftUpgrade(params: {
2553
+ peer: InputPeerLike;
2554
+ /** Prepaid upgrade hash, taken from `SavedStarGift.prepaidUpgradeHash` */
2555
+ hash: string;
2556
+ /**
2557
+ * Whether to dispatch the new message event
2558
+ * to the client's update handler.
2559
+ */
2560
+ shouldDispatch?: true;
2561
+ }): Promise<Message | null>;
2562
+ /**
2563
+ * Accept or decline a purchase offer for a star gift
2564
+ *
2565
+ * @returns The generated service message
2566
+ */
2567
+ resolveStarGiftOffer(options: {
2568
+ /** ID of the message containing the offer */
2569
+ message: number;
2570
+ /** Whether to accept or decline the offer */
2571
+ action: 'accept' | 'decline';
2572
+ /**
2573
+ * Whether to dispatch the new message event
2574
+ * to the client's update handler.
2575
+ */
2576
+ shouldDispatch?: true;
2577
+ }): Promise<Message>;
2578
+ /**
2579
+ * Create a purchase offer for a unique star gift
2580
+ * @param client
2581
+ * @param params
2582
+ */
2583
+ sendStarGiftOffer(params: {
2584
+ /** ID of the peer to send the offer to */
2585
+ peerId: InputPeerLike;
2586
+ /** Slug of the star gift to create an offer for */
2587
+ slug: string;
2588
+ /** Amount of stars to offer */
2589
+ price: InputStarsAmount;
2590
+ /** Duration of the offer in seconds */
2591
+ duration: number;
2592
+ /** When the recipient has paid messages enabled, the maximum number of stars that you are willing to spend */
2593
+ allowPaidMessages?: tl.Long;
2594
+ /**
2595
+ * Whether to dispatch the new message event
2596
+ * to the client's update handler.
2597
+ */
2598
+ shouldDispatch?: true;
2599
+ }): Promise<Message>;
2600
+ /**
2601
+ * Send a star gift to a user.
2602
+ *
2603
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2604
+ * > as this method hides the actual invoice and payment form from the user.
2605
+ * > For GUI clients, you should refer to the method's source code and
2606
+ * > present the payment form to the user.
2607
+ *
2608
+ * **Available**: 👤 users only
2609
+ *
2610
+ * @returns Service message about the sent gift, if one was generated.
2611
+ */
2612
+ sendStarGift(params: {
2613
+ /** ID of the peer to send the gift to */
2614
+ peerId: InputPeerLike;
2615
+ /** ID of the gift to send */
2616
+ gift: Long | StarGift;
2617
+ /**
2618
+ * Whether to send the gift anonymously
2619
+ * (i.e. if the recipient chooses to display the gift
2620
+ * on their profile, your name won't be visible)
2621
+ */
2622
+ anonymous?: boolean;
2623
+ /** Message to send along with the gift */
2624
+ message?: InputText;
2625
+ /** Whether to automatically upgrade the gift to a unique star gift */
2626
+ withUpgrade?: boolean;
2627
+ /**
2628
+ * Whether to dispatch the new message event
2629
+ * to the client's update handler.
2630
+ */
2631
+ shouldDispatch?: true;
2632
+ }): Promise<Message | null>;
2633
+ /** Set resale price for an owned star gift */
2634
+ setResaleStarGiftPrice(params: {
2635
+ /** Star gift to update the price of */
2636
+ gift: InputStarGift;
2637
+ /**
2638
+ * New price of the gift (in stars), or `null` to unlist
2639
+ */
2640
+ price: InputStarsAmount | null;
2641
+ }): Promise<void>;
2642
+ /**
2643
+ * Transfer a unique star gift.
2644
+ *
2645
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2646
+ * > as this method hides the actual invoice and payment form from the user.
2647
+ * > For GUI clients, you should refer to the method's source code and
2648
+ * > present the payment form to the user.
2649
+ *
2650
+ * **Available**: 👤 users only
2651
+ *
2652
+ * @returns Service message about the transferred gift, if one was generated.
2653
+ */
2654
+ transferStarGift(params: {
2655
+ /** Star gift to transfer */
2656
+ gift: InputStarGift;
2657
+ /** ID of the user to transfer the gift to */
2658
+ recipient: InputPeerLike;
2659
+ /**
2660
+ * Whether to dispatch the new message event
2661
+ * to the client's update handler.
2662
+ */
2663
+ shouldDispatch?: true;
2664
+ }): Promise<Message | null>;
2665
+ /**
2666
+ * Upgrades a star gift to a unique gift.
2667
+ *
2668
+ * > **Note**: this method is not indended to be used by full-fledged clients,
2669
+ * > as this method hides the actual invoice and payment form from the user.
2670
+ * > For GUI clients, you should refer to the method's source code and
2671
+ * > present the payment form to the user.
2672
+ *
2673
+ * **Available**: 👤 users only
2674
+ *
2675
+ * @returns Service message about the upgraded gift, if one was generated.
2676
+ */
2677
+ upgradeStarGift(params: {
2678
+ gift: InputStarGift;
2679
+ /**
2680
+ * Whether to retain the original details of the gift
2681
+ * (like sender, recipient, date, message)
2682
+ */
2683
+ keepOriginalDetails?: boolean;
2684
+ /**
2685
+ * Whether to dispatch the new message event
2686
+ * to the client's update handler.
2687
+ */
2688
+ shouldDispatch?: true;
2689
+ }): Promise<Message | null>;
2690
+ /**
2691
+ * Create an additional invite link for the chat.
2692
+ *
2693
+ * You must be an administrator and have appropriate rights.
2694
+ *
2695
+ * **Available**: 👤 users only
2696
+ *
2697
+ * @param chatId Chat ID
2698
+ * @param params
2699
+ */
2700
+ createInviteLink(chatId: InputPeerLike, params?: {
2701
+ /**
2702
+ * Date when this link will expire.
2703
+ * If `number` is passed, UNIX time in ms is expected.
2704
+ */
2705
+ expires?: number | Date;
2706
+ /**
2707
+ * Maximum number of users that can be members of this chat
2708
+ * at the same time after joining using this link.
2709
+ *
2710
+ * Integer in range `[1, 99999]` or `Infinity`
2711
+ *
2712
+ * @default `Infinity`
2713
+ */
2714
+ usageLimit?: number;
2715
+ /**
2716
+ * Whether users to be joined via this link need to be
2717
+ * approved by an admin
2718
+ */
2719
+ withApproval?: boolean;
2720
+ /**
2721
+ * When a pricing plan is passed, this link will become a paid subscription link
2722
+ *
2723
+ * Currently the only allowed `.period` is 1 month, i.e. `2592000`
2724
+ */
2725
+ subscriptionPricing?: tl.TypeStarsSubscriptionPricing;
2726
+ }): Promise<ChatInviteLink>;
2727
+ /**
2728
+ * Edit an invite link. You can only edit non-primary
2729
+ * invite links.
2730
+ *
2731
+ * Only pass the fields that you want to modify.
2732
+ *
2733
+ * **Available**: 👤 users only
2734
+ *
2735
+ * @param chatId Chat ID
2736
+ * @param link Invite link to edit
2737
+ * @param params
2738
+ * @returns Modified invite link
2739
+ */
2740
+ editInviteLink(params: {
2741
+ /** Chat ID */
2742
+ chatId: InputPeerLike;
2743
+ /** Invite link to edit */
2744
+ link: string | ChatInviteLink;
2745
+ /**
2746
+ * Date when this link will expire.
2747
+ * If `number` is passed, UNIX time in ms is expected.
2748
+ */
2749
+ expires?: number | Date;
2750
+ /**
2751
+ * Maximum number of users that can be members of this chat
2752
+ * at the same time after joining using this link.
2753
+ *
2754
+ * Integer in range `[1, 99999]` or `Infinity`,
2755
+ */
2756
+ usageLimit?: number;
2757
+ /**
2758
+ * Whether users to be joined via this link need to be
2759
+ * approved by an admin
2760
+ */
2761
+ withApproval?: boolean;
2762
+ }): Promise<ChatInviteLink>;
2763
+ /**
2764
+ * Generate a new primary invite link for a chat,
2765
+ * old primary link is revoked.
2766
+ *
2767
+ * > **Note**: each administrator has their own primary invite link,
2768
+ * > and bots by default don't have one.
2769
+ *
2770
+ * **Available**: 👤 users only
2771
+ *
2772
+ * @param chatId Chat IDs
2773
+ */
2774
+ exportInviteLink(chatId: InputPeerLike): Promise<ChatInviteLink>;
2775
+ /**
2776
+ * Iterate over users who have joined
2777
+ * the chat with the given invite link.
2778
+ *
2779
+ * **Available**: 👤 users only
2780
+ *
2781
+ * @param chatId Chat ID
2782
+ * @param params Additional params
2443
2783
  */
2444
2784
  getInviteLinkMembers(chatId: InputPeerLike, params?: {
2445
2785
  /**
@@ -2543,7 +2883,7 @@ export interface TelegramClient extends ITelegramClient {
2543
2883
  }): Promise<void>;
2544
2884
  /**
2545
2885
  * Approve or decline join request to a chat.
2546
- * **Available**: both users and bots
2886
+ * **Available**: 👤 users only
2547
2887
  *
2548
2888
  */
2549
2889
  hideJoinRequest(params: {
@@ -2610,7 +2950,7 @@ export interface TelegramClient extends ITelegramClient {
2610
2950
  * If `link` is a primary invite link, a new invite link will be
2611
2951
  * generated automatically by Telegram
2612
2952
  *
2613
- * **Available**: both users and bots
2953
+ * **Available**: 👤 users only
2614
2954
  *
2615
2955
  * @param chatId Chat ID
2616
2956
  * @param link Invite link to revoke
@@ -2620,7 +2960,7 @@ export interface TelegramClient extends ITelegramClient {
2620
2960
  /**
2621
2961
  * Append item(s) to a todo list
2622
2962
  *
2623
- * **Available**: both users and bots
2963
+ * **Available**: 👤 users only
2624
2964
  *
2625
2965
  * @returns Service message about the appended todo item(s), if any.
2626
2966
  */
@@ -2638,7 +2978,7 @@ export interface TelegramClient extends ITelegramClient {
2638
2978
  *
2639
2979
  * Once closed, poll can't be re-opened, and nobody
2640
2980
  * will be able to vote in it
2641
- * **Available**: both users and bots
2981
+ * **Available**: 👤 users only
2642
2982
  *
2643
2983
  */
2644
2984
  closePoll(params: InputMessageId & {
@@ -2651,7 +2991,7 @@ export interface TelegramClient extends ITelegramClient {
2651
2991
  /**
2652
2992
  * Delete messages by their IDs
2653
2993
  *
2654
- * **Available**: both users and bots
2994
+ * **Available**: 👤 users only
2655
2995
  *
2656
2996
  * @param chatId Chat's marked ID, its username, phone or `"me"` or `"self"`.
2657
2997
  * @param ids Message(s) ID(s) to delete.
@@ -2677,7 +3017,7 @@ export interface TelegramClient extends ITelegramClient {
2677
3017
  /**
2678
3018
  * Edit sent inline message text, media and reply markup.
2679
3019
  *
2680
- * **Available**: both users and bots
3020
+ * **Available**: 👤 users only
2681
3021
  *
2682
3022
  * @param messageId
2683
3023
  * Inline message ID, either as a TL object, or as a
@@ -2783,7 +3123,7 @@ export interface TelegramClient extends ITelegramClient {
2783
3123
  * Forward one or more messages by their IDs.
2784
3124
  * You can forward no more than 100 messages at once.
2785
3125
  *
2786
- * **Available**: both users and bots
3126
+ * **Available**: 👤 users only
2787
3127
  *
2788
3128
  * @param toChatId Destination chat ID, username, phone, `"me"` or `"self"`
2789
3129
  * @param fromChatId Source chat ID, username, phone, `"me"` or `"self"`
@@ -2968,7 +3308,7 @@ export interface TelegramClient extends ITelegramClient {
2968
3308
  * For messages that were not found, `null` will be
2969
3309
  * returned at that position.
2970
3310
  *
2971
- * **Available**: both users and bots
3311
+ * **Available**: 👤 users only
2972
3312
  *
2973
3313
  * @param messageIds Messages IDs
2974
3314
  * @param [fromReply]
@@ -3148,7 +3488,7 @@ export interface TelegramClient extends ITelegramClient {
3148
3488
  * For supergroups/channels, you must have appropriate permissions,
3149
3489
  * either as an admin, or as default permissions
3150
3490
  *
3151
- * **Available**: both users and bots
3491
+ * **Available**: 👤 users only
3152
3492
  *
3153
3493
  * @returns Service message about pinned message, if one was generated.
3154
3494
  */
@@ -3709,7 +4049,7 @@ export interface TelegramClient extends ITelegramClient {
3709
4049
  *
3710
4050
  * This status is automatically renewed by mtcute until a further
3711
4051
  * call with `cancel` is made, or a message is sent to the chat.
3712
- * **Available**: both users and bots
4052
+ * **Available**: 👤 users only
3713
4053
  *
3714
4054
  */
3715
4055
  setTyping(params: {
@@ -3737,7 +4077,7 @@ export interface TelegramClient extends ITelegramClient {
3737
4077
  /**
3738
4078
  * Toggle the completion status of a todo list item(s)
3739
4079
  *
3740
- * **Available**: both users and bots
4080
+ * **Available**: 👤 users only
3741
4081
  *
3742
4082
  * @returns Service message about the toggled items, if any.
3743
4083
  */
@@ -3775,7 +4115,7 @@ export interface TelegramClient extends ITelegramClient {
3775
4115
  /**
3776
4116
  * Unpin all pinned messages in a chat.
3777
4117
  *
3778
- * **Available**: both users and bots
4118
+ * **Available**: 👤 users only
3779
4119
  *
3780
4120
  * @param chatId Chat or user ID
3781
4121
  */
@@ -3796,7 +4136,7 @@ export interface TelegramClient extends ITelegramClient {
3796
4136
  * For supergroups/channels, you must have appropriate permissions,
3797
4137
  * either as an admin, or as default permissions
3798
4138
  *
3799
- * **Available**: both users and bots
4139
+ * **Available**: 👤 users only
3800
4140
  *
3801
4141
  * @param chatId Chat ID, username, phone number, `"self"` or `"me"`
3802
4142
  * @param messageId Message ID
@@ -3882,25 +4222,6 @@ export interface TelegramClient extends ITelegramClient {
3882
4222
  * @param password 2FA password as plaintext
3883
4223
  */
3884
4224
  removeCloudPassword(password: string): Promise<void>;
3885
- _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
3886
- /**
3887
- * Accept, hide or convert a star gift.
3888
- *
3889
- * **Available**: 👤 users only
3890
- *
3891
- * @returns Whether the action was successful
3892
- */
3893
- acceptStarGift(params: {
3894
- /** Input star gift to accept */
3895
- gift: InputStarGift;
3896
- /**
3897
- * Action to perform on the gift.
3898
- * - `save` - save the gift to your profile
3899
- * - `hide` - hide the gift from your profile
3900
- * - `convert` - convert the gift to stars (can't be undone)
3901
- */
3902
- action: 'save' | 'hide' | 'convert';
3903
- }): Promise<boolean>;
3904
4225
  /**
3905
4226
  * Boost a given channel
3906
4227
  *
@@ -3909,19 +4230,6 @@ export interface TelegramClient extends ITelegramClient {
3909
4230
  * @param peerId Peer ID to boost
3910
4231
  */
3911
4232
  applyBoost(peerId: InputPeerLike): Promise<void>;
3912
- buyResaleGift(params: {
3913
- /** Slug of the star gift to buy */
3914
- slug: string;
3915
- /** ID of the user to buy the gift for */
3916
- recipient: InputPeerLike;
3917
- /**
3918
- * Whether to dispatch the new message event
3919
- * to the client's update handler.
3920
- */
3921
- shouldDispatch?: true;
3922
- /** Whether to use TON currency for payment */
3923
- ton?: boolean;
3924
- }): Promise<Message | null>;
3925
4233
  /**
3926
4234
  * Check if the current user can apply boost to some channel
3927
4235
  *
@@ -4017,91 +4325,13 @@ export interface TelegramClient extends ITelegramClient {
4017
4325
  *
4018
4326
  */
4019
4327
  getMyBoostSlots(): Promise<BoostSlot[]>;
4020
- /**
4021
- * Get a list of star gifts up for resale
4022
- * **Available**: ✅ both users and bots
4023
- *
4024
- */
4025
- getStarGiftResaleOptions(params: {
4026
- /** ID of the gift to get resale options for */
4027
- giftId: tl.Long;
4028
- /**
4029
- * Sorting attribute
4030
- *
4031
- * - `price`: Sort by price
4032
- * - `num`: Sort by its unique number
4033
- */
4034
- sort?: 'price' | 'num';
4035
- /**
4036
- * Hash of the `attributes` field, as returned by the server in the first response
4037
- */
4038
- attributesHash?: Long;
4039
- /** Attributes to filter for */
4040
- attributes?: tl.TypeStarGiftAttributeId[] | InputStarGiftAttributeIds;
4041
- /** Offset for pagination */
4042
- offset?: string;
4043
- /** Limit for pagination */
4044
- limit?: number;
4045
- }): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
4046
- /** Get one or more saved star gifts by their IDs */
4047
- getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
4048
- /**
4049
- * Get a list of saved star gifts of a user/channel
4050
- *
4051
- * Note that filters currently only work for channels
4052
- * **Available**: ✅ both users and bots
4053
- *
4054
- */
4055
- getSavedStarGifts(params: {
4056
- /** Peer to get saved gifts from */
4057
- owner: InputPeerLike;
4058
- /** Whether to exclude hidden gifts */
4059
- excludeHidden?: boolean;
4060
- /** Whether to exclude publicly visible gifts */
4061
- excludePublic?: boolean;
4062
- /** Whether to exclude gifts with unlimited availability */
4063
- excludeUnlimited?: boolean;
4064
- /** Whether to exclude unique gifts */
4065
- excludeUnique?: boolean;
4066
- /** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
4067
- excludeUnupgradable?: boolean;
4068
- /** Whether to exclude gifts that can be upgraded */
4069
- excludeUpgradable?: boolean;
4070
- /** ID of the collection to get gifts from */
4071
- collectionId?: number;
4072
- /** Whether to sort by value */
4073
- sortByValue?: boolean;
4074
- /** Offset for pagination */
4075
- offset?: string;
4076
- /** Limit for pagination */
4077
- limit?: number;
4078
- }): Promise<ArrayPaginated<SavedStarGift, string>>;
4079
- /**
4080
- * Get the list of available star gifts.
4081
- * **Available**: 👤 users only
4082
- *
4083
- */
4084
- getStarGiftOptions(): Promise<StarGift[]>;
4085
- /**
4086
- * Get the value of a unique star gift
4087
- */
4088
- getStarGiftValue(params: {
4089
- /** Slug of the star gift */
4090
- slug: string;
4091
- }): Promise<StarGiftValue>;
4092
- getStarGiftWithdrawalUrl(params: {
4093
- /** The star gift to withdraw */
4094
- gift: InputStarGift;
4095
- /** 2FA password */
4096
- password: string;
4097
- }): Promise<string>;
4098
4328
  /**
4099
4329
  * Get Telegram Stars transactions for a given peer.
4100
4330
  *
4101
4331
  * You can either pass `self` to get your own transactions,
4102
4332
  * or a chat/bot ID to get transactions of that peer.
4103
4333
  *
4104
- * **Available**: both users and bots
4334
+ * **Available**: 👤 users only
4105
4335
  *
4106
4336
  * @param peerId Peer ID
4107
4337
  * @param params Additional parameters
@@ -4130,12 +4360,6 @@ export interface TelegramClient extends ITelegramClient {
4130
4360
  */
4131
4361
  limit?: number;
4132
4362
  }): Promise<StarsStatus>;
4133
- /**
4134
- * Get information about a unique star gift by its slug
4135
- * **Available**: ✅ both users and bots
4136
- *
4137
- */
4138
- getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
4139
4363
  /**
4140
4364
  * Iterate over boosters of a channel.
4141
4365
  *
@@ -4158,26 +4382,6 @@ export interface TelegramClient extends ITelegramClient {
4158
4382
  */
4159
4383
  chunkSize?: number;
4160
4384
  }): AsyncIterableIterator<Boost>;
4161
- /**
4162
- * Iterate over saved star gifts of a user,
4163
- * wrapper over {@link getSavedStarGifts}
4164
- * **Available**: ✅ both users and bots
4165
- *
4166
- */
4167
- iterSavedStarGifts(params: Parameters<typeof getSavedStarGifts>[1] & {
4168
- /**
4169
- * Number of gifts to fetch per request
4170
- *
4171
- * @default 100
4172
- */
4173
- chunkSize?: number;
4174
- /**
4175
- * Total number of gifts to fetch
4176
- *
4177
- * @default Infinity
4178
- */
4179
- limit?: number;
4180
- }): AsyncIterableIterator<SavedStarGift>;
4181
4385
  /**
4182
4386
  * Iterate over Telegram Stars transactions for a given peer.
4183
4387
  *
@@ -4206,72 +4410,6 @@ export interface TelegramClient extends ITelegramClient {
4206
4410
  */
4207
4411
  chunkSize?: number;
4208
4412
  }): AsyncIterableIterator<StarsTransaction>;
4209
- /**
4210
- * Toggles whether one or more star gift is pinned to the top of the list
4211
- * **Available**: ✅ both users and bots
4212
- *
4213
- */
4214
- togglePinnedStarGifts(params: {
4215
- /** One or more gifts to pin */
4216
- gifts: MaybeArray<InputStarGift>;
4217
- /** Peer where the gift is sent */
4218
- peer: InputPeerLike;
4219
- }): Promise<void>;
4220
- /**
4221
- * Pay for other user's star gift upgrade.
4222
- *
4223
- * > **Note**: this method is not indended to be used by full-fledged clients,
4224
- * > as this method hides the actual invoice and payment form from the user.
4225
- * > For GUI clients, you should refer to the method's source code and
4226
- * > present the payment form to the user.
4227
- *
4228
- * **Available**: 👤 users only
4229
- *
4230
- * @returns Service message about the payment for the upgrade, if one was generated.
4231
- */
4232
- prepayStarGiftUpgrade(params: {
4233
- peer: InputPeerLike;
4234
- /** Prepaid upgrade hash, taken from `SavedStarGift.prepaidUpgradeHash` */
4235
- hash: string;
4236
- /**
4237
- * Whether to dispatch the new message event
4238
- * to the client's update handler.
4239
- */
4240
- shouldDispatch?: true;
4241
- }): Promise<Message | null>;
4242
- /**
4243
- * Send a star gift to a user.
4244
- *
4245
- * > **Note**: this method is not indended to be used by full-fledged clients,
4246
- * > as this method hides the actual invoice and payment form from the user.
4247
- * > For GUI clients, you should refer to the method's source code and
4248
- * > present the payment form to the user.
4249
- *
4250
- * **Available**: 👤 users only
4251
- *
4252
- * @returns Service message about the sent gift, if one was generated.
4253
- */
4254
- sendStarGift(params: {
4255
- /** ID of the peer to send the gift to */
4256
- peerId: InputPeerLike;
4257
- /** ID of the gift to send */
4258
- gift: Long | StarGift;
4259
- /**
4260
- * Whether to send the gift anonymously
4261
- * (i.e. if the recipient chooses to display the gift
4262
- * on their profile, your name won't be visible)
4263
- */
4264
- anonymous?: boolean;
4265
- /** Message to send along with the gift */
4266
- message?: InputText;
4267
- /** Whether to automatically upgrade the gift to a unique star gift */
4268
- withUpgrade?: boolean;
4269
- /**
4270
- * Whether to dispatch the new message event
4271
- * to the client's update handler.
4272
- */
4273
- shouldDispatch?: true;
4274
- }): Promise<Message | null>;
4275
4413
  /**
4276
4414
  * Set current user's business introduction.
4277
4415
  *
@@ -4310,69 +4448,12 @@ export interface TelegramClient extends ITelegramClient {
4310
4448
  /** Business work intervals, raw intervals */
4311
4449
  intervals: tl.TypeBusinessWeeklyOpen[];
4312
4450
  })) | null): Promise<void>;
4313
- /** Set resale price for an owned star gift */
4314
- setResaleStarGiftPrice(params: {
4315
- /** Star gift to update the price of */
4316
- gift: InputStarGift;
4317
- /**
4318
- * New price of the gift (in stars), or `null` to unlist
4319
- */
4320
- price: tl.Long | number | tl.TypeStarsAmount | null;
4321
- }): Promise<void>;
4322
- /**
4323
- * Transfer a unique star gift.
4324
- *
4325
- * > **Note**: this method is not indended to be used by full-fledged clients,
4326
- * > as this method hides the actual invoice and payment form from the user.
4327
- * > For GUI clients, you should refer to the method's source code and
4328
- * > present the payment form to the user.
4329
- *
4330
- * **Available**: 👤 users only
4331
- *
4332
- * @returns Service message about the transferred gift, if one was generated.
4333
- */
4334
- transferStarGift(params: {
4335
- /** Star gift to transfer */
4336
- gift: InputStarGift;
4337
- /** ID of the user to transfer the gift to */
4338
- recipient: InputPeerLike;
4339
- /**
4340
- * Whether to dispatch the new message event
4341
- * to the client's update handler.
4342
- */
4343
- shouldDispatch?: true;
4344
- }): Promise<Message | null>;
4345
- /**
4346
- * Upgrades a star gift to a unique gift.
4347
- *
4348
- * > **Note**: this method is not indended to be used by full-fledged clients,
4349
- * > as this method hides the actual invoice and payment form from the user.
4350
- * > For GUI clients, you should refer to the method's source code and
4351
- * > present the payment form to the user.
4352
- *
4353
- * **Available**: 👤 users only
4354
- *
4355
- * @returns Service message about the upgraded gift, if one was generated.
4356
- */
4357
- upgradeStarGift(params: {
4358
- gift: InputStarGift;
4359
- /**
4360
- * Whether to retain the original details of the gift
4361
- * (like sender, recipient, date, message)
4362
- */
4363
- keepOriginalDetails?: boolean;
4364
- /**
4365
- * Whether to dispatch the new message event
4366
- * to the client's update handler.
4367
- */
4368
- shouldDispatch?: true;
4369
- }): Promise<Message | null>;
4370
4451
  /**
4371
4452
  * Add a sticker to a sticker set.
4372
4453
  *
4373
4454
  * For bots the sticker set must have been created by this bot.
4374
4455
  *
4375
- * **Available**: both users and bots
4456
+ * **Available**: 👤 users only
4376
4457
  *
4377
4458
  * @param setId Sticker set short name or TL object with input sticker set
4378
4459
  * @param sticker Sticker to be added
@@ -4391,7 +4472,7 @@ export interface TelegramClient extends ITelegramClient {
4391
4472
  /**
4392
4473
  * Create a new sticker set.
4393
4474
  *
4394
- * **Available**: both users and bots
4475
+ * **Available**: 👤 users only
4395
4476
  *
4396
4477
  * @param params
4397
4478
  * @returns Newly created sticker set
@@ -4459,7 +4540,7 @@ export interface TelegramClient extends ITelegramClient {
4459
4540
  *
4460
4541
  * For bots the sticker set must have been created by this bot.
4461
4542
  *
4462
- * **Available**: both users and bots
4543
+ * **Available**: 👤 users only
4463
4544
  *
4464
4545
  * @param sticker
4465
4546
  * TDLib and Bot API compatible File ID, or a
@@ -4470,7 +4551,7 @@ export interface TelegramClient extends ITelegramClient {
4470
4551
  /**
4471
4552
  * Get custom emoji stickers by their IDs
4472
4553
  *
4473
- * **Available**: both users and bots
4554
+ * **Available**: 👤 users only
4474
4555
  *
4475
4556
  * @param ids IDs of the stickers (as defined in {@link MessageEntity.emojiId})
4476
4557
  */
@@ -4505,7 +4586,7 @@ export interface TelegramClient extends ITelegramClient {
4505
4586
  /**
4506
4587
  * Get a sticker set and stickers inside of it.
4507
4588
  *
4508
- * **Available**: both users and bots
4589
+ * **Available**: 👤 users only
4509
4590
  *
4510
4591
  * @param setId Sticker set identifier
4511
4592
  */
@@ -4516,7 +4597,7 @@ export interface TelegramClient extends ITelegramClient {
4516
4597
  *
4517
4598
  * For bots the sticker set must have been created by this bot.
4518
4599
  *
4519
- * **Available**: both users and bots
4600
+ * **Available**: 👤 users only
4520
4601
  *
4521
4602
  * @param sticker
4522
4603
  * TDLib and Bot API compatible File ID, or a
@@ -4550,7 +4631,7 @@ export interface TelegramClient extends ITelegramClient {
4550
4631
  /**
4551
4632
  * Set group sticker set for a supergroup
4552
4633
  *
4553
- * **Available**: both users and bots
4634
+ * **Available**: 👤 users only
4554
4635
  *
4555
4636
  * @param setId Sticker set short name or a TL object with input sticker set
4556
4637
  * @param thumb Sticker set thumbnail
@@ -4561,7 +4642,7 @@ export interface TelegramClient extends ITelegramClient {
4561
4642
  /**
4562
4643
  * Set sticker set thumbnail
4563
4644
  *
4564
- * **Available**: both users and bots
4645
+ * **Available**: 👤 users only
4565
4646
  *
4566
4647
  * @param id Sticker set short name or a TL object with input sticker set
4567
4648
  * @param thumb Sticker set thumbnail
@@ -5002,7 +5083,7 @@ export interface TelegramClient extends ITelegramClient {
5002
5083
  getGlobalTtl(): Promise<number>;
5003
5084
  /**
5004
5085
  * Get currently authorized user's full information
5005
- * **Available**: both users and bots
5086
+ * **Available**: 👤 users only
5006
5087
  *
5007
5088
  */
5008
5089
  getMe(): Promise<User>;
@@ -5020,7 +5101,7 @@ export interface TelegramClient extends ITelegramClient {
5020
5101
  /**
5021
5102
  * Get a single profile picture of a user by its ID
5022
5103
  *
5023
- * **Available**: both users and bots
5104
+ * **Available**: 👤 users only
5024
5105
  *
5025
5106
  * @param userId User ID, username, phone number, `"me"` or `"self"`
5026
5107
  * @param photoId ID of the photo to fetch
@@ -5030,7 +5111,7 @@ export interface TelegramClient extends ITelegramClient {
5030
5111
  /**
5031
5112
  * Get a list of profile pictures of a user
5032
5113
  *
5033
- * **Available**: both users and bots
5114
+ * **Available**: 👤 users only
5034
5115
  *
5035
5116
  * @param userId User ID, username, phone number, `"me"` or `"self"`
5036
5117
  * @param params
@@ -5051,6 +5132,8 @@ export interface TelegramClient extends ITelegramClient {
5051
5132
  }): Promise<ArrayPaginated<Photo, number>>;
5052
5133
  /**
5053
5134
  * Get music files saved to the user's profile
5135
+ * **Available**: 👤 users only
5136
+ *
5054
5137
  */
5055
5138
  getSavedMusic(params: {
5056
5139
  /** User ID, username, phone number, `"me"` or `"self"` */
@@ -5192,6 +5275,8 @@ export interface TelegramClient extends ITelegramClient {
5192
5275
  * - yourself (`self`)
5193
5276
  * - supergroups or channels with enough boosts which you are an admin of
5194
5277
  * - for bots – users who gave you the appropriate permissions
5278
+ * **Available**: 👤 users only
5279
+ *
5195
5280
  */
5196
5281
  setEmojiStatus(params: {
5197
5282
  /** User or chat where the emoji status should be set */
@@ -5231,7 +5316,7 @@ export interface TelegramClient extends ITelegramClient {
5231
5316
  * Set a new profile photo or video for the current user.
5232
5317
  *
5233
5318
  * You can also pass a file ID or an InputPhoto to re-use existing photo.
5234
- * **Available**: both users and bots
5319
+ * **Available**: 👤 users only
5235
5320
  *
5236
5321
  */
5237
5322
  setMyProfilePhoto(params: {