@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.
- package/client.cjs +18 -12
- package/client.js +21 -15
- package/highlevel/client.d.cts +78 -72
- package/highlevel/client.d.ts +78 -72
- package/highlevel/methods/forums/toggle-forum.cjs +0 -10
- package/highlevel/methods/forums/toggle-forum.d.cts +0 -10
- package/highlevel/methods/forums/toggle-forum.d.ts +0 -10
- package/highlevel/methods/forums/toggle-forum.js +0 -10
- package/highlevel/methods/premium/get-resale-star-gifts.cjs +0 -4
- package/highlevel/methods/premium/get-resale-star-gifts.d.cts +0 -6
- package/highlevel/methods/premium/get-resale-star-gifts.d.ts +0 -6
- package/highlevel/methods/premium/get-resale-star-gifts.js +0 -4
- package/highlevel/methods/premium/get-saved-star-gifts.cjs +2 -1
- package/highlevel/methods/premium/get-saved-star-gifts.d.cts +4 -2
- package/highlevel/methods/premium/get-saved-star-gifts.d.ts +4 -2
- package/highlevel/methods/premium/get-saved-star-gifts.js +2 -1
- package/highlevel/methods/{auth/run.cjs → premium/get-star-gift-value.cjs} +8 -5
- package/highlevel/methods/premium/get-star-gift-value.d.cts +9 -0
- package/highlevel/methods/premium/get-star-gift-value.d.ts +9 -0
- package/highlevel/methods/premium/get-star-gift-value.js +11 -0
- package/highlevel/methods/premium/get-stars-transactions.cjs +3 -2
- package/highlevel/methods/premium/get-stars-transactions.d.cts +2 -0
- package/highlevel/methods/premium/get-stars-transactions.d.ts +2 -0
- package/highlevel/methods/premium/get-stars-transactions.js +3 -2
- package/highlevel/methods/premium/iter-saved-star-gifts.cjs +15 -10
- package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +13 -19
- package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +13 -19
- package/highlevel/methods/premium/iter-saved-star-gifts.js +15 -10
- package/highlevel/methods/premium/prepay-star-gift-upgrade.cjs +30 -0
- package/highlevel/methods/premium/prepay-star-gift-upgrade.d.cts +23 -0
- package/highlevel/methods/premium/prepay-star-gift-upgrade.d.ts +23 -0
- package/highlevel/methods/premium/prepay-star-gift-upgrade.js +25 -0
- package/highlevel/methods/stickers/delete-sticker-from-set.d.cts +2 -4
- package/highlevel/methods/stickers/delete-sticker-from-set.d.ts +2 -4
- package/highlevel/methods/stickers/move-sticker-in-set.d.cts +2 -4
- package/highlevel/methods/stickers/move-sticker-in-set.d.ts +2 -4
- package/highlevel/methods/stickers/replace-sticker-in-set.d.cts +2 -4
- package/highlevel/methods/stickers/replace-sticker-in-set.d.ts +2 -4
- package/highlevel/methods/users/get-saved-music.cjs +38 -0
- package/highlevel/methods/users/get-saved-music.d.cts +13 -0
- package/highlevel/methods/users/get-saved-music.d.ts +13 -0
- package/highlevel/methods/users/get-saved-music.js +33 -0
- package/highlevel/methods/users/save-music-to-profile.cjs +57 -0
- package/highlevel/methods/users/save-music-to-profile.d.cts +19 -0
- package/highlevel/methods/users/save-music-to-profile.d.ts +19 -0
- package/highlevel/methods/users/save-music-to-profile.js +52 -0
- package/highlevel/methods/users/set-emoji-status.cjs +0 -8
- package/highlevel/methods/users/set-emoji-status.d.cts +0 -11
- package/highlevel/methods/users/set-emoji-status.d.ts +0 -11
- package/highlevel/methods/users/set-emoji-status.js +1 -9
- package/highlevel/methods.d.cts +5 -4
- package/highlevel/methods.d.ts +5 -4
- package/highlevel/storage/service/current-user.cjs +5 -4
- package/highlevel/storage/service/current-user.js +5 -4
- package/highlevel/types/files/utils.d.cts +7 -0
- package/highlevel/types/files/utils.d.ts +7 -0
- package/highlevel/types/media/document.d.cts +1 -1
- package/highlevel/types/media/document.d.ts +1 -1
- package/highlevel/types/messages/message-action.cjs +43 -21
- package/highlevel/types/messages/message-action.d.cts +58 -17
- package/highlevel/types/messages/message-action.d.ts +58 -17
- package/highlevel/types/messages/message-action.js +43 -21
- package/highlevel/types/peers/full-user.cjs +10 -1
- package/highlevel/types/peers/full-user.d.cts +3 -0
- package/highlevel/types/peers/full-user.d.ts +3 -0
- package/highlevel/types/peers/full-user.js +10 -1
- package/highlevel/types/premium/index.d.cts +1 -0
- package/highlevel/types/premium/index.d.ts +1 -0
- package/highlevel/types/premium/saved-star-gift.cjs +6 -0
- package/highlevel/types/premium/saved-star-gift.d.cts +4 -0
- package/highlevel/types/premium/saved-star-gift.d.ts +4 -0
- package/highlevel/types/premium/saved-star-gift.js +6 -0
- package/highlevel/types/premium/star-gift-value.cjs +65 -0
- package/highlevel/types/premium/star-gift-value.d.cts +41 -0
- package/highlevel/types/premium/star-gift-value.d.ts +41 -0
- package/highlevel/types/premium/star-gift-value.js +60 -0
- package/highlevel/types/premium/stars-gift-unique.cjs +10 -3
- package/highlevel/types/premium/stars-gift-unique.d.cts +1 -1
- package/highlevel/types/premium/stars-gift-unique.d.ts +1 -1
- package/highlevel/types/premium/stars-gift-unique.js +10 -3
- package/highlevel/types/premium/stars-transaction.cjs +9 -0
- package/highlevel/types/premium/stars-transaction.d.cts +10 -0
- package/highlevel/types/premium/stars-transaction.d.ts +10 -0
- package/highlevel/types/premium/stars-transaction.js +9 -0
- package/index.cjs +2 -0
- package/index.js +2 -0
- package/methods.cjs +9 -5
- package/methods.js +12 -8
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/package.json +2 -2
- package/utils/binary/compat.cjs +35 -4
- package/utils/binary/compat.js +35 -4
- package/highlevel/methods/auth/run.d.cts +0 -16
- package/highlevel/methods/auth/run.d.ts +0 -16
- package/highlevel/methods/auth/run.js +0 -8
package/highlevel/client.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
/**
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
/**
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
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
|
-
*
|
|
5177
|
+
* Upload progress callback
|
|
5178
|
+
*
|
|
5179
|
+
* @param uploaded Number of bytes uploaded
|
|
5180
|
+
* @param total Total file size
|
|
5179
5181
|
*/
|
|
5180
|
-
|
|
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
|
|
@@ -6,15 +6,6 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const resolvePeer = require("../users/resolve-peer.cjs");
|
|
9
|
-
async function toggleForum(client, chatId, enabled = false) {
|
|
10
|
-
const res = await client.call({
|
|
11
|
-
_: "channels.toggleForum",
|
|
12
|
-
channel: await resolvePeer.resolveChannel(client, chatId),
|
|
13
|
-
enabled,
|
|
14
|
-
tabs: false
|
|
15
|
-
});
|
|
16
|
-
client.handleClientUpdate(res);
|
|
17
|
-
}
|
|
18
9
|
async function updateForumSettings(client, chatId, settings) {
|
|
19
10
|
const res = await client.call({
|
|
20
11
|
_: "channels.toggleForum",
|
|
@@ -24,5 +15,4 @@ async function updateForumSettings(client, chatId, settings) {
|
|
|
24
15
|
});
|
|
25
16
|
client.handleClientUpdate(res);
|
|
26
17
|
}
|
|
27
|
-
exports.toggleForum = toggleForum;
|
|
28
18
|
exports.updateForumSettings = updateForumSettings;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputPeerLike } from '../../types/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Set whether a supergroup is a forum.
|
|
5
|
-
*
|
|
6
|
-
* Only owner of the supergroup can change this setting.
|
|
7
|
-
*
|
|
8
|
-
* @param chatId Chat ID or username
|
|
9
|
-
* @param enabled Whether the supergroup should be a forum
|
|
10
|
-
* @deprecated Use {@link updateForumSettings} instead
|
|
11
|
-
*/
|
|
12
|
-
export declare function toggleForum(client: ITelegramClient, chatId: InputPeerLike, enabled?: boolean): Promise<void>;
|
|
13
3
|
/**
|
|
14
4
|
* Update forum settings of a supergroup.
|
|
15
5
|
*
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
2
|
import { InputPeerLike } from '../../types/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Set whether a supergroup is a forum.
|
|
5
|
-
*
|
|
6
|
-
* Only owner of the supergroup can change this setting.
|
|
7
|
-
*
|
|
8
|
-
* @param chatId Chat ID or username
|
|
9
|
-
* @param enabled Whether the supergroup should be a forum
|
|
10
|
-
* @deprecated Use {@link updateForumSettings} instead
|
|
11
|
-
*/
|
|
12
|
-
export declare function toggleForum(client: ITelegramClient, chatId: InputPeerLike, enabled?: boolean): Promise<void>;
|
|
13
3
|
/**
|
|
14
4
|
* Update forum settings of a supergroup.
|
|
15
5
|
*
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { resolveChannel } from "../users/resolve-peer.js";
|
|
2
|
-
async function toggleForum(client, chatId, enabled = false) {
|
|
3
|
-
const res = await client.call({
|
|
4
|
-
_: "channels.toggleForum",
|
|
5
|
-
channel: await resolveChannel(client, chatId),
|
|
6
|
-
enabled,
|
|
7
|
-
tabs: false
|
|
8
|
-
});
|
|
9
|
-
client.handleClientUpdate(res);
|
|
10
|
-
}
|
|
11
2
|
async function updateForumSettings(client, chatId, settings) {
|
|
12
3
|
const res = await client.call({
|
|
13
4
|
_: "channels.toggleForum",
|
|
@@ -18,6 +9,5 @@ async function updateForumSettings(client, chatId, settings) {
|
|
|
18
9
|
client.handleClientUpdate(res);
|
|
19
10
|
}
|
|
20
11
|
export {
|
|
21
|
-
toggleForum,
|
|
22
12
|
updateForumSettings
|
|
23
13
|
};
|
|
@@ -103,9 +103,5 @@ async function getStarGiftResaleOptions(client, params) {
|
|
|
103
103
|
res.nextOffset
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
-
async function getResaleOptions(client, params) {
|
|
107
|
-
return getStarGiftResaleOptions(client, params);
|
|
108
|
-
}
|
|
109
106
|
exports._normalizeResaleAttributes = _normalizeResaleAttributes;
|
|
110
|
-
exports.getResaleOptions = getResaleOptions;
|
|
111
107
|
exports.getStarGiftResaleOptions = getStarGiftResaleOptions;
|
|
@@ -43,9 +43,3 @@ export declare function getStarGiftResaleOptions(client: ITelegramClient, params
|
|
|
43
43
|
/** Limit for pagination */
|
|
44
44
|
limit?: number;
|
|
45
45
|
}): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
|
|
46
|
-
/**
|
|
47
|
-
* Get a list of star gifts up for resale
|
|
48
|
-
*
|
|
49
|
-
* @deprecated Deprecated alias, use `getStarGiftResaleOptions` instead
|
|
50
|
-
*/
|
|
51
|
-
export declare function getResaleOptions(client: ITelegramClient, params: Parameters<typeof getStarGiftResaleOptions>[1]): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
|
|
@@ -43,9 +43,3 @@ export declare function getStarGiftResaleOptions(client: ITelegramClient, params
|
|
|
43
43
|
/** Limit for pagination */
|
|
44
44
|
limit?: number;
|
|
45
45
|
}): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
|
|
46
|
-
/**
|
|
47
|
-
* Get a list of star gifts up for resale
|
|
48
|
-
*
|
|
49
|
-
* @deprecated Deprecated alias, use `getStarGiftResaleOptions` instead
|
|
50
|
-
*/
|
|
51
|
-
export declare function getResaleOptions(client: ITelegramClient, params: Parameters<typeof getStarGiftResaleOptions>[1]): Promise<ArrayPaginatedWithMeta<StarGiftUnique, string, ResaleStarGiftsMeta>>;
|
|
@@ -96,11 +96,7 @@ async function getStarGiftResaleOptions(client, params) {
|
|
|
96
96
|
res.nextOffset
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
async function getResaleOptions(client, params) {
|
|
100
|
-
return getStarGiftResaleOptions(client, params);
|
|
101
|
-
}
|
|
102
99
|
export {
|
|
103
100
|
_normalizeResaleAttributes,
|
|
104
|
-
getResaleOptions,
|
|
105
101
|
getStarGiftResaleOptions
|
|
106
102
|
};
|
|
@@ -16,7 +16,8 @@ async function getSavedStarGifts(client, params) {
|
|
|
16
16
|
excludeUnsaved: params.excludeHidden,
|
|
17
17
|
excludeSaved: params.excludePublic,
|
|
18
18
|
excludeUnlimited: params.excludeUnlimited,
|
|
19
|
-
|
|
19
|
+
excludeUnupgradable: params.excludeUnupgradable,
|
|
20
|
+
excludeUpgradable: params.excludeUpgradable,
|
|
20
21
|
excludeUnique: params.excludeUnique,
|
|
21
22
|
sortByValue: params.sortByValue,
|
|
22
23
|
collectionId: params.collectionId,
|
|
@@ -15,10 +15,12 @@ export declare function getSavedStarGifts(client: ITelegramClient, params: {
|
|
|
15
15
|
excludePublic?: boolean;
|
|
16
16
|
/** Whether to exclude gifts with unlimited availability */
|
|
17
17
|
excludeUnlimited?: boolean;
|
|
18
|
-
/** Whether to exclude gifts with limited availability */
|
|
19
|
-
excludeLimited?: boolean;
|
|
20
18
|
/** Whether to exclude unique gifts */
|
|
21
19
|
excludeUnique?: boolean;
|
|
20
|
+
/** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
|
|
21
|
+
excludeUnupgradable?: boolean;
|
|
22
|
+
/** Whether to exclude gifts that can be upgraded */
|
|
23
|
+
excludeUpgradable?: boolean;
|
|
22
24
|
/** ID of the collection to get gifts from */
|
|
23
25
|
collectionId?: number;
|
|
24
26
|
/** Whether to sort by value */
|
|
@@ -15,10 +15,12 @@ export declare function getSavedStarGifts(client: ITelegramClient, params: {
|
|
|
15
15
|
excludePublic?: boolean;
|
|
16
16
|
/** Whether to exclude gifts with unlimited availability */
|
|
17
17
|
excludeUnlimited?: boolean;
|
|
18
|
-
/** Whether to exclude gifts with limited availability */
|
|
19
|
-
excludeLimited?: boolean;
|
|
20
18
|
/** Whether to exclude unique gifts */
|
|
21
19
|
excludeUnique?: boolean;
|
|
20
|
+
/** Whether to exclude gifts that cannot be upgraded (either not limited or already upgraded) */
|
|
21
|
+
excludeUnupgradable?: boolean;
|
|
22
|
+
/** Whether to exclude gifts that can be upgraded */
|
|
23
|
+
excludeUpgradable?: boolean;
|
|
22
24
|
/** ID of the collection to get gifts from */
|
|
23
25
|
collectionId?: number;
|
|
24
26
|
/** Whether to sort by value */
|
|
@@ -9,7 +9,8 @@ async function getSavedStarGifts(client, params) {
|
|
|
9
9
|
excludeUnsaved: params.excludeHidden,
|
|
10
10
|
excludeSaved: params.excludePublic,
|
|
11
11
|
excludeUnlimited: params.excludeUnlimited,
|
|
12
|
-
|
|
12
|
+
excludeUnupgradable: params.excludeUnupgradable,
|
|
13
|
+
excludeUpgradable: params.excludeUpgradable,
|
|
13
14
|
excludeUnique: params.excludeUnique,
|
|
14
15
|
sortByValue: params.sortByValue,
|
|
15
16
|
collectionId: params.collectionId,
|
|
@@ -5,9 +5,12 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const starGiftValue = require("../../types/premium/star-gift-value.cjs");
|
|
9
|
+
async function getStarGiftValue(client, params) {
|
|
10
|
+
const res = await client.call({
|
|
11
|
+
_: "payments.getUniqueStarGiftValueInfo",
|
|
12
|
+
slug: params.slug
|
|
13
|
+
});
|
|
14
|
+
return new starGiftValue.StarGiftValue(res);
|
|
12
15
|
}
|
|
13
|
-
exports.
|
|
16
|
+
exports.getStarGiftValue = getStarGiftValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { StarGiftValue } from '../../types/premium/star-gift-value.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the value of a unique star gift
|
|
5
|
+
*/
|
|
6
|
+
export declare function getStarGiftValue(client: ITelegramClient, params: {
|
|
7
|
+
/** Slug of the star gift */
|
|
8
|
+
slug: string;
|
|
9
|
+
}): Promise<StarGiftValue>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
+
import { StarGiftValue } from '../../types/premium/star-gift-value.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the value of a unique star gift
|
|
5
|
+
*/
|
|
6
|
+
export declare function getStarGiftValue(client: ITelegramClient, params: {
|
|
7
|
+
/** Slug of the star gift */
|
|
8
|
+
slug: string;
|
|
9
|
+
}): Promise<StarGiftValue>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StarGiftValue as StarGiftValue$2 } from "../../types/premium/star-gift-value.js";
|
|
2
|
+
async function getStarGiftValue(client, params) {
|
|
3
|
+
const res = await client.call({
|
|
4
|
+
_: "payments.getUniqueStarGiftValueInfo",
|
|
5
|
+
slug: params.slug
|
|
6
|
+
});
|
|
7
|
+
return new StarGiftValue$2(res);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
getStarGiftValue
|
|
11
|
+
};
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
8
8
|
const starsStatus = require("../../types/premium/stars-status.cjs");
|
|
9
9
|
const resolvePeer = require("../users/resolve-peer.cjs");
|
|
10
10
|
async function getStarsTransactions(client, peerId, params) {
|
|
11
|
-
const { direction, sort, subscriptionId, offset = "", limit = 100 } = params ?? {};
|
|
11
|
+
const { direction, sort, subscriptionId, offset = "", limit = 100, ton } = params ?? {};
|
|
12
12
|
const res = await client.call({
|
|
13
13
|
_: "payments.getStarsTransactions",
|
|
14
14
|
peer: await resolvePeer.resolvePeer(client, peerId),
|
|
@@ -17,7 +17,8 @@ async function getStarsTransactions(client, peerId, params) {
|
|
|
17
17
|
outbound: direction === "outgoing",
|
|
18
18
|
inbound: direction === "incoming",
|
|
19
19
|
ascending: sort === "asc",
|
|
20
|
-
subscriptionId
|
|
20
|
+
subscriptionId,
|
|
21
|
+
ton
|
|
21
22
|
});
|
|
22
23
|
return new starsStatus.StarsStatus(res);
|
|
23
24
|
}
|
|
@@ -25,6 +25,8 @@ export declare function getStarsTransactions(client: ITelegramClient, peerId: In
|
|
|
25
25
|
subscriptionId?: string;
|
|
26
26
|
/** Pagination offset */
|
|
27
27
|
offset?: string;
|
|
28
|
+
/** Whether to return transactions made in TON */
|
|
29
|
+
ton?: boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Pagination limit
|
|
30
32
|
*
|
|
@@ -25,6 +25,8 @@ export declare function getStarsTransactions(client: ITelegramClient, peerId: In
|
|
|
25
25
|
subscriptionId?: string;
|
|
26
26
|
/** Pagination offset */
|
|
27
27
|
offset?: string;
|
|
28
|
+
/** Whether to return transactions made in TON */
|
|
29
|
+
ton?: boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Pagination limit
|
|
30
32
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StarsStatus as StarsStatus$2 } from "../../types/premium/stars-status.js";
|
|
2
2
|
import { resolvePeer } from "../users/resolve-peer.js";
|
|
3
3
|
async function getStarsTransactions(client, peerId, params) {
|
|
4
|
-
const { direction, sort, subscriptionId, offset = "", limit = 100 } = params ?? {};
|
|
4
|
+
const { direction, sort, subscriptionId, offset = "", limit = 100, ton } = params ?? {};
|
|
5
5
|
const res = await client.call({
|
|
6
6
|
_: "payments.getStarsTransactions",
|
|
7
7
|
peer: await resolvePeer(client, peerId),
|
|
@@ -10,7 +10,8 @@ async function getStarsTransactions(client, peerId, params) {
|
|
|
10
10
|
outbound: direction === "outgoing",
|
|
11
11
|
inbound: direction === "incoming",
|
|
12
12
|
ascending: sort === "asc",
|
|
13
|
-
subscriptionId
|
|
13
|
+
subscriptionId,
|
|
14
|
+
ton
|
|
14
15
|
});
|
|
15
16
|
return new StarsStatus$2(res);
|
|
16
17
|
}
|
|
@@ -9,25 +9,30 @@ const savedStarGift = require("../../types/premium/saved-star-gift.cjs");
|
|
|
9
9
|
const resolvePeer = require("../users/resolve-peer.cjs");
|
|
10
10
|
const peersIndex = require("../../types/peers/peers-index.cjs");
|
|
11
11
|
async function* iterSavedStarGifts(client, params) {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const {
|
|
13
|
+
owner,
|
|
14
|
+
offset: offsetInitial = "",
|
|
15
|
+
chunkSize = 100,
|
|
16
|
+
limit = Infinity,
|
|
17
|
+
...rest
|
|
18
|
+
} = params;
|
|
19
|
+
const ownerPeer = await resolvePeer.resolvePeer(client, owner);
|
|
20
|
+
let offset = offsetInitial;
|
|
21
|
+
let current = 0;
|
|
14
22
|
while (true) {
|
|
15
23
|
const res = await client.call({
|
|
16
24
|
_: "payments.getSavedStarGifts",
|
|
17
|
-
peer:
|
|
18
|
-
excludeUnsaved: params.excludeUnsaved,
|
|
19
|
-
excludeSaved: params.excludeSaved,
|
|
20
|
-
excludeUnlimited: params.excludeUnlimited,
|
|
21
|
-
excludeLimited: params.excludeLimited,
|
|
22
|
-
excludeUnique: params.excludeUnique,
|
|
23
|
-
sortByValue: params.sortByValue,
|
|
25
|
+
peer: ownerPeer,
|
|
24
26
|
offset,
|
|
25
|
-
limit:
|
|
27
|
+
limit: Math.min(chunkSize, limit - current),
|
|
28
|
+
...rest
|
|
26
29
|
});
|
|
27
30
|
const peers = peersIndex.PeersIndex.from(res);
|
|
28
31
|
yield* res.gifts.map((it) => new savedStarGift.SavedStarGift(it, peers));
|
|
29
32
|
if (!res.nextOffset) break;
|
|
30
33
|
offset = res.nextOffset;
|
|
34
|
+
current += res.gifts.length;
|
|
35
|
+
if (current >= limit) break;
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
38
|
exports.iterSavedStarGifts = iterSavedStarGifts;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import { ITelegramClient } from '../../client.types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getSavedStarGifts } from './get-saved-star-gifts.js';
|
|
3
3
|
import { SavedStarGift } from '../../types/premium/saved-star-gift.js';
|
|
4
4
|
/**
|
|
5
5
|
* Iterate over saved star gifts of a user,
|
|
6
6
|
* wrapper over {@link getSavedStarGifts}
|
|
7
7
|
*/
|
|
8
|
-
export declare function iterSavedStarGifts(client: ITelegramClient, params: {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
excludeUnique?: boolean;
|
|
21
|
-
/** Whether to sort by value */
|
|
22
|
-
sortByValue?: boolean;
|
|
23
|
-
/** Offset for pagination */
|
|
24
|
-
offset?: string;
|
|
25
|
-
/** Limit for pagination */
|
|
8
|
+
export declare function iterSavedStarGifts(client: ITelegramClient, params: Parameters<typeof getSavedStarGifts>[1] & {
|
|
9
|
+
/**
|
|
10
|
+
* Number of gifts to fetch per request
|
|
11
|
+
*
|
|
12
|
+
* @default 100
|
|
13
|
+
*/
|
|
14
|
+
chunkSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Total number of gifts to fetch
|
|
17
|
+
*
|
|
18
|
+
* @default Infinity
|
|
19
|
+
*/
|
|
26
20
|
limit?: number;
|
|
27
21
|
}): AsyncIterableIterator<SavedStarGift>;
|