@mtcute/core 0.19.7 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/client.cjs +24 -0
  2. package/client.js +24 -0
  3. package/highlevel/base.cjs +2 -2
  4. package/highlevel/base.js +2 -2
  5. package/highlevel/client.d.cts +68 -9
  6. package/highlevel/client.d.ts +68 -9
  7. package/highlevel/methods/files/normalize-input-media.cjs +12 -2
  8. package/highlevel/methods/files/normalize-input-media.js +12 -2
  9. package/highlevel/methods/messages/forward-messages.cjs +4 -2
  10. package/highlevel/methods/messages/forward-messages.d.cts +2 -0
  11. package/highlevel/methods/messages/forward-messages.d.ts +2 -0
  12. package/highlevel/methods/messages/forward-messages.js +4 -2
  13. package/highlevel/methods/premium/_normalize-input-star-gift.cjs +23 -0
  14. package/highlevel/methods/premium/_normalize-input-star-gift.d.cts +4 -0
  15. package/highlevel/methods/premium/_normalize-input-star-gift.d.ts +4 -0
  16. package/highlevel/methods/premium/_normalize-input-star-gift.js +18 -0
  17. package/highlevel/methods/premium/accept-star-gift.cjs +4 -3
  18. package/highlevel/methods/premium/accept-star-gift.d.cts +3 -3
  19. package/highlevel/methods/premium/accept-star-gift.d.ts +3 -3
  20. package/highlevel/methods/premium/accept-star-gift.js +4 -3
  21. package/highlevel/methods/premium/get-saved-star-gifts-by-id.cjs +21 -0
  22. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.cts +6 -0
  23. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.ts +6 -0
  24. package/highlevel/methods/premium/get-saved-star-gifts-by-id.js +16 -0
  25. package/highlevel/methods/premium/get-saved-star-gifts.cjs +32 -0
  26. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +24 -0
  27. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +24 -0
  28. package/highlevel/methods/premium/get-saved-star-gifts.js +27 -0
  29. package/highlevel/methods/premium/get-star-gift-withdrawal-url.cjs +23 -0
  30. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.cts +8 -0
  31. package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.ts +8 -0
  32. package/highlevel/methods/premium/get-star-gift-withdrawal-url.js +18 -0
  33. package/highlevel/methods/premium/get-unique-star-gift.cjs +20 -0
  34. package/highlevel/methods/premium/get-unique-star-gift.d.cts +6 -0
  35. package/highlevel/methods/premium/get-unique-star-gift.d.ts +6 -0
  36. package/highlevel/methods/premium/get-unique-star-gift.js +15 -0
  37. package/highlevel/methods/premium/iter-saved-star-gifts.cjs +33 -0
  38. package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +27 -0
  39. package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +27 -0
  40. package/highlevel/methods/premium/iter-saved-star-gifts.js +28 -0
  41. package/highlevel/methods/premium/send-star-gift.cjs +2 -2
  42. package/highlevel/methods/premium/send-star-gift.d.cts +2 -2
  43. package/highlevel/methods/premium/send-star-gift.d.ts +2 -2
  44. package/highlevel/methods/premium/send-star-gift.js +3 -3
  45. package/highlevel/methods/premium/transfer-star-gift.cjs +4 -4
  46. package/highlevel/methods/premium/transfer-star-gift.d.cts +3 -3
  47. package/highlevel/methods/premium/transfer-star-gift.d.ts +3 -3
  48. package/highlevel/methods/premium/transfer-star-gift.js +5 -5
  49. package/highlevel/methods/premium/upgrade-star-gift.cjs +3 -3
  50. package/highlevel/methods/premium/upgrade-star-gift.d.cts +2 -2
  51. package/highlevel/methods/premium/upgrade-star-gift.d.ts +2 -2
  52. package/highlevel/methods/premium/upgrade-star-gift.js +3 -3
  53. package/highlevel/methods/users/set-emoji-status.cjs +8 -1
  54. package/highlevel/methods/users/set-emoji-status.d.cts +2 -0
  55. package/highlevel/methods/users/set-emoji-status.d.ts +2 -0
  56. package/highlevel/methods/users/set-emoji-status.js +8 -1
  57. package/highlevel/methods.d.cts +6 -0
  58. package/highlevel/methods.d.ts +6 -0
  59. package/highlevel/types/media/input-media/types.d.cts +4 -0
  60. package/highlevel/types/media/input-media/types.d.ts +4 -0
  61. package/highlevel/types/media/video.cjs +8 -0
  62. package/highlevel/types/media/video.d.cts +3 -0
  63. package/highlevel/types/media/video.d.ts +3 -0
  64. package/highlevel/types/media/video.js +8 -0
  65. package/highlevel/types/messages/message-action.cjs +22 -1
  66. package/highlevel/types/messages/message-action.d.cts +4 -0
  67. package/highlevel/types/messages/message-action.d.ts +4 -0
  68. package/highlevel/types/messages/message-action.js +22 -1
  69. package/highlevel/types/peers/chat.cjs +3 -1
  70. package/highlevel/types/peers/chat.js +3 -1
  71. package/highlevel/types/peers/full-chat.cjs +8 -0
  72. package/highlevel/types/peers/full-chat.d.cts +4 -0
  73. package/highlevel/types/peers/full-chat.d.ts +4 -0
  74. package/highlevel/types/peers/full-chat.js +8 -0
  75. package/highlevel/types/peers/user.cjs +3 -1
  76. package/highlevel/types/peers/user.js +3 -1
  77. package/highlevel/types/premium/index.d.cts +1 -0
  78. package/highlevel/types/premium/index.d.ts +1 -0
  79. package/highlevel/types/premium/saved-star-gift.cjs +80 -0
  80. package/highlevel/types/premium/saved-star-gift.d.cts +39 -0
  81. package/highlevel/types/premium/saved-star-gift.d.ts +39 -0
  82. package/highlevel/types/premium/saved-star-gift.js +75 -0
  83. package/highlevel/types/premium/stars-gift-unique.cjs +18 -5
  84. package/highlevel/types/premium/stars-gift-unique.d.cts +11 -5
  85. package/highlevel/types/premium/stars-gift-unique.d.ts +11 -5
  86. package/highlevel/types/premium/stars-gift-unique.js +18 -5
  87. package/highlevel/types/premium/stars-gift.d.cts +12 -1
  88. package/highlevel/types/premium/stars-gift.d.ts +12 -1
  89. package/highlevel/types/reactions/emoji-status.cjs +38 -1
  90. package/highlevel/types/reactions/emoji-status.d.cts +23 -2
  91. package/highlevel/types/reactions/emoji-status.d.ts +23 -2
  92. package/highlevel/types/reactions/emoji-status.js +39 -2
  93. package/highlevel/types/stories/interactive/index.cjs +4 -0
  94. package/highlevel/types/stories/interactive/index.d.cts +3 -2
  95. package/highlevel/types/stories/interactive/index.d.ts +3 -2
  96. package/highlevel/types/stories/interactive/index.js +4 -0
  97. package/highlevel/types/stories/interactive/star-gift.cjs +22 -0
  98. package/highlevel/types/stories/interactive/star-gift.d.cts +12 -0
  99. package/highlevel/types/stories/interactive/star-gift.d.ts +12 -0
  100. package/highlevel/types/stories/interactive/star-gift.js +17 -0
  101. package/highlevel/updates/manager.cjs +11 -9
  102. package/highlevel/updates/manager.d.cts +1 -3
  103. package/highlevel/updates/manager.d.ts +1 -3
  104. package/highlevel/updates/manager.js +11 -9
  105. package/index.cjs +5 -0
  106. package/index.js +6 -1
  107. package/methods.cjs +12 -0
  108. package/methods.js +12 -0
  109. package/network/network-manager.cjs +1 -1
  110. package/network/network-manager.js +1 -1
  111. package/package.json +2 -2
package/client.cjs CHANGED
@@ -186,6 +186,7 @@ const changeCloudPassword = require("./highlevel/methods/password/change-cloud-p
186
186
  const enableCloudPassword = require("./highlevel/methods/password/enable-cloud-password.cjs");
187
187
  const passwordEmail = require("./highlevel/methods/password/password-email.cjs");
188
188
  const removeCloudPassword = require("./highlevel/methods/password/remove-cloud-password.cjs");
189
+ const _normalizeInputStarGift = require("./highlevel/methods/premium/_normalize-input-star-gift.cjs");
189
190
  const acceptStarGift = require("./highlevel/methods/premium/accept-star-gift.cjs");
190
191
  const applyBoost = require("./highlevel/methods/premium/apply-boost.cjs");
191
192
  const canApplyBoost = require("./highlevel/methods/premium/can-apply-boost.cjs");
@@ -196,10 +197,15 @@ const getBoosts = require("./highlevel/methods/premium/get-boosts.cjs");
196
197
  const getBusinessChatLinks = require("./highlevel/methods/premium/get-business-chat-links.cjs");
197
198
  const getBusinessConnection = require("./highlevel/methods/premium/get-business-connection.cjs");
198
199
  const getMyBoostSlots = require("./highlevel/methods/premium/get-my-boost-slots.cjs");
200
+ const getSavedStarGiftsById = require("./highlevel/methods/premium/get-saved-star-gifts-by-id.cjs");
201
+ const getSavedStarGifts = require("./highlevel/methods/premium/get-saved-star-gifts.cjs");
199
202
  const getStarGiftOptions = require("./highlevel/methods/premium/get-star-gift-options.cjs");
203
+ const getStarGiftWithdrawalUrl = require("./highlevel/methods/premium/get-star-gift-withdrawal-url.cjs");
200
204
  const getStarGifts = require("./highlevel/methods/premium/get-star-gifts.cjs");
201
205
  const getStarsTransactions = require("./highlevel/methods/premium/get-stars-transactions.cjs");
206
+ const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
202
207
  const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
208
+ const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
203
209
  const iterStarGifts = require("./highlevel/methods/premium/iter-star-gifts.cjs");
204
210
  const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
205
211
  const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
@@ -1012,6 +1018,9 @@ TelegramClient.prototype.cancelPasswordEmail = function(...args) {
1012
1018
  TelegramClient.prototype.removeCloudPassword = function(...args) {
1013
1019
  return removeCloudPassword.removeCloudPassword(this._client, ...args);
1014
1020
  };
1021
+ TelegramClient.prototype._normalizeInputStarGift = function(...args) {
1022
+ return _normalizeInputStarGift._normalizeInputStarGift(this._client, ...args);
1023
+ };
1015
1024
  TelegramClient.prototype.acceptStarGift = function(...args) {
1016
1025
  return acceptStarGift.acceptStarGift(this._client, ...args);
1017
1026
  };
@@ -1045,18 +1054,33 @@ TelegramClient.prototype.getBusinessConnection = function(...args) {
1045
1054
  TelegramClient.prototype.getMyBoostSlots = function(...args) {
1046
1055
  return getMyBoostSlots.getMyBoostSlots(this._client, ...args);
1047
1056
  };
1057
+ TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1058
+ return getSavedStarGiftsById.getSavedStarGiftsById(this._client, ...args);
1059
+ };
1060
+ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1061
+ return getSavedStarGifts.getSavedStarGifts(this._client, ...args);
1062
+ };
1048
1063
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1049
1064
  return getStarGiftOptions.getStarGiftOptions(this._client, ...args);
1050
1065
  };
1066
+ TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1067
+ return getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl(this._client, ...args);
1068
+ };
1051
1069
  TelegramClient.prototype.getStarGifts = function(...args) {
1052
1070
  return getStarGifts.getStarGifts(this._client, ...args);
1053
1071
  };
1054
1072
  TelegramClient.prototype.getStarsTransactions = function(...args) {
1055
1073
  return getStarsTransactions.getStarsTransactions(this._client, ...args);
1056
1074
  };
1075
+ TelegramClient.prototype.getUniqueStarGift = function(...args) {
1076
+ return getUniqueStarGift.getUniqueStarGift(this._client, ...args);
1077
+ };
1057
1078
  TelegramClient.prototype.iterBoosters = function(...args) {
1058
1079
  return iterBoosters.iterBoosters(this._client, ...args);
1059
1080
  };
1081
+ TelegramClient.prototype.iterSavedStarGifts = function(...args) {
1082
+ return iterSavedStarGifts.iterSavedStarGifts(this._client, ...args);
1083
+ };
1060
1084
  TelegramClient.prototype.iterStarGifts = function(...args) {
1061
1085
  return iterStarGifts.iterStarGifts(this._client, ...args);
1062
1086
  };
package/client.js CHANGED
@@ -179,6 +179,7 @@ import { changeCloudPassword } from "./highlevel/methods/password/change-cloud-p
179
179
  import { enableCloudPassword } from "./highlevel/methods/password/enable-cloud-password.js";
180
180
  import { verifyPasswordEmail, resendPasswordEmail, cancelPasswordEmail } from "./highlevel/methods/password/password-email.js";
181
181
  import { removeCloudPassword } from "./highlevel/methods/password/remove-cloud-password.js";
182
+ import { _normalizeInputStarGift } from "./highlevel/methods/premium/_normalize-input-star-gift.js";
182
183
  import { acceptStarGift } from "./highlevel/methods/premium/accept-star-gift.js";
183
184
  import { applyBoost } from "./highlevel/methods/premium/apply-boost.js";
184
185
  import { canApplyBoost } from "./highlevel/methods/premium/can-apply-boost.js";
@@ -189,10 +190,15 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
189
190
  import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
190
191
  import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
191
192
  import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
193
+ import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
194
+ import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
192
195
  import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
196
+ import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
193
197
  import { getStarGifts } from "./highlevel/methods/premium/get-star-gifts.js";
194
198
  import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
199
+ import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
195
200
  import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
201
+ import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
196
202
  import { iterStarGifts } from "./highlevel/methods/premium/iter-star-gifts.js";
197
203
  import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
198
204
  import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
@@ -1005,6 +1011,9 @@ TelegramClient.prototype.cancelPasswordEmail = function(...args) {
1005
1011
  TelegramClient.prototype.removeCloudPassword = function(...args) {
1006
1012
  return removeCloudPassword(this._client, ...args);
1007
1013
  };
1014
+ TelegramClient.prototype._normalizeInputStarGift = function(...args) {
1015
+ return _normalizeInputStarGift(this._client, ...args);
1016
+ };
1008
1017
  TelegramClient.prototype.acceptStarGift = function(...args) {
1009
1018
  return acceptStarGift(this._client, ...args);
1010
1019
  };
@@ -1038,18 +1047,33 @@ TelegramClient.prototype.getBusinessConnection = function(...args) {
1038
1047
  TelegramClient.prototype.getMyBoostSlots = function(...args) {
1039
1048
  return getMyBoostSlots(this._client, ...args);
1040
1049
  };
1050
+ TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1051
+ return getSavedStarGiftsById(this._client, ...args);
1052
+ };
1053
+ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1054
+ return getSavedStarGifts(this._client, ...args);
1055
+ };
1041
1056
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1042
1057
  return getStarGiftOptions(this._client, ...args);
1043
1058
  };
1059
+ TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1060
+ return getStarGiftWithdrawalUrl(this._client, ...args);
1061
+ };
1044
1062
  TelegramClient.prototype.getStarGifts = function(...args) {
1045
1063
  return getStarGifts(this._client, ...args);
1046
1064
  };
1047
1065
  TelegramClient.prototype.getStarsTransactions = function(...args) {
1048
1066
  return getStarsTransactions(this._client, ...args);
1049
1067
  };
1068
+ TelegramClient.prototype.getUniqueStarGift = function(...args) {
1069
+ return getUniqueStarGift(this._client, ...args);
1070
+ };
1050
1071
  TelegramClient.prototype.iterBoosters = function(...args) {
1051
1072
  return iterBoosters(this._client, ...args);
1052
1073
  };
1074
+ TelegramClient.prototype.iterSavedStarGifts = function(...args) {
1075
+ return iterSavedStarGifts(this._client, ...args);
1076
+ };
1053
1077
  TelegramClient.prototype.iterStarGifts = function(...args) {
1054
1078
  return iterStarGifts(this._client, ...args);
1055
1079
  };
@@ -125,8 +125,8 @@ class BaseTelegramClient {
125
125
  async notifyLoggedIn(auth) {
126
126
  const user = this.mt.network.notifyLoggedIn(auth);
127
127
  this.log.prefix = `[USER ${user.id}] `;
128
- const self = await this.storage.self.storeFrom(user);
129
- this.updates?.notifyLoggedIn(self);
128
+ await this.storage.self.storeFrom(user);
129
+ this.updates?.notifyLoggedIn();
130
130
  return user;
131
131
  }
132
132
  async notifyLoggedOut() {
package/highlevel/base.js CHANGED
@@ -118,8 +118,8 @@ class BaseTelegramClient {
118
118
  async notifyLoggedIn(auth) {
119
119
  const user = this.mt.network.notifyLoggedIn(auth);
120
120
  this.log.prefix = `[USER ${user.id}] `;
121
- const self = await this.storage.self.storeFrom(user);
122
- this.updates?.notifyLoggedIn(self);
121
+ await this.storage.self.storeFrom(user);
122
+ this.updates?.notifyLoggedIn();
123
123
  return user;
124
124
  }
125
125
  async notifyLoggedOut() {
@@ -23,7 +23,7 @@ import { QuoteParamsFrom } from './methods/messages/send-quote.js';
23
23
  import { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
24
24
  import { CanSendStoryResult } from './methods/stories/can-send-story.js';
25
25
  import { ITelegramStorageProvider } from './storage/provider.js';
26
- import { AllStories, ArrayPaginated, ArrayWithTotal, 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, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SentCode, StarGift, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js';
26
+ import { AllStories, ArrayPaginated, ArrayWithTotal, 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, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStarGift, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SavedStarGift, SentCode, StarGift, StarGiftUnique, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js';
27
27
  import { ParsedUpdateHandlerParams } from './updates/parsed.js';
28
28
  import { RawUpdateInfo } from './updates/types.js';
29
29
  import { InputStringSessionData } from './utils/string-session.js';
@@ -3818,6 +3818,7 @@ export interface TelegramClient extends ITelegramClient {
3818
3818
  * @param password 2FA password as plaintext
3819
3819
  */
3820
3820
  removeCloudPassword(password: string): Promise<void>;
3821
+ _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
3821
3822
  /**
3822
3823
  * Accept, hide or convert a star gift.
3823
3824
  *
@@ -3826,8 +3827,8 @@ export interface TelegramClient extends ITelegramClient {
3826
3827
  * @returns Whether the action was successful
3827
3828
  */
3828
3829
  acceptStarGift(params: {
3829
- /** ID of the message containing the gift */
3830
- message: number | Message;
3830
+ /** Input star gift to accept */
3831
+ gift: InputStarGift;
3831
3832
  /**
3832
3833
  * Action to perform on the gift.
3833
3834
  * - `save` - save the gift to your profile
@@ -3939,12 +3940,41 @@ export interface TelegramClient extends ITelegramClient {
3939
3940
  *
3940
3941
  */
3941
3942
  getMyBoostSlots(): Promise<BoostSlot[]>;
3943
+ /** Get one or more saved star gifts by their IDs */
3944
+ getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
3945
+ /** Get a list of saved star gifts of a user */
3946
+ getSavedStarGifts(params: {
3947
+ /** Peer to get saved gifts from */
3948
+ owner: InputPeerLike;
3949
+ /** Whether to exclude hidden gifts */
3950
+ excludeHidden?: boolean;
3951
+ /** Whether to exclude publicly visible gifts */
3952
+ excludePublic?: boolean;
3953
+ /** Whether to exclude gifts with unlimited availability */
3954
+ excludeUnlimited?: boolean;
3955
+ /** Whether to exclude gifts with limited availability */
3956
+ excludeLimited?: boolean;
3957
+ /** Whether to exclude unique gifts */
3958
+ excludeUnique?: boolean;
3959
+ /** Whether to sort by value */
3960
+ sortByValue?: boolean;
3961
+ /** Offset for pagination */
3962
+ offset?: string;
3963
+ /** Limit for pagination */
3964
+ limit?: number;
3965
+ }): Promise<ArrayPaginated<SavedStarGift, string>>;
3942
3966
  /**
3943
3967
  * Get the list of available star gifts.
3944
3968
  * **Available**: 👤 users only
3945
3969
  *
3946
3970
  */
3947
3971
  getStarGiftOptions(): Promise<StarGift[]>;
3972
+ getStarGiftWithdrawalUrl(params: {
3973
+ /** The star gift to withdraw */
3974
+ gift: InputStarGift;
3975
+ /** 2FA password */
3976
+ password: string;
3977
+ }): Promise<string>;
3948
3978
  /**
3949
3979
  * Get a list of gifts sent to a user.
3950
3980
  *
@@ -3998,6 +4028,10 @@ export interface TelegramClient extends ITelegramClient {
3998
4028
  */
3999
4029
  limit?: number;
4000
4030
  }): Promise<StarsStatus>;
4031
+ /**
4032
+ * Get information about a unique star gift by its slug
4033
+ */
4034
+ getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
4001
4035
  /**
4002
4036
  * Iterate over boosters of a channel.
4003
4037
  *
@@ -4020,6 +4054,30 @@ export interface TelegramClient extends ITelegramClient {
4020
4054
  */
4021
4055
  chunkSize?: number;
4022
4056
  }): AsyncIterableIterator<Boost>;
4057
+ /**
4058
+ * Iterate over saved star gifts of a user,
4059
+ * wrapper over {@link getSavedStarGifts}
4060
+ */
4061
+ iterSavedStarGifts(params: {
4062
+ /** Peer to get saved gifts from */
4063
+ owner: InputPeerLike;
4064
+ /** Whether to exclude unsaved gifts */
4065
+ excludeUnsaved?: boolean;
4066
+ /** Whether to exclude saved gifts */
4067
+ excludeSaved?: boolean;
4068
+ /** Whether to exclude gifts with unlimited availability */
4069
+ excludeUnlimited?: boolean;
4070
+ /** Whether to exclude gifts with limited availability */
4071
+ excludeLimited?: boolean;
4072
+ /** Whether to exclude unique gifts */
4073
+ excludeUnique?: boolean;
4074
+ /** Whether to sort by value */
4075
+ sortByValue?: boolean;
4076
+ /** Offset for pagination */
4077
+ offset?: string;
4078
+ /** Limit for pagination */
4079
+ limit?: number;
4080
+ }): AsyncIterableIterator<SavedStarGift>;
4023
4081
  /**
4024
4082
  * Iterate over gifts sent to a given user.
4025
4083
  *
@@ -4086,8 +4144,8 @@ export interface TelegramClient extends ITelegramClient {
4086
4144
  * @returns Service message about the sent gift
4087
4145
  */
4088
4146
  sendStarGift(params: {
4089
- /** ID of the user to send the gift to */
4090
- userId: InputPeerLike;
4147
+ /** ID of the peer to send the gift to */
4148
+ peerId: InputPeerLike;
4091
4149
  /** ID of the gift to send */
4092
4150
  gift: Long | StarGift;
4093
4151
  /**
@@ -4157,8 +4215,8 @@ export interface TelegramClient extends ITelegramClient {
4157
4215
  * @returns Service message about the transferred gift
4158
4216
  */
4159
4217
  transferStarGift(params: {
4160
- /** ID of the message containing the gift */
4161
- message: number | Message;
4218
+ /** Star gift to transfer */
4219
+ gift: InputStarGift;
4162
4220
  /** ID of the user to transfer the gift to */
4163
4221
  recepient: InputPeerLike;
4164
4222
  /**
@@ -4180,8 +4238,7 @@ export interface TelegramClient extends ITelegramClient {
4180
4238
  * @returns Service message about the upgraded gift
4181
4239
  */
4182
4240
  upgradeStarGift(params: {
4183
- /** ID of the message containing the gift */
4184
- message: number | Message;
4241
+ gift: InputStarGift;
4185
4242
  /**
4186
4243
  * Whether to retain the original details of the gift
4187
4244
  * (like sender, recipient, date, message)
@@ -4993,6 +5050,8 @@ export interface TelegramClient extends ITelegramClient {
4993
5050
  peerId: InputPeerLike;
4994
5051
  /** Custom emoji ID or `null` to remove the emoji */
4995
5052
  emoji: tl.Long | null;
5053
+ /** When true, `emoji` is the ID of the collectible emoji */
5054
+ isCollectible?: boolean;
4996
5055
  /**
4997
5056
  * Date when the emoji status should expire (only if `emoji` is not `null`)
4998
5057
  */
@@ -23,7 +23,7 @@ import { QuoteParamsFrom } from './methods/messages/send-quote.js';
23
23
  import { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
24
24
  import { CanSendStoryResult } from './methods/stories/can-send-story.js';
25
25
  import { ITelegramStorageProvider } from './storage/provider.js';
26
- import { AllStories, ArrayPaginated, ArrayWithTotal, 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, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SentCode, StarGift, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js';
26
+ import { AllStories, ArrayPaginated, ArrayWithTotal, 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, InputFileLike, InputInlineResult, InputMediaLike, InputMediaSticker, InputMessageId, InputPeerLike, InputPrivacyRule, InputReaction, InputStarGift, InputStickerSet, InputStickerSetItem, InputText, InputWebview, MaybeDynamic, Message, MessageEffect, MessageMedia, MessageReactions, ParametersSkip2, ParsedUpdate, PeerReaction, PeerStories, Photo, Poll, PollUpdate, PollVoteUpdate, PreCheckoutQuery, RawDocument, ReplyMarkup, SavedStarGift, SentCode, StarGift, StarGiftUnique, StarsStatus, StarsTransaction, Sticker, StickerSet, StickerType, StoriesStealthMode, Story, StoryInteractions, StoryUpdate, StoryViewer, StoryViewersList, TakeoutSession, TextWithEntities, TypingStatus, UploadedFile, UploadFileLike, User, UserStarGift, UserStatusUpdate, UserTypingUpdate, WebviewResult } from './types/index.js';
27
27
  import { ParsedUpdateHandlerParams } from './updates/parsed.js';
28
28
  import { RawUpdateInfo } from './updates/types.js';
29
29
  import { InputStringSessionData } from './utils/string-session.js';
@@ -3818,6 +3818,7 @@ export interface TelegramClient extends ITelegramClient {
3818
3818
  * @param password 2FA password as plaintext
3819
3819
  */
3820
3820
  removeCloudPassword(password: string): Promise<void>;
3821
+ _normalizeInputStarGift(gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
3821
3822
  /**
3822
3823
  * Accept, hide or convert a star gift.
3823
3824
  *
@@ -3826,8 +3827,8 @@ export interface TelegramClient extends ITelegramClient {
3826
3827
  * @returns Whether the action was successful
3827
3828
  */
3828
3829
  acceptStarGift(params: {
3829
- /** ID of the message containing the gift */
3830
- message: number | Message;
3830
+ /** Input star gift to accept */
3831
+ gift: InputStarGift;
3831
3832
  /**
3832
3833
  * Action to perform on the gift.
3833
3834
  * - `save` - save the gift to your profile
@@ -3939,12 +3940,41 @@ export interface TelegramClient extends ITelegramClient {
3939
3940
  *
3940
3941
  */
3941
3942
  getMyBoostSlots(): Promise<BoostSlot[]>;
3943
+ /** Get one or more saved star gifts by their IDs */
3944
+ getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
3945
+ /** Get a list of saved star gifts of a user */
3946
+ getSavedStarGifts(params: {
3947
+ /** Peer to get saved gifts from */
3948
+ owner: InputPeerLike;
3949
+ /** Whether to exclude hidden gifts */
3950
+ excludeHidden?: boolean;
3951
+ /** Whether to exclude publicly visible gifts */
3952
+ excludePublic?: boolean;
3953
+ /** Whether to exclude gifts with unlimited availability */
3954
+ excludeUnlimited?: boolean;
3955
+ /** Whether to exclude gifts with limited availability */
3956
+ excludeLimited?: boolean;
3957
+ /** Whether to exclude unique gifts */
3958
+ excludeUnique?: boolean;
3959
+ /** Whether to sort by value */
3960
+ sortByValue?: boolean;
3961
+ /** Offset for pagination */
3962
+ offset?: string;
3963
+ /** Limit for pagination */
3964
+ limit?: number;
3965
+ }): Promise<ArrayPaginated<SavedStarGift, string>>;
3942
3966
  /**
3943
3967
  * Get the list of available star gifts.
3944
3968
  * **Available**: 👤 users only
3945
3969
  *
3946
3970
  */
3947
3971
  getStarGiftOptions(): Promise<StarGift[]>;
3972
+ getStarGiftWithdrawalUrl(params: {
3973
+ /** The star gift to withdraw */
3974
+ gift: InputStarGift;
3975
+ /** 2FA password */
3976
+ password: string;
3977
+ }): Promise<string>;
3948
3978
  /**
3949
3979
  * Get a list of gifts sent to a user.
3950
3980
  *
@@ -3998,6 +4028,10 @@ export interface TelegramClient extends ITelegramClient {
3998
4028
  */
3999
4029
  limit?: number;
4000
4030
  }): Promise<StarsStatus>;
4031
+ /**
4032
+ * Get information about a unique star gift by its slug
4033
+ */
4034
+ getUniqueStarGift(slug: string): Promise<StarGiftUnique>;
4001
4035
  /**
4002
4036
  * Iterate over boosters of a channel.
4003
4037
  *
@@ -4020,6 +4054,30 @@ export interface TelegramClient extends ITelegramClient {
4020
4054
  */
4021
4055
  chunkSize?: number;
4022
4056
  }): AsyncIterableIterator<Boost>;
4057
+ /**
4058
+ * Iterate over saved star gifts of a user,
4059
+ * wrapper over {@link getSavedStarGifts}
4060
+ */
4061
+ iterSavedStarGifts(params: {
4062
+ /** Peer to get saved gifts from */
4063
+ owner: InputPeerLike;
4064
+ /** Whether to exclude unsaved gifts */
4065
+ excludeUnsaved?: boolean;
4066
+ /** Whether to exclude saved gifts */
4067
+ excludeSaved?: boolean;
4068
+ /** Whether to exclude gifts with unlimited availability */
4069
+ excludeUnlimited?: boolean;
4070
+ /** Whether to exclude gifts with limited availability */
4071
+ excludeLimited?: boolean;
4072
+ /** Whether to exclude unique gifts */
4073
+ excludeUnique?: boolean;
4074
+ /** Whether to sort by value */
4075
+ sortByValue?: boolean;
4076
+ /** Offset for pagination */
4077
+ offset?: string;
4078
+ /** Limit for pagination */
4079
+ limit?: number;
4080
+ }): AsyncIterableIterator<SavedStarGift>;
4023
4081
  /**
4024
4082
  * Iterate over gifts sent to a given user.
4025
4083
  *
@@ -4086,8 +4144,8 @@ export interface TelegramClient extends ITelegramClient {
4086
4144
  * @returns Service message about the sent gift
4087
4145
  */
4088
4146
  sendStarGift(params: {
4089
- /** ID of the user to send the gift to */
4090
- userId: InputPeerLike;
4147
+ /** ID of the peer to send the gift to */
4148
+ peerId: InputPeerLike;
4091
4149
  /** ID of the gift to send */
4092
4150
  gift: Long | StarGift;
4093
4151
  /**
@@ -4157,8 +4215,8 @@ export interface TelegramClient extends ITelegramClient {
4157
4215
  * @returns Service message about the transferred gift
4158
4216
  */
4159
4217
  transferStarGift(params: {
4160
- /** ID of the message containing the gift */
4161
- message: number | Message;
4218
+ /** Star gift to transfer */
4219
+ gift: InputStarGift;
4162
4220
  /** ID of the user to transfer the gift to */
4163
4221
  recepient: InputPeerLike;
4164
4222
  /**
@@ -4180,8 +4238,7 @@ export interface TelegramClient extends ITelegramClient {
4180
4238
  * @returns Service message about the upgraded gift
4181
4239
  */
4182
4240
  upgradeStarGift(params: {
4183
- /** ID of the message containing the gift */
4184
- message: number | Message;
4241
+ gift: InputStarGift;
4185
4242
  /**
4186
4243
  * Whether to retain the original details of the gift
4187
4244
  * (like sender, recipient, date, message)
@@ -4993,6 +5050,8 @@ export interface TelegramClient extends ITelegramClient {
4993
5050
  peerId: InputPeerLike;
4994
5051
  /** Custom emoji ID or `null` to remove the emoji */
4995
5052
  emoji: tl.Long | null;
5053
+ /** When true, `emoji` is the ID of the collectible emoji */
5054
+ isCollectible?: boolean;
4996
5055
  /**
4997
5056
  * Date when the emoji status should expire (only if `emoji` is not `null`)
4998
5057
  */
@@ -213,6 +213,12 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
213
213
  inputFile = uploaded.inputFile;
214
214
  mime = uploaded.mime;
215
215
  };
216
+ let videoCover;
217
+ if (media.type === "video" && media.cover) {
218
+ const inputMedia = await _normalizeInputMedia(client, media.cover);
219
+ typeAssertions.assertTypeIs("uploadMediaIfNeeded", inputMedia, "inputMediaPhoto");
220
+ videoCover = inputMedia.id;
221
+ }
216
222
  const uploadPeer = params.uploadPeer ?? { _: "inputPeerSelf" };
217
223
  const uploadMediaIfNeeded = async (inputMedia, photo) => {
218
224
  if (!uploadMedia) return inputMedia;
@@ -248,7 +254,9 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
248
254
  fileReference: res.document.fileReference
249
255
  },
250
256
  ttlSeconds: media.ttlSeconds,
251
- spoiler: media.type === "video" && media.spoiler
257
+ spoiler: media.type === "video" && media.spoiler,
258
+ videoCover,
259
+ videoTimestamp: media.type === "video" ? media.timestamp : void 0
252
260
  };
253
261
  };
254
262
  const input = media.file;
@@ -358,7 +366,9 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
358
366
  mimeType: mime,
359
367
  attributes,
360
368
  ttlSeconds: media.ttlSeconds,
361
- spoiler: media.type === "video" && media.spoiler
369
+ spoiler: media.type === "video" && media.spoiler,
370
+ videoTimestamp: media.type === "video" ? media.timestamp : void 0,
371
+ videoCover
362
372
  },
363
373
  false
364
374
  );
@@ -206,6 +206,12 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
206
206
  inputFile = uploaded.inputFile;
207
207
  mime = uploaded.mime;
208
208
  };
209
+ let videoCover;
210
+ if (media.type === "video" && media.cover) {
211
+ const inputMedia = await _normalizeInputMedia(client, media.cover);
212
+ assertTypeIs("uploadMediaIfNeeded", inputMedia, "inputMediaPhoto");
213
+ videoCover = inputMedia.id;
214
+ }
209
215
  const uploadPeer = params.uploadPeer ?? { _: "inputPeerSelf" };
210
216
  const uploadMediaIfNeeded = async (inputMedia, photo) => {
211
217
  if (!uploadMedia) return inputMedia;
@@ -241,7 +247,9 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
241
247
  fileReference: res.document.fileReference
242
248
  },
243
249
  ttlSeconds: media.ttlSeconds,
244
- spoiler: media.type === "video" && media.spoiler
250
+ spoiler: media.type === "video" && media.spoiler,
251
+ videoCover,
252
+ videoTimestamp: media.type === "video" ? media.timestamp : void 0
245
253
  };
246
254
  };
247
255
  const input = media.file;
@@ -351,7 +359,9 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
351
359
  mimeType: mime,
352
360
  attributes,
353
361
  ttlSeconds: media.ttlSeconds,
354
- spoiler: media.type === "video" && media.spoiler
362
+ spoiler: media.type === "video" && media.spoiler,
363
+ videoTimestamp: media.type === "video" ? media.timestamp : void 0,
364
+ videoCover
355
365
  },
356
366
  false
357
367
  );
@@ -25,7 +25,8 @@ async function forwardMessagesById(client, params) {
25
25
  sendAs,
26
26
  noAuthor,
27
27
  noCaption,
28
- allowPaidFloodskip
28
+ allowPaidFloodskip,
29
+ videoTimestamp
29
30
  } = params;
30
31
  if (messages.length > 100) {
31
32
  throw new errors.MtArgumentError("You can forward no more than 100 messages at once");
@@ -45,7 +46,8 @@ async function forwardMessagesById(client, params) {
45
46
  noforwards: forbidForwards,
46
47
  sendAs: sendAs ? await resolvePeer.resolvePeer(client, sendAs) : void 0,
47
48
  quickReplyShortcut: sendCommon._normalizeQuickReplyShortcut(params.quickReply),
48
- allowPaidFloodskip
49
+ allowPaidFloodskip,
50
+ videoTimestamp
49
51
  });
50
52
  utils.assertIsUpdatesGroup("messages.forwardMessages", res);
51
53
  client.handleClientUpdate(res, !params.shouldDispatch);
@@ -57,6 +57,8 @@ export interface ForwardMessageOptions {
57
57
  * The Stars will be withdrawn from the bot's balance.
58
58
  */
59
59
  allowPaidFloodskip?: boolean;
60
+ /** Video timestamp to use for the forwarded video */
61
+ videoTimestamp?: number;
60
62
  }
61
63
  /**
62
64
  * Forward one or more messages by their IDs.
@@ -57,6 +57,8 @@ export interface ForwardMessageOptions {
57
57
  * The Stars will be withdrawn from the bot's balance.
58
58
  */
59
59
  allowPaidFloodskip?: boolean;
60
+ /** Video timestamp to use for the forwarded video */
61
+ videoTimestamp?: number;
60
62
  }
61
63
  /**
62
64
  * Forward one or more messages by their IDs.
@@ -18,7 +18,8 @@ async function forwardMessagesById(client, params) {
18
18
  sendAs,
19
19
  noAuthor,
20
20
  noCaption,
21
- allowPaidFloodskip
21
+ allowPaidFloodskip,
22
+ videoTimestamp
22
23
  } = params;
23
24
  if (messages.length > 100) {
24
25
  throw new MtArgumentError("You can forward no more than 100 messages at once");
@@ -38,7 +39,8 @@ async function forwardMessagesById(client, params) {
38
39
  noforwards: forbidForwards,
39
40
  sendAs: sendAs ? await resolvePeer(client, sendAs) : void 0,
40
41
  quickReplyShortcut: _normalizeQuickReplyShortcut(params.quickReply),
41
- allowPaidFloodskip
42
+ allowPaidFloodskip,
43
+ videoTimestamp
42
44
  });
43
45
  assertIsUpdatesGroup("messages.forwardMessages", res);
44
46
  client.handleClientUpdate(res, !params.shouldDispatch);
@@ -0,0 +1,23 @@
1
+ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WARNED) {
2
+ globalThis._MTCUTE_CJS_DEPRECATION_WARNED = true;
3
+ console.warn("[@mtcute/core] CommonJS support is deprecated and will be removed in 0.25.0. Please consider switching to ESM, it's " + (/* @__PURE__ */ new Date()).getFullYear() + " already.");
4
+ console.warn("[@mtcute/core] Learn more about switching to ESM: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c");
5
+ }
6
+ "use strict";
7
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
+ const resolvePeer = require("../users/resolve-peer.cjs");
9
+ async function _normalizeInputStarGift(client, gift) {
10
+ if ("message" in gift) {
11
+ return {
12
+ _: "inputSavedStarGiftUser",
13
+ msgId: typeof gift.message === "number" ? gift.message : gift.message.id
14
+ };
15
+ } else {
16
+ return {
17
+ _: "inputSavedStarGiftChat",
18
+ peer: await resolvePeer.resolvePeer(client, gift.owner),
19
+ savedId: gift.savedId
20
+ };
21
+ }
22
+ }
23
+ exports._normalizeInputStarGift = _normalizeInputStarGift;
@@ -0,0 +1,4 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { ITelegramClient } from '../../client.types.js';
3
+ import { InputStarGift } from '../../types/index.js';
4
+ export declare function _normalizeInputStarGift(client: ITelegramClient, gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
@@ -0,0 +1,4 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { ITelegramClient } from '../../client.types.js';
3
+ import { InputStarGift } from '../../types/index.js';
4
+ export declare function _normalizeInputStarGift(client: ITelegramClient, gift: InputStarGift): Promise<tl.TypeInputSavedStarGift>;
@@ -0,0 +1,18 @@
1
+ import { resolvePeer } from "../users/resolve-peer.js";
2
+ async function _normalizeInputStarGift(client, gift) {
3
+ if ("message" in gift) {
4
+ return {
5
+ _: "inputSavedStarGiftUser",
6
+ msgId: typeof gift.message === "number" ? gift.message : gift.message.id
7
+ };
8
+ } else {
9
+ return {
10
+ _: "inputSavedStarGiftChat",
11
+ peer: await resolvePeer(client, gift.owner),
12
+ savedId: gift.savedId
13
+ };
14
+ }
15
+ }
16
+ export {
17
+ _normalizeInputStarGift
18
+ };