@mtcute/core 0.25.7 → 0.26.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 (118) hide show
  1. package/client.cjs +20 -11
  2. package/client.js +23 -14
  3. package/highlevel/client.d.cts +80 -64
  4. package/highlevel/client.d.ts +80 -64
  5. package/highlevel/methods/files/normalize-input-media.cjs +13 -4
  6. package/highlevel/methods/files/normalize-input-media.js +13 -4
  7. package/highlevel/methods/forums/toggle-forum.cjs +0 -10
  8. package/highlevel/methods/forums/toggle-forum.d.cts +0 -10
  9. package/highlevel/methods/forums/toggle-forum.d.ts +0 -10
  10. package/highlevel/methods/forums/toggle-forum.js +0 -10
  11. package/highlevel/methods/premium/buy-resale-gift.cjs +3 -2
  12. package/highlevel/methods/premium/buy-resale-gift.d.cts +2 -0
  13. package/highlevel/methods/premium/buy-resale-gift.d.ts +2 -0
  14. package/highlevel/methods/premium/buy-resale-gift.js +3 -2
  15. package/highlevel/methods/premium/get-resale-star-gifts.cjs +2 -2
  16. package/highlevel/methods/premium/get-resale-star-gifts.d.cts +1 -1
  17. package/highlevel/methods/premium/get-resale-star-gifts.d.ts +1 -1
  18. package/highlevel/methods/premium/get-resale-star-gifts.js +2 -2
  19. package/highlevel/methods/premium/get-saved-star-gifts.cjs +2 -1
  20. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +4 -2
  21. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +4 -2
  22. package/highlevel/methods/premium/get-saved-star-gifts.js +2 -1
  23. package/highlevel/methods/{auth/run.cjs → premium/get-star-gift-value.cjs} +8 -5
  24. package/highlevel/methods/premium/get-star-gift-value.d.cts +9 -0
  25. package/highlevel/methods/premium/get-star-gift-value.d.ts +9 -0
  26. package/highlevel/methods/premium/get-star-gift-value.js +11 -0
  27. package/highlevel/methods/premium/get-stars-transactions.cjs +3 -2
  28. package/highlevel/methods/premium/get-stars-transactions.d.cts +2 -0
  29. package/highlevel/methods/premium/get-stars-transactions.d.ts +2 -0
  30. package/highlevel/methods/premium/get-stars-transactions.js +3 -2
  31. package/highlevel/methods/premium/iter-saved-star-gifts.cjs +15 -10
  32. package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +13 -19
  33. package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +13 -19
  34. package/highlevel/methods/premium/iter-saved-star-gifts.js +15 -10
  35. package/highlevel/methods/premium/prepay-star-gift-upgrade.cjs +30 -0
  36. package/highlevel/methods/premium/prepay-star-gift-upgrade.d.cts +23 -0
  37. package/highlevel/methods/premium/prepay-star-gift-upgrade.d.ts +23 -0
  38. package/highlevel/methods/premium/prepay-star-gift-upgrade.js +25 -0
  39. package/highlevel/methods/stickers/delete-sticker-from-set.d.cts +2 -4
  40. package/highlevel/methods/stickers/delete-sticker-from-set.d.ts +2 -4
  41. package/highlevel/methods/stickers/move-sticker-in-set.d.cts +2 -4
  42. package/highlevel/methods/stickers/move-sticker-in-set.d.ts +2 -4
  43. package/highlevel/methods/stickers/replace-sticker-in-set.d.cts +2 -4
  44. package/highlevel/methods/stickers/replace-sticker-in-set.d.ts +2 -4
  45. package/highlevel/methods/users/get-saved-music.cjs +38 -0
  46. package/highlevel/methods/users/get-saved-music.d.cts +13 -0
  47. package/highlevel/methods/users/get-saved-music.d.ts +13 -0
  48. package/highlevel/methods/users/get-saved-music.js +33 -0
  49. package/highlevel/methods/users/save-music-to-profile.cjs +57 -0
  50. package/highlevel/methods/users/save-music-to-profile.d.cts +19 -0
  51. package/highlevel/methods/users/save-music-to-profile.d.ts +19 -0
  52. package/highlevel/methods/users/save-music-to-profile.js +52 -0
  53. package/highlevel/methods/users/set-emoji-status.cjs +0 -8
  54. package/highlevel/methods/users/set-emoji-status.d.cts +0 -11
  55. package/highlevel/methods/users/set-emoji-status.d.ts +0 -11
  56. package/highlevel/methods/users/set-emoji-status.js +1 -9
  57. package/highlevel/methods.d.cts +6 -4
  58. package/highlevel/methods.d.ts +6 -4
  59. package/highlevel/types/files/utils.d.cts +7 -0
  60. package/highlevel/types/files/utils.d.ts +7 -0
  61. package/highlevel/types/media/document.d.cts +1 -1
  62. package/highlevel/types/media/document.d.ts +1 -1
  63. package/highlevel/types/messages/message-action.cjs +43 -21
  64. package/highlevel/types/messages/message-action.d.cts +58 -17
  65. package/highlevel/types/messages/message-action.d.ts +58 -17
  66. package/highlevel/types/messages/message-action.js +43 -21
  67. package/highlevel/types/peers/chat.cjs +5 -1
  68. package/highlevel/types/peers/chat.d.cts +5 -1
  69. package/highlevel/types/peers/chat.d.ts +5 -1
  70. package/highlevel/types/peers/chat.js +5 -1
  71. package/highlevel/types/peers/full-chat.cjs +4 -0
  72. package/highlevel/types/peers/full-chat.d.cts +2 -0
  73. package/highlevel/types/peers/full-chat.d.ts +2 -0
  74. package/highlevel/types/peers/full-chat.js +4 -0
  75. package/highlevel/types/peers/full-user.cjs +10 -1
  76. package/highlevel/types/peers/full-user.d.cts +3 -0
  77. package/highlevel/types/peers/full-user.d.ts +3 -0
  78. package/highlevel/types/peers/full-user.js +10 -1
  79. package/highlevel/types/premium/index.d.cts +1 -0
  80. package/highlevel/types/premium/index.d.ts +1 -0
  81. package/highlevel/types/premium/saved-star-gift.cjs +6 -0
  82. package/highlevel/types/premium/saved-star-gift.d.cts +4 -0
  83. package/highlevel/types/premium/saved-star-gift.d.ts +4 -0
  84. package/highlevel/types/premium/saved-star-gift.js +6 -0
  85. package/highlevel/types/premium/star-gift-value.cjs +65 -0
  86. package/highlevel/types/premium/star-gift-value.d.cts +41 -0
  87. package/highlevel/types/premium/star-gift-value.d.ts +41 -0
  88. package/highlevel/types/premium/star-gift-value.js +60 -0
  89. package/highlevel/types/premium/stars-gift-unique.cjs +10 -3
  90. package/highlevel/types/premium/stars-gift-unique.d.cts +1 -1
  91. package/highlevel/types/premium/stars-gift-unique.d.ts +1 -1
  92. package/highlevel/types/premium/stars-gift-unique.js +10 -3
  93. package/highlevel/types/premium/stars-transaction.cjs +9 -0
  94. package/highlevel/types/premium/stars-transaction.d.cts +10 -0
  95. package/highlevel/types/premium/stars-transaction.d.ts +10 -0
  96. package/highlevel/types/premium/stars-transaction.js +9 -0
  97. package/index.cjs +2 -0
  98. package/index.js +2 -0
  99. package/methods.cjs +10 -5
  100. package/methods.js +13 -8
  101. package/network/mtproto-session.cjs +1 -0
  102. package/network/mtproto-session.d.cts +1 -0
  103. package/network/mtproto-session.d.ts +1 -0
  104. package/network/mtproto-session.js +1 -0
  105. package/network/network-manager.cjs +1 -1
  106. package/network/network-manager.js +1 -1
  107. package/network/session-connection.cjs +27 -10
  108. package/network/session-connection.d.cts +1 -0
  109. package/network/session-connection.d.ts +1 -0
  110. package/network/session-connection.js +27 -10
  111. package/package.json +2 -2
  112. package/utils/binary/compat.cjs +35 -4
  113. package/utils/binary/compat.js +35 -4
  114. package/utils/binary/serialization.d.cts +3 -3
  115. package/utils/binary/serialization.d.ts +3 -3
  116. package/highlevel/methods/auth/run.d.cts +0 -16
  117. package/highlevel/methods/auth/run.d.ts +0 -16
  118. package/highlevel/methods/auth/run.js +0 -8
package/client.cjs CHANGED
@@ -12,7 +12,6 @@ const getPasswordHint = require("./highlevel/methods/auth/get-password-hint.cjs"
12
12
  const logOut = require("./highlevel/methods/auth/log-out.cjs");
13
13
  const recoverPassword = require("./highlevel/methods/auth/recover-password.cjs");
14
14
  const resendCode = require("./highlevel/methods/auth/resend-code.cjs");
15
- const run = require("./highlevel/methods/auth/run.cjs");
16
15
  const sendCode = require("./highlevel/methods/auth/send-code.cjs");
17
16
  const sendRecoveryCode = require("./highlevel/methods/auth/send-recovery-code.cjs");
18
17
  const signInBot = require("./highlevel/methods/auth/sign-in-bot.cjs");
@@ -208,6 +207,7 @@ const getResaleStarGifts = require("./highlevel/methods/premium/get-resale-star-
208
207
  const getSavedStarGiftsById = require("./highlevel/methods/premium/get-saved-star-gifts-by-id.cjs");
209
208
  const getSavedStarGifts = require("./highlevel/methods/premium/get-saved-star-gifts.cjs");
210
209
  const getStarGiftOptions = require("./highlevel/methods/premium/get-star-gift-options.cjs");
210
+ const getStarGiftValue = require("./highlevel/methods/premium/get-star-gift-value.cjs");
211
211
  const getStarGiftWithdrawalUrl = require("./highlevel/methods/premium/get-star-gift-withdrawal-url.cjs");
212
212
  const getStarsTransactions = require("./highlevel/methods/premium/get-stars-transactions.cjs");
213
213
  const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
@@ -215,6 +215,7 @@ const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
215
215
  const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
216
216
  const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
217
217
  const pinStarGift = require("./highlevel/methods/premium/pin-star-gift.cjs");
218
+ const prepayStarGiftUpgrade = require("./highlevel/methods/premium/prepay-star-gift-upgrade.cjs");
218
219
  const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
219
220
  const setBusinessIntro = require("./highlevel/methods/premium/set-business-intro.cjs");
220
221
  const setBusinessWorkHours = require("./highlevel/methods/premium/set-business-work-hours.cjs");
@@ -262,12 +263,14 @@ const getMyUsername = require("./highlevel/methods/users/get-my-username.cjs");
262
263
  const getPeerSettings = require("./highlevel/methods/users/get-peer-settings.cjs");
263
264
  const getProfilePhoto = require("./highlevel/methods/users/get-profile-photo.cjs");
264
265
  const getProfilePhotos = require("./highlevel/methods/users/get-profile-photos.cjs");
266
+ const getSavedMusic = require("./highlevel/methods/users/get-saved-music.cjs");
265
267
  const getUsers = require("./highlevel/methods/users/get-users.cjs");
266
268
  const isPeerAvailable = require("./highlevel/methods/users/is-peer-available.cjs");
267
269
  const iterProfilePhotos = require("./highlevel/methods/users/iter-profile-photos.cjs");
268
270
  const resolvePeerMany = require("./highlevel/methods/users/resolve-peer-many.cjs");
269
271
  const resolvePeer = require("./highlevel/methods/users/resolve-peer.cjs");
270
272
  const resolvePhoneNumber = require("./highlevel/methods/users/resolve-phone-number.cjs");
273
+ const saveMusicToProfile = require("./highlevel/methods/users/save-music-to-profile.cjs");
271
274
  const setEmojiStatus = require("./highlevel/methods/users/set-emoji-status.cjs");
272
275
  const setGlobalTtl = require("./highlevel/methods/users/set-global-ttl.cjs");
273
276
  const setMyBirthday = require("./highlevel/methods/users/set-my-birthday.cjs");
@@ -450,9 +453,6 @@ TelegramClient.prototype.recoverPassword = function(...args) {
450
453
  TelegramClient.prototype.resendCode = function(...args) {
451
454
  return resendCode.resendCode(this._client, ...args);
452
455
  };
453
- TelegramClient.prototype.run = function(...args) {
454
- return run.run(this._client, ...args);
455
- };
456
456
  TelegramClient.prototype.sendCode = function(...args) {
457
457
  return sendCode.sendCode(this._client, ...args);
458
458
  };
@@ -783,9 +783,6 @@ TelegramClient.prototype.toggleForumTopicClosed = function(...args) {
783
783
  TelegramClient.prototype.toggleForumTopicPinned = function(...args) {
784
784
  return toggleForumTopicPinned.toggleForumTopicPinned(this._client, ...args);
785
785
  };
786
- TelegramClient.prototype.toggleForum = function(...args) {
787
- return toggleForum.toggleForum(this._client, ...args);
788
- };
789
786
  TelegramClient.prototype.updateForumSettings = function(...args) {
790
787
  return toggleForum.updateForumSettings(this._client, ...args);
791
788
  };
@@ -1089,8 +1086,8 @@ TelegramClient.prototype.getBusinessConnection = function(...args) {
1089
1086
  TelegramClient.prototype.getMyBoostSlots = function(...args) {
1090
1087
  return getMyBoostSlots.getMyBoostSlots(this._client, ...args);
1091
1088
  };
1092
- TelegramClient.prototype.getResaleOptions = function(...args) {
1093
- return getResaleStarGifts.getResaleOptions(this._client, ...args);
1089
+ TelegramClient.prototype.getStarGiftResaleOptions = function(...args) {
1090
+ return getResaleStarGifts.getStarGiftResaleOptions(this._client, ...args);
1094
1091
  };
1095
1092
  TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1096
1093
  return getSavedStarGiftsById.getSavedStarGiftsById(this._client, ...args);
@@ -1101,6 +1098,9 @@ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1101
1098
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1102
1099
  return getStarGiftOptions.getStarGiftOptions(this._client, ...args);
1103
1100
  };
1101
+ TelegramClient.prototype.getStarGiftValue = function(...args) {
1102
+ return getStarGiftValue.getStarGiftValue(this._client, ...args);
1103
+ };
1104
1104
  TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1105
1105
  return getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl(this._client, ...args);
1106
1106
  };
@@ -1122,6 +1122,9 @@ TelegramClient.prototype.iterStarsTransactions = function(...args) {
1122
1122
  TelegramClient.prototype.togglePinnedStarGifts = function(...args) {
1123
1123
  return pinStarGift.togglePinnedStarGifts(this._client, ...args);
1124
1124
  };
1125
+ TelegramClient.prototype.prepayStarGiftUpgrade = function(...args) {
1126
+ return prepayStarGiftUpgrade.prepayStarGiftUpgrade(this._client, ...args);
1127
+ };
1125
1128
  TelegramClient.prototype.sendStarGift = function(...args) {
1126
1129
  return sendStarGift.sendStarGift(this._client, ...args);
1127
1130
  };
@@ -1269,6 +1272,9 @@ TelegramClient.prototype.getProfilePhoto = function(...args) {
1269
1272
  TelegramClient.prototype.getProfilePhotos = function(...args) {
1270
1273
  return getProfilePhotos.getProfilePhotos(this._client, ...args);
1271
1274
  };
1275
+ TelegramClient.prototype.getSavedMusic = function(...args) {
1276
+ return getSavedMusic.getSavedMusic(this._client, ...args);
1277
+ };
1272
1278
  TelegramClient.prototype.getUsers = function(...args) {
1273
1279
  return getUsers.getUsers(this._client, ...args);
1274
1280
  };
@@ -1293,8 +1299,11 @@ TelegramClient.prototype.resolveChannel = function(...args) {
1293
1299
  TelegramClient.prototype.resolvePhoneNumber = function(...args) {
1294
1300
  return resolvePhoneNumber.resolvePhoneNumber(this._client, ...args);
1295
1301
  };
1296
- TelegramClient.prototype.setMyEmojiStatus = function(...args) {
1297
- return setEmojiStatus.setMyEmojiStatus(this._client, ...args);
1302
+ TelegramClient.prototype.saveMusicToProfile = function(...args) {
1303
+ return saveMusicToProfile.saveMusicToProfile(this._client, ...args);
1304
+ };
1305
+ TelegramClient.prototype.unsaveMusicFromProfile = function(...args) {
1306
+ return saveMusicToProfile.unsaveMusicFromProfile(this._client, ...args);
1298
1307
  };
1299
1308
  TelegramClient.prototype.setEmojiStatus = function(...args) {
1300
1309
  return setEmojiStatus.setEmojiStatus(this._client, ...args);
package/client.js CHANGED
@@ -5,7 +5,6 @@ import { getPasswordHint } from "./highlevel/methods/auth/get-password-hint.js";
5
5
  import { logOut } from "./highlevel/methods/auth/log-out.js";
6
6
  import { recoverPassword } from "./highlevel/methods/auth/recover-password.js";
7
7
  import { resendCode } from "./highlevel/methods/auth/resend-code.js";
8
- import { run } from "./highlevel/methods/auth/run.js";
9
8
  import { sendCode } from "./highlevel/methods/auth/send-code.js";
10
9
  import { sendRecoveryCode } from "./highlevel/methods/auth/send-recovery-code.js";
11
10
  import { signInBot } from "./highlevel/methods/auth/sign-in-bot.js";
@@ -110,7 +109,7 @@ import { iterForumTopics } from "./highlevel/methods/forums/iter-forum-topics.js
110
109
  import { reorderPinnedForumTopics } from "./highlevel/methods/forums/reorder-pinned-forum-topics.js";
111
110
  import { toggleForumTopicClosed } from "./highlevel/methods/forums/toggle-forum-topic-closed.js";
112
111
  import { toggleForumTopicPinned } from "./highlevel/methods/forums/toggle-forum-topic-pinned.js";
113
- import { toggleForum, updateForumSettings } from "./highlevel/methods/forums/toggle-forum.js";
112
+ import { updateForumSettings } from "./highlevel/methods/forums/toggle-forum.js";
114
113
  import { toggleGeneralTopicHidden } from "./highlevel/methods/forums/toggle-general-topic-hidden.js";
115
114
  import { createInviteLink } from "./highlevel/methods/invite-links/create-invite-link.js";
116
115
  import { editInviteLink } from "./highlevel/methods/invite-links/edit-invite-link.js";
@@ -197,10 +196,11 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
197
196
  import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
198
197
  import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
199
198
  import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
200
- import { getResaleOptions } from "./highlevel/methods/premium/get-resale-star-gifts.js";
199
+ import { getStarGiftResaleOptions } from "./highlevel/methods/premium/get-resale-star-gifts.js";
201
200
  import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
202
201
  import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
203
202
  import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
203
+ import { getStarGiftValue } from "./highlevel/methods/premium/get-star-gift-value.js";
204
204
  import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
205
205
  import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
206
206
  import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
@@ -208,6 +208,7 @@ import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
208
208
  import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
209
209
  import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
210
210
  import { togglePinnedStarGifts } from "./highlevel/methods/premium/pin-star-gift.js";
211
+ import { prepayStarGiftUpgrade } from "./highlevel/methods/premium/prepay-star-gift-upgrade.js";
211
212
  import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
212
213
  import { setBusinessIntro } from "./highlevel/methods/premium/set-business-intro.js";
213
214
  import { setBusinessWorkHours } from "./highlevel/methods/premium/set-business-work-hours.js";
@@ -255,13 +256,15 @@ import { getMyUsername } from "./highlevel/methods/users/get-my-username.js";
255
256
  import { getPeerSettings } from "./highlevel/methods/users/get-peer-settings.js";
256
257
  import { getProfilePhoto } from "./highlevel/methods/users/get-profile-photo.js";
257
258
  import { getProfilePhotos } from "./highlevel/methods/users/get-profile-photos.js";
259
+ import { getSavedMusic } from "./highlevel/methods/users/get-saved-music.js";
258
260
  import { getUsers } from "./highlevel/methods/users/get-users.js";
259
261
  import { isPeerAvailable } from "./highlevel/methods/users/is-peer-available.js";
260
262
  import { iterProfilePhotos } from "./highlevel/methods/users/iter-profile-photos.js";
261
263
  import { resolvePeerMany } from "./highlevel/methods/users/resolve-peer-many.js";
262
264
  import { resolvePeer, resolveUser, resolveChannel } from "./highlevel/methods/users/resolve-peer.js";
263
265
  import { resolvePhoneNumber } from "./highlevel/methods/users/resolve-phone-number.js";
264
- import { setMyEmojiStatus, setEmojiStatus } from "./highlevel/methods/users/set-emoji-status.js";
266
+ import { saveMusicToProfile, unsaveMusicFromProfile } from "./highlevel/methods/users/save-music-to-profile.js";
267
+ import { setEmojiStatus } from "./highlevel/methods/users/set-emoji-status.js";
265
268
  import { setGlobalTtl } from "./highlevel/methods/users/set-global-ttl.js";
266
269
  import { setMyBirthday } from "./highlevel/methods/users/set-my-birthday.js";
267
270
  import { setMyProfilePhoto } from "./highlevel/methods/users/set-my-profile-photo.js";
@@ -443,9 +446,6 @@ TelegramClient.prototype.recoverPassword = function(...args) {
443
446
  TelegramClient.prototype.resendCode = function(...args) {
444
447
  return resendCode(this._client, ...args);
445
448
  };
446
- TelegramClient.prototype.run = function(...args) {
447
- return run(this._client, ...args);
448
- };
449
449
  TelegramClient.prototype.sendCode = function(...args) {
450
450
  return sendCode(this._client, ...args);
451
451
  };
@@ -776,9 +776,6 @@ TelegramClient.prototype.toggleForumTopicClosed = function(...args) {
776
776
  TelegramClient.prototype.toggleForumTopicPinned = function(...args) {
777
777
  return toggleForumTopicPinned(this._client, ...args);
778
778
  };
779
- TelegramClient.prototype.toggleForum = function(...args) {
780
- return toggleForum(this._client, ...args);
781
- };
782
779
  TelegramClient.prototype.updateForumSettings = function(...args) {
783
780
  return updateForumSettings(this._client, ...args);
784
781
  };
@@ -1082,8 +1079,8 @@ TelegramClient.prototype.getBusinessConnection = function(...args) {
1082
1079
  TelegramClient.prototype.getMyBoostSlots = function(...args) {
1083
1080
  return getMyBoostSlots(this._client, ...args);
1084
1081
  };
1085
- TelegramClient.prototype.getResaleOptions = function(...args) {
1086
- return getResaleOptions(this._client, ...args);
1082
+ TelegramClient.prototype.getStarGiftResaleOptions = function(...args) {
1083
+ return getStarGiftResaleOptions(this._client, ...args);
1087
1084
  };
1088
1085
  TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1089
1086
  return getSavedStarGiftsById(this._client, ...args);
@@ -1094,6 +1091,9 @@ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1094
1091
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1095
1092
  return getStarGiftOptions(this._client, ...args);
1096
1093
  };
1094
+ TelegramClient.prototype.getStarGiftValue = function(...args) {
1095
+ return getStarGiftValue(this._client, ...args);
1096
+ };
1097
1097
  TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1098
1098
  return getStarGiftWithdrawalUrl(this._client, ...args);
1099
1099
  };
@@ -1115,6 +1115,9 @@ TelegramClient.prototype.iterStarsTransactions = function(...args) {
1115
1115
  TelegramClient.prototype.togglePinnedStarGifts = function(...args) {
1116
1116
  return togglePinnedStarGifts(this._client, ...args);
1117
1117
  };
1118
+ TelegramClient.prototype.prepayStarGiftUpgrade = function(...args) {
1119
+ return prepayStarGiftUpgrade(this._client, ...args);
1120
+ };
1118
1121
  TelegramClient.prototype.sendStarGift = function(...args) {
1119
1122
  return sendStarGift(this._client, ...args);
1120
1123
  };
@@ -1262,6 +1265,9 @@ TelegramClient.prototype.getProfilePhoto = function(...args) {
1262
1265
  TelegramClient.prototype.getProfilePhotos = function(...args) {
1263
1266
  return getProfilePhotos(this._client, ...args);
1264
1267
  };
1268
+ TelegramClient.prototype.getSavedMusic = function(...args) {
1269
+ return getSavedMusic(this._client, ...args);
1270
+ };
1265
1271
  TelegramClient.prototype.getUsers = function(...args) {
1266
1272
  return getUsers(this._client, ...args);
1267
1273
  };
@@ -1286,8 +1292,11 @@ TelegramClient.prototype.resolveChannel = function(...args) {
1286
1292
  TelegramClient.prototype.resolvePhoneNumber = function(...args) {
1287
1293
  return resolvePhoneNumber(this._client, ...args);
1288
1294
  };
1289
- TelegramClient.prototype.setMyEmojiStatus = function(...args) {
1290
- return setMyEmojiStatus(this._client, ...args);
1295
+ TelegramClient.prototype.saveMusicToProfile = function(...args) {
1296
+ return saveMusicToProfile(this._client, ...args);
1297
+ };
1298
+ TelegramClient.prototype.unsaveMusicFromProfile = function(...args) {
1299
+ return unsaveMusicFromProfile(this._client, ...args);
1291
1300
  };
1292
1301
  TelegramClient.prototype.setEmojiStatus = function(...args) {
1293
1302
  return setEmojiStatus(this._client, ...args);
@@ -1,4 +1,3 @@
1
- import { tdFileId } from '@mtcute/file-id';
2
1
  import { tl } from '@mtcute/tl';
3
2
  import { default as Long } from 'long';
4
3
  import { RpcCallOptions } from '../network/index.js';
@@ -25,12 +24,11 @@ import { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
25
24
  import { InputStarGiftAttributeIds, ResaleStarGiftsMeta } from './methods/premium/get-resale-star-gifts.js';
26
25
  import { CanSendStoryResult } from './methods/stories/can-send-story.js';
27
26
  import { ITelegramStorageProvider } from './storage/provider.js';
28
- import { AllStories, ArrayPaginated, ArrayPaginatedWithMeta, 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, Peer, PeerReaction, PeerSettings, 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, UserStatusUpdate, UserTypingUpdate, WebPageMedia, WebviewResult } from './types/index.js';
27
+ 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';
29
28
  import { ParsedUpdateHandlerParams } from './updates/parsed.js';
30
29
  import { RawUpdateInfo } from './updates/types.js';
31
30
  import { InputStringSessionData } from './utils/string-session.js';
32
31
  import { Emitter } from '@fuman/utils';
33
- import { start } from './methods/auth/start.js';
34
32
  import { getChatEventLog } from './methods/chats/get-chat-event-log.js';
35
33
  import { getChatMembers } from './methods/chats/get-chat-members.js';
36
34
  import { getInviteLinkMembers } from './methods/invite-links/get-invite-link-members.js';
@@ -38,6 +36,7 @@ import { sendMediaGroup } from './methods/messages/send-media-group.js';
38
36
  import { sendMedia } from './methods/messages/send-media.js';
39
37
  import { sendText } from './methods/messages/send-text.js';
40
38
  import { getBoosts } from './methods/premium/get-boosts.js';
39
+ import { getSavedStarGifts } from './methods/premium/get-saved-star-gifts.js';
41
40
  import { getStarsTransactions } from './methods/premium/get-stars-transactions.js';
42
41
  import { getAllStories } from './methods/stories/get-all-stories.js';
43
42
  import { getProfileStories } from './methods/stories/get-profile-stories.js';
@@ -203,21 +202,6 @@ export interface TelegramClient extends ITelegramClient {
203
202
  /** Abort signal */
204
203
  abortSignal?: AbortSignal;
205
204
  }): Promise<SentCode>;
206
- /**
207
- * Simple wrapper that calls {@link start} and then
208
- * provided callback function (if any) without the
209
- * need to introduce a `main()` function manually.
210
- *
211
- * Errors that were encountered while calling {@link start}
212
- * and `then` will be emitted as usual, and can be caught with {@link onError}
213
- *
214
- * **Available**: ✅ both users and bots
215
- *
216
- * @param params Parameters to be passed to {@link start}
217
- * @param then Function to be called after {@link start} returns
218
- * @deprecated This method provides no real value over {@link start}, please use it instead
219
- */
220
- run(params: Parameters<typeof start>[1], then?: (user: User) => void | Promise<void>): void;
221
205
  /**
222
206
  * Send the confirmation code to the given phone number
223
207
  *
@@ -2328,18 +2312,6 @@ export interface TelegramClient extends ITelegramClient {
2328
2312
  /** Whether the topic should be pinned */
2329
2313
  pinned: boolean;
2330
2314
  }): Promise<void>;
2331
- /**
2332
- * Set whether a supergroup is a forum.
2333
- *
2334
- * Only owner of the supergroup can change this setting.
2335
- *
2336
- * **Available**: 👤 users only
2337
- *
2338
- * @param chatId Chat ID or username
2339
- * @param [enabled=false] Whether the supergroup should be a forum
2340
- * @deprecated Use {@link updateForumSettings} instead
2341
- */
2342
- toggleForum(chatId: InputPeerLike, enabled?: boolean): Promise<void>;
2343
2315
  /**
2344
2316
  * Update forum settings of a supergroup.
2345
2317
  *
@@ -3947,6 +3919,8 @@ export interface TelegramClient extends ITelegramClient {
3947
3919
  * to the client's update handler.
3948
3920
  */
3949
3921
  shouldDispatch?: true;
3922
+ /** Whether to use TON currency for payment */
3923
+ ton?: boolean;
3950
3924
  }): Promise<Message | null>;
3951
3925
  /**
3952
3926
  * Check if the current user can apply boost to some channel
@@ -4048,7 +4022,7 @@ export interface TelegramClient extends ITelegramClient {
4048
4022
  * **Available**: ✅ both users and bots
4049
4023
  *
4050
4024
  */
4051
- getResaleOptions(params: {
4025
+ getStarGiftResaleOptions(params: {
4052
4026
  /** ID of the gift to get resale options for */
4053
4027
  giftId: tl.Long;
4054
4028
  /**
@@ -4087,10 +4061,12 @@ export interface TelegramClient extends ITelegramClient {
4087
4061
  excludePublic?: boolean;
4088
4062
  /** Whether to exclude gifts with unlimited availability */
4089
4063
  excludeUnlimited?: boolean;
4090
- /** Whether to exclude gifts with limited availability */
4091
- excludeLimited?: boolean;
4092
4064
  /** Whether to exclude unique gifts */
4093
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;
4094
4070
  /** ID of the collection to get gifts from */
4095
4071
  collectionId?: number;
4096
4072
  /** Whether to sort by value */
@@ -4106,6 +4082,13 @@ export interface TelegramClient extends ITelegramClient {
4106
4082
  *
4107
4083
  */
4108
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>;
4109
4092
  getStarGiftWithdrawalUrl(params: {
4110
4093
  /** The star gift to withdraw */
4111
4094
  gift: InputStarGift;
@@ -4138,6 +4121,8 @@ export interface TelegramClient extends ITelegramClient {
4138
4121
  subscriptionId?: string;
4139
4122
  /** Pagination offset */
4140
4123
  offset?: string;
4124
+ /** Whether to return transactions made in TON */
4125
+ ton?: boolean;
4141
4126
  /**
4142
4127
  * Pagination limit
4143
4128
  *
@@ -4179,24 +4164,18 @@ export interface TelegramClient extends ITelegramClient {
4179
4164
  * **Available**: ✅ both users and bots
4180
4165
  *
4181
4166
  */
4182
- iterSavedStarGifts(params: {
4183
- /** Peer to get saved gifts from */
4184
- owner: InputPeerLike;
4185
- /** Whether to exclude unsaved gifts */
4186
- excludeUnsaved?: boolean;
4187
- /** Whether to exclude saved gifts */
4188
- excludeSaved?: boolean;
4189
- /** Whether to exclude gifts with unlimited availability */
4190
- excludeUnlimited?: boolean;
4191
- /** Whether to exclude gifts with limited availability */
4192
- excludeLimited?: boolean;
4193
- /** Whether to exclude unique gifts */
4194
- excludeUnique?: boolean;
4195
- /** Whether to sort by value */
4196
- sortByValue?: boolean;
4197
- /** Offset for pagination */
4198
- offset?: string;
4199
- /** Limit for pagination */
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
+ */
4200
4179
  limit?: number;
4201
4180
  }): AsyncIterableIterator<SavedStarGift>;
4202
4181
  /**
@@ -4238,6 +4217,28 @@ export interface TelegramClient extends ITelegramClient {
4238
4217
  /** Peer where the gift is sent */
4239
4218
  peer: InputPeerLike;
4240
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>;
4241
4242
  /**
4242
4243
  * Send a star gift to a user.
4243
4244
  *
@@ -4465,7 +4466,7 @@ export interface TelegramClient extends ITelegramClient {
4465
4466
  * TL object representing a sticker to be removed
4466
4467
  * @returns Modfiied sticker set
4467
4468
  */
4468
- deleteStickerFromSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument): Promise<StickerSet>;
4469
+ deleteStickerFromSet(sticker: InputDocumentId): Promise<StickerSet>;
4469
4470
  /**
4470
4471
  * Get custom emoji stickers by their IDs
4471
4472
  *
@@ -4523,7 +4524,7 @@ export interface TelegramClient extends ITelegramClient {
4523
4524
  * @param position New sticker position (starting from 0)
4524
4525
  * @returns Modified sticker set
4525
4526
  */
4526
- moveStickerInSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument, position: number): Promise<StickerSet>;
4527
+ moveStickerInSet(sticker: InputDocumentId, position: number): Promise<StickerSet>;
4527
4528
  /**
4528
4529
  * Replace a sticker in a sticker set with another sticker
4529
4530
  *
@@ -4537,7 +4538,7 @@ export interface TelegramClient extends ITelegramClient {
4537
4538
  * @param newSticker New sticker to replace the old one with
4538
4539
  * @returns Modfiied sticker set
4539
4540
  */
4540
- replaceStickerInSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument, newSticker: InputStickerSetItem, params?: {
4541
+ replaceStickerInSet(sticker: InputDocumentId, newSticker: InputStickerSetItem, params?: {
4541
4542
  /**
4542
4543
  * Upload progress callback
4543
4544
  *
@@ -5048,6 +5049,17 @@ export interface TelegramClient extends ITelegramClient {
5048
5049
  */
5049
5050
  limit?: number;
5050
5051
  }): Promise<ArrayPaginated<Photo, number>>;
5052
+ /**
5053
+ * Get music files saved to the user's profile
5054
+ */
5055
+ getSavedMusic(params: {
5056
+ /** User ID, username, phone number, `"me"` or `"self"` */
5057
+ userId: InputPeerLike;
5058
+ /** Offset for pagination */
5059
+ offset?: number;
5060
+ /** Limit for pagination */
5061
+ limit?: number;
5062
+ }): Promise<ArrayPaginated<Audio, number>>;
5051
5063
  /**
5052
5064
  * Get information about multiple users.
5053
5065
  * You can retrieve up to 200 users at once.
@@ -5156,18 +5168,22 @@ export interface TelegramClient extends ITelegramClient {
5156
5168
  * @param [force=false] Whether to force re-fetch the peer from the server
5157
5169
  */
5158
5170
  resolvePhoneNumber(phone: string, force?: boolean): Promise<tl.TypeInputPeer>;
5159
- /**
5160
- * Set an emoji status for the current user
5161
- *
5162
- * **Available**: both users and bots
5163
- *
5164
- * @deprecated – use {@link setEmojiStatus} with `self` instead
5165
- */
5166
- setMyEmojiStatus(emoji: tl.Long | null, params?: {
5171
+ saveMusicToProfile(params: {
5172
+ /** Audio file to save (or its ID) */
5173
+ audio: InputMediaAudio | InputDocumentId;
5174
+ /** Optionally, document ID after which we should insert the music */
5175
+ after?: InputDocumentId;
5167
5176
  /**
5168
- * Date when the emoji status should expire (only if `emoji` is not `null`)
5177
+ * Upload progress callback
5178
+ *
5179
+ * @param uploaded Number of bytes uploaded
5180
+ * @param total Total file size
5169
5181
  */
5170
- until?: number | Date;
5182
+ progressCallback?: (uploaded: number, total: number) => void;
5183
+ }): Promise<void>;
5184
+ unsaveMusicFromProfile(params: {
5185
+ /** ID of the Audio file to unsave */
5186
+ audio: InputDocumentId;
5171
5187
  }): Promise<void>;
5172
5188
  /**
5173
5189
  * Set an emoji status for the given user/chat