@mtcute/core 0.23.2 → 0.23.3
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 +12 -0
- package/client.js +12 -0
- package/highlevel/client.d.cts +44 -5
- package/highlevel/client.d.ts +44 -5
- package/highlevel/methods/chats/get-chat-event-log.cjs +5 -3
- package/highlevel/methods/chats/get-chat-event-log.js +3 -1
- package/highlevel/methods/premium/_normalize-input-star-gift.cjs +6 -0
- package/highlevel/methods/premium/_normalize-input-star-gift.js +6 -0
- package/highlevel/methods/premium/buy-resale-gift.cjs +30 -0
- package/highlevel/methods/premium/buy-resale-gift.d.cts +13 -0
- package/highlevel/methods/premium/buy-resale-gift.d.ts +13 -0
- package/highlevel/methods/premium/buy-resale-gift.js +25 -0
- package/highlevel/methods/premium/get-resale-star-gifts.cjs +107 -0
- package/highlevel/methods/premium/get-resale-star-gifts.d.cts +45 -0
- package/highlevel/methods/premium/get-resale-star-gifts.d.ts +45 -0
- package/highlevel/methods/premium/get-resale-star-gifts.js +102 -0
- package/highlevel/methods/premium/get-unique-star-gift.cjs +1 -1
- package/highlevel/methods/premium/get-unique-star-gift.js +1 -1
- package/highlevel/methods/premium/set-gift-resale-price.cjs +19 -0
- package/highlevel/methods/premium/set-gift-resale-price.d.cts +9 -0
- package/highlevel/methods/premium/set-gift-resale-price.d.ts +9 -0
- package/highlevel/methods/premium/set-gift-resale-price.js +14 -0
- package/highlevel/methods/premium/transfer-star-gift.cjs +26 -11
- package/highlevel/methods/premium/transfer-star-gift.js +26 -11
- package/highlevel/methods/premium/upgrade-star-gift.cjs +26 -11
- package/highlevel/methods/premium/upgrade-star-gift.js +26 -11
- package/highlevel/methods.d.cts +4 -0
- package/highlevel/methods.d.ts +4 -0
- package/highlevel/types/messages/message-action.cjs +8 -2
- package/highlevel/types/messages/message-action.d.cts +6 -0
- package/highlevel/types/messages/message-action.d.ts +6 -0
- package/highlevel/types/messages/message-action.js +8 -2
- package/highlevel/types/peers/chat-event/actions.cjs +49 -1
- package/highlevel/types/peers/chat-event/actions.d.cts +60 -2
- package/highlevel/types/peers/chat-event/actions.d.ts +60 -2
- package/highlevel/types/peers/chat-event/actions.js +49 -1
- package/highlevel/types/peers/chat-event/filters.cjs +9 -0
- package/highlevel/types/peers/chat-event/filters.js +9 -0
- package/highlevel/types/peers/chat-event/index.cjs +3 -2
- package/highlevel/types/peers/chat-event/index.d.cts +2 -1
- package/highlevel/types/peers/chat-event/index.d.ts +2 -1
- package/highlevel/types/peers/chat-event/index.js +3 -2
- package/highlevel/types/peers/chat.cjs +5 -4
- package/highlevel/types/peers/chat.d.cts +2 -0
- package/highlevel/types/peers/chat.d.ts +2 -0
- package/highlevel/types/peers/chat.js +5 -4
- package/highlevel/types/peers/user.cjs +1 -4
- package/highlevel/types/peers/user.js +1 -4
- package/highlevel/types/premium/saved-star-gift.cjs +8 -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 +8 -0
- package/highlevel/types/premium/stars-gift-unique.cjs +11 -1
- package/highlevel/types/premium/stars-gift-unique.d.cts +4 -0
- package/highlevel/types/premium/stars-gift-unique.d.ts +4 -0
- package/highlevel/types/premium/stars-gift-unique.js +11 -1
- package/highlevel/types/premium/stars-gift.cjs +11 -1
- package/highlevel/types/premium/stars-gift.d.cts +8 -1
- package/highlevel/types/premium/stars-gift.d.ts +8 -1
- package/highlevel/types/premium/stars-gift.js +11 -1
- package/highlevel/types/premium/stars-transaction.cjs +6 -0
- package/highlevel/types/premium/stars-transaction.d.cts +7 -0
- package/highlevel/types/premium/stars-transaction.d.ts +7 -0
- package/highlevel/types/premium/stars-transaction.js +6 -0
- package/highlevel/types/reactions/emoji-status.cjs +6 -0
- package/highlevel/types/reactions/emoji-status.d.cts +1 -0
- package/highlevel/types/reactions/emoji-status.d.ts +1 -0
- package/highlevel/types/reactions/emoji-status.js +6 -0
- package/highlevel/types/utils.d.cts +4 -0
- package/highlevel/types/utils.d.ts +4 -0
- package/highlevel/utils/misc-utils.cjs +8 -0
- package/highlevel/utils/misc-utils.d.cts +2 -1
- package/highlevel/utils/misc-utils.d.ts +2 -1
- package/highlevel/utils/misc-utils.js +8 -0
- package/methods.cjs +6 -0
- package/methods.js +6 -0
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/package.json +2 -2
- package/utils/binary/compat.cjs +9 -0
- package/utils/binary/compat.js +9 -0
- package/utils.cjs +1 -0
- package/utils.js +2 -1
|
@@ -9,13 +9,15 @@ const peerUtils = require("../../../../utils/peer-utils.cjs");
|
|
|
9
9
|
const typeAssertions = require("../../../../utils/type-assertions.cjs");
|
|
10
10
|
const photo = require("../../media/photo.cjs");
|
|
11
11
|
const message = require("../../messages/message.cjs");
|
|
12
|
+
const emojiStatus = require("../../reactions/emoji-status.cjs");
|
|
13
|
+
const chatColors = require("../chat-colors.cjs");
|
|
12
14
|
const chatInviteLink = require("../chat-invite-link.cjs");
|
|
13
15
|
const chatLocation = require("../chat-location.cjs");
|
|
14
16
|
const chatMember = require("../chat-member.cjs");
|
|
15
17
|
const chatPermissions = require("../chat-permissions.cjs");
|
|
16
18
|
const forumTopic = require("../forum-topic.cjs");
|
|
17
19
|
const user = require("../user.cjs");
|
|
18
|
-
function _actionFromTl(e, peers) {
|
|
20
|
+
function _actionFromTl(e, peers, peerId) {
|
|
19
21
|
switch (e._) {
|
|
20
22
|
case "channelAdminLogEventActionParticipantJoin":
|
|
21
23
|
return { type: "user_joined" };
|
|
@@ -235,6 +237,52 @@ function _actionFromTl(e, peers) {
|
|
|
235
237
|
prev: new chatMember.ChatMember(e.prevParticipant, peers),
|
|
236
238
|
new: new chatMember.ChatMember(e.newParticipant, peers)
|
|
237
239
|
};
|
|
240
|
+
case "channelAdminLogEventActionChangeAvailableReactions":
|
|
241
|
+
return {
|
|
242
|
+
type: "available_reactions_changed",
|
|
243
|
+
prev: e.prevValue,
|
|
244
|
+
new: e.newValue
|
|
245
|
+
};
|
|
246
|
+
case "channelAdminLogEventActionChangeEmojiStatus":
|
|
247
|
+
return {
|
|
248
|
+
type: "emoji_status_changed",
|
|
249
|
+
prev: emojiStatus.EmojiStatus.fromTl(e.prevValue),
|
|
250
|
+
new: emojiStatus.EmojiStatus.fromTl(e.newValue)
|
|
251
|
+
};
|
|
252
|
+
case "channelAdminLogEventActionChangeEmojiStickerSet":
|
|
253
|
+
return {
|
|
254
|
+
type: "emoji_stickerset_changed",
|
|
255
|
+
old: e.prevStickerset,
|
|
256
|
+
new: e.newStickerset
|
|
257
|
+
};
|
|
258
|
+
case "channelAdminLogEventActionChangePeerColor":
|
|
259
|
+
case "channelAdminLogEventActionChangeProfilePeerColor":
|
|
260
|
+
return {
|
|
261
|
+
type: e._ === "channelAdminLogEventActionChangePeerColor" ? "peer_color_changed" : "profile_peer_color_changed",
|
|
262
|
+
prev: new chatColors.ChatColors(peerId, e.prevValue),
|
|
263
|
+
new: new chatColors.ChatColors(peerId, e.newValue)
|
|
264
|
+
};
|
|
265
|
+
case "channelAdminLogEventActionChangeWallpaper":
|
|
266
|
+
return {
|
|
267
|
+
type: "wallpaper_changed",
|
|
268
|
+
old: e.prevValue,
|
|
269
|
+
new: e.newValue
|
|
270
|
+
};
|
|
271
|
+
case "channelAdminLogEventActionSendMessage":
|
|
272
|
+
return {
|
|
273
|
+
type: "msg_sent",
|
|
274
|
+
message: new message.Message(e.message, peers)
|
|
275
|
+
};
|
|
276
|
+
case "channelAdminLogEventActionToggleAntiSpam":
|
|
277
|
+
return {
|
|
278
|
+
type: "toggle_anti_spam",
|
|
279
|
+
enabled: e.newValue
|
|
280
|
+
};
|
|
281
|
+
case "channelAdminLogEventActionToggleAutotranslation":
|
|
282
|
+
return {
|
|
283
|
+
type: "toggle_autotranslation",
|
|
284
|
+
enabled: e.newValue
|
|
285
|
+
};
|
|
238
286
|
default:
|
|
239
287
|
return null;
|
|
240
288
|
}
|
|
@@ -2,6 +2,8 @@ import { tl } from '@mtcute/tl';
|
|
|
2
2
|
import { PeersIndex } from '../peers-index.js';
|
|
3
3
|
import { Photo } from '../../media/photo.js';
|
|
4
4
|
import { Message } from '../../messages/message.js';
|
|
5
|
+
import { EmojiStatus } from '../../reactions/emoji-status.js';
|
|
6
|
+
import { ChatColors } from '../chat-colors.js';
|
|
5
7
|
import { ChatInviteLink } from '../chat-invite-link.js';
|
|
6
8
|
import { ChatLocation } from '../chat-location.js';
|
|
7
9
|
import { ChatMember } from '../chat-member.js';
|
|
@@ -273,7 +275,63 @@ export interface ChatActionSubscriptionExtended {
|
|
|
273
275
|
/** New participant information */
|
|
274
276
|
new: ChatMember;
|
|
275
277
|
}
|
|
278
|
+
export interface ChatActionAvailableReactionsChanged {
|
|
279
|
+
type: 'available_reactions_changed';
|
|
280
|
+
/** Previous available reactions */
|
|
281
|
+
prev: tl.TypeChatReactions;
|
|
282
|
+
/** New available reactions */
|
|
283
|
+
new: tl.TypeChatReactions;
|
|
284
|
+
}
|
|
285
|
+
export interface ChatActionEmojiStatusChanged {
|
|
286
|
+
type: 'emoji_status_changed';
|
|
287
|
+
/** Previous emoji status */
|
|
288
|
+
prev: EmojiStatus | null;
|
|
289
|
+
/** New emoji status */
|
|
290
|
+
new: EmojiStatus | null;
|
|
291
|
+
}
|
|
292
|
+
/** Group emoji stickerset has been changed */
|
|
293
|
+
export interface ChatActionEmojiStickersetChanged {
|
|
294
|
+
type: 'emoji_stickerset_changed';
|
|
295
|
+
/** Old emoji stickerset */
|
|
296
|
+
old: tl.TypeInputStickerSet;
|
|
297
|
+
/** New emoji stickerset */
|
|
298
|
+
new: tl.TypeInputStickerSet;
|
|
299
|
+
}
|
|
300
|
+
/** Group peer color has been changed */
|
|
301
|
+
export interface ChatActionPeerColorChanged {
|
|
302
|
+
type: 'peer_color_changed' | 'profile_peer_color_changed';
|
|
303
|
+
/** Previous colors */
|
|
304
|
+
prev: ChatColors;
|
|
305
|
+
/** New colors */
|
|
306
|
+
new: ChatColors;
|
|
307
|
+
}
|
|
308
|
+
/** Group wallpaper has been changed */
|
|
309
|
+
export interface ChatActionWallpaperChanged {
|
|
310
|
+
type: 'wallpaper_changed';
|
|
311
|
+
/** Old wallpaper */
|
|
312
|
+
old: tl.TypeWallPaper;
|
|
313
|
+
/** New wallpaper */
|
|
314
|
+
new: tl.TypeWallPaper;
|
|
315
|
+
}
|
|
316
|
+
/** A message has been sent */
|
|
317
|
+
export interface ChatActionMessageSent {
|
|
318
|
+
type: 'msg_sent';
|
|
319
|
+
/** Message that was sent */
|
|
320
|
+
message: Message;
|
|
321
|
+
}
|
|
322
|
+
/** Aggressive anti-spam has been toggled */
|
|
323
|
+
export interface ChatActionToggleAntiSpam {
|
|
324
|
+
type: 'toggle_anti_spam';
|
|
325
|
+
/** Whether the chat now has aggressive anti-spam enabled */
|
|
326
|
+
enabled: boolean;
|
|
327
|
+
}
|
|
328
|
+
/** Auto-translation has been toggled */
|
|
329
|
+
export interface ChatActionToggleAutotranslation {
|
|
330
|
+
type: 'toggle_autotranslation';
|
|
331
|
+
/** Whether the chat is now in autotranslation mode */
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
}
|
|
276
334
|
/** Chat event action (`null` if unsupported) */
|
|
277
|
-
export type ChatAction = ChatActionUserJoined | ChatActionUserLeft | ChatActionUserInvited | ChatActionTitleChanged | ChatActionDescriptionChanged | ChatActionUsernameChanged | ChatActionUsernamesChanged | ChatActionPhotoChanged | ChatActionInvitesToggled | ChatActionSignaturesToggled | ChatActionMessagePinned | ChatActionMessageEdited | ChatActionMessageDeleted | ChatActionUserPermissionsChanged | ChatActionUserAdminPermissionsChanged | ChatActionStickersetChanged | ChatActionHistoryToggled | ChatActionDefaultPermissionsChanged | ChatActionPollStopped | ChatActionLinkedChatChanged | ChatActionLocationChanged | ChatActionSlowModeChanged | ChatActionCallStarted | ChatActionCallEnded | ChatActionCallSettingChanged | ChatActionUserJoinedInvite | ChatActionInviteLinkDeleted | ChatActionInviteLinkEdited | ChatActionInviteLinkRevoked | ChatActionUserJoinedApproved | ChatActionTtlChanged | ChatActionNoForwardsToggled | ChatActionForumToggled | ChatActionTopicCreated | ChatActionTopicEdited | ChatActionTopicDeleted | ChatActionSignatureProfilesToggled | ChatActionSubscriptionExtended | null;
|
|
335
|
+
export type ChatAction = ChatActionUserJoined | ChatActionUserLeft | ChatActionUserInvited | ChatActionTitleChanged | ChatActionDescriptionChanged | ChatActionUsernameChanged | ChatActionUsernamesChanged | ChatActionPhotoChanged | ChatActionInvitesToggled | ChatActionSignaturesToggled | ChatActionMessagePinned | ChatActionMessageEdited | ChatActionMessageDeleted | ChatActionUserPermissionsChanged | ChatActionUserAdminPermissionsChanged | ChatActionStickersetChanged | ChatActionHistoryToggled | ChatActionDefaultPermissionsChanged | ChatActionPollStopped | ChatActionLinkedChatChanged | ChatActionLocationChanged | ChatActionSlowModeChanged | ChatActionCallStarted | ChatActionCallEnded | ChatActionCallSettingChanged | ChatActionUserJoinedInvite | ChatActionInviteLinkDeleted | ChatActionInviteLinkEdited | ChatActionInviteLinkRevoked | ChatActionUserJoinedApproved | ChatActionTtlChanged | ChatActionNoForwardsToggled | ChatActionForumToggled | ChatActionTopicCreated | ChatActionTopicEdited | ChatActionTopicDeleted | ChatActionSignatureProfilesToggled | ChatActionSubscriptionExtended | ChatActionAvailableReactionsChanged | ChatActionEmojiStatusChanged | ChatActionEmojiStickersetChanged | ChatActionPeerColorChanged | ChatActionWallpaperChanged | ChatActionMessageSent | ChatActionToggleAntiSpam | ChatActionToggleAutotranslation | null;
|
|
278
336
|
/** @internal */
|
|
279
|
-
export declare function _actionFromTl(e: tl.TypeChannelAdminLogEventAction, peers: PeersIndex): ChatAction;
|
|
337
|
+
export declare function _actionFromTl(e: tl.TypeChannelAdminLogEventAction, peers: PeersIndex, peerId: number): ChatAction;
|
|
@@ -2,6 +2,8 @@ import { tl } from '@mtcute/tl';
|
|
|
2
2
|
import { PeersIndex } from '../peers-index.js';
|
|
3
3
|
import { Photo } from '../../media/photo.js';
|
|
4
4
|
import { Message } from '../../messages/message.js';
|
|
5
|
+
import { EmojiStatus } from '../../reactions/emoji-status.js';
|
|
6
|
+
import { ChatColors } from '../chat-colors.js';
|
|
5
7
|
import { ChatInviteLink } from '../chat-invite-link.js';
|
|
6
8
|
import { ChatLocation } from '../chat-location.js';
|
|
7
9
|
import { ChatMember } from '../chat-member.js';
|
|
@@ -273,7 +275,63 @@ export interface ChatActionSubscriptionExtended {
|
|
|
273
275
|
/** New participant information */
|
|
274
276
|
new: ChatMember;
|
|
275
277
|
}
|
|
278
|
+
export interface ChatActionAvailableReactionsChanged {
|
|
279
|
+
type: 'available_reactions_changed';
|
|
280
|
+
/** Previous available reactions */
|
|
281
|
+
prev: tl.TypeChatReactions;
|
|
282
|
+
/** New available reactions */
|
|
283
|
+
new: tl.TypeChatReactions;
|
|
284
|
+
}
|
|
285
|
+
export interface ChatActionEmojiStatusChanged {
|
|
286
|
+
type: 'emoji_status_changed';
|
|
287
|
+
/** Previous emoji status */
|
|
288
|
+
prev: EmojiStatus | null;
|
|
289
|
+
/** New emoji status */
|
|
290
|
+
new: EmojiStatus | null;
|
|
291
|
+
}
|
|
292
|
+
/** Group emoji stickerset has been changed */
|
|
293
|
+
export interface ChatActionEmojiStickersetChanged {
|
|
294
|
+
type: 'emoji_stickerset_changed';
|
|
295
|
+
/** Old emoji stickerset */
|
|
296
|
+
old: tl.TypeInputStickerSet;
|
|
297
|
+
/** New emoji stickerset */
|
|
298
|
+
new: tl.TypeInputStickerSet;
|
|
299
|
+
}
|
|
300
|
+
/** Group peer color has been changed */
|
|
301
|
+
export interface ChatActionPeerColorChanged {
|
|
302
|
+
type: 'peer_color_changed' | 'profile_peer_color_changed';
|
|
303
|
+
/** Previous colors */
|
|
304
|
+
prev: ChatColors;
|
|
305
|
+
/** New colors */
|
|
306
|
+
new: ChatColors;
|
|
307
|
+
}
|
|
308
|
+
/** Group wallpaper has been changed */
|
|
309
|
+
export interface ChatActionWallpaperChanged {
|
|
310
|
+
type: 'wallpaper_changed';
|
|
311
|
+
/** Old wallpaper */
|
|
312
|
+
old: tl.TypeWallPaper;
|
|
313
|
+
/** New wallpaper */
|
|
314
|
+
new: tl.TypeWallPaper;
|
|
315
|
+
}
|
|
316
|
+
/** A message has been sent */
|
|
317
|
+
export interface ChatActionMessageSent {
|
|
318
|
+
type: 'msg_sent';
|
|
319
|
+
/** Message that was sent */
|
|
320
|
+
message: Message;
|
|
321
|
+
}
|
|
322
|
+
/** Aggressive anti-spam has been toggled */
|
|
323
|
+
export interface ChatActionToggleAntiSpam {
|
|
324
|
+
type: 'toggle_anti_spam';
|
|
325
|
+
/** Whether the chat now has aggressive anti-spam enabled */
|
|
326
|
+
enabled: boolean;
|
|
327
|
+
}
|
|
328
|
+
/** Auto-translation has been toggled */
|
|
329
|
+
export interface ChatActionToggleAutotranslation {
|
|
330
|
+
type: 'toggle_autotranslation';
|
|
331
|
+
/** Whether the chat is now in autotranslation mode */
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
}
|
|
276
334
|
/** Chat event action (`null` if unsupported) */
|
|
277
|
-
export type ChatAction = ChatActionUserJoined | ChatActionUserLeft | ChatActionUserInvited | ChatActionTitleChanged | ChatActionDescriptionChanged | ChatActionUsernameChanged | ChatActionUsernamesChanged | ChatActionPhotoChanged | ChatActionInvitesToggled | ChatActionSignaturesToggled | ChatActionMessagePinned | ChatActionMessageEdited | ChatActionMessageDeleted | ChatActionUserPermissionsChanged | ChatActionUserAdminPermissionsChanged | ChatActionStickersetChanged | ChatActionHistoryToggled | ChatActionDefaultPermissionsChanged | ChatActionPollStopped | ChatActionLinkedChatChanged | ChatActionLocationChanged | ChatActionSlowModeChanged | ChatActionCallStarted | ChatActionCallEnded | ChatActionCallSettingChanged | ChatActionUserJoinedInvite | ChatActionInviteLinkDeleted | ChatActionInviteLinkEdited | ChatActionInviteLinkRevoked | ChatActionUserJoinedApproved | ChatActionTtlChanged | ChatActionNoForwardsToggled | ChatActionForumToggled | ChatActionTopicCreated | ChatActionTopicEdited | ChatActionTopicDeleted | ChatActionSignatureProfilesToggled | ChatActionSubscriptionExtended | null;
|
|
335
|
+
export type ChatAction = ChatActionUserJoined | ChatActionUserLeft | ChatActionUserInvited | ChatActionTitleChanged | ChatActionDescriptionChanged | ChatActionUsernameChanged | ChatActionUsernamesChanged | ChatActionPhotoChanged | ChatActionInvitesToggled | ChatActionSignaturesToggled | ChatActionMessagePinned | ChatActionMessageEdited | ChatActionMessageDeleted | ChatActionUserPermissionsChanged | ChatActionUserAdminPermissionsChanged | ChatActionStickersetChanged | ChatActionHistoryToggled | ChatActionDefaultPermissionsChanged | ChatActionPollStopped | ChatActionLinkedChatChanged | ChatActionLocationChanged | ChatActionSlowModeChanged | ChatActionCallStarted | ChatActionCallEnded | ChatActionCallSettingChanged | ChatActionUserJoinedInvite | ChatActionInviteLinkDeleted | ChatActionInviteLinkEdited | ChatActionInviteLinkRevoked | ChatActionUserJoinedApproved | ChatActionTtlChanged | ChatActionNoForwardsToggled | ChatActionForumToggled | ChatActionTopicCreated | ChatActionTopicEdited | ChatActionTopicDeleted | ChatActionSignatureProfilesToggled | ChatActionSubscriptionExtended | ChatActionAvailableReactionsChanged | ChatActionEmojiStatusChanged | ChatActionEmojiStickersetChanged | ChatActionPeerColorChanged | ChatActionWallpaperChanged | ChatActionMessageSent | ChatActionToggleAntiSpam | ChatActionToggleAutotranslation | null;
|
|
278
336
|
/** @internal */
|
|
279
|
-
export declare function _actionFromTl(e: tl.TypeChannelAdminLogEventAction, peers: PeersIndex): ChatAction;
|
|
337
|
+
export declare function _actionFromTl(e: tl.TypeChannelAdminLogEventAction, peers: PeersIndex, peerId: number): ChatAction;
|
|
@@ -2,13 +2,15 @@ import { toggleChannelIdMark } from "../../../../utils/peer-utils.js";
|
|
|
2
2
|
import { assertTypeIs } from "../../../../utils/type-assertions.js";
|
|
3
3
|
import { Photo as Photo$2 } from "../../media/photo.js";
|
|
4
4
|
import { Message as Message$2 } from "../../messages/message.js";
|
|
5
|
+
import { EmojiStatus as EmojiStatus$1 } from "../../reactions/emoji-status.js";
|
|
6
|
+
import { ChatColors as ChatColors$1 } from "../chat-colors.js";
|
|
5
7
|
import { ChatInviteLink as ChatInviteLink$2 } from "../chat-invite-link.js";
|
|
6
8
|
import { ChatLocation as ChatLocation$2 } from "../chat-location.js";
|
|
7
9
|
import { ChatMember as ChatMember$2 } from "../chat-member.js";
|
|
8
10
|
import { ChatPermissions as ChatPermissions$1 } from "../chat-permissions.js";
|
|
9
11
|
import { ForumTopic as ForumTopic$2 } from "../forum-topic.js";
|
|
10
12
|
import { User as User$2 } from "../user.js";
|
|
11
|
-
function _actionFromTl(e, peers) {
|
|
13
|
+
function _actionFromTl(e, peers, peerId) {
|
|
12
14
|
switch (e._) {
|
|
13
15
|
case "channelAdminLogEventActionParticipantJoin":
|
|
14
16
|
return { type: "user_joined" };
|
|
@@ -228,6 +230,52 @@ function _actionFromTl(e, peers) {
|
|
|
228
230
|
prev: new ChatMember$2(e.prevParticipant, peers),
|
|
229
231
|
new: new ChatMember$2(e.newParticipant, peers)
|
|
230
232
|
};
|
|
233
|
+
case "channelAdminLogEventActionChangeAvailableReactions":
|
|
234
|
+
return {
|
|
235
|
+
type: "available_reactions_changed",
|
|
236
|
+
prev: e.prevValue,
|
|
237
|
+
new: e.newValue
|
|
238
|
+
};
|
|
239
|
+
case "channelAdminLogEventActionChangeEmojiStatus":
|
|
240
|
+
return {
|
|
241
|
+
type: "emoji_status_changed",
|
|
242
|
+
prev: EmojiStatus$1.fromTl(e.prevValue),
|
|
243
|
+
new: EmojiStatus$1.fromTl(e.newValue)
|
|
244
|
+
};
|
|
245
|
+
case "channelAdminLogEventActionChangeEmojiStickerSet":
|
|
246
|
+
return {
|
|
247
|
+
type: "emoji_stickerset_changed",
|
|
248
|
+
old: e.prevStickerset,
|
|
249
|
+
new: e.newStickerset
|
|
250
|
+
};
|
|
251
|
+
case "channelAdminLogEventActionChangePeerColor":
|
|
252
|
+
case "channelAdminLogEventActionChangeProfilePeerColor":
|
|
253
|
+
return {
|
|
254
|
+
type: e._ === "channelAdminLogEventActionChangePeerColor" ? "peer_color_changed" : "profile_peer_color_changed",
|
|
255
|
+
prev: new ChatColors$1(peerId, e.prevValue),
|
|
256
|
+
new: new ChatColors$1(peerId, e.newValue)
|
|
257
|
+
};
|
|
258
|
+
case "channelAdminLogEventActionChangeWallpaper":
|
|
259
|
+
return {
|
|
260
|
+
type: "wallpaper_changed",
|
|
261
|
+
old: e.prevValue,
|
|
262
|
+
new: e.newValue
|
|
263
|
+
};
|
|
264
|
+
case "channelAdminLogEventActionSendMessage":
|
|
265
|
+
return {
|
|
266
|
+
type: "msg_sent",
|
|
267
|
+
message: new Message$2(e.message, peers)
|
|
268
|
+
};
|
|
269
|
+
case "channelAdminLogEventActionToggleAntiSpam":
|
|
270
|
+
return {
|
|
271
|
+
type: "toggle_anti_spam",
|
|
272
|
+
enabled: e.newValue
|
|
273
|
+
};
|
|
274
|
+
case "channelAdminLogEventActionToggleAutotranslation":
|
|
275
|
+
return {
|
|
276
|
+
type: "toggle_autotranslation",
|
|
277
|
+
enabled: e.newValue
|
|
278
|
+
};
|
|
231
279
|
default:
|
|
232
280
|
return null;
|
|
233
281
|
}
|
|
@@ -91,6 +91,15 @@ function normalizeChatEventFilters(input) {
|
|
|
91
91
|
serverFilter.forums = true;
|
|
92
92
|
break;
|
|
93
93
|
case "sub_extend":
|
|
94
|
+
case "available_reactions_changed":
|
|
95
|
+
case "emoji_status_changed":
|
|
96
|
+
case "emoji_stickerset_changed":
|
|
97
|
+
case "msg_sent":
|
|
98
|
+
case "peer_color_changed":
|
|
99
|
+
case "profile_peer_color_changed":
|
|
100
|
+
case "wallpaper_changed":
|
|
101
|
+
case "toggle_anti_spam":
|
|
102
|
+
case "toggle_autotranslation":
|
|
94
103
|
serverFilter.invite = true;
|
|
95
104
|
serverFilter.invites = true;
|
|
96
105
|
serverFilter.join = true;
|
|
@@ -84,6 +84,15 @@ function normalizeChatEventFilters(input) {
|
|
|
84
84
|
serverFilter.forums = true;
|
|
85
85
|
break;
|
|
86
86
|
case "sub_extend":
|
|
87
|
+
case "available_reactions_changed":
|
|
88
|
+
case "emoji_status_changed":
|
|
89
|
+
case "emoji_stickerset_changed":
|
|
90
|
+
case "msg_sent":
|
|
91
|
+
case "peer_color_changed":
|
|
92
|
+
case "profile_peer_color_changed":
|
|
93
|
+
case "wallpaper_changed":
|
|
94
|
+
case "toggle_anti_spam":
|
|
95
|
+
case "toggle_autotranslation":
|
|
87
96
|
serverFilter.invite = true;
|
|
88
97
|
serverFilter.invites = true;
|
|
89
98
|
serverFilter.join = true;
|
|
@@ -10,9 +10,10 @@ const user = require("../user.cjs");
|
|
|
10
10
|
const actions = require("./actions.cjs");
|
|
11
11
|
const inspectable = require("../../../utils/inspectable.cjs");
|
|
12
12
|
class ChatEvent {
|
|
13
|
-
constructor(raw, _peers) {
|
|
13
|
+
constructor(raw, _peers, _chatId) {
|
|
14
14
|
this.raw = raw;
|
|
15
15
|
this._peers = _peers;
|
|
16
|
+
this._chatId = _chatId;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* Event ID.
|
|
@@ -36,7 +37,7 @@ class ChatEvent {
|
|
|
36
37
|
return new user.User(this._peers.user(this.raw.userId));
|
|
37
38
|
}
|
|
38
39
|
get action() {
|
|
39
|
-
return actions._actionFromTl(this.raw.action, this._peers);
|
|
40
|
+
return actions._actionFromTl(this.raw.action, this._peers, this._chatId);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
const ChatEvent$1 = /* @__PURE__ */ memoize.memoizeGetters(ChatEvent, ["actor", "action"]);
|
|
@@ -7,7 +7,8 @@ export type { ChatEventFilters, InputChatEventFilters } from './filters.js';
|
|
|
7
7
|
export declare class ChatEvent {
|
|
8
8
|
readonly raw: tl.TypeChannelAdminLogEvent;
|
|
9
9
|
readonly _peers: PeersIndex;
|
|
10
|
-
|
|
10
|
+
readonly _chatId: number;
|
|
11
|
+
constructor(raw: tl.TypeChannelAdminLogEvent, _peers: PeersIndex, _chatId: number);
|
|
11
12
|
/**
|
|
12
13
|
* Event ID.
|
|
13
14
|
*
|
|
@@ -7,7 +7,8 @@ export type { ChatEventFilters, InputChatEventFilters } from './filters.js';
|
|
|
7
7
|
export declare class ChatEvent {
|
|
8
8
|
readonly raw: tl.TypeChannelAdminLogEvent;
|
|
9
9
|
readonly _peers: PeersIndex;
|
|
10
|
-
|
|
10
|
+
readonly _chatId: number;
|
|
11
|
+
constructor(raw: tl.TypeChannelAdminLogEvent, _peers: PeersIndex, _chatId: number);
|
|
11
12
|
/**
|
|
12
13
|
* Event ID.
|
|
13
14
|
*
|
|
@@ -3,9 +3,10 @@ import { User as User$2 } from "../user.js";
|
|
|
3
3
|
import { _actionFromTl } from "./actions.js";
|
|
4
4
|
import { makeInspectable } from "../../../utils/inspectable.js";
|
|
5
5
|
class ChatEvent {
|
|
6
|
-
constructor(raw, _peers) {
|
|
6
|
+
constructor(raw, _peers, _chatId) {
|
|
7
7
|
this.raw = raw;
|
|
8
8
|
this._peers = _peers;
|
|
9
|
+
this._chatId = _chatId;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Event ID.
|
|
@@ -29,7 +30,7 @@ class ChatEvent {
|
|
|
29
30
|
return new User$2(this._peers.user(this.raw.userId));
|
|
30
31
|
}
|
|
31
32
|
get action() {
|
|
32
|
-
return _actionFromTl(this.raw.action, this._peers);
|
|
33
|
+
return _actionFromTl(this.raw.action, this._peers, this._chatId);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
const ChatEvent$1 = /* @__PURE__ */ memoizeGetters(ChatEvent, ["actor", "action"]);
|
|
@@ -238,6 +238,10 @@ class Chat {
|
|
|
238
238
|
get hasSignatures() {
|
|
239
239
|
return this.raw._ === "channel" && this.raw.signatures;
|
|
240
240
|
}
|
|
241
|
+
/** Whether this chat/channel has auto-translation enabled */
|
|
242
|
+
get hasAutoTranslation() {
|
|
243
|
+
return this.raw._ === "channel" && this.raw.autotranslation;
|
|
244
|
+
}
|
|
241
245
|
/** Chat title */
|
|
242
246
|
get title() {
|
|
243
247
|
return this.raw.title;
|
|
@@ -329,10 +333,7 @@ class Chat {
|
|
|
329
333
|
*/
|
|
330
334
|
get emojiStatus() {
|
|
331
335
|
if (this.raw._ !== "channel") return null;
|
|
332
|
-
|
|
333
|
-
return null;
|
|
334
|
-
}
|
|
335
|
-
return new emojiStatus.EmojiStatus(this.raw.emojiStatus);
|
|
336
|
+
return emojiStatus.EmojiStatus.fromTl(this.raw.emojiStatus);
|
|
336
337
|
}
|
|
337
338
|
/**
|
|
338
339
|
* If non-null, this user was verified by a bot, and this field contains
|
|
@@ -129,6 +129,8 @@ export declare class Chat {
|
|
|
129
129
|
get hasProfileSignatures(): boolean;
|
|
130
130
|
/** Whether this channel has author signatures enabled under posts */
|
|
131
131
|
get hasSignatures(): boolean;
|
|
132
|
+
/** Whether this chat/channel has auto-translation enabled */
|
|
133
|
+
get hasAutoTranslation(): boolean;
|
|
132
134
|
/** Chat title */
|
|
133
135
|
get title(): string;
|
|
134
136
|
/** Chat username (if available) */
|
|
@@ -129,6 +129,8 @@ export declare class Chat {
|
|
|
129
129
|
get hasProfileSignatures(): boolean;
|
|
130
130
|
/** Whether this channel has author signatures enabled under posts */
|
|
131
131
|
get hasSignatures(): boolean;
|
|
132
|
+
/** Whether this chat/channel has auto-translation enabled */
|
|
133
|
+
get hasAutoTranslation(): boolean;
|
|
132
134
|
/** Chat title */
|
|
133
135
|
get title(): string;
|
|
134
136
|
/** Chat username (if available) */
|
|
@@ -231,6 +231,10 @@ class Chat {
|
|
|
231
231
|
get hasSignatures() {
|
|
232
232
|
return this.raw._ === "channel" && this.raw.signatures;
|
|
233
233
|
}
|
|
234
|
+
/** Whether this chat/channel has auto-translation enabled */
|
|
235
|
+
get hasAutoTranslation() {
|
|
236
|
+
return this.raw._ === "channel" && this.raw.autotranslation;
|
|
237
|
+
}
|
|
234
238
|
/** Chat title */
|
|
235
239
|
get title() {
|
|
236
240
|
return this.raw.title;
|
|
@@ -322,10 +326,7 @@ class Chat {
|
|
|
322
326
|
*/
|
|
323
327
|
get emojiStatus() {
|
|
324
328
|
if (this.raw._ !== "channel") return null;
|
|
325
|
-
|
|
326
|
-
return null;
|
|
327
|
-
}
|
|
328
|
-
return new EmojiStatus$1(this.raw.emojiStatus);
|
|
329
|
+
return EmojiStatus$1.fromTl(this.raw.emojiStatus);
|
|
329
330
|
}
|
|
330
331
|
/**
|
|
331
332
|
* If non-null, this user was verified by a bot, and this field contains
|
|
@@ -335,10 +335,7 @@ class User {
|
|
|
335
335
|
* User's emoji status, if any.
|
|
336
336
|
*/
|
|
337
337
|
get emojiStatus() {
|
|
338
|
-
|
|
339
|
-
return null;
|
|
340
|
-
}
|
|
341
|
-
return new emojiStatus.EmojiStatus(this.raw.emojiStatus);
|
|
338
|
+
return emojiStatus.EmojiStatus.fromTl(this.raw.emojiStatus);
|
|
342
339
|
}
|
|
343
340
|
/** Whether you have hidden (arhived) this user's stories */
|
|
344
341
|
get storiesHidden() {
|
|
@@ -328,10 +328,7 @@ class User {
|
|
|
328
328
|
* User's emoji status, if any.
|
|
329
329
|
*/
|
|
330
330
|
get emojiStatus() {
|
|
331
|
-
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
|
-
return new EmojiStatus$1(this.raw.emojiStatus);
|
|
331
|
+
return EmojiStatus$1.fromTl(this.raw.emojiStatus);
|
|
335
332
|
}
|
|
336
333
|
/** Whether you have hidden (arhived) this user's stories */
|
|
337
334
|
get storiesHidden() {
|
|
@@ -78,6 +78,14 @@ class SavedStarGift {
|
|
|
78
78
|
get canExportAt() {
|
|
79
79
|
return this.raw.canExportAt ? new Date(this.raw.canExportAt * 1e3) : null;
|
|
80
80
|
}
|
|
81
|
+
/** Date when the gift can be transferred */
|
|
82
|
+
get canTransferAt() {
|
|
83
|
+
return this.raw.canTransferAt ? new Date(this.raw.canTransferAt * 1e3) : null;
|
|
84
|
+
}
|
|
85
|
+
/** Date when the gift can be resold */
|
|
86
|
+
get canResellAt() {
|
|
87
|
+
return this.raw.canResellAt ? new Date(this.raw.canResellAt * 1e3) : null;
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
const SavedStarGift$1 = /* @__PURE__ */ inspectable.makeInspectable(SavedStarGift);
|
|
83
91
|
const SavedStarGift$2 = /* @__PURE__ */ memoize.memoizeGetters(SavedStarGift$1, ["sender", "gift"]);
|
|
@@ -38,4 +38,8 @@ export declare class SavedStarGift {
|
|
|
38
38
|
get transferStars(): tl.Long | null;
|
|
39
39
|
/** Date when the gift can be exported to blockchain */
|
|
40
40
|
get canExportAt(): Date | null;
|
|
41
|
+
/** Date when the gift can be transferred */
|
|
42
|
+
get canTransferAt(): Date | null;
|
|
43
|
+
/** Date when the gift can be resold */
|
|
44
|
+
get canResellAt(): Date | null;
|
|
41
45
|
}
|
|
@@ -38,4 +38,8 @@ export declare class SavedStarGift {
|
|
|
38
38
|
get transferStars(): tl.Long | null;
|
|
39
39
|
/** Date when the gift can be exported to blockchain */
|
|
40
40
|
get canExportAt(): Date | null;
|
|
41
|
+
/** Date when the gift can be transferred */
|
|
42
|
+
get canTransferAt(): Date | null;
|
|
43
|
+
/** Date when the gift can be resold */
|
|
44
|
+
get canResellAt(): Date | null;
|
|
41
45
|
}
|
|
@@ -71,6 +71,14 @@ class SavedStarGift {
|
|
|
71
71
|
get canExportAt() {
|
|
72
72
|
return this.raw.canExportAt ? new Date(this.raw.canExportAt * 1e3) : null;
|
|
73
73
|
}
|
|
74
|
+
/** Date when the gift can be transferred */
|
|
75
|
+
get canTransferAt() {
|
|
76
|
+
return this.raw.canTransferAt ? new Date(this.raw.canTransferAt * 1e3) : null;
|
|
77
|
+
}
|
|
78
|
+
/** Date when the gift can be resold */
|
|
79
|
+
get canResellAt() {
|
|
80
|
+
return this.raw.canResellAt ? new Date(this.raw.canResellAt * 1e3) : null;
|
|
81
|
+
}
|
|
74
82
|
}
|
|
75
83
|
const SavedStarGift$1 = /* @__PURE__ */ makeInspectable(SavedStarGift);
|
|
76
84
|
const SavedStarGift$2 = /* @__PURE__ */ memoizeGetters(SavedStarGift$1, ["sender", "gift"]);
|
|
@@ -36,6 +36,10 @@ class StarGiftUniqueBackdrop {
|
|
|
36
36
|
constructor(raw) {
|
|
37
37
|
this.raw = raw;
|
|
38
38
|
}
|
|
39
|
+
/** ID of the backdrop */
|
|
40
|
+
get id() {
|
|
41
|
+
return this.raw.backdropId;
|
|
42
|
+
}
|
|
39
43
|
/** Rarity permille of the attribute */
|
|
40
44
|
get permille() {
|
|
41
45
|
return this.raw.rarityPermille;
|
|
@@ -100,6 +104,7 @@ class StarGiftUniqueOriginalDetails {
|
|
|
100
104
|
return this.raw.message ?? null;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
107
|
+
const StarGiftUniqueOriginalDetails$1 = /* @__PURE__ */ inspectable.makeInspectable(StarGiftUniqueOriginalDetails);
|
|
103
108
|
class StarGiftUnique {
|
|
104
109
|
constructor(raw, _peers) {
|
|
105
110
|
this.raw = raw;
|
|
@@ -155,12 +160,17 @@ class StarGiftUnique {
|
|
|
155
160
|
get ownerName() {
|
|
156
161
|
return this.raw.ownerName ?? null;
|
|
157
162
|
}
|
|
163
|
+
// todo: merge into one property
|
|
158
164
|
get availabilityIssued() {
|
|
159
165
|
return this.raw.availabilityIssued;
|
|
160
166
|
}
|
|
161
167
|
get availabilityTotal() {
|
|
162
168
|
return this.raw.availabilityTotal;
|
|
163
169
|
}
|
|
170
|
+
/** Number of stars this gift is up for resell for */
|
|
171
|
+
get resellPrice() {
|
|
172
|
+
return this.raw.resellStars ?? null;
|
|
173
|
+
}
|
|
164
174
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
165
175
|
get model() {
|
|
166
176
|
return new StarGiftUniqueAttribute(this._model);
|
|
@@ -192,4 +202,4 @@ const StarGiftUnique$2 = /* @__PURE__ */ memoize.memoizeGetters(StarGiftUnique$1
|
|
|
192
202
|
exports.StarGiftUnique = StarGiftUnique$2;
|
|
193
203
|
exports.StarGiftUniqueAttribute = StarGiftUniqueAttribute$2;
|
|
194
204
|
exports.StarGiftUniqueBackdrop = StarGiftUniqueBackdrop$1;
|
|
195
|
-
exports.StarGiftUniqueOriginalDetails = StarGiftUniqueOriginalDetails;
|
|
205
|
+
exports.StarGiftUniqueOriginalDetails = StarGiftUniqueOriginalDetails$1;
|
|
@@ -17,6 +17,8 @@ export declare class StarGiftUniqueAttribute {
|
|
|
17
17
|
export declare class StarGiftUniqueBackdrop {
|
|
18
18
|
readonly raw: tl.RawStarGiftAttributeBackdrop;
|
|
19
19
|
constructor(raw: tl.RawStarGiftAttributeBackdrop);
|
|
20
|
+
/** ID of the backdrop */
|
|
21
|
+
get id(): number;
|
|
20
22
|
/** Rarity permille of the attribute */
|
|
21
23
|
get permille(): number;
|
|
22
24
|
/** Display name of the attribute */
|
|
@@ -83,6 +85,8 @@ export declare class StarGiftUnique {
|
|
|
83
85
|
get ownerName(): string | null;
|
|
84
86
|
get availabilityIssued(): number;
|
|
85
87
|
get availabilityTotal(): number;
|
|
88
|
+
/** Number of stars this gift is up for resell for */
|
|
89
|
+
get resellPrice(): tl.Long | null;
|
|
86
90
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
87
91
|
get model(): StarGiftUniqueAttribute;
|
|
88
92
|
/** Pattern of the unique star gift */
|
|
@@ -17,6 +17,8 @@ export declare class StarGiftUniqueAttribute {
|
|
|
17
17
|
export declare class StarGiftUniqueBackdrop {
|
|
18
18
|
readonly raw: tl.RawStarGiftAttributeBackdrop;
|
|
19
19
|
constructor(raw: tl.RawStarGiftAttributeBackdrop);
|
|
20
|
+
/** ID of the backdrop */
|
|
21
|
+
get id(): number;
|
|
20
22
|
/** Rarity permille of the attribute */
|
|
21
23
|
get permille(): number;
|
|
22
24
|
/** Display name of the attribute */
|
|
@@ -83,6 +85,8 @@ export declare class StarGiftUnique {
|
|
|
83
85
|
get ownerName(): string | null;
|
|
84
86
|
get availabilityIssued(): number;
|
|
85
87
|
get availabilityTotal(): number;
|
|
88
|
+
/** Number of stars this gift is up for resell for */
|
|
89
|
+
get resellPrice(): tl.Long | null;
|
|
86
90
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
87
91
|
get model(): StarGiftUniqueAttribute;
|
|
88
92
|
/** Pattern of the unique star gift */
|