@mtcute/core 0.16.14 → 0.17.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.
@@ -0,0 +1,26 @@
1
+ import { ITelegramClient } from '../../client.types.js';
2
+ import { InputPeerLike, UserStarGift } from '../../types/index.js';
3
+ import { getStarGifts } from './get-star-gifts.js';
4
+ /**
5
+ * Iterate over gifts sent to a given user.
6
+ *
7
+ * Wrapper over {@link getStarGifts}
8
+ *
9
+ * @param peerId Peer ID
10
+ * @param params Additional parameters
11
+ */
12
+ export declare function iterStarGifts(client: ITelegramClient, peerId: InputPeerLike, params?: Parameters<typeof getStarGifts>[2] & {
13
+ /**
14
+ * Total number of gifts to fetch
15
+ *
16
+ * @default Infinity, i.e. fetch all gifts
17
+ */
18
+ limit?: number;
19
+ /**
20
+ * Number of gifts to fetch per request
21
+ * Usually you don't need to change this
22
+ *
23
+ * @default 100
24
+ */
25
+ chunkSize?: number;
26
+ }): AsyncIterableIterator<UserStarGift>;
@@ -0,0 +1,35 @@
1
+ import { default as Long } from 'long';
2
+ import { InputPeerLike } from '../../types/peers/peer.js';
3
+ import { StarGift } from '../../types/premium/stars-gift.js';
4
+ import { InputText } from '../../types/misc/entities.js';
5
+ import { ITelegramClient } from '../../client.types.js';
6
+ import { Message } from '../../types/messages/message.js';
7
+ /**
8
+ * Send a star gift to a user.
9
+ *
10
+ * > **Note**: this method is not indended to be used by full-fledged clients,
11
+ * > as this method hides the actual invoice and payment form from the user.
12
+ * > For GUI clients, you should refer to the method's source code and
13
+ * > present the payment form to the user.
14
+ *
15
+ * @returns Service message about the sent gift
16
+ */
17
+ export declare function sendStarGift(client: ITelegramClient, params: {
18
+ /** ID of the user to send the gift to */
19
+ userId: InputPeerLike;
20
+ /** ID of the gift to send */
21
+ gift: Long | StarGift;
22
+ /**
23
+ * Whether to send the gift anonymously
24
+ * (i.e. if the recipient chooses to display the gift
25
+ * on their profile, your name won't be visible)
26
+ */
27
+ anonymous?: boolean;
28
+ /** Message to send along with the gift */
29
+ message?: InputText;
30
+ /**
31
+ * Whether to dispatch the new message event
32
+ * to the client's update handler.
33
+ */
34
+ shouldDispatch?: true;
35
+ }): Promise<Message>;
@@ -1,5 +1,5 @@
1
1
  import { ITelegramClient } from '../../client.types.js';
2
- import { InputFileLike, InputPeerLike, InputStickerSetItem, StickerSourceType, StickerType, StickerSet } from '../../types/index.js';
2
+ import { InputFileLike, InputPeerLike, InputStickerSetItem, StickerType, StickerSet } from '../../types/index.js';
3
3
  /**
4
4
  * Create a new sticker set.
5
5
  *
@@ -32,12 +32,6 @@ export declare function createStickerSet(client: ITelegramClient, params: {
32
32
  * @default `sticker`, i.e. regular stickers.
33
33
  */
34
34
  type?: StickerType;
35
- /**
36
- * File source type for the stickers in this set.
37
- *
38
- * @default `static`, i.e. regular WEBP stickers.
39
- */
40
- sourceType?: StickerSourceType;
41
35
  /**
42
36
  * Whether to create "adaptive" emoji set.
43
37
  *
@@ -201,6 +201,7 @@ export { verifyPasswordEmail } from './methods/password/password-email.js';
201
201
  export { resendPasswordEmail } from './methods/password/password-email.js';
202
202
  export { cancelPasswordEmail } from './methods/password/password-email.js';
203
203
  export { removeCloudPassword } from './methods/password/remove-cloud-password.js';
204
+ export { acceptStarGift } from './methods/premium/accept-star-gift.js';
204
205
  export { applyBoost } from './methods/premium/apply-boost.js';
205
206
  export { canApplyBoost } from './methods/premium/can-apply-boost.js';
206
207
  export type { CanApplyBoostResult } from './methods/premium/can-apply-boost.js';
@@ -212,9 +213,13 @@ export { getBoosts } from './methods/premium/get-boosts.js';
212
213
  export { getBusinessChatLinks } from './methods/premium/get-business-chat-links.js';
213
214
  export { getBusinessConnection } from './methods/premium/get-business-connection.js';
214
215
  export { getMyBoostSlots } from './methods/premium/get-my-boost-slots.js';
216
+ export { getStarGiftOptions } from './methods/premium/get-star-gift-options.js';
217
+ export { getStarGifts } from './methods/premium/get-star-gifts.js';
215
218
  export { getStarsTransactions } from './methods/premium/get-stars-transactions.js';
216
219
  export { iterBoosters } from './methods/premium/iter-boosters.js';
220
+ export { iterStarGifts } from './methods/premium/iter-star-gifts.js';
217
221
  export { iterStarsTransactions } from './methods/premium/iter-stars-transactions.js';
222
+ export { sendStarGift } from './methods/premium/send-star-gift.js';
218
223
  export { setBusinessIntro } from './methods/premium/set-business-intro.js';
219
224
  export { setBusinessWorkHours } from './methods/premium/set-business-work-hours.js';
220
225
  export { addStickerToSet } from './methods/stickers/add-sticker-to-set.js';
@@ -246,7 +251,6 @@ export { iterAllStories } from './methods/stories/iter-all-stories.js';
246
251
  export { iterProfileStories } from './methods/stories/iter-profile-stories.js';
247
252
  export { iterStoryViewers } from './methods/stories/iter-story-viewers.js';
248
253
  export { readStories } from './methods/stories/read-stories.js';
249
- export { reportStory } from './methods/stories/report-story.js';
250
254
  export { sendStoryReaction } from './methods/stories/send-story-reaction.js';
251
255
  export { sendStory } from './methods/stories/send-story.js';
252
256
  export { togglePeerStoriesArchived } from './methods/stories/toggle-peer-stories-archived.js';
@@ -186,6 +186,13 @@ export declare function requestPeer(text: string, buttonId: number, params: {
186
186
  */
187
187
  count?: number;
188
188
  }): tl.RawKeyboardButtonRequestPeer;
189
+ /**
190
+ * Button to copy text to the user's clipboard
191
+ */
192
+ export declare function copy(params: {
193
+ text: string;
194
+ copyText?: string;
195
+ }): tl.RawKeyboardButtonCopy;
189
196
  /**
190
197
  * Find a button in the keyboard by its text or by predicate
191
198
  *
@@ -44,4 +44,5 @@ export declare class Video extends RawDocument {
44
44
  /** For self-destructing videos, TTL in seconds */
45
45
  get ttlSeconds(): number | null;
46
46
  get videoStartTs(): number | null;
47
+ get codec(): string | null;
47
48
  }
@@ -2,6 +2,8 @@ import { tl } from '@mtcute/tl';
2
2
  import { CallDiscardReason } from '../calls/index.js';
3
3
  import { Photo } from '../media/photo.js';
4
4
  import { Peer } from '../peers/peer.js';
5
+ import { StarGift } from '../premium/stars-gift.js';
6
+ import { TextWithEntities } from '../misc/entities.js';
5
7
  import { Message } from './message.js';
6
8
  /** Group was created */
7
9
  export interface ActionChatCreated {
@@ -359,7 +361,7 @@ export interface ActionPaymentRefunded {
359
361
  charge: tl.TypePaymentCharge;
360
362
  }
361
363
  /** Telegram Stars were gifted by the other chat participant */
362
- export interface ActionStarsGifted {
364
+ export interface ActionStarGifted {
363
365
  readonly type: 'stars_gifted';
364
366
  /** Whether `currency` is a cryptocurrency */
365
367
  isCrypto: boolean;
@@ -387,6 +389,21 @@ export interface ActionStarsPrize {
387
389
  /** Message ID containing the giveaway */
388
390
  giveawayMessageId: number;
389
391
  }
390
- export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarsGifted | ActionStarsPrize | null;
392
+ export interface ActionStarGift {
393
+ readonly type: 'stars_gift';
394
+ /** Whether the sender chose to send the gift anonymously */
395
+ nameHidden: boolean;
396
+ /** Whether this gift was saved to the recipient's profile */
397
+ saved: boolean;
398
+ /** Whether this gift was converted to stars */
399
+ converted: boolean;
400
+ /** Amount of stars the gift can be converted to by the recipient */
401
+ convertStars: tl.Long;
402
+ /** The gift itself */
403
+ gift: StarGift;
404
+ /** Message attached to the gift */
405
+ message: TextWithEntities | null;
406
+ }
407
+ export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGift | null;
391
408
  /** @internal */
392
409
  export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
@@ -1,6 +1,6 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { InputFileLike } from '../files/index.js';
3
- import { MaskPosition, Sticker, StickerSourceType, StickerType, Thumbnail } from '../media/index.js';
3
+ import { MaskPosition, Sticker, StickerType, Thumbnail } from '../media/index.js';
4
4
  /**
5
5
  * Input sticker set.
6
6
  * Can be one of:
@@ -71,10 +71,6 @@ export declare class StickerSet {
71
71
  * Type of the stickers in this set
72
72
  */
73
73
  get type(): StickerType;
74
- /**
75
- * Source file type of the stickers in this set
76
- */
77
- get sourceType(): StickerSourceType;
78
74
  /**
79
75
  * Date when this sticker set was installed
80
76
  */
@@ -8,3 +8,4 @@ export * from './business-intro.js';
8
8
  export * from './business-work-hours.js';
9
9
  export * from './stars-transaction.js';
10
10
  export * from './stars-status.js';
11
+ export * from './stars-gift.js';
@@ -0,0 +1,57 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { Sticker } from '../media/sticker.js';
3
+ import { PeersIndex } from '../peers/peers-index.js';
4
+ import { User } from '../peers/user.js';
5
+ import { TextWithEntities } from '../misc/entities.js';
6
+ /**
7
+ * A gift with stars attached to it.
8
+ */
9
+ export declare class StarGift {
10
+ readonly raw: tl.TypeStarGift;
11
+ constructor(raw: tl.TypeStarGift);
12
+ /** ID of the gift */
13
+ get id(): tl.Long;
14
+ /** Sticker associated with the gift */
15
+ get sticker(): Sticker;
16
+ /** Amount of stars the gift was purchased for */
17
+ get purchaseStars(): tl.Long;
18
+ /**
19
+ * Amount of stars the gift can be converted to by the recipient
20
+ */
21
+ get convertStars(): tl.Long;
22
+ /**
23
+ * For limited availability gifts,
24
+ * the number of remaining and total gifts available
25
+ */
26
+ get availability(): {
27
+ remains: number;
28
+ total: number;
29
+ } | null;
30
+ }
31
+ /**
32
+ * Information about a certain user's {@link StarGift}.
33
+ */
34
+ export declare class UserStarGift {
35
+ readonly raw: tl.RawUserStarGift;
36
+ readonly peers: PeersIndex;
37
+ constructor(raw: tl.RawUserStarGift, peers: PeersIndex);
38
+ /** Whether the sender chose to appear anonymously */
39
+ get nameHidden(): boolean;
40
+ /** Whether this gift is not visible on the recipient's profile */
41
+ get hidden(): boolean;
42
+ /** Sender of the gift, if available */
43
+ get sender(): User | null;
44
+ /** Message ID where the gift was sent, if available */
45
+ get messageId(): number | null;
46
+ /** Date the gift was sent */
47
+ get date(): Date;
48
+ /** The gift itself */
49
+ get gift(): StarGift;
50
+ /** Text attached to the gift */
51
+ get text(): TextWithEntities | null;
52
+ /**
53
+ * If the gift was converted to stars, the amount of stars
54
+ * it was converted to
55
+ */
56
+ get convertStars(): tl.Long | null;
57
+ }
@@ -4,6 +4,7 @@ import { Peer } from '../peers/peer.js';
4
4
  import { User } from '../peers/user.js';
5
5
  import { MessageMedia } from '../messages/message-media.js';
6
6
  import { WebDocument } from '../files/web-document.js';
7
+ import { StarGift } from './stars-gift.js';
7
8
  /**
8
9
  * Type of the transaction.
9
10
  *
@@ -16,6 +17,7 @@ import { WebDocument } from '../files/web-document.js';
16
17
  * - `gift`: This transaction is a gift from a user
17
18
  * - `bot_purchase`: This transaction is a purchase at a bot-operated store
18
19
  * - `channel_subscription`: This transaction is a subscription to a channel
20
+ * - `star_gift`: This transaction is either a star gift to a user (if outgoing), or converting a star gift to stars (if incoming)
19
21
  */
20
22
  export type StarsTransactionType = {
21
23
  type: 'unsupported';
@@ -98,6 +100,12 @@ export type StarsTransactionType = {
98
100
  peer: Peer;
99
101
  /** ID of the message containing the giveaway where the stars were given */
100
102
  messageId: number;
103
+ } | {
104
+ type: 'star_gift';
105
+ /** Related peer */
106
+ peer: Peer;
107
+ /** The gift */
108
+ gift: StarGift;
101
109
  };
102
110
  export declare class StarsTransaction {
103
111
  readonly raw: tl.RawStarsTransaction;
package/index.cjs CHANGED
@@ -8,8 +8,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
8
  const Long = require("long");
9
9
  const conditionVariable = require("./chunks/cjs/eX3zeDAz.js");
10
10
  const tl = require("@mtcute/tl");
11
- const client = require("./chunks/cjs/DIHjSN4l.js");
12
- const storyViewer = require("./chunks/cjs/chPq0GcA.js");
11
+ const client = require("./chunks/cjs/B_4IhLh8.js");
12
+ const storyViewer = require("./chunks/cjs/CSfUPcui.js");
13
13
  const controllablePromise = require("./chunks/cjs/CZAB54t2.js");
14
14
  const peersIndex = require("./chunks/cjs/ija5tZ1t.js");
15
15
  require("@mtcute/tl-runtime");
@@ -1231,6 +1231,7 @@ exports.RawLocation = storyViewer.RawLocation;
1231
1231
  exports.RepliedMessageInfo = storyViewer.RepliedMessageInfo$2;
1232
1232
  exports.SearchFilters = storyViewer.SearchFilters;
1233
1233
  exports.SentCode = storyViewer.SentCode$1;
1234
+ exports.StarGift = storyViewer.StarGift$2;
1234
1235
  exports.StarsStatus = storyViewer.StarsStatus$2;
1235
1236
  exports.StarsTransaction = storyViewer.StarsTransaction$2;
1236
1237
  exports.Sticker = storyViewer.Sticker$2;
@@ -1250,6 +1251,7 @@ exports.StoryViewersList = storyViewer.StoryViewersList$2;
1250
1251
  exports.TakeoutSession = storyViewer.TakeoutSession$1;
1251
1252
  exports.Thumbnail = storyViewer.Thumbnail$2;
1252
1253
  exports.User = storyViewer.User$2;
1254
+ exports.UserStarGift = storyViewer.UserStarGift$2;
1253
1255
  exports.Venue = storyViewer.Venue$2;
1254
1256
  exports.Video = storyViewer.Video$2;
1255
1257
  exports.Voice = storyViewer.Voice$2;
package/index.js CHANGED
@@ -3,10 +3,10 @@ import { default as default2 } from "long";
3
3
  import { concatBuffers, dataViewFromBuffer, getRandomInt, bufferToReversed } from "./chunks/es/DY1E3mHM.js";
4
4
  import { assertNever, getAllPeersFrom, getBarePeerId, getMarkedPeerId, parseMarkedPeerId, toggleChannelIdMark } from "./chunks/es/DY1E3mHM.js";
5
5
  import { mtp, tl } from "@mtcute/tl";
6
- import { TransportError, basic } from "./chunks/es/qzEaLpWa.js";
7
- import { BotChatJoinRequestUpdate$2, BotReactionCountUpdate$2, BotReactionUpdate$2, BotStoppedUpdate$2, BusinessCallbackQuery$2, BusinessMessage, CallbackQuery$2, ChatJoinRequestUpdate$2, ChatMemberUpdate$2, ChosenInlineResult$2, Conversation, DeleteBusinessMessageUpdate$2, DeleteMessageUpdate$1, DeleteStoryUpdate$2, HistoryReadUpdate$1, InlineCallbackQuery$2, InlineQuery$2, MtClient, PollUpdate$2, PollVoteUpdate$2, PreCheckoutQuery$2, SessionConnection, StorageManager, StoryUpdate$2, TelegramStorageManager, TransportState, UpdatesManager, UserStatusUpdate$2, UserTypingUpdate$1, defaultReconnectionStrategy } from "./chunks/es/qzEaLpWa.js";
8
- import { normalizeInputReaction } from "./chunks/es/Btmu4f4t.js";
9
- import { AllStories$2, Audio$2, Boost$2, BoostSlot$2, BoostStats$1, factories$1, factories, factories$2, BotKeyboardBuilder, BusinessAccount$2, BusinessChatLink$2, BusinessConnection$2, BusinessIntro$2, BusinessWorkHours$2, Chat$2, ChatEvent$2, ChatInviteLink$2, ChatInviteLinkMember$2, ChatLocation$2, ChatMember$2, ChatPermissions$1, ChatPhoto$2, ChatPhotoSize$2, ChatPreview$2, ChatlistPreview$2, CollectibleInfo$1, Contact$1, Dialog$2, Dice$1, Document$2, DraftMessage$2, ExtendedMediaPreview$2, FactCheck$2, FileLocation$1, ForumTopic$2, FullChat$2, Game$2, GameHighScore$2, Invoice$2, LiveLocation$1, Location$1, MASK_POSITION_POINT_TO_TL, MediaStory$1, Message$2, MessageEffect$2, MessageEntity$2, MessageForwardInfo$2, MessageReactions$2, MessageRepliesInfo$2, PaidMedia$2, PaidPeerReaction$2, PeerReaction$2, PeerStories$2, Photo$2, Poll$2, PollAnswer$2, RawDocument, RawLocation, RepliedMessageInfo$2, SearchFilters, SentCode$1, StarsStatus$2, StarsTransaction$2, Sticker$2, StickerSet$2, StoriesStealthMode$1, Story$2, StoryInteractions$2, StoryInteractiveChannelPost$2, StoryInteractiveLocation$2, StoryInteractiveReaction$1, StoryInteractiveUrl, StoryInteractiveVenue$2, StoryInteractiveWeather$1, StoryRepost, StoryViewer$2, StoryViewersList$2, TakeoutSession$1, Thumbnail$2, User$2, Venue$2, Video$2, Voice$2, WebDocument$1, WebPage$2, _actionFromTl, _callDiscardReasonFromTl, _callDiscardReasonToTl, _messageActionFromTl, _messageMediaFromTl, _storyInteractiveElementFromTl, businessWorkHoursDaysToRaw, inputTextToTl, isUploadedFile, normalizeInputMessageId, normalizeInputStickerSet, parsePeer, toReactionEmoji } from "./chunks/es/Btmu4f4t.js";
6
+ import { TransportError, basic } from "./chunks/es/DzOlHce2.js";
7
+ import { BotChatJoinRequestUpdate$2, BotReactionCountUpdate$2, BotReactionUpdate$2, BotStoppedUpdate$2, BusinessCallbackQuery$2, BusinessMessage, CallbackQuery$2, ChatJoinRequestUpdate$2, ChatMemberUpdate$2, ChosenInlineResult$2, Conversation, DeleteBusinessMessageUpdate$2, DeleteMessageUpdate$1, DeleteStoryUpdate$2, HistoryReadUpdate$1, InlineCallbackQuery$2, InlineQuery$2, MtClient, PollUpdate$2, PollVoteUpdate$2, PreCheckoutQuery$2, SessionConnection, StorageManager, StoryUpdate$2, TelegramStorageManager, TransportState, UpdatesManager, UserStatusUpdate$2, UserTypingUpdate$1, defaultReconnectionStrategy } from "./chunks/es/DzOlHce2.js";
8
+ import { normalizeInputReaction } from "./chunks/es/DKzd1_Yg.js";
9
+ import { AllStories$2, Audio$2, Boost$2, BoostSlot$2, BoostStats$1, factories$1, factories, factories$2, BotKeyboardBuilder, BusinessAccount$2, BusinessChatLink$2, BusinessConnection$2, BusinessIntro$2, BusinessWorkHours$2, Chat$2, ChatEvent$2, ChatInviteLink$2, ChatInviteLinkMember$2, ChatLocation$2, ChatMember$2, ChatPermissions$1, ChatPhoto$2, ChatPhotoSize$2, ChatPreview$2, ChatlistPreview$2, CollectibleInfo$1, Contact$1, Dialog$2, Dice$1, Document$2, DraftMessage$2, ExtendedMediaPreview$2, FactCheck$2, FileLocation$1, ForumTopic$2, FullChat$2, Game$2, GameHighScore$2, Invoice$2, LiveLocation$1, Location$1, MASK_POSITION_POINT_TO_TL, MediaStory$1, Message$2, MessageEffect$2, MessageEntity$2, MessageForwardInfo$2, MessageReactions$2, MessageRepliesInfo$2, PaidMedia$2, PaidPeerReaction$2, PeerReaction$2, PeerStories$2, Photo$2, Poll$2, PollAnswer$2, RawDocument, RawLocation, RepliedMessageInfo$2, SearchFilters, SentCode$1, StarGift$2, StarsStatus$2, StarsTransaction$2, Sticker$2, StickerSet$2, StoriesStealthMode$1, Story$2, StoryInteractions$2, StoryInteractiveChannelPost$2, StoryInteractiveLocation$2, StoryInteractiveReaction$1, StoryInteractiveUrl, StoryInteractiveVenue$2, StoryInteractiveWeather$1, StoryRepost, StoryViewer$2, StoryViewersList$2, TakeoutSession$1, Thumbnail$2, User$2, UserStarGift$2, Venue$2, Video$2, Voice$2, WebDocument$1, WebPage$2, _actionFromTl, _callDiscardReasonFromTl, _callDiscardReasonToTl, _messageActionFromTl, _messageMediaFromTl, _storyInteractiveElementFromTl, businessWorkHoursDaysToRaw, inputTextToTl, isUploadedFile, normalizeInputMessageId, normalizeInputStickerSet, parsePeer, toReactionEmoji } from "./chunks/es/DKzd1_Yg.js";
10
10
  import { isTlRpcError } from "./chunks/es/BN3qj7tU.js";
11
11
  import { MtEmptyError, MtInvalidPeerTypeError, MtMessageNotFoundError, MtPeerNotFoundError } from "./chunks/es/BN3qj7tU.js";
12
12
  import { PeersIndex } from "./chunks/es/N3PMYmCL.js";
@@ -1230,6 +1230,7 @@ export {
1230
1230
  SearchFilters,
1231
1231
  SentCode$1 as SentCode,
1232
1232
  SessionConnection,
1233
+ StarGift$2 as StarGift,
1233
1234
  StarsStatus$2 as StarsStatus,
1234
1235
  StarsTransaction$2 as StarsTransaction,
1235
1236
  Sticker$2 as Sticker,
@@ -1257,6 +1258,7 @@ export {
1257
1258
  TransportState,
1258
1259
  UpdatesManager,
1259
1260
  User$2 as User,
1261
+ UserStarGift$2 as UserStarGift,
1260
1262
  UserStatusUpdate$2 as UserStatusUpdate,
1261
1263
  UserTypingUpdate$1 as UserTypingUpdate,
1262
1264
  Venue$2 as Venue,
package/methods.cjs CHANGED
@@ -5,9 +5,10 @@ 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 updateProfile = require("./chunks/cjs/CntZHjXA.js");
9
- const storyViewer = require("./chunks/cjs/chPq0GcA.js");
8
+ const updateProfile = require("./chunks/cjs/CgIc6lxt.js");
9
+ const storyViewer = require("./chunks/cjs/CSfUPcui.js");
10
10
  exports._normalizePrivacyRules = updateProfile._normalizePrivacyRules;
11
+ exports.acceptStarGift = updateProfile.acceptStarGift;
11
12
  exports.addChatMembers = updateProfile.addChatMembers;
12
13
  exports.addContact = updateProfile.addContact;
13
14
  exports.addStickerToSet = updateProfile.addStickerToSet;
@@ -129,6 +130,8 @@ exports.getReactionUsers = updateProfile.getReactionUsers;
129
130
  exports.getReplyTo = updateProfile.getReplyTo;
130
131
  exports.getScheduledMessages = updateProfile.getScheduledMessages;
131
132
  exports.getSimilarChannels = updateProfile.getSimilarChannels;
133
+ exports.getStarGiftOptions = updateProfile.getStarGiftOptions;
134
+ exports.getStarGifts = updateProfile.getStarGifts;
132
135
  exports.getStarsTransactions = updateProfile.getStarsTransactions;
133
136
  exports.getStickerSet = updateProfile.getStickerSet;
134
137
  exports.getStoriesById = updateProfile.getStoriesById;
@@ -159,6 +162,7 @@ exports.iterReactionUsers = updateProfile.iterReactionUsers;
159
162
  exports.iterSearchGlobal = updateProfile.iterSearchGlobal;
160
163
  exports.iterSearchHashtag = updateProfile.iterSearchHashtag;
161
164
  exports.iterSearchMessages = updateProfile.iterSearchMessages;
165
+ exports.iterStarGifts = updateProfile.iterStarGifts;
162
166
  exports.iterStarsTransactions = updateProfile.iterStarsTransactions;
163
167
  exports.iterStoryViewers = updateProfile.iterStoryViewers;
164
168
  exports.joinChat = updateProfile.joinChat;
@@ -183,7 +187,6 @@ exports.replaceStickerInSet = updateProfile.replaceStickerInSet;
183
187
  exports.replyMedia = updateProfile.replyMedia;
184
188
  exports.replyMediaGroup = updateProfile.replyMediaGroup;
185
189
  exports.replyText = updateProfile.replyText;
186
- exports.reportStory = updateProfile.reportStory;
187
190
  exports.resendCode = updateProfile.resendCode;
188
191
  exports.resendPasswordEmail = updateProfile.resendPasswordEmail;
189
192
  exports.restrictChatMember = updateProfile.restrictChatMember;
@@ -200,6 +203,7 @@ exports.sendPaidReaction = updateProfile.sendPaidReaction;
200
203
  exports.sendReaction = updateProfile.sendReaction;
201
204
  exports.sendRecoveryCode = updateProfile.sendRecoveryCode;
202
205
  exports.sendScheduled = updateProfile.sendScheduled;
206
+ exports.sendStarGift = updateProfile.sendStarGift;
203
207
  exports.sendStory = updateProfile.sendStory;
204
208
  exports.sendStoryReaction = updateProfile.sendStoryReaction;
205
209
  exports.sendTyping = updateProfile.sendTyping;
package/methods.js CHANGED
@@ -1,9 +1,10 @@
1
- import { _normalizePrivacyRules, addChatMembers, addContact, addStickerToSet, answerCallbackQuery, answerInlineQuery, answerMedia, answerMediaGroup, answerPreCheckoutQuery, answerText, applyBoost, archiveChats, banChatMember, blockUser, canApplyBoost, canSendStory, cancelPasswordEmail, changeCloudPassword, checkPassword, closeChat, closePoll, commentMedia, commentMediaGroup, commentText, createBusinessChatLink, createChannel, createFolder, createForumTopic, createGroup, createInviteLink, createStickerSet, createSupergroup, deleteBusinessChatLink, deleteChannel, deleteChatPhoto, deleteContacts, deleteFolder, deleteForumTopicHistory, deleteGroup, deleteHistory, deleteMessages, deleteMessagesById, deleteMyCommands, deleteProfilePhotos, deleteScheduledMessages, deleteStickerFromSet, deleteStories, deleteUserHistory, downloadAsBuffer, downloadAsIterable, downloadAsStream, editAdminRights, editBusinessChatLink, editCloseFriends, editCloseFriendsRaw, editFolder, editForumTopic, editInlineMessage, editInviteLink, editMessage, editStory, enableCloudPassword, exportInviteLink, findDialogs, findFolder, forwardMessages, forwardMessagesById, getAllScheduledMessages, getAllStories, getAvailableMessageEffects, getBoostStats, getBoosts, getBotInfo, getBotMenuButton, getBusinessChatLinks, getCallbackAnswer, getCallbackQueryMessage, getChat, getChatEventLog, getChatMember, getChatMembers, getChatPreview, getChatlistPreview, getCollectibleInfo, getCommonChats, getContacts, getCustomEmojis, getCustomEmojisFromMessages, getFactCheck, getFolders, getForumTopics, getForumTopicsById, getFullChat, getGameHighScores, getGlobalTtl, getHistory, getInlineGameHighScores, getInstalledStickers, getInviteLink, getInviteLinkMembers, getInviteLinks, getMe, getMessageByLink, getMessageGroup, getMessageReactions, getMessageReactionsById, getMessagesUnsafe, getMyBoostSlots, getMyCommands, getMyStickerSets, getMyUsername, getNearbyChats, getPasswordHint, getPeerStories, getPrimaryInviteLink, getProfilePhoto, getProfilePhotos, getProfileStories, getReactionUsers, getReplyTo, getScheduledMessages, getSimilarChannels, getStarsTransactions, getStickerSet, getStoriesById, getStoriesInteractions, getStoryLink, getStoryViewers, getUsers, hideAllJoinRequests, hideJoinRequest, hideMyStoriesViews, importContacts, incrementStoriesViews, initTakeoutSession, isPeerAvailable, isSelfPeer, iterAllStories, iterBoosters, iterChatEventLog, iterChatMembers, iterDialogs, iterForumTopics, iterHistory, iterInviteLinkMembers, iterInviteLinks, iterProfilePhotos, iterProfileStories, iterReactionUsers, iterSearchGlobal, iterSearchHashtag, iterSearchMessages, iterStarsTransactions, iterStoryViewers, joinChat, joinChatlist, kickChatMember, leaveChat, logOut, markChatUnread, moveStickerInSet, openChat, pinMessage, quoteWithMedia, quoteWithMediaGroup, quoteWithText, readReactions, readStories, recoverPassword, removeCloudPassword, reorderPinnedForumTopics, reorderUsernames, replaceStickerInSet, replyMedia, replyMediaGroup, replyText, reportStory, resendCode, resendPasswordEmail, restrictChatMember, revokeInviteLink, run, saveDraft, searchGlobal, searchHashtag, searchMessages, sendCode, sendCopy, sendCopyGroup, sendPaidReaction, sendReaction, sendRecoveryCode, sendScheduled, sendStory, sendStoryReaction, sendTyping, sendVote, setBotInfo, setBotMenuButton, setBusinessIntro, setBusinessWorkHours, setChatColor, setChatDefaultPermissions, setChatDescription, setChatPhoto, setChatStickerSet, setChatTitle, setChatTtl, setChatUsername, setFoldersOrder, setGameScore, setGlobalTtl, setInlineGameScore, setMyBirthday, setMyCommands, setMyDefaultRights, setMyEmojiStatus, setMyProfilePhoto, setMyUsername, setOffline, setSlowMode, setStickerSetThumb, signIn, signInBot, signInQr, start, startTest, toggleContentProtection, toggleForum, toggleForumTopicClosed, toggleForumTopicPinned, toggleFragmentUsername, toggleGeneralTopicHidden, toggleJoinRequests, toggleJoinToSend, togglePeerStoriesArchived, toggleStoriesPinned, translateMessage, translateText, unarchiveChats, unbanChatMember, unblockUser, unpinAllMessages, unpinMessage, updateProfile, uploadMedia, verifyPasswordEmail } from "./chunks/es/Jz_hDg6M.js";
2
- import { _normalizeInputFile, _normalizeInputMedia, getBusinessConnection, getDiscussionMessage, getMessages, getPeerDialogs, readHistory, resolveChannel, resolvePeer, resolvePeerMany, resolveUser, sendMedia, sendMediaGroup, sendText, uploadFile } from "./chunks/es/Btmu4f4t.js";
1
+ import { _normalizePrivacyRules, acceptStarGift, addChatMembers, addContact, addStickerToSet, answerCallbackQuery, answerInlineQuery, answerMedia, answerMediaGroup, answerPreCheckoutQuery, answerText, applyBoost, archiveChats, banChatMember, blockUser, canApplyBoost, canSendStory, cancelPasswordEmail, changeCloudPassword, checkPassword, closeChat, closePoll, commentMedia, commentMediaGroup, commentText, createBusinessChatLink, createChannel, createFolder, createForumTopic, createGroup, createInviteLink, createStickerSet, createSupergroup, deleteBusinessChatLink, deleteChannel, deleteChatPhoto, deleteContacts, deleteFolder, deleteForumTopicHistory, deleteGroup, deleteHistory, deleteMessages, deleteMessagesById, deleteMyCommands, deleteProfilePhotos, deleteScheduledMessages, deleteStickerFromSet, deleteStories, deleteUserHistory, downloadAsBuffer, downloadAsIterable, downloadAsStream, editAdminRights, editBusinessChatLink, editCloseFriends, editCloseFriendsRaw, editFolder, editForumTopic, editInlineMessage, editInviteLink, editMessage, editStory, enableCloudPassword, exportInviteLink, findDialogs, findFolder, forwardMessages, forwardMessagesById, getAllScheduledMessages, getAllStories, getAvailableMessageEffects, getBoostStats, getBoosts, getBotInfo, getBotMenuButton, getBusinessChatLinks, getCallbackAnswer, getCallbackQueryMessage, getChat, getChatEventLog, getChatMember, getChatMembers, getChatPreview, getChatlistPreview, getCollectibleInfo, getCommonChats, getContacts, getCustomEmojis, getCustomEmojisFromMessages, getFactCheck, getFolders, getForumTopics, getForumTopicsById, getFullChat, getGameHighScores, getGlobalTtl, getHistory, getInlineGameHighScores, getInstalledStickers, getInviteLink, getInviteLinkMembers, getInviteLinks, getMe, getMessageByLink, getMessageGroup, getMessageReactions, getMessageReactionsById, getMessagesUnsafe, getMyBoostSlots, getMyCommands, getMyStickerSets, getMyUsername, getNearbyChats, getPasswordHint, getPeerStories, getPrimaryInviteLink, getProfilePhoto, getProfilePhotos, getProfileStories, getReactionUsers, getReplyTo, getScheduledMessages, getSimilarChannels, getStarGiftOptions, getStarGifts, getStarsTransactions, getStickerSet, getStoriesById, getStoriesInteractions, getStoryLink, getStoryViewers, getUsers, hideAllJoinRequests, hideJoinRequest, hideMyStoriesViews, importContacts, incrementStoriesViews, initTakeoutSession, isPeerAvailable, isSelfPeer, iterAllStories, iterBoosters, iterChatEventLog, iterChatMembers, iterDialogs, iterForumTopics, iterHistory, iterInviteLinkMembers, iterInviteLinks, iterProfilePhotos, iterProfileStories, iterReactionUsers, iterSearchGlobal, iterSearchHashtag, iterSearchMessages, iterStarGifts, iterStarsTransactions, iterStoryViewers, joinChat, joinChatlist, kickChatMember, leaveChat, logOut, markChatUnread, moveStickerInSet, openChat, pinMessage, quoteWithMedia, quoteWithMediaGroup, quoteWithText, readReactions, readStories, recoverPassword, removeCloudPassword, reorderPinnedForumTopics, reorderUsernames, replaceStickerInSet, replyMedia, replyMediaGroup, replyText, resendCode, resendPasswordEmail, restrictChatMember, revokeInviteLink, run, saveDraft, searchGlobal, searchHashtag, searchMessages, sendCode, sendCopy, sendCopyGroup, sendPaidReaction, sendReaction, sendRecoveryCode, sendScheduled, sendStarGift, sendStory, sendStoryReaction, sendTyping, sendVote, setBotInfo, setBotMenuButton, setBusinessIntro, setBusinessWorkHours, setChatColor, setChatDefaultPermissions, setChatDescription, setChatPhoto, setChatStickerSet, setChatTitle, setChatTtl, setChatUsername, setFoldersOrder, setGameScore, setGlobalTtl, setInlineGameScore, setMyBirthday, setMyCommands, setMyDefaultRights, setMyEmojiStatus, setMyProfilePhoto, setMyUsername, setOffline, setSlowMode, setStickerSetThumb, signIn, signInBot, signInQr, start, startTest, toggleContentProtection, toggleForum, toggleForumTopicClosed, toggleForumTopicPinned, toggleFragmentUsername, toggleGeneralTopicHidden, toggleJoinRequests, toggleJoinToSend, togglePeerStoriesArchived, toggleStoriesPinned, translateMessage, translateText, unarchiveChats, unbanChatMember, unblockUser, unpinAllMessages, unpinMessage, updateProfile, uploadMedia, verifyPasswordEmail } from "./chunks/es/KKzIgirK.js";
2
+ import { _normalizeInputFile, _normalizeInputMedia, getBusinessConnection, getDiscussionMessage, getMessages, getPeerDialogs, readHistory, resolveChannel, resolvePeer, resolvePeerMany, resolveUser, sendMedia, sendMediaGroup, sendText, uploadFile } from "./chunks/es/DKzd1_Yg.js";
3
3
  export {
4
4
  _normalizeInputFile,
5
5
  _normalizeInputMedia,
6
6
  _normalizePrivacyRules,
7
+ acceptStarGift,
7
8
  addChatMembers,
8
9
  addContact,
9
10
  addStickerToSet,
@@ -129,6 +130,8 @@ export {
129
130
  getReplyTo,
130
131
  getScheduledMessages,
131
132
  getSimilarChannels,
133
+ getStarGiftOptions,
134
+ getStarGifts,
132
135
  getStarsTransactions,
133
136
  getStickerSet,
134
137
  getStoriesById,
@@ -159,6 +162,7 @@ export {
159
162
  iterSearchGlobal,
160
163
  iterSearchHashtag,
161
164
  iterSearchMessages,
165
+ iterStarGifts,
162
166
  iterStarsTransactions,
163
167
  iterStoryViewers,
164
168
  joinChat,
@@ -184,7 +188,6 @@ export {
184
188
  replyMedia,
185
189
  replyMediaGroup,
186
190
  replyText,
187
- reportStory,
188
191
  resendCode,
189
192
  resendPasswordEmail,
190
193
  resolveChannel,
@@ -207,6 +210,7 @@ export {
207
210
  sendReaction,
208
211
  sendRecoveryCode,
209
212
  sendScheduled,
213
+ sendStarGift,
210
214
  sendStory,
211
215
  sendStoryReaction,
212
216
  sendText,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.16.14",
4
+ "version": "0.17.1",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "author": "alina sireneva <alina@tei.su>",
7
7
  "license": "MIT",
@@ -70,9 +70,9 @@
70
70
  },
71
71
  "scripts": {},
72
72
  "dependencies": {
73
- "@mtcute/file-id": "^0.16.12",
74
- "@mtcute/tl": "^187.0.0",
75
- "@mtcute/tl-runtime": "^0.16.9",
73
+ "@mtcute/file-id": "^0.17.0",
74
+ "@mtcute/tl": "^189.0.0",
75
+ "@mtcute/tl-runtime": "^0.17.0",
76
76
  "@types/events": "3.0.0",
77
77
  "events": "3.2.0",
78
78
  "long": "5.2.3"
@@ -1,19 +0,0 @@
1
- import { tl } from '@mtcute/tl';
2
- import { MaybeArray } from '../../../types/utils.js';
3
- import { ITelegramClient } from '../../client.types.js';
4
- import { InputPeerLike } from '../../types/index.js';
5
- /**
6
- * Report a story (or multiple stories) to the moderation team
7
- */
8
- export declare function reportStory(client: ITelegramClient, peerId: InputPeerLike, storyIds: MaybeArray<number>, params?: {
9
- /**
10
- * Reason for reporting
11
- *
12
- * @default inputReportReasonSpam
13
- */
14
- reason?: tl.TypeReportReason;
15
- /**
16
- * Additional comment to the report
17
- */
18
- message?: string;
19
- }): Promise<void>;