@mtcute/core 0.26.0 → 0.26.2
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/highlevel/client.d.cts +3 -3
- package/highlevel/client.d.ts +3 -3
- package/highlevel/methods/chats/set-chat-color.cjs +5 -2
- package/highlevel/methods/chats/set-chat-color.d.cts +0 -2
- package/highlevel/methods/chats/set-chat-color.d.ts +0 -2
- package/highlevel/methods/chats/set-chat-color.js +5 -2
- package/highlevel/methods/contacts/add-contact.cjs +4 -2
- package/highlevel/methods/contacts/add-contact.d.cts +5 -1
- package/highlevel/methods/contacts/add-contact.d.ts +5 -1
- package/highlevel/methods/contacts/add-contact.js +4 -2
- package/highlevel/methods/contacts/set-contact-note.d.cts +9 -0
- package/highlevel/methods/contacts/set-contact-note.d.ts +9 -0
- package/highlevel/methods/forums/create-forum-topic.cjs +2 -2
- package/highlevel/methods/forums/create-forum-topic.js +3 -3
- package/highlevel/methods/forums/delete-forum-topic-history.cjs +9 -6
- package/highlevel/methods/forums/delete-forum-topic-history.js +10 -7
- package/highlevel/methods/forums/edit-forum-topic.cjs +6 -4
- package/highlevel/methods/forums/edit-forum-topic.d.cts +4 -0
- package/highlevel/methods/forums/edit-forum-topic.d.ts +4 -0
- package/highlevel/methods/forums/edit-forum-topic.js +7 -5
- package/highlevel/methods/forums/get-forum-topics-by-id.cjs +2 -2
- package/highlevel/methods/forums/get-forum-topics-by-id.js +3 -3
- package/highlevel/methods/forums/get-forum-topics.cjs +2 -2
- package/highlevel/methods/forums/get-forum-topics.js +3 -3
- package/highlevel/methods/forums/iter-forum-topics.cjs +1 -1
- package/highlevel/methods/forums/iter-forum-topics.js +2 -2
- package/highlevel/methods/messages/append-todo-list.cjs +1 -1
- package/highlevel/methods/messages/append-todo-list.js +1 -1
- package/highlevel/methods/messages/get-messages-unsafe.d.cts +1 -1
- package/highlevel/methods/messages/get-messages-unsafe.d.ts +1 -1
- package/highlevel/methods/messages/get-messages.d.cts +1 -1
- package/highlevel/methods/messages/get-messages.d.ts +1 -1
- package/highlevel/methods/messages/get-scheduled-messages.d.cts +1 -1
- package/highlevel/methods/messages/get-scheduled-messages.d.ts +1 -1
- package/highlevel/methods/premium/get-saved-star-gifts.cjs +1 -0
- package/highlevel/methods/premium/get-saved-star-gifts.d.cts +4 -0
- package/highlevel/methods/premium/get-saved-star-gifts.d.ts +4 -0
- package/highlevel/methods/premium/get-saved-star-gifts.js +1 -0
- package/highlevel/methods/users/set-emoji-status.cjs +2 -7
- package/highlevel/methods/users/set-emoji-status.js +2 -7
- package/highlevel/storage/service/current-user.cjs +5 -4
- package/highlevel/storage/service/current-user.js +5 -4
- package/highlevel/types/messages/message-action.cjs +15 -2
- package/highlevel/types/messages/message-action.d.cts +14 -1
- package/highlevel/types/messages/message-action.d.ts +14 -1
- package/highlevel/types/messages/message-action.js +15 -2
- package/highlevel/types/peers/chat-event/actions.cjs +1 -0
- package/highlevel/types/peers/chat-event/actions.js +1 -0
- package/highlevel/types/peers/chat.cjs +8 -2
- package/highlevel/types/peers/chat.js +8 -2
- package/highlevel/types/peers/forum-topic.cjs +10 -0
- package/highlevel/types/peers/forum-topic.d.cts +5 -0
- package/highlevel/types/peers/forum-topic.d.ts +5 -0
- package/highlevel/types/peers/forum-topic.js +10 -0
- package/highlevel/types/peers/full-user.cjs +4 -0
- 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 +4 -0
- package/highlevel/types/peers/user.cjs +12 -2
- package/highlevel/types/peers/user.d.cts +2 -0
- package/highlevel/types/peers/user.d.ts +2 -0
- package/highlevel/types/peers/user.js +12 -2
- package/highlevel/types/premium/saved-star-gift.cjs +4 -0
- package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
- package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
- package/highlevel/types/premium/saved-star-gift.js +4 -0
- package/highlevel/types/premium/stars-gift-unique.cjs +24 -0
- package/highlevel/types/premium/stars-gift-unique.d.cts +14 -0
- package/highlevel/types/premium/stars-gift-unique.d.ts +14 -0
- package/highlevel/types/premium/stars-gift-unique.js +24 -0
- package/highlevel/types/premium/stars-gift.cjs +4 -0
- package/highlevel/types/premium/stars-gift.d.cts +2 -0
- package/highlevel/types/premium/stars-gift.d.ts +2 -0
- package/highlevel/types/premium/stars-gift.js +4 -0
- 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/updates/history-read-update.cjs +2 -1
- package/highlevel/types/updates/history-read-update.js +2 -1
- package/highlevel/types/updates/user-typing-update.cjs +12 -0
- package/highlevel/types/updates/user-typing-update.d.cts +2 -0
- package/highlevel/types/updates/user-typing-update.d.ts +2 -0
- package/highlevel/types/updates/user-typing-update.js +12 -0
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/network/session-connection.cjs +16 -4
- package/network/session-connection.js +16 -4
- package/package.json +2 -2
- package/utils/binary/compat.cjs +16 -2
- package/utils/binary/compat.js +16 -2
|
@@ -57,11 +57,10 @@ class CurrentUserService extends BaseService {
|
|
|
57
57
|
_cached;
|
|
58
58
|
async store(info) {
|
|
59
59
|
if (info && this._cached) {
|
|
60
|
-
if (this._cached.userId === info.userId) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
60
|
this._cached.userId = info.userId;
|
|
64
61
|
this._cached.isBot = info.isBot;
|
|
62
|
+
this._cached.isPremium = info.isPremium;
|
|
63
|
+
this._cached.usernames = info.usernames;
|
|
65
64
|
} else {
|
|
66
65
|
this._cached = info;
|
|
67
66
|
}
|
|
@@ -80,7 +79,9 @@ class CurrentUserService extends BaseService {
|
|
|
80
79
|
return obj;
|
|
81
80
|
}
|
|
82
81
|
async fetch() {
|
|
83
|
-
if (this._cached)
|
|
82
|
+
if (this._cached) {
|
|
83
|
+
return this._cached;
|
|
84
|
+
}
|
|
84
85
|
const data = await this._kv.get(KV_CURRENT_USER);
|
|
85
86
|
if (!data) return null;
|
|
86
87
|
const info = parse(data);
|
|
@@ -167,7 +167,8 @@ function _messageActionFromTl(act) {
|
|
|
167
167
|
type: "topic_created",
|
|
168
168
|
title: act.title,
|
|
169
169
|
iconColor: act.iconColor,
|
|
170
|
-
iconCustomEmoji: act.iconEmojiId
|
|
170
|
+
iconCustomEmoji: act.iconEmojiId,
|
|
171
|
+
titleMissing: act.titleMissing
|
|
171
172
|
};
|
|
172
173
|
case "messageActionTopicEdit":
|
|
173
174
|
return {
|
|
@@ -330,8 +331,15 @@ function _messageActionFromTl(act) {
|
|
|
330
331
|
canTransferAt: act.canTransferAt ? new Date(act.canTransferAt * 1e3) : void 0,
|
|
331
332
|
canResellAt: act.canResellAt ? new Date(act.canResellAt * 1e3) : void 0,
|
|
332
333
|
canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
|
|
333
|
-
savedId: act.savedId
|
|
334
|
+
savedId: act.savedId,
|
|
335
|
+
dropDetailsStars: act.dropOriginalDetailsStars
|
|
334
336
|
};
|
|
337
|
+
if (act.assigned) {
|
|
338
|
+
return {
|
|
339
|
+
type: "star_gift_assigned",
|
|
340
|
+
...common
|
|
341
|
+
};
|
|
342
|
+
}
|
|
335
343
|
if (act.resaleAmount) {
|
|
336
344
|
return {
|
|
337
345
|
type: "star_gift_bought_resale",
|
|
@@ -381,6 +389,11 @@ function _messageActionFromTl(act) {
|
|
|
381
389
|
cryptoAmount: act.cryptoAmount,
|
|
382
390
|
transactionId: act.transactionId
|
|
383
391
|
};
|
|
392
|
+
case "messageActionSuggestBirthday":
|
|
393
|
+
return {
|
|
394
|
+
type: "suggest_birthday",
|
|
395
|
+
birthday: act.birthday
|
|
396
|
+
};
|
|
384
397
|
default:
|
|
385
398
|
return null;
|
|
386
399
|
}
|
|
@@ -218,6 +218,8 @@ export interface ActionTopicCreated {
|
|
|
218
218
|
iconColor: number;
|
|
219
219
|
/** Icon emoji of the topic */
|
|
220
220
|
iconCustomEmoji?: tl.Long;
|
|
221
|
+
/** Whether the title is not set yet */
|
|
222
|
+
titleMissing?: boolean;
|
|
221
223
|
}
|
|
222
224
|
/** Forum topic was modified */
|
|
223
225
|
export interface ActionTopicEdited {
|
|
@@ -461,6 +463,8 @@ interface StarGiftUniqueCommon {
|
|
|
461
463
|
canResellAt?: Date;
|
|
462
464
|
/** If the gift can be exported to blockchain, date when it will become available */
|
|
463
465
|
canExportAt?: Date;
|
|
466
|
+
/** Amount of stars needed to drop the original details */
|
|
467
|
+
dropDetailsStars?: tl.Long;
|
|
464
468
|
/** ID of the related saved profile gift */
|
|
465
469
|
savedId?: tl.Long;
|
|
466
470
|
}
|
|
@@ -474,6 +478,10 @@ export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
|
|
|
474
478
|
/** Number of stars/TON that were paid for the gift */
|
|
475
479
|
amount: tl.TypeStarsAmount;
|
|
476
480
|
}
|
|
481
|
+
/** A star gift previously exported to the blockchain was assigned to your profile */
|
|
482
|
+
export interface ActionStarGiftAssigned extends StarGiftUniqueCommon {
|
|
483
|
+
readonly type: 'star_gift_assigned';
|
|
484
|
+
}
|
|
477
485
|
/** A star gift was transferred */
|
|
478
486
|
export interface ActionStarGiftTransferred extends StarGiftUniqueCommon {
|
|
479
487
|
readonly type: 'star_gift_transferred';
|
|
@@ -522,7 +530,12 @@ export interface ActionTonGift {
|
|
|
522
530
|
/** Transaction ID */
|
|
523
531
|
transactionId?: string;
|
|
524
532
|
}
|
|
525
|
-
export
|
|
533
|
+
export interface ActionSuggestBirthday {
|
|
534
|
+
readonly type: 'suggest_birthday';
|
|
535
|
+
/** Birthday */
|
|
536
|
+
birthday: tl.RawBirthday;
|
|
537
|
+
}
|
|
538
|
+
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 | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | null;
|
|
526
539
|
/** @internal */
|
|
527
540
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
528
541
|
export {};
|
|
@@ -218,6 +218,8 @@ export interface ActionTopicCreated {
|
|
|
218
218
|
iconColor: number;
|
|
219
219
|
/** Icon emoji of the topic */
|
|
220
220
|
iconCustomEmoji?: tl.Long;
|
|
221
|
+
/** Whether the title is not set yet */
|
|
222
|
+
titleMissing?: boolean;
|
|
221
223
|
}
|
|
222
224
|
/** Forum topic was modified */
|
|
223
225
|
export interface ActionTopicEdited {
|
|
@@ -461,6 +463,8 @@ interface StarGiftUniqueCommon {
|
|
|
461
463
|
canResellAt?: Date;
|
|
462
464
|
/** If the gift can be exported to blockchain, date when it will become available */
|
|
463
465
|
canExportAt?: Date;
|
|
466
|
+
/** Amount of stars needed to drop the original details */
|
|
467
|
+
dropDetailsStars?: tl.Long;
|
|
464
468
|
/** ID of the related saved profile gift */
|
|
465
469
|
savedId?: tl.Long;
|
|
466
470
|
}
|
|
@@ -474,6 +478,10 @@ export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
|
|
|
474
478
|
/** Number of stars/TON that were paid for the gift */
|
|
475
479
|
amount: tl.TypeStarsAmount;
|
|
476
480
|
}
|
|
481
|
+
/** A star gift previously exported to the blockchain was assigned to your profile */
|
|
482
|
+
export interface ActionStarGiftAssigned extends StarGiftUniqueCommon {
|
|
483
|
+
readonly type: 'star_gift_assigned';
|
|
484
|
+
}
|
|
477
485
|
/** A star gift was transferred */
|
|
478
486
|
export interface ActionStarGiftTransferred extends StarGiftUniqueCommon {
|
|
479
487
|
readonly type: 'star_gift_transferred';
|
|
@@ -522,7 +530,12 @@ export interface ActionTonGift {
|
|
|
522
530
|
/** Transaction ID */
|
|
523
531
|
transactionId?: string;
|
|
524
532
|
}
|
|
525
|
-
export
|
|
533
|
+
export interface ActionSuggestBirthday {
|
|
534
|
+
readonly type: 'suggest_birthday';
|
|
535
|
+
/** Birthday */
|
|
536
|
+
birthday: tl.RawBirthday;
|
|
537
|
+
}
|
|
538
|
+
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 | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | null;
|
|
526
539
|
/** @internal */
|
|
527
540
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
528
541
|
export {};
|
|
@@ -160,7 +160,8 @@ function _messageActionFromTl(act) {
|
|
|
160
160
|
type: "topic_created",
|
|
161
161
|
title: act.title,
|
|
162
162
|
iconColor: act.iconColor,
|
|
163
|
-
iconCustomEmoji: act.iconEmojiId
|
|
163
|
+
iconCustomEmoji: act.iconEmojiId,
|
|
164
|
+
titleMissing: act.titleMissing
|
|
164
165
|
};
|
|
165
166
|
case "messageActionTopicEdit":
|
|
166
167
|
return {
|
|
@@ -323,8 +324,15 @@ function _messageActionFromTl(act) {
|
|
|
323
324
|
canTransferAt: act.canTransferAt ? new Date(act.canTransferAt * 1e3) : void 0,
|
|
324
325
|
canResellAt: act.canResellAt ? new Date(act.canResellAt * 1e3) : void 0,
|
|
325
326
|
canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
|
|
326
|
-
savedId: act.savedId
|
|
327
|
+
savedId: act.savedId,
|
|
328
|
+
dropDetailsStars: act.dropOriginalDetailsStars
|
|
327
329
|
};
|
|
330
|
+
if (act.assigned) {
|
|
331
|
+
return {
|
|
332
|
+
type: "star_gift_assigned",
|
|
333
|
+
...common
|
|
334
|
+
};
|
|
335
|
+
}
|
|
328
336
|
if (act.resaleAmount) {
|
|
329
337
|
return {
|
|
330
338
|
type: "star_gift_bought_resale",
|
|
@@ -374,6 +382,11 @@ function _messageActionFromTl(act) {
|
|
|
374
382
|
cryptoAmount: act.cryptoAmount,
|
|
375
383
|
transactionId: act.transactionId
|
|
376
384
|
};
|
|
385
|
+
case "messageActionSuggestBirthday":
|
|
386
|
+
return {
|
|
387
|
+
type: "suggest_birthday",
|
|
388
|
+
birthday: act.birthday
|
|
389
|
+
};
|
|
377
390
|
default:
|
|
378
391
|
return null;
|
|
379
392
|
}
|
|
@@ -257,6 +257,7 @@ function _actionFromTl(e, peers, peerId) {
|
|
|
257
257
|
};
|
|
258
258
|
case "channelAdminLogEventActionChangePeerColor":
|
|
259
259
|
case "channelAdminLogEventActionChangeProfilePeerColor":
|
|
260
|
+
if (e.prevValue._ !== "peerColor" || e.newValue._ !== "peerColor") return null;
|
|
260
261
|
return {
|
|
261
262
|
type: e._ === "channelAdminLogEventActionChangePeerColor" ? "peer_color_changed" : "profile_peer_color_changed",
|
|
262
263
|
prev: new chatColors.ChatColors(peerId, e.prevValue),
|
|
@@ -250,6 +250,7 @@ function _actionFromTl(e, peers, peerId) {
|
|
|
250
250
|
};
|
|
251
251
|
case "channelAdminLogEventActionChangePeerColor":
|
|
252
252
|
case "channelAdminLogEventActionChangeProfilePeerColor":
|
|
253
|
+
if (e.prevValue._ !== "peerColor" || e.newValue._ !== "peerColor") return null;
|
|
253
254
|
return {
|
|
254
255
|
type: e._ === "channelAdminLogEventActionChangePeerColor" ? "peer_color_changed" : "profile_peer_color_changed",
|
|
255
256
|
prev: new ChatColors$1(peerId, e.prevValue),
|
|
@@ -345,7 +345,10 @@ class Chat {
|
|
|
345
345
|
* as well as to render the chat title
|
|
346
346
|
*/
|
|
347
347
|
get color() {
|
|
348
|
-
return new chatColors.ChatColors(
|
|
348
|
+
return new chatColors.ChatColors(
|
|
349
|
+
this.raw.id,
|
|
350
|
+
this.raw._ === "channel" && this.raw.color?._ === "peerColor" ? this.raw.color : void 0
|
|
351
|
+
);
|
|
349
352
|
}
|
|
350
353
|
/**
|
|
351
354
|
* Chat's emoji status, if any.
|
|
@@ -367,7 +370,10 @@ class Chat {
|
|
|
367
370
|
* the user's profile
|
|
368
371
|
*/
|
|
369
372
|
get profileColors() {
|
|
370
|
-
return new chatColors.ChatColors(
|
|
373
|
+
return new chatColors.ChatColors(
|
|
374
|
+
this.raw.id,
|
|
375
|
+
this.raw._ === "channel" && this.raw.profileColor?._ === "peerColor" ? this.raw.profileColor : void 0
|
|
376
|
+
);
|
|
371
377
|
}
|
|
372
378
|
/** Boosts level this chat has (0 if none or is not a channel) */
|
|
373
379
|
get boostsLevel() {
|
|
@@ -338,7 +338,10 @@ class Chat {
|
|
|
338
338
|
* as well as to render the chat title
|
|
339
339
|
*/
|
|
340
340
|
get color() {
|
|
341
|
-
return new ChatColors$1(
|
|
341
|
+
return new ChatColors$1(
|
|
342
|
+
this.raw.id,
|
|
343
|
+
this.raw._ === "channel" && this.raw.color?._ === "peerColor" ? this.raw.color : void 0
|
|
344
|
+
);
|
|
342
345
|
}
|
|
343
346
|
/**
|
|
344
347
|
* Chat's emoji status, if any.
|
|
@@ -360,7 +363,10 @@ class Chat {
|
|
|
360
363
|
* the user's profile
|
|
361
364
|
*/
|
|
362
365
|
get profileColors() {
|
|
363
|
-
return new ChatColors$1(
|
|
366
|
+
return new ChatColors$1(
|
|
367
|
+
this.raw.id,
|
|
368
|
+
this.raw._ === "channel" && this.raw.profileColor?._ === "peerColor" ? this.raw.profileColor : void 0
|
|
369
|
+
);
|
|
364
370
|
}
|
|
365
371
|
/** Boosts level this chat has (0 if none or is not a channel) */
|
|
366
372
|
get boostsLevel() {
|
|
@@ -80,6 +80,12 @@ class ForumTopic {
|
|
|
80
80
|
get title() {
|
|
81
81
|
return this.raw.title;
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Whether the title is not set yet
|
|
85
|
+
*/
|
|
86
|
+
get titleMissing() {
|
|
87
|
+
return this.raw.titleMissing;
|
|
88
|
+
}
|
|
83
89
|
/**
|
|
84
90
|
* Color of the topic's icon, used as a fallback
|
|
85
91
|
* in case {@link iconEmoji} is not set.
|
|
@@ -101,6 +107,10 @@ class ForumTopic {
|
|
|
101
107
|
get creator() {
|
|
102
108
|
return peer.parsePeer(this.raw.fromId, this._peers);
|
|
103
109
|
}
|
|
110
|
+
// idk???
|
|
111
|
+
get peer() {
|
|
112
|
+
return peer.parsePeer(this.raw.peer, this._peers);
|
|
113
|
+
}
|
|
104
114
|
/**
|
|
105
115
|
* The latest message sent in this topic
|
|
106
116
|
*/
|
|
@@ -46,6 +46,10 @@ export declare class ForumTopic {
|
|
|
46
46
|
* Title of the topic
|
|
47
47
|
*/
|
|
48
48
|
get title(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the title is not set yet
|
|
51
|
+
*/
|
|
52
|
+
get titleMissing(): boolean;
|
|
49
53
|
/**
|
|
50
54
|
* Color of the topic's icon, used as a fallback
|
|
51
55
|
* in case {@link iconEmoji} is not set.
|
|
@@ -61,6 +65,7 @@ export declare class ForumTopic {
|
|
|
61
65
|
* Creator of the topic
|
|
62
66
|
*/
|
|
63
67
|
get creator(): Peer;
|
|
68
|
+
get peer(): Peer;
|
|
64
69
|
/**
|
|
65
70
|
* The latest message sent in this topic
|
|
66
71
|
*/
|
|
@@ -46,6 +46,10 @@ export declare class ForumTopic {
|
|
|
46
46
|
* Title of the topic
|
|
47
47
|
*/
|
|
48
48
|
get title(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the title is not set yet
|
|
51
|
+
*/
|
|
52
|
+
get titleMissing(): boolean;
|
|
49
53
|
/**
|
|
50
54
|
* Color of the topic's icon, used as a fallback
|
|
51
55
|
* in case {@link iconEmoji} is not set.
|
|
@@ -61,6 +65,7 @@ export declare class ForumTopic {
|
|
|
61
65
|
* Creator of the topic
|
|
62
66
|
*/
|
|
63
67
|
get creator(): Peer;
|
|
68
|
+
get peer(): Peer;
|
|
64
69
|
/**
|
|
65
70
|
* The latest message sent in this topic
|
|
66
71
|
*/
|
|
@@ -73,6 +73,12 @@ class ForumTopic {
|
|
|
73
73
|
get title() {
|
|
74
74
|
return this.raw.title;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether the title is not set yet
|
|
78
|
+
*/
|
|
79
|
+
get titleMissing() {
|
|
80
|
+
return this.raw.titleMissing;
|
|
81
|
+
}
|
|
76
82
|
/**
|
|
77
83
|
* Color of the topic's icon, used as a fallback
|
|
78
84
|
* in case {@link iconEmoji} is not set.
|
|
@@ -94,6 +100,10 @@ class ForumTopic {
|
|
|
94
100
|
get creator() {
|
|
95
101
|
return parsePeer(this.raw.fromId, this._peers);
|
|
96
102
|
}
|
|
103
|
+
// idk???
|
|
104
|
+
get peer() {
|
|
105
|
+
return parsePeer(this.raw.peer, this._peers);
|
|
106
|
+
}
|
|
97
107
|
/**
|
|
98
108
|
* The latest message sent in this topic
|
|
99
109
|
*/
|
|
@@ -139,6 +139,10 @@ class FullUser extends user.User {
|
|
|
139
139
|
get bio() {
|
|
140
140
|
return this.full.about ?? "";
|
|
141
141
|
}
|
|
142
|
+
/** Note about the user, only visible to you */
|
|
143
|
+
get note() {
|
|
144
|
+
return this.full.note ?? null;
|
|
145
|
+
}
|
|
142
146
|
/** Number of star gifts the user has chosen to display on their profile */
|
|
143
147
|
get starGiftsCount() {
|
|
144
148
|
return this.full.stargiftsCount ?? 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { tl } from '@mtcute/tl';
|
|
2
2
|
import { Audio } from '../media/audio.js';
|
|
3
|
+
import { TextWithEntities } from '../misc/entities.js';
|
|
3
4
|
import { Photo } from '../media/photo.js';
|
|
4
5
|
import { BusinessAccount } from '../premium/business-account.js';
|
|
5
6
|
import { BotVerification } from './bot-verification.js';
|
|
@@ -81,6 +82,8 @@ export declare class FullUser extends User {
|
|
|
81
82
|
* group, supergroup or channel.
|
|
82
83
|
*/
|
|
83
84
|
get bio(): string;
|
|
85
|
+
/** Note about the user, only visible to you */
|
|
86
|
+
get note(): TextWithEntities | null;
|
|
84
87
|
/** Number of star gifts the user has chosen to display on their profile */
|
|
85
88
|
get starGiftsCount(): number;
|
|
86
89
|
/** If this chat is a bot, whether the current user can manage its emoji status */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { tl } from '@mtcute/tl';
|
|
2
2
|
import { Audio } from '../media/audio.js';
|
|
3
|
+
import { TextWithEntities } from '../misc/entities.js';
|
|
3
4
|
import { Photo } from '../media/photo.js';
|
|
4
5
|
import { BusinessAccount } from '../premium/business-account.js';
|
|
5
6
|
import { BotVerification } from './bot-verification.js';
|
|
@@ -81,6 +82,8 @@ export declare class FullUser extends User {
|
|
|
81
82
|
* group, supergroup or channel.
|
|
82
83
|
*/
|
|
83
84
|
get bio(): string;
|
|
85
|
+
/** Note about the user, only visible to you */
|
|
86
|
+
get note(): TextWithEntities | null;
|
|
84
87
|
/** Number of star gifts the user has chosen to display on their profile */
|
|
85
88
|
get starGiftsCount(): number;
|
|
86
89
|
/** If this chat is a bot, whether the current user can manage its emoji status */
|
|
@@ -132,6 +132,10 @@ class FullUser extends User$2 {
|
|
|
132
132
|
get bio() {
|
|
133
133
|
return this.full.about ?? "";
|
|
134
134
|
}
|
|
135
|
+
/** Note about the user, only visible to you */
|
|
136
|
+
get note() {
|
|
137
|
+
return this.full.note ?? null;
|
|
138
|
+
}
|
|
135
139
|
/** Number of star gifts the user has chosen to display on their profile */
|
|
136
140
|
get starGiftsCount() {
|
|
137
141
|
return this.full.stargiftsCount ?? 0;
|
|
@@ -107,6 +107,10 @@ class User {
|
|
|
107
107
|
get isBotEditable() {
|
|
108
108
|
return this.raw.botCanEdit;
|
|
109
109
|
}
|
|
110
|
+
/** Whether this bot is forum-like (i.e. supports threads) */
|
|
111
|
+
get isBotWithForumView() {
|
|
112
|
+
return this.raw.botForumView;
|
|
113
|
+
}
|
|
110
114
|
/** Whether this user has been verified by Telegram */
|
|
111
115
|
get isVerified() {
|
|
112
116
|
return this.raw.verified;
|
|
@@ -356,7 +360,10 @@ class User {
|
|
|
356
360
|
* as well as to render the chat title
|
|
357
361
|
*/
|
|
358
362
|
get color() {
|
|
359
|
-
return new chatColors.ChatColors(
|
|
363
|
+
return new chatColors.ChatColors(
|
|
364
|
+
this.raw.id,
|
|
365
|
+
this.raw.color?._ === "peerColor" ? this.raw.color : void 0
|
|
366
|
+
);
|
|
360
367
|
}
|
|
361
368
|
/**
|
|
362
369
|
* Color that should be used when rendering the header of
|
|
@@ -365,7 +372,10 @@ class User {
|
|
|
365
372
|
* If `null`, a generic header should be used instead
|
|
366
373
|
*/
|
|
367
374
|
get profileColors() {
|
|
368
|
-
return this.raw.profileColor ? new chatColors.ChatColors(
|
|
375
|
+
return this.raw.profileColor ? new chatColors.ChatColors(
|
|
376
|
+
this.raw.id,
|
|
377
|
+
this.raw.profileColor?._ === "peerColor" ? this.raw.profileColor : void 0
|
|
378
|
+
) : null;
|
|
369
379
|
}
|
|
370
380
|
/** If this user has paid messages enabled, price of one message in stars */
|
|
371
381
|
get paidMessagePrice() {
|
|
@@ -82,6 +82,8 @@ export declare class User {
|
|
|
82
82
|
get isBotWithInlineGeo(): boolean;
|
|
83
83
|
/** Whether this bot can be edited by the current user */
|
|
84
84
|
get isBotEditable(): boolean;
|
|
85
|
+
/** Whether this bot is forum-like (i.e. supports threads) */
|
|
86
|
+
get isBotWithForumView(): boolean;
|
|
85
87
|
/** Whether this user has been verified by Telegram */
|
|
86
88
|
get isVerified(): boolean;
|
|
87
89
|
/**
|
|
@@ -82,6 +82,8 @@ export declare class User {
|
|
|
82
82
|
get isBotWithInlineGeo(): boolean;
|
|
83
83
|
/** Whether this bot can be edited by the current user */
|
|
84
84
|
get isBotEditable(): boolean;
|
|
85
|
+
/** Whether this bot is forum-like (i.e. supports threads) */
|
|
86
|
+
get isBotWithForumView(): boolean;
|
|
85
87
|
/** Whether this user has been verified by Telegram */
|
|
86
88
|
get isVerified(): boolean;
|
|
87
89
|
/**
|
|
@@ -100,6 +100,10 @@ class User {
|
|
|
100
100
|
get isBotEditable() {
|
|
101
101
|
return this.raw.botCanEdit;
|
|
102
102
|
}
|
|
103
|
+
/** Whether this bot is forum-like (i.e. supports threads) */
|
|
104
|
+
get isBotWithForumView() {
|
|
105
|
+
return this.raw.botForumView;
|
|
106
|
+
}
|
|
103
107
|
/** Whether this user has been verified by Telegram */
|
|
104
108
|
get isVerified() {
|
|
105
109
|
return this.raw.verified;
|
|
@@ -349,7 +353,10 @@ class User {
|
|
|
349
353
|
* as well as to render the chat title
|
|
350
354
|
*/
|
|
351
355
|
get color() {
|
|
352
|
-
return new ChatColors$1(
|
|
356
|
+
return new ChatColors$1(
|
|
357
|
+
this.raw.id,
|
|
358
|
+
this.raw.color?._ === "peerColor" ? this.raw.color : void 0
|
|
359
|
+
);
|
|
353
360
|
}
|
|
354
361
|
/**
|
|
355
362
|
* Color that should be used when rendering the header of
|
|
@@ -358,7 +365,10 @@ class User {
|
|
|
358
365
|
* If `null`, a generic header should be used instead
|
|
359
366
|
*/
|
|
360
367
|
get profileColors() {
|
|
361
|
-
return this.raw.profileColor ? new ChatColors$1(
|
|
368
|
+
return this.raw.profileColor ? new ChatColors$1(
|
|
369
|
+
this.raw.id,
|
|
370
|
+
this.raw.profileColor?._ === "peerColor" ? this.raw.profileColor : void 0
|
|
371
|
+
) : null;
|
|
362
372
|
}
|
|
363
373
|
/** If this user has paid messages enabled, price of one message in stars */
|
|
364
374
|
get paidMessagePrice() {
|
|
@@ -74,6 +74,10 @@ class SavedStarGift {
|
|
|
74
74
|
get transferStars() {
|
|
75
75
|
return this.raw.transferStars ?? null;
|
|
76
76
|
}
|
|
77
|
+
/** Amount of stars needed to drop the original details */
|
|
78
|
+
get dropDetailsStars() {
|
|
79
|
+
return this.raw.dropOriginalDetailsStars ?? null;
|
|
80
|
+
}
|
|
77
81
|
/** Date when the gift can be exported to blockchain */
|
|
78
82
|
get canExportAt() {
|
|
79
83
|
return this.raw.canExportAt ? new Date(this.raw.canExportAt * 1e3) : null;
|
|
@@ -36,6 +36,8 @@ export declare class SavedStarGift {
|
|
|
36
36
|
get upgradeStars(): tl.Long | null;
|
|
37
37
|
/** Amount of stars needed to transfer the gift */
|
|
38
38
|
get transferStars(): tl.Long | null;
|
|
39
|
+
/** Amount of stars needed to drop the original details */
|
|
40
|
+
get dropDetailsStars(): tl.Long | null;
|
|
39
41
|
/** Date when the gift can be exported to blockchain */
|
|
40
42
|
get canExportAt(): Date | null;
|
|
41
43
|
/** Date when the gift can be transferred */
|
|
@@ -36,6 +36,8 @@ export declare class SavedStarGift {
|
|
|
36
36
|
get upgradeStars(): tl.Long | null;
|
|
37
37
|
/** Amount of stars needed to transfer the gift */
|
|
38
38
|
get transferStars(): tl.Long | null;
|
|
39
|
+
/** Amount of stars needed to drop the original details */
|
|
40
|
+
get dropDetailsStars(): tl.Long | null;
|
|
39
41
|
/** Date when the gift can be exported to blockchain */
|
|
40
42
|
get canExportAt(): Date | null;
|
|
41
43
|
/** Date when the gift can be transferred */
|
|
@@ -67,6 +67,10 @@ class SavedStarGift {
|
|
|
67
67
|
get transferStars() {
|
|
68
68
|
return this.raw.transferStars ?? null;
|
|
69
69
|
}
|
|
70
|
+
/** Amount of stars needed to drop the original details */
|
|
71
|
+
get dropDetailsStars() {
|
|
72
|
+
return this.raw.dropOriginalDetailsStars ?? null;
|
|
73
|
+
}
|
|
70
74
|
/** Date when the gift can be exported to blockchain */
|
|
71
75
|
get canExportAt() {
|
|
72
76
|
return this.raw.canExportAt ? new Date(this.raw.canExportAt * 1e3) : null;
|
|
@@ -182,6 +182,30 @@ class StarGiftUnique {
|
|
|
182
182
|
const resellPriceTon = this.raw.resellAmount?.find((it) => it._ === "starsTonAmount");
|
|
183
183
|
return resellPriceTon?.amount ?? null;
|
|
184
184
|
}
|
|
185
|
+
/** Profile colors associated with this gift */
|
|
186
|
+
get peerColor() {
|
|
187
|
+
if (this.raw.peerColor?._ !== "peerColorCollectible") return null;
|
|
188
|
+
return this.raw.peerColor;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* ID of the user who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
192
|
+
* but is displayed as a gift on this peer's profile)
|
|
193
|
+
*/
|
|
194
|
+
get hostId() {
|
|
195
|
+
if (!this.raw.hostId) return null;
|
|
196
|
+
return peerUtils.getMarkedPeerId(this.raw.hostId);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* ID of the peer who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
200
|
+
* but is displayed as a gift on this peer's profile), if available
|
|
201
|
+
* > Note: in some cases, only {@link hostId} is available, and not {@link host},
|
|
202
|
+
* > in which cases please use `tg.getPeer(ownerId)` manually
|
|
203
|
+
*/
|
|
204
|
+
get host() {
|
|
205
|
+
if (!this.raw.hostId) return null;
|
|
206
|
+
if (!this._peers.has(this.raw.hostId)) return null;
|
|
207
|
+
return peer.parsePeer(this.raw.hostId, this._peers);
|
|
208
|
+
}
|
|
185
209
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
186
210
|
get model() {
|
|
187
211
|
return new StarGiftUniqueAttribute(this._model);
|
|
@@ -91,6 +91,20 @@ export declare class StarGiftUnique {
|
|
|
91
91
|
get resellPriceStars(): tl.Long | null;
|
|
92
92
|
/** Number of nanoton this gift is up for resell for */
|
|
93
93
|
get resellPriceTon(): tl.Long | null;
|
|
94
|
+
/** Profile colors associated with this gift */
|
|
95
|
+
get peerColor(): tl.RawPeerColorCollectible | null;
|
|
96
|
+
/**
|
|
97
|
+
* ID of the user who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
98
|
+
* but is displayed as a gift on this peer's profile)
|
|
99
|
+
*/
|
|
100
|
+
get hostId(): number | null;
|
|
101
|
+
/**
|
|
102
|
+
* ID of the peer who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
103
|
+
* but is displayed as a gift on this peer's profile), if available
|
|
104
|
+
* > Note: in some cases, only {@link hostId} is available, and not {@link host},
|
|
105
|
+
* > in which cases please use `tg.getPeer(ownerId)` manually
|
|
106
|
+
*/
|
|
107
|
+
get host(): Peer | null;
|
|
94
108
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
95
109
|
get model(): StarGiftUniqueAttribute;
|
|
96
110
|
/** Pattern of the unique star gift */
|
|
@@ -91,6 +91,20 @@ export declare class StarGiftUnique {
|
|
|
91
91
|
get resellPriceStars(): tl.Long | null;
|
|
92
92
|
/** Number of nanoton this gift is up for resell for */
|
|
93
93
|
get resellPriceTon(): tl.Long | null;
|
|
94
|
+
/** Profile colors associated with this gift */
|
|
95
|
+
get peerColor(): tl.RawPeerColorCollectible | null;
|
|
96
|
+
/**
|
|
97
|
+
* ID of the user who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
98
|
+
* but is displayed as a gift on this peer's profile)
|
|
99
|
+
*/
|
|
100
|
+
get hostId(): number | null;
|
|
101
|
+
/**
|
|
102
|
+
* ID of the peer who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
103
|
+
* but is displayed as a gift on this peer's profile), if available
|
|
104
|
+
* > Note: in some cases, only {@link hostId} is available, and not {@link host},
|
|
105
|
+
* > in which cases please use `tg.getPeer(ownerId)` manually
|
|
106
|
+
*/
|
|
107
|
+
get host(): Peer | null;
|
|
94
108
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
95
109
|
get model(): StarGiftUniqueAttribute;
|
|
96
110
|
/** Pattern of the unique star gift */
|
|
@@ -175,6 +175,30 @@ class StarGiftUnique {
|
|
|
175
175
|
const resellPriceTon = this.raw.resellAmount?.find((it) => it._ === "starsTonAmount");
|
|
176
176
|
return resellPriceTon?.amount ?? null;
|
|
177
177
|
}
|
|
178
|
+
/** Profile colors associated with this gift */
|
|
179
|
+
get peerColor() {
|
|
180
|
+
if (this.raw.peerColor?._ !== "peerColorCollectible") return null;
|
|
181
|
+
return this.raw.peerColor;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* ID of the user who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
185
|
+
* but is displayed as a gift on this peer's profile)
|
|
186
|
+
*/
|
|
187
|
+
get hostId() {
|
|
188
|
+
if (!this.raw.hostId) return null;
|
|
189
|
+
return getMarkedPeerId(this.raw.hostId);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* ID of the peer who "hosts" this gift (i.e. this gift is actually stored on the TON blockchain,
|
|
193
|
+
* but is displayed as a gift on this peer's profile), if available
|
|
194
|
+
* > Note: in some cases, only {@link hostId} is available, and not {@link host},
|
|
195
|
+
* > in which cases please use `tg.getPeer(ownerId)` manually
|
|
196
|
+
*/
|
|
197
|
+
get host() {
|
|
198
|
+
if (!this.raw.hostId) return null;
|
|
199
|
+
if (!this._peers.has(this.raw.hostId)) return null;
|
|
200
|
+
return parsePeer(this.raw.hostId, this._peers);
|
|
201
|
+
}
|
|
178
202
|
/** Model (i.e. the gift itself) of the unique star gift */
|
|
179
203
|
get model() {
|
|
180
204
|
return new StarGiftUniqueAttribute(this._model);
|