@mtkruto/node 0.2.37 → 0.2.41
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/esm/3_types.d.ts +1 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +1 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/0_params.d.ts +17 -3
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_utilities.d.ts +1 -0
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +13 -0
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +3 -0
- package/esm/client/2_update_manager.js +5 -5
- package/esm/client/3_message_manager.js +8 -8
- package/esm/client/5_client.d.ts +4 -0
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +56 -33
- package/esm/tl/0_api.d.ts +173 -16
- package/esm/tl/0_api.d.ts.map +1 -1
- package/esm/tl/0_api.js +279 -34
- package/esm/tl/1_utilities.d.ts +1 -1
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +13 -1
- package/esm/types/0_reaction.d.ts +15 -6
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_refunded_payment.d.ts +6 -0
- package/esm/types/0_refunded_payment.d.ts.map +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts +13 -0
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -0
- package/esm/types/0_switch_inline_query_chosen_chats.js +1 -0
- package/esm/types/1_giveaway.d.ts +3 -1
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_giveaway.js +4 -2
- package/esm/types/2_chat.d.ts +1 -0
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_forward_header.d.ts +40 -0
- package/esm/types/2_forward_header.d.ts.map +1 -0
- package/esm/types/2_forward_header.js +55 -0
- package/esm/types/2_inline_keyboard_button.d.ts +61 -14
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/4_message.d.ts +9 -14
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +5 -25
- package/esm/types/6_update.d.ts +29 -2
- package/esm/types/6_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +1 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +1 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/0_params.d.ts +17 -3
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.js +2 -2
- package/script/client/0_utilities.d.ts +1 -0
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +15 -1
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +3 -0
- package/script/client/2_update_manager.js +5 -5
- package/script/client/3_message_manager.js +8 -8
- package/script/client/5_client.d.ts +4 -0
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +55 -32
- package/script/tl/0_api.d.ts +173 -16
- package/script/tl/0_api.d.ts.map +1 -1
- package/script/tl/0_api.js +279 -34
- package/script/tl/1_utilities.d.ts +1 -1
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +13 -1
- package/script/types/0_reaction.d.ts +15 -6
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +4 -4
- package/script/types/0_refunded_payment.d.ts +6 -0
- package/script/types/0_refunded_payment.d.ts.map +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.d.ts +13 -0
- package/script/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -0
- package/script/types/0_switch_inline_query_chosen_chats.js +2 -0
- package/script/types/1_giveaway.d.ts +3 -1
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_giveaway.js +4 -2
- package/script/types/2_chat.d.ts +1 -0
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_forward_header.d.ts +40 -0
- package/script/types/2_forward_header.d.ts.map +1 -0
- package/script/types/2_forward_header.js +59 -0
- package/script/types/2_inline_keyboard_button.d.ts +61 -14
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/4_message.d.ts +9 -14
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +5 -25
- package/script/types/6_update.d.ts +29 -2
- package/script/types/6_update.d.ts.map +1 -1
package/esm/client/5_client.js
CHANGED
|
@@ -28,7 +28,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
28
28
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
30
|
};
|
|
31
|
-
var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_videoChatManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_paymentManager, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_publicKeys, _Client_ignoreOutgoing, _Client_persistCache, _Client_cdn, _Client_L, _Client_LsignIn, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_reconnecting, _Client_reconnect, _Client_getApiId, _Client_getCdnConnectionPool, _Client_getCdnConnection, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectMutex, _Client_lastConnect, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_connectionInsuranceLoopStarted, _Client_connectionInsuranceLoopAbortController, _Client_startConnectionInsuranceLoop, _Client_connectionInsuranceLoop, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
31
|
+
var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_videoChatManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_paymentManager, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_publicKeys, _Client_ignoreOutgoing, _Client_persistCache, _Client_disableUpdates, _Client_authString, _Client_cdn, _Client_L, _Client_LsignIn, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_reconnecting, _Client_reconnect, _Client_getApiId, _Client_getCdnConnectionPool, _Client_getCdnConnection, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectMutex, _Client_lastConnect, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_connectionInsuranceLoopStarted, _Client_connectionInsuranceLoopAbortController, _Client_startConnectionInsuranceLoop, _Client_connectionInsuranceLoop, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_authStringImported, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
33
|
import { AccessError, ConnectionError, InputError } from "../0_errors.js";
|
|
34
34
|
import { cleanObject, drop, getLogger, getRandomId, minute, mustPrompt, mustPromptOneOf, Mutex, second, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
@@ -41,7 +41,7 @@ import { AuthKeyUnregistered, ConnectionNotInited, FloodWait, Migrate, PasswordH
|
|
|
41
41
|
import { PhoneCodeInvalid } from "../4_errors.js";
|
|
42
42
|
import { checkPassword } from "./0_password.js";
|
|
43
43
|
import { StorageOperations } from "./0_storage_operations.js";
|
|
44
|
-
import { getUsername, isMtprotoFunction, resolve } from "./0_utilities.js";
|
|
44
|
+
import { getUsername, isCdnFunction, isMtprotoFunction, resolve } from "./0_utilities.js";
|
|
45
45
|
import { ClientEncrypted } from "./1_client_encrypted.js";
|
|
46
46
|
import { ClientPlain } from "./1_client_plain.js";
|
|
47
47
|
import { Composer as Composer_ } from "./1_composer.js";
|
|
@@ -151,6 +151,8 @@ export class Client extends Composer {
|
|
|
151
151
|
_Client_publicKeys.set(this, void 0);
|
|
152
152
|
_Client_ignoreOutgoing.set(this, void 0);
|
|
153
153
|
_Client_persistCache.set(this, void 0);
|
|
154
|
+
_Client_disableUpdates.set(this, void 0);
|
|
155
|
+
_Client_authString.set(this, void 0);
|
|
154
156
|
_Client_cdn.set(this, void 0);
|
|
155
157
|
_Client_L.set(this, void 0);
|
|
156
158
|
_Client_LsignIn.set(this, void 0);
|
|
@@ -199,9 +201,9 @@ export class Client extends Composer {
|
|
|
199
201
|
}
|
|
200
202
|
unreachable();
|
|
201
203
|
};
|
|
202
|
-
const chat_ = "messageReactions" in update ? update.messageReactions.chat : "messageReactionCount" in update ? update.messageReactionCount.chat : "chatMember" in update ? update.chatMember.chat : "joinRequest" in update ? update.joinRequest.chat : undefined;
|
|
204
|
+
const chat_ = "messageReactions" in update ? update.messageReactions.chat : "messageReactionCount" in update ? update.messageReactionCount.chat : "chatMember" in update ? update.chatMember.chat : "joinRequest" in update ? update.joinRequest.chat : "story" in update ? update.story.chat : undefined;
|
|
203
205
|
const chat = chat_ ?? msg?.chat;
|
|
204
|
-
const from = "callbackQuery" in update ? update.callbackQuery.from : "inlineQuery" in update ? update.inlineQuery.from : "message" in update ? update.message.from : "editedMessage" in update ? update.editedMessage?.from : "chatMember" in update ? update.chatMember.from : "messageReactions" in update ? update.messageReactions.user : "preCheckoutQuery" in update ? update.preCheckoutQuery.from : "joinRequest" in update ? update.joinRequest.user : undefined;
|
|
206
|
+
const from = "callbackQuery" in update ? update.callbackQuery.from : "inlineQuery" in update ? update.inlineQuery.from : "message" in update ? update.message.from : "editedMessage" in update ? update.editedMessage?.from : "chatMember" in update ? update.chatMember.from : "messageReactions" in update ? update.messageReactions.user : "preCheckoutQuery" in update ? update.preCheckoutQuery.from : "joinRequest" in update ? update.joinRequest.user : "businessConnection" in update ? update.businessConnection.user : undefined;
|
|
205
207
|
const senderChat = msg?.senderChat;
|
|
206
208
|
const getReplyTo = (quote, chatId, messageId) => {
|
|
207
209
|
if ("story" in update) {
|
|
@@ -580,6 +582,7 @@ export class Client extends Composer {
|
|
|
580
582
|
},
|
|
581
583
|
})
|
|
582
584
|
});
|
|
585
|
+
_Client_authStringImported.set(this, false);
|
|
583
586
|
_Client_lastGetMe.set(this, null);
|
|
584
587
|
__classPrivateFieldSet(this, _Client_client, new ClientEncrypted(params), "f");
|
|
585
588
|
__classPrivateFieldGet(this, _Client_client, "f").stateChangeHandler = __classPrivateFieldGet(this, _Client_stateChangeHandler, "f").bind(this);
|
|
@@ -620,6 +623,8 @@ export class Client extends Composer {
|
|
|
620
623
|
this.storage = new StorageOperations(__classPrivateFieldGet(this, _Client_storage_, "f"));
|
|
621
624
|
this.messageStorage = new StorageOperations(__classPrivateFieldGet(this, _Client_messageStorage_, "f"));
|
|
622
625
|
__classPrivateFieldSet(this, _Client_parseMode, params?.parseMode ?? null, "f");
|
|
626
|
+
__classPrivateFieldSet(this, _Client_disableUpdates, params?.disableUpdates ?? false, "f");
|
|
627
|
+
__classPrivateFieldSet(this, _Client_authString, params?.authString, "f");
|
|
623
628
|
this.appVersion = params?.appVersion ?? APP_VERSION;
|
|
624
629
|
this.deviceModel = params?.deviceModel ?? DEVICE_MODEL;
|
|
625
630
|
this.langCode = params?.langCode ?? LANG_CODE;
|
|
@@ -759,6 +764,9 @@ export class Client extends Composer {
|
|
|
759
764
|
await new Promise((r) => setTimeout(r, 3 * second));
|
|
760
765
|
}
|
|
761
766
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initStorage).call(this);
|
|
767
|
+
if (__classPrivateFieldGet(this, _Client_authString, "f") && !__classPrivateFieldGet(this, _Client_authStringImported, "f")) {
|
|
768
|
+
await this.importAuthString(__classPrivateFieldGet(this, _Client_authString, "f"));
|
|
769
|
+
}
|
|
762
770
|
const [authKey, dc] = await Promise.all([this.storage.getAuthKey(), this.storage.getDc()]);
|
|
763
771
|
if (authKey != null && dc != null) {
|
|
764
772
|
await __classPrivateFieldGet(this, _Client_client, "f").setAuthKey(authKey);
|
|
@@ -796,7 +804,7 @@ export class Client extends Composer {
|
|
|
796
804
|
}
|
|
797
805
|
await __classPrivateFieldGet(this, _Client_client, "f").reconnect();
|
|
798
806
|
}
|
|
799
|
-
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_paymentManager = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_cdn = new WeakMap(), _Client_L = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_reconnecting = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_lastConnect = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_connectionInsuranceLoopStarted = new WeakMap(), _Client_connectionInsuranceLoopAbortController = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_reconnect = async function _Client_reconnect() {
|
|
807
|
+
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_paymentManager = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_disableUpdates = new WeakMap(), _Client_authString = new WeakMap(), _Client_cdn = new WeakMap(), _Client_L = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_reconnecting = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_lastConnect = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_connectionInsuranceLoopStarted = new WeakMap(), _Client_connectionInsuranceLoopAbortController = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_authStringImported = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_reconnect = async function _Client_reconnect() {
|
|
800
808
|
if (this.connected) {
|
|
801
809
|
return;
|
|
802
810
|
}
|
|
@@ -1126,8 +1134,12 @@ export class Client extends Composer {
|
|
|
1126
1134
|
return this.storage.exportAuthString(__classPrivateFieldGet(this, _Client_apiId, "f"));
|
|
1127
1135
|
}
|
|
1128
1136
|
async importAuthString(authString) {
|
|
1137
|
+
if (this.connected) {
|
|
1138
|
+
throw new Error("Cannot import auth string while the client is connected");
|
|
1139
|
+
}
|
|
1129
1140
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initStorage).call(this);
|
|
1130
1141
|
await this.storage.importAuthString(authString);
|
|
1142
|
+
__classPrivateFieldSet(this, _Client_authStringImported, true, "f");
|
|
1131
1143
|
}
|
|
1132
1144
|
/**
|
|
1133
1145
|
* Get a chat's inputPeer. Useful when calling API functions directly.
|
|
@@ -1260,6 +1272,9 @@ export class Client extends Composer {
|
|
|
1260
1272
|
let n = 1;
|
|
1261
1273
|
while (true) {
|
|
1262
1274
|
try {
|
|
1275
|
+
if (__classPrivateFieldGet(this, _Client_disableUpdates, "f") && !isMtprotoFunction(function_) && !isCdnFunction(function_)) {
|
|
1276
|
+
function_ = { _: "invokeWithoutUpdates", query: function_ };
|
|
1277
|
+
}
|
|
1263
1278
|
if (!__classPrivateFieldGet(this, _Client_connectionInited, "f") && !isMtprotoFunction(function_)) {
|
|
1264
1279
|
__classPrivateFieldSet(this, _Client_connectionInited, true, "f");
|
|
1265
1280
|
__classPrivateFieldGet(this, _Client_L, "f").debug("init");
|
|
@@ -2556,6 +2571,9 @@ export class Client extends Composer {
|
|
|
2556
2571
|
}
|
|
2557
2572
|
}
|
|
2558
2573
|
_a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
2574
|
+
if (__classPrivateFieldGet(this, _Client_disableUpdates, "f") && !("authorizationState" in update) && !("connectionState" in update)) {
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2559
2577
|
try {
|
|
2560
2578
|
await this.middleware()(await __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, update), resolve);
|
|
2561
2579
|
}
|
|
@@ -2580,51 +2598,56 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
2580
2598
|
}
|
|
2581
2599
|
}
|
|
2582
2600
|
if (MessageManager.canHandleUpdate(update)) {
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2601
|
+
promises.push(async () => {
|
|
2602
|
+
const update_ = await __classPrivateFieldGet(this, _Client_messageManager, "f").handleUpdate(update);
|
|
2603
|
+
if (!update_) {
|
|
2604
|
+
return;
|
|
2605
|
+
}
|
|
2606
|
+
try {
|
|
2607
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, update_);
|
|
2608
|
+
}
|
|
2609
|
+
finally {
|
|
2610
|
+
if ("deletedMessages" in update_) {
|
|
2611
|
+
for (const { chatId, messageId } of update_.deletedMessages) {
|
|
2612
|
+
await this.messageStorage.setMessage(chatId, messageId, null);
|
|
2613
|
+
await __classPrivateFieldGet(this, _Client_chatListManager, "f").reassignChatLastMessage(chatId);
|
|
2595
2614
|
}
|
|
2596
2615
|
}
|
|
2597
|
-
}
|
|
2598
|
-
}
|
|
2616
|
+
}
|
|
2617
|
+
});
|
|
2599
2618
|
}
|
|
2600
2619
|
if (VideoChatManager.canHandleUpdate(update)) {
|
|
2601
|
-
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_videoChatManager, "f").handleUpdate(update)));
|
|
2620
|
+
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_videoChatManager, "f").handleUpdate(update)));
|
|
2602
2621
|
}
|
|
2603
2622
|
if (CallbackQueryManager.canHandleUpdate(update)) {
|
|
2604
|
-
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").handleUpdate(update)));
|
|
2623
|
+
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").handleUpdate(update)));
|
|
2605
2624
|
}
|
|
2606
2625
|
if (InlineQueryManager.canHandleUpdate(update)) {
|
|
2607
|
-
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").handleUpdate(update)));
|
|
2626
|
+
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").handleUpdate(update)));
|
|
2608
2627
|
}
|
|
2609
2628
|
if (ReactionManager.canHandleUpdate(update)) {
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2629
|
+
promises.push(async () => {
|
|
2630
|
+
const upd = await __classPrivateFieldGet(this, _Client_reactionManager, "f").handleUpdate(update);
|
|
2631
|
+
if (upd) {
|
|
2632
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd);
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2614
2635
|
}
|
|
2615
2636
|
if (ChatListManager.canHandleUpdate(update)) {
|
|
2616
|
-
|
|
2637
|
+
promises.push(() => __classPrivateFieldGet(this, _Client_chatListManager, "f").handleUpdate(update));
|
|
2617
2638
|
}
|
|
2618
2639
|
if (StoryManager.canHandleUpdate(update)) {
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2640
|
+
promises.push(async () => {
|
|
2641
|
+
const upd = await __classPrivateFieldGet(this, _Client_storyManager, "f").handleUpdate(update);
|
|
2642
|
+
if (upd) {
|
|
2643
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd);
|
|
2644
|
+
}
|
|
2645
|
+
});
|
|
2623
2646
|
}
|
|
2624
2647
|
if (BusinessConnectionManager.canHandleUpdate(update)) {
|
|
2625
|
-
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
|
|
2648
|
+
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
|
|
2626
2649
|
}
|
|
2627
|
-
return () => Promise.all(promises);
|
|
2650
|
+
return () => Promise.all(promises.map((v) => v()));
|
|
2628
2651
|
}, _Client_getMe = async function _Client_getMe() {
|
|
2629
2652
|
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
|
|
2630
2653
|
return __classPrivateFieldGet(this, _Client_lastGetMe, "f");
|