@mtcute/core 0.25.8 → 0.26.1

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 (96) hide show
  1. package/client.cjs +18 -12
  2. package/client.js +21 -15
  3. package/highlevel/client.d.cts +78 -72
  4. package/highlevel/client.d.ts +78 -72
  5. package/highlevel/methods/forums/toggle-forum.cjs +0 -10
  6. package/highlevel/methods/forums/toggle-forum.d.cts +0 -10
  7. package/highlevel/methods/forums/toggle-forum.d.ts +0 -10
  8. package/highlevel/methods/forums/toggle-forum.js +0 -10
  9. package/highlevel/methods/premium/get-resale-star-gifts.cjs +0 -4
  10. package/highlevel/methods/premium/get-resale-star-gifts.d.cts +0 -6
  11. package/highlevel/methods/premium/get-resale-star-gifts.d.ts +0 -6
  12. package/highlevel/methods/premium/get-resale-star-gifts.js +0 -4
  13. package/highlevel/methods/premium/get-saved-star-gifts.cjs +2 -1
  14. package/highlevel/methods/premium/get-saved-star-gifts.d.cts +4 -2
  15. package/highlevel/methods/premium/get-saved-star-gifts.d.ts +4 -2
  16. package/highlevel/methods/premium/get-saved-star-gifts.js +2 -1
  17. package/highlevel/methods/{auth/run.cjs → premium/get-star-gift-value.cjs} +8 -5
  18. package/highlevel/methods/premium/get-star-gift-value.d.cts +9 -0
  19. package/highlevel/methods/premium/get-star-gift-value.d.ts +9 -0
  20. package/highlevel/methods/premium/get-star-gift-value.js +11 -0
  21. package/highlevel/methods/premium/get-stars-transactions.cjs +3 -2
  22. package/highlevel/methods/premium/get-stars-transactions.d.cts +2 -0
  23. package/highlevel/methods/premium/get-stars-transactions.d.ts +2 -0
  24. package/highlevel/methods/premium/get-stars-transactions.js +3 -2
  25. package/highlevel/methods/premium/iter-saved-star-gifts.cjs +15 -10
  26. package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +13 -19
  27. package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +13 -19
  28. package/highlevel/methods/premium/iter-saved-star-gifts.js +15 -10
  29. package/highlevel/methods/premium/prepay-star-gift-upgrade.cjs +30 -0
  30. package/highlevel/methods/premium/prepay-star-gift-upgrade.d.cts +23 -0
  31. package/highlevel/methods/premium/prepay-star-gift-upgrade.d.ts +23 -0
  32. package/highlevel/methods/premium/prepay-star-gift-upgrade.js +25 -0
  33. package/highlevel/methods/stickers/delete-sticker-from-set.d.cts +2 -4
  34. package/highlevel/methods/stickers/delete-sticker-from-set.d.ts +2 -4
  35. package/highlevel/methods/stickers/move-sticker-in-set.d.cts +2 -4
  36. package/highlevel/methods/stickers/move-sticker-in-set.d.ts +2 -4
  37. package/highlevel/methods/stickers/replace-sticker-in-set.d.cts +2 -4
  38. package/highlevel/methods/stickers/replace-sticker-in-set.d.ts +2 -4
  39. package/highlevel/methods/users/get-saved-music.cjs +38 -0
  40. package/highlevel/methods/users/get-saved-music.d.cts +13 -0
  41. package/highlevel/methods/users/get-saved-music.d.ts +13 -0
  42. package/highlevel/methods/users/get-saved-music.js +33 -0
  43. package/highlevel/methods/users/save-music-to-profile.cjs +57 -0
  44. package/highlevel/methods/users/save-music-to-profile.d.cts +19 -0
  45. package/highlevel/methods/users/save-music-to-profile.d.ts +19 -0
  46. package/highlevel/methods/users/save-music-to-profile.js +52 -0
  47. package/highlevel/methods/users/set-emoji-status.cjs +0 -8
  48. package/highlevel/methods/users/set-emoji-status.d.cts +0 -11
  49. package/highlevel/methods/users/set-emoji-status.d.ts +0 -11
  50. package/highlevel/methods/users/set-emoji-status.js +1 -9
  51. package/highlevel/methods.d.cts +5 -4
  52. package/highlevel/methods.d.ts +5 -4
  53. package/highlevel/storage/service/current-user.cjs +5 -4
  54. package/highlevel/storage/service/current-user.js +5 -4
  55. package/highlevel/types/files/utils.d.cts +7 -0
  56. package/highlevel/types/files/utils.d.ts +7 -0
  57. package/highlevel/types/media/document.d.cts +1 -1
  58. package/highlevel/types/media/document.d.ts +1 -1
  59. package/highlevel/types/messages/message-action.cjs +43 -21
  60. package/highlevel/types/messages/message-action.d.cts +58 -17
  61. package/highlevel/types/messages/message-action.d.ts +58 -17
  62. package/highlevel/types/messages/message-action.js +43 -21
  63. package/highlevel/types/peers/full-user.cjs +10 -1
  64. package/highlevel/types/peers/full-user.d.cts +3 -0
  65. package/highlevel/types/peers/full-user.d.ts +3 -0
  66. package/highlevel/types/peers/full-user.js +10 -1
  67. package/highlevel/types/premium/index.d.cts +1 -0
  68. package/highlevel/types/premium/index.d.ts +1 -0
  69. package/highlevel/types/premium/saved-star-gift.cjs +6 -0
  70. package/highlevel/types/premium/saved-star-gift.d.cts +4 -0
  71. package/highlevel/types/premium/saved-star-gift.d.ts +4 -0
  72. package/highlevel/types/premium/saved-star-gift.js +6 -0
  73. package/highlevel/types/premium/star-gift-value.cjs +65 -0
  74. package/highlevel/types/premium/star-gift-value.d.cts +41 -0
  75. package/highlevel/types/premium/star-gift-value.d.ts +41 -0
  76. package/highlevel/types/premium/star-gift-value.js +60 -0
  77. package/highlevel/types/premium/stars-gift-unique.cjs +10 -3
  78. package/highlevel/types/premium/stars-gift-unique.d.cts +1 -1
  79. package/highlevel/types/premium/stars-gift-unique.d.ts +1 -1
  80. package/highlevel/types/premium/stars-gift-unique.js +10 -3
  81. package/highlevel/types/premium/stars-transaction.cjs +9 -0
  82. package/highlevel/types/premium/stars-transaction.d.cts +10 -0
  83. package/highlevel/types/premium/stars-transaction.d.ts +10 -0
  84. package/highlevel/types/premium/stars-transaction.js +9 -0
  85. package/index.cjs +2 -0
  86. package/index.js +2 -0
  87. package/methods.cjs +9 -5
  88. package/methods.js +12 -8
  89. package/network/network-manager.cjs +1 -1
  90. package/network/network-manager.js +1 -1
  91. package/package.json +2 -2
  92. package/utils/binary/compat.cjs +35 -4
  93. package/utils/binary/compat.js +35 -4
  94. package/highlevel/methods/auth/run.d.cts +0 -16
  95. package/highlevel/methods/auth/run.d.ts +0 -16
  96. 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
  };
@@ -1092,9 +1089,6 @@ TelegramClient.prototype.getMyBoostSlots = function(...args) {
1092
1089
  TelegramClient.prototype.getStarGiftResaleOptions = function(...args) {
1093
1090
  return getResaleStarGifts.getStarGiftResaleOptions(this._client, ...args);
1094
1091
  };
1095
- TelegramClient.prototype.getResaleOptions = function(...args) {
1096
- return getResaleStarGifts.getResaleOptions(this._client, ...args);
1097
- };
1098
1092
  TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1099
1093
  return getSavedStarGiftsById.getSavedStarGiftsById(this._client, ...args);
1100
1094
  };
@@ -1104,6 +1098,9 @@ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1104
1098
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1105
1099
  return getStarGiftOptions.getStarGiftOptions(this._client, ...args);
1106
1100
  };
1101
+ TelegramClient.prototype.getStarGiftValue = function(...args) {
1102
+ return getStarGiftValue.getStarGiftValue(this._client, ...args);
1103
+ };
1107
1104
  TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1108
1105
  return getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl(this._client, ...args);
1109
1106
  };
@@ -1125,6 +1122,9 @@ TelegramClient.prototype.iterStarsTransactions = function(...args) {
1125
1122
  TelegramClient.prototype.togglePinnedStarGifts = function(...args) {
1126
1123
  return pinStarGift.togglePinnedStarGifts(this._client, ...args);
1127
1124
  };
1125
+ TelegramClient.prototype.prepayStarGiftUpgrade = function(...args) {
1126
+ return prepayStarGiftUpgrade.prepayStarGiftUpgrade(this._client, ...args);
1127
+ };
1128
1128
  TelegramClient.prototype.sendStarGift = function(...args) {
1129
1129
  return sendStarGift.sendStarGift(this._client, ...args);
1130
1130
  };
@@ -1272,6 +1272,9 @@ TelegramClient.prototype.getProfilePhoto = function(...args) {
1272
1272
  TelegramClient.prototype.getProfilePhotos = function(...args) {
1273
1273
  return getProfilePhotos.getProfilePhotos(this._client, ...args);
1274
1274
  };
1275
+ TelegramClient.prototype.getSavedMusic = function(...args) {
1276
+ return getSavedMusic.getSavedMusic(this._client, ...args);
1277
+ };
1275
1278
  TelegramClient.prototype.getUsers = function(...args) {
1276
1279
  return getUsers.getUsers(this._client, ...args);
1277
1280
  };
@@ -1296,8 +1299,11 @@ TelegramClient.prototype.resolveChannel = function(...args) {
1296
1299
  TelegramClient.prototype.resolvePhoneNumber = function(...args) {
1297
1300
  return resolvePhoneNumber.resolvePhoneNumber(this._client, ...args);
1298
1301
  };
1299
- TelegramClient.prototype.setMyEmojiStatus = function(...args) {
1300
- 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);
1301
1307
  };
1302
1308
  TelegramClient.prototype.setEmojiStatus = function(...args) {
1303
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 { getStarGiftResaleOptions, 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
  };
@@ -1085,9 +1082,6 @@ TelegramClient.prototype.getMyBoostSlots = function(...args) {
1085
1082
  TelegramClient.prototype.getStarGiftResaleOptions = function(...args) {
1086
1083
  return getStarGiftResaleOptions(this._client, ...args);
1087
1084
  };
1088
- TelegramClient.prototype.getResaleOptions = function(...args) {
1089
- return getResaleOptions(this._client, ...args);
1090
- };
1091
1085
  TelegramClient.prototype.getSavedStarGiftsById = function(...args) {
1092
1086
  return getSavedStarGiftsById(this._client, ...args);
1093
1087
  };
@@ -1097,6 +1091,9 @@ TelegramClient.prototype.getSavedStarGifts = function(...args) {
1097
1091
  TelegramClient.prototype.getStarGiftOptions = function(...args) {
1098
1092
  return getStarGiftOptions(this._client, ...args);
1099
1093
  };
1094
+ TelegramClient.prototype.getStarGiftValue = function(...args) {
1095
+ return getStarGiftValue(this._client, ...args);
1096
+ };
1100
1097
  TelegramClient.prototype.getStarGiftWithdrawalUrl = function(...args) {
1101
1098
  return getStarGiftWithdrawalUrl(this._client, ...args);
1102
1099
  };
@@ -1118,6 +1115,9 @@ TelegramClient.prototype.iterStarsTransactions = function(...args) {
1118
1115
  TelegramClient.prototype.togglePinnedStarGifts = function(...args) {
1119
1116
  return togglePinnedStarGifts(this._client, ...args);
1120
1117
  };
1118
+ TelegramClient.prototype.prepayStarGiftUpgrade = function(...args) {
1119
+ return prepayStarGiftUpgrade(this._client, ...args);
1120
+ };
1121
1121
  TelegramClient.prototype.sendStarGift = function(...args) {
1122
1122
  return sendStarGift(this._client, ...args);
1123
1123
  };
@@ -1265,6 +1265,9 @@ TelegramClient.prototype.getProfilePhoto = function(...args) {
1265
1265
  TelegramClient.prototype.getProfilePhotos = function(...args) {
1266
1266
  return getProfilePhotos(this._client, ...args);
1267
1267
  };
1268
+ TelegramClient.prototype.getSavedMusic = function(...args) {
1269
+ return getSavedMusic(this._client, ...args);
1270
+ };
1268
1271
  TelegramClient.prototype.getUsers = function(...args) {
1269
1272
  return getUsers(this._client, ...args);
1270
1273
  };
@@ -1289,8 +1292,11 @@ TelegramClient.prototype.resolveChannel = function(...args) {
1289
1292
  TelegramClient.prototype.resolvePhoneNumber = function(...args) {
1290
1293
  return resolvePhoneNumber(this._client, ...args);
1291
1294
  };
1292
- TelegramClient.prototype.setMyEmojiStatus = function(...args) {
1293
- 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);
1294
1300
  };
1295
1301
  TelegramClient.prototype.setEmojiStatus = function(...args) {
1296
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';
@@ -22,15 +21,14 @@ import { SendCopyGroupParams } from './methods/messages/send-copy-group.js';
22
21
  import { SendCopyParams } from './methods/messages/send-copy.js';
23
22
  import { QuoteParamsFrom } from './methods/messages/send-quote.js';
24
23
  import { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
25
- import { InputStarGiftAttributeIds, ResaleStarGiftsMeta, getStarGiftResaleOptions } from './methods/premium/get-resale-star-gifts.js';
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
  *
@@ -4071,14 +4043,6 @@ export interface TelegramClient extends ITelegramClient {
4071
4043
  /** Limit for pagination */
4072
4044
  limit?: number;
4073
4045
  }): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
4074
- /**
4075
- * Get a list of star gifts up for resale
4076
- *
4077
- * **Available**: ✅ both users and bots
4078
- *
4079
- * @deprecated Deprecated alias, use `getStarGiftResaleOptions` instead
4080
- */
4081
- getResaleOptions(params: Parameters<typeof getStarGiftResaleOptions>[1]): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
4082
4046
  /** Get one or more saved star gifts by their IDs */
4083
4047
  getSavedStarGiftsById(gifts: MaybeArray<InputStarGift>): Promise<SavedStarGift[]>;
4084
4048
  /**
@@ -4097,10 +4061,12 @@ export interface TelegramClient extends ITelegramClient {
4097
4061
  excludePublic?: boolean;
4098
4062
  /** Whether to exclude gifts with unlimited availability */
4099
4063
  excludeUnlimited?: boolean;
4100
- /** Whether to exclude gifts with limited availability */
4101
- excludeLimited?: boolean;
4102
4064
  /** Whether to exclude unique gifts */
4103
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;
4104
4070
  /** ID of the collection to get gifts from */
4105
4071
  collectionId?: number;
4106
4072
  /** Whether to sort by value */
@@ -4116,6 +4082,13 @@ export interface TelegramClient extends ITelegramClient {
4116
4082
  *
4117
4083
  */
4118
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>;
4119
4092
  getStarGiftWithdrawalUrl(params: {
4120
4093
  /** The star gift to withdraw */
4121
4094
  gift: InputStarGift;
@@ -4148,6 +4121,8 @@ export interface TelegramClient extends ITelegramClient {
4148
4121
  subscriptionId?: string;
4149
4122
  /** Pagination offset */
4150
4123
  offset?: string;
4124
+ /** Whether to return transactions made in TON */
4125
+ ton?: boolean;
4151
4126
  /**
4152
4127
  * Pagination limit
4153
4128
  *
@@ -4189,24 +4164,18 @@ export interface TelegramClient extends ITelegramClient {
4189
4164
  * **Available**: ✅ both users and bots
4190
4165
  *
4191
4166
  */
4192
- iterSavedStarGifts(params: {
4193
- /** Peer to get saved gifts from */
4194
- owner: InputPeerLike;
4195
- /** Whether to exclude unsaved gifts */
4196
- excludeUnsaved?: boolean;
4197
- /** Whether to exclude saved gifts */
4198
- excludeSaved?: boolean;
4199
- /** Whether to exclude gifts with unlimited availability */
4200
- excludeUnlimited?: boolean;
4201
- /** Whether to exclude gifts with limited availability */
4202
- excludeLimited?: boolean;
4203
- /** Whether to exclude unique gifts */
4204
- excludeUnique?: boolean;
4205
- /** Whether to sort by value */
4206
- sortByValue?: boolean;
4207
- /** Offset for pagination */
4208
- offset?: string;
4209
- /** 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
+ */
4210
4179
  limit?: number;
4211
4180
  }): AsyncIterableIterator<SavedStarGift>;
4212
4181
  /**
@@ -4248,6 +4217,28 @@ export interface TelegramClient extends ITelegramClient {
4248
4217
  /** Peer where the gift is sent */
4249
4218
  peer: InputPeerLike;
4250
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>;
4251
4242
  /**
4252
4243
  * Send a star gift to a user.
4253
4244
  *
@@ -4475,7 +4466,7 @@ export interface TelegramClient extends ITelegramClient {
4475
4466
  * TL object representing a sticker to be removed
4476
4467
  * @returns Modfiied sticker set
4477
4468
  */
4478
- deleteStickerFromSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument): Promise<StickerSet>;
4469
+ deleteStickerFromSet(sticker: InputDocumentId): Promise<StickerSet>;
4479
4470
  /**
4480
4471
  * Get custom emoji stickers by their IDs
4481
4472
  *
@@ -4533,7 +4524,7 @@ export interface TelegramClient extends ITelegramClient {
4533
4524
  * @param position New sticker position (starting from 0)
4534
4525
  * @returns Modified sticker set
4535
4526
  */
4536
- moveStickerInSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument, position: number): Promise<StickerSet>;
4527
+ moveStickerInSet(sticker: InputDocumentId, position: number): Promise<StickerSet>;
4537
4528
  /**
4538
4529
  * Replace a sticker in a sticker set with another sticker
4539
4530
  *
@@ -4547,7 +4538,7 @@ export interface TelegramClient extends ITelegramClient {
4547
4538
  * @param newSticker New sticker to replace the old one with
4548
4539
  * @returns Modfiied sticker set
4549
4540
  */
4550
- replaceStickerInSet(sticker: string | tdFileId.RawFullRemoteFileLocation | tl.TypeInputDocument, newSticker: InputStickerSetItem, params?: {
4541
+ replaceStickerInSet(sticker: InputDocumentId, newSticker: InputStickerSetItem, params?: {
4551
4542
  /**
4552
4543
  * Upload progress callback
4553
4544
  *
@@ -5058,6 +5049,17 @@ export interface TelegramClient extends ITelegramClient {
5058
5049
  */
5059
5050
  limit?: number;
5060
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>>;
5061
5063
  /**
5062
5064
  * Get information about multiple users.
5063
5065
  * You can retrieve up to 200 users at once.
@@ -5166,18 +5168,22 @@ export interface TelegramClient extends ITelegramClient {
5166
5168
  * @param [force=false] Whether to force re-fetch the peer from the server
5167
5169
  */
5168
5170
  resolvePhoneNumber(phone: string, force?: boolean): Promise<tl.TypeInputPeer>;
5169
- /**
5170
- * Set an emoji status for the current user
5171
- *
5172
- * **Available**: both users and bots
5173
- *
5174
- * @deprecated – use {@link setEmojiStatus} with `self` instead
5175
- */
5176
- 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;
5177
5176
  /**
5178
- * 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
5179
5181
  */
5180
- 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;
5181
5187
  }): Promise<void>;
5182
5188
  /**
5183
5189
  * Set an emoji status for the given user/chat