@mtkruto/node 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/3_types.d.ts +4 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +4 -0
- package/esm/client/0_params.d.ts +16 -2
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_update_processor.d.ts +7 -0
- package/esm/client/0_update_processor.d.ts.map +1 -0
- package/esm/client/0_update_processor.js +1 -0
- package/esm/client/2_business_connection_manager.d.ts +3 -2
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +1 -1
- package/esm/client/2_gift_manager.d.ts +29 -0
- package/esm/client/2_gift_manager.d.ts.map +1 -0
- package/esm/client/2_gift_manager.js +62 -0
- package/esm/client/2_payment_manager.d.ts +3 -2
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +1 -1
- package/esm/client/2_reaction_manager.d.ts +3 -2
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +1 -1
- package/esm/client/2_translations_manager.d.ts +3 -2
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +1 -1
- package/esm/client/3_message_manager.d.ts +8 -25
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +26 -238
- package/esm/client/3_video_chat_manager.d.ts +3 -2
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +1 -1
- package/esm/client/4_callback_query_manager.d.ts +3 -2
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +1 -1
- package/esm/client/4_chat_list_manager.d.ts +4 -3
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +2 -1
- package/esm/client/4_chat_manager.d.ts +61 -0
- package/esm/client/4_chat_manager.d.ts.map +1 -0
- package/esm/client/4_chat_manager.js +293 -0
- package/esm/client/4_inline_query_manager.d.ts +3 -2
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +1 -1
- package/esm/client/4_poll_manager.d.ts +3 -2
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +1 -1
- package/esm/client/4_story_manager.d.ts +3 -2
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +1 -1
- package/esm/client/5_client.d.ts +33 -6
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +163 -71
- package/esm/types/1_sticker.d.ts +1 -0
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +6 -2
- package/esm/types/2_gift_upgraded_component.d.ts +95 -0
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/esm/types/2_gift_upgraded_component.js +88 -0
- package/esm/types/3_gift.d.ts +84 -0
- package/esm/types/3_gift.d.ts.map +1 -0
- package/esm/types/3_gift.js +90 -0
- package/esm/types/4_user_gift.d.ts +44 -0
- package/esm/types/4_user_gift.d.ts.map +1 -0
- package/esm/types/4_user_gift.js +43 -0
- package/esm/types/5_user_gifts.d.ts +32 -0
- package/esm/types/5_user_gifts.d.ts.map +1 -0
- package/esm/types/5_user_gifts.js +29 -0
- package/package.json +1 -1
- package/script/3_types.d.ts +4 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +4 -0
- package/script/client/0_params.d.ts +16 -2
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_update_processor.d.ts +7 -0
- package/script/client/0_update_processor.d.ts.map +1 -0
- package/script/client/0_update_processor.js +2 -0
- package/script/client/2_business_connection_manager.d.ts +3 -2
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +1 -1
- package/script/client/2_gift_manager.d.ts +29 -0
- package/script/client/2_gift_manager.d.ts.map +1 -0
- package/script/client/2_gift_manager.js +66 -0
- package/script/client/2_payment_manager.d.ts +3 -2
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +1 -1
- package/script/client/2_reaction_manager.d.ts +3 -2
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +1 -1
- package/script/client/2_translations_manager.d.ts +3 -2
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +1 -1
- package/script/client/3_message_manager.d.ts +8 -25
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +23 -235
- package/script/client/3_video_chat_manager.d.ts +3 -2
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +1 -1
- package/script/client/4_callback_query_manager.d.ts +3 -2
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_list_manager.d.ts +4 -3
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +2 -1
- package/script/client/4_chat_manager.d.ts +61 -0
- package/script/client/4_chat_manager.d.ts.map +1 -0
- package/script/client/4_chat_manager.js +297 -0
- package/script/client/4_inline_query_manager.d.ts +3 -2
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +1 -1
- package/script/client/4_poll_manager.d.ts +3 -2
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +1 -1
- package/script/client/4_story_manager.d.ts +3 -2
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +1 -1
- package/script/client/5_client.d.ts +33 -6
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +163 -71
- package/script/types/1_sticker.d.ts +1 -0
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +7 -2
- package/script/types/2_gift_upgraded_component.d.ts +95 -0
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/script/types/2_gift_upgraded_component.js +91 -0
- package/script/types/3_gift.d.ts +84 -0
- package/script/types/3_gift.d.ts.map +1 -0
- package/script/types/3_gift.js +95 -0
- package/script/types/4_user_gift.d.ts +44 -0
- package/script/types/4_user_gift.d.ts.map +1 -0
- package/script/types/4_user_gift.js +46 -0
- package/script/types/5_user_gifts.d.ts +32 -0
- package/script/types/5_user_gifts.d.ts.map +1 -0
- package/script/types/5_user_gifts.js +32 -0
package/esm/client/5_client.js
CHANGED
|
@@ -28,7 +28,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
28
28
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
29
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
30
|
};
|
|
31
|
-
var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery,
|
|
31
|
+
var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery, _Client_accountManager, _Client_botInfoManager, _Client_businessConnectionManager, _Client_fileManager, _Client_giftManager, _Client_networkStatisticsManager, _Client_paymentManager, _Client_reactionManager, _Client_translationsManager, _Client_updateManager, _Client_messageManager, _Client_videoChatManager, _Client_callbackQueryManager, _Client_chatListManager, _Client_chatManager, _Client_inlineQueryManager, _Client_pollManager, _Client_storyManager, _Client_managers, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_publicKeys, _Client_outgoingMessages, _Client_persistCache, _Client_disableUpdates, _Client_authString, _Client_cdn, _Client_L, _Client_LsignIn, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_Lmin, _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_getInputPeerChatId, _Client_getInputPeerInner, _Client_getMinInputPeer, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
32
32
|
import { MINUTE, SECOND, unreachable } from "../0_deps.js";
|
|
33
33
|
import { AccessError, ConnectionError, InputError } from "../0_errors.js";
|
|
34
34
|
import { cleanObject, drop, getLogger, getRandomId, mustPrompt, mustPromptOneOf, Mutex, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
@@ -49,6 +49,7 @@ import { AccountManager } from "./2_account_manager.js";
|
|
|
49
49
|
import { BotInfoManager } from "./2_bot_info_manager.js";
|
|
50
50
|
import { BusinessConnectionManager } from "./2_business_connection_manager.js";
|
|
51
51
|
import { FileManager } from "./2_file_manager.js";
|
|
52
|
+
import { GiftManager } from "./2_gift_manager.js";
|
|
52
53
|
import { NetworkStatisticsManager } from "./2_network_statistics_manager.js";
|
|
53
54
|
import { PaymentManager } from "./2_payment_manager.js";
|
|
54
55
|
import { ReactionManager } from "./2_reaction_manager.js";
|
|
@@ -58,6 +59,7 @@ import { MessageManager } from "./3_message_manager.js";
|
|
|
58
59
|
import { VideoChatManager } from "./3_video_chat_manager.js";
|
|
59
60
|
import { CallbackQueryManager } from "./4_callback_query_manager.js";
|
|
60
61
|
import { ChatListManager } from "./4_chat_list_manager.js";
|
|
62
|
+
import { ChatManager } from "./4_chat_manager.js";
|
|
61
63
|
import { InlineQueryManager } from "./4_inline_query_manager.js";
|
|
62
64
|
import { PollManager } from "./4_poll_manager.js";
|
|
63
65
|
import { StoryManager } from "./4_story_manager.js";
|
|
@@ -78,21 +80,25 @@ export class Client extends Composer {
|
|
|
78
80
|
// deno-lint-ignore no-explicit-any
|
|
79
81
|
get managers() {
|
|
80
82
|
return __classPrivateFieldGet(this, _Client_managers, "f") ?? (__classPrivateFieldSet(this, _Client_managers, __classPrivateFieldGet(this, _Client_managers, "f") ?? {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
// 2_
|
|
84
|
+
accountManager: __classPrivateFieldGet(this, _Client_accountManager, "f"),
|
|
83
85
|
botInfoManager: __classPrivateFieldGet(this, _Client_botInfoManager, "f"),
|
|
86
|
+
businessConnectionManager: __classPrivateFieldGet(this, _Client_businessConnectionManager, "f"),
|
|
84
87
|
fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"),
|
|
88
|
+
giftManager: __classPrivateFieldGet(this, _Client_giftManager, "f"),
|
|
89
|
+
networkStatisticsManager: __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f"),
|
|
90
|
+
paymentManager: __classPrivateFieldGet(this, _Client_paymentManager, "f"),
|
|
85
91
|
reactionManager: __classPrivateFieldGet(this, _Client_reactionManager, "f"),
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
translationsManager: __classPrivateFieldGet(this, _Client_translationsManager, "f"),
|
|
93
|
+
updateManager: __classPrivateFieldGet(this, _Client_updateManager, "f"),
|
|
94
|
+
// 3_
|
|
88
95
|
messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f"),
|
|
89
|
-
|
|
96
|
+
videoChatManager: __classPrivateFieldGet(this, _Client_videoChatManager, "f"),
|
|
97
|
+
// 4_
|
|
90
98
|
callbackQueryManager: __classPrivateFieldGet(this, _Client_callbackQueryManager, "f"),
|
|
91
|
-
inlineQueryManager: __classPrivateFieldGet(this, _Client_inlineQueryManager, "f"),
|
|
92
99
|
chatListManager: __classPrivateFieldGet(this, _Client_chatListManager, "f"),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
translationsManager: __classPrivateFieldGet(this, _Client_translationsManager, "f"),
|
|
100
|
+
inlineQueryManager: __classPrivateFieldGet(this, _Client_inlineQueryManager, "f"),
|
|
101
|
+
storyManager: __classPrivateFieldGet(this, _Client_storyManager, "f"),
|
|
96
102
|
}, "f"));
|
|
97
103
|
}
|
|
98
104
|
/**
|
|
@@ -103,22 +109,27 @@ export class Client extends Composer {
|
|
|
103
109
|
_Client_instances.add(this);
|
|
104
110
|
_Client_client.set(this, void 0);
|
|
105
111
|
_Client_guaranteeUpdateDelivery.set(this, void 0);
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
// 2_
|
|
113
|
+
_Client_accountManager.set(this, void 0);
|
|
108
114
|
_Client_botInfoManager.set(this, void 0);
|
|
115
|
+
_Client_businessConnectionManager.set(this, void 0);
|
|
109
116
|
_Client_fileManager.set(this, void 0);
|
|
117
|
+
_Client_giftManager.set(this, void 0);
|
|
118
|
+
_Client_networkStatisticsManager.set(this, void 0);
|
|
119
|
+
_Client_paymentManager.set(this, void 0);
|
|
110
120
|
_Client_reactionManager.set(this, void 0);
|
|
111
|
-
|
|
112
|
-
|
|
121
|
+
_Client_translationsManager.set(this, void 0);
|
|
122
|
+
_Client_updateManager.set(this, void 0);
|
|
123
|
+
// 3_
|
|
113
124
|
_Client_messageManager.set(this, void 0);
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
_Client_videoChatManager.set(this, void 0);
|
|
126
|
+
// 4_
|
|
116
127
|
_Client_callbackQueryManager.set(this, void 0);
|
|
117
|
-
_Client_inlineQueryManager.set(this, void 0);
|
|
118
128
|
_Client_chatListManager.set(this, void 0);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
_Client_chatManager.set(this, void 0);
|
|
130
|
+
_Client_inlineQueryManager.set(this, void 0);
|
|
131
|
+
_Client_pollManager.set(this, void 0);
|
|
132
|
+
_Client_storyManager.set(this, void 0);
|
|
122
133
|
// deno-lint-ignore no-explicit-any
|
|
123
134
|
_Client_managers.set(this, void 0);
|
|
124
135
|
_Client_storage_.set(this, void 0);
|
|
@@ -397,6 +408,14 @@ export class Client extends Composer {
|
|
|
397
408
|
const inlineMessageId = mustGetInlineMsgId();
|
|
398
409
|
return this.editInlineMessageText(inlineMessageId, text, params);
|
|
399
410
|
},
|
|
411
|
+
editInlineMessageMedia: (media, params) => {
|
|
412
|
+
const inlineMessageId = mustGetInlineMsgId();
|
|
413
|
+
return this.editInlineMessageMedia(inlineMessageId, media, params);
|
|
414
|
+
},
|
|
415
|
+
editInlineMessageCaption: (params) => {
|
|
416
|
+
const inlineMessageId = mustGetInlineMsgId();
|
|
417
|
+
return this.editInlineMessageCaption(inlineMessageId, params);
|
|
418
|
+
},
|
|
400
419
|
editInlineMessageLiveLocation: (latitude, longitude, params) => {
|
|
401
420
|
const inlineMessageId = mustGetInlineMsgId();
|
|
402
421
|
return this.editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params);
|
|
@@ -409,6 +428,14 @@ export class Client extends Composer {
|
|
|
409
428
|
const { chatId } = mustGetMsg();
|
|
410
429
|
return this.editMessageText(chatId, messageId, text, params);
|
|
411
430
|
},
|
|
431
|
+
editMessageCaption: (messageId, params) => {
|
|
432
|
+
const { chatId } = mustGetMsg();
|
|
433
|
+
return this.editMessageCaption(chatId, messageId, params);
|
|
434
|
+
},
|
|
435
|
+
editMessageMedia: (messageId, media, params) => {
|
|
436
|
+
const { chatId } = mustGetMsg();
|
|
437
|
+
return this.editMessageMedia(chatId, messageId, media, params);
|
|
438
|
+
},
|
|
412
439
|
editMessageLiveLocation: (messageId, latitude, longitude, params) => {
|
|
413
440
|
const { chatId } = mustGetMsg();
|
|
414
441
|
return this.editMessageLiveLocation(chatId, messageId, latitude, longitude, params);
|
|
@@ -711,22 +738,27 @@ export class Client extends Composer {
|
|
|
711
738
|
langPack: this.platform,
|
|
712
739
|
langCode: this.language,
|
|
713
740
|
};
|
|
714
|
-
|
|
715
|
-
__classPrivateFieldSet(this,
|
|
741
|
+
// 2_
|
|
742
|
+
__classPrivateFieldSet(this, _Client_accountManager, new AccountManager(c), "f");
|
|
716
743
|
__classPrivateFieldSet(this, _Client_botInfoManager, new BotInfoManager(c), "f");
|
|
717
|
-
__classPrivateFieldSet(this, _Client_fileManager, new FileManager(c), "f");
|
|
718
|
-
__classPrivateFieldSet(this, _Client_reactionManager, new ReactionManager(c), "f");
|
|
719
744
|
__classPrivateFieldSet(this, _Client_businessConnectionManager, new BusinessConnectionManager(c), "f");
|
|
720
|
-
__classPrivateFieldSet(this,
|
|
721
|
-
__classPrivateFieldSet(this,
|
|
722
|
-
__classPrivateFieldSet(this,
|
|
723
|
-
__classPrivateFieldSet(this, _Client_pollManager, new PollManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
724
|
-
__classPrivateFieldSet(this, _Client_storyManager, new StoryManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
725
|
-
__classPrivateFieldSet(this, _Client_inlineQueryManager, new InlineQueryManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
726
|
-
__classPrivateFieldSet(this, _Client_chatListManager, new ChatListManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
727
|
-
__classPrivateFieldSet(this, _Client_accountManager, new AccountManager(c), "f");
|
|
745
|
+
const fileManager = __classPrivateFieldSet(this, _Client_fileManager, new FileManager(c), "f");
|
|
746
|
+
__classPrivateFieldSet(this, _Client_giftManager, new GiftManager(c), "f");
|
|
747
|
+
__classPrivateFieldSet(this, _Client_networkStatisticsManager, new NetworkStatisticsManager(c), "f");
|
|
728
748
|
__classPrivateFieldSet(this, _Client_paymentManager, new PaymentManager(c), "f");
|
|
749
|
+
__classPrivateFieldSet(this, _Client_reactionManager, new ReactionManager(c), "f");
|
|
729
750
|
__classPrivateFieldSet(this, _Client_translationsManager, new TranslationsManager(c), "f");
|
|
751
|
+
__classPrivateFieldSet(this, _Client_updateManager, new UpdateManager(c), "f");
|
|
752
|
+
// 3_
|
|
753
|
+
const messageManager = __classPrivateFieldSet(this, _Client_messageManager, new MessageManager({ ...c, fileManager }), "f");
|
|
754
|
+
__classPrivateFieldSet(this, _Client_videoChatManager, new VideoChatManager({ ...c, fileManager }), "f");
|
|
755
|
+
// 4_
|
|
756
|
+
__classPrivateFieldSet(this, _Client_callbackQueryManager, new CallbackQueryManager({ ...c, messageManager }), "f");
|
|
757
|
+
__classPrivateFieldSet(this, _Client_chatListManager, new ChatListManager({ ...c, fileManager, messageManager }), "f");
|
|
758
|
+
__classPrivateFieldSet(this, _Client_chatManager, new ChatManager({ ...c, fileManager, messageManager }), "f");
|
|
759
|
+
__classPrivateFieldSet(this, _Client_inlineQueryManager, new InlineQueryManager({ ...c, messageManager }), "f");
|
|
760
|
+
__classPrivateFieldSet(this, _Client_pollManager, new PollManager({ ...c, messageManager }), "f");
|
|
761
|
+
__classPrivateFieldSet(this, _Client_storyManager, new StoryManager({ ...c, fileManager, messageManager }), "f");
|
|
730
762
|
__classPrivateFieldGet(this, _Client_updateManager, "f").setUpdateHandler(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleUpdate).bind(this));
|
|
731
763
|
const transportProvider = __classPrivateFieldGet(this, _Client_client, "f").transportProvider;
|
|
732
764
|
__classPrivateFieldGet(this, _Client_client, "f").transportProvider = (params) => {
|
|
@@ -846,7 +878,7 @@ export class Client extends Composer {
|
|
|
846
878
|
}
|
|
847
879
|
await __classPrivateFieldGet(this, _Client_client, "f").reconnect();
|
|
848
880
|
}
|
|
849
|
-
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(),
|
|
881
|
+
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_giftManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_paymentManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_translationsManager = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_chatManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_pollManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_managers = 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_outgoingMessages = 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_Lmin = 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() {
|
|
850
882
|
if (this.connected) {
|
|
851
883
|
return;
|
|
852
884
|
}
|
|
@@ -1820,6 +1852,15 @@ export class Client extends Composer {
|
|
|
1820
1852
|
async editInlineMessageText(inlineMessageId, text, params) {
|
|
1821
1853
|
await __classPrivateFieldGet(this, _Client_messageManager, "f").editInlineMessageText(inlineMessageId, text, params);
|
|
1822
1854
|
}
|
|
1855
|
+
/**
|
|
1856
|
+
* Edit an inline message's caption. Bot-only.
|
|
1857
|
+
*
|
|
1858
|
+
* @method ms
|
|
1859
|
+
* @param inlineMessageId The inline message's identifier.
|
|
1860
|
+
*/
|
|
1861
|
+
async editInlineMessageCaption(inlineMessageId, params) {
|
|
1862
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").editInlineMessageCaption(inlineMessageId, params);
|
|
1863
|
+
}
|
|
1823
1864
|
/**
|
|
1824
1865
|
* Edit a message's reply markup.
|
|
1825
1866
|
*
|
|
@@ -2158,7 +2199,7 @@ export class Client extends Composer {
|
|
|
2158
2199
|
* @param availableReactions The new available reactions.
|
|
2159
2200
|
*/
|
|
2160
2201
|
async setAvailableReactions(chatId, availableReactions) {
|
|
2161
|
-
await __classPrivateFieldGet(this,
|
|
2202
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").setAvailableReactions(chatId, availableReactions);
|
|
2162
2203
|
}
|
|
2163
2204
|
/**
|
|
2164
2205
|
* Set a chat's photo.
|
|
@@ -2168,7 +2209,7 @@ export class Client extends Composer {
|
|
|
2168
2209
|
* @param photo A photo to set as the chat's photo.
|
|
2169
2210
|
*/
|
|
2170
2211
|
async setChatPhoto(chatId, photo, params) {
|
|
2171
|
-
await __classPrivateFieldGet(this,
|
|
2212
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").setChatPhoto(chatId, photo, params);
|
|
2172
2213
|
}
|
|
2173
2214
|
/**
|
|
2174
2215
|
* Delete a chat's photo.
|
|
@@ -2177,7 +2218,7 @@ export class Client extends Composer {
|
|
|
2177
2218
|
* @param chatId The identifier of the chat.
|
|
2178
2219
|
*/
|
|
2179
2220
|
async deleteChatPhoto(chatId) {
|
|
2180
|
-
await __classPrivateFieldGet(this,
|
|
2221
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").deleteChatPhoto(chatId);
|
|
2181
2222
|
}
|
|
2182
2223
|
/**
|
|
2183
2224
|
* Ban a member from a chat.
|
|
@@ -2187,7 +2228,7 @@ export class Client extends Composer {
|
|
|
2187
2228
|
* @param memberId The identifier of the member.
|
|
2188
2229
|
*/
|
|
2189
2230
|
async banChatMember(chatId, memberId, params) {
|
|
2190
|
-
await __classPrivateFieldGet(this,
|
|
2231
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").banChatMember(chatId, memberId, params);
|
|
2191
2232
|
}
|
|
2192
2233
|
/**
|
|
2193
2234
|
* Unban a member from a chat.
|
|
@@ -2197,7 +2238,7 @@ export class Client extends Composer {
|
|
|
2197
2238
|
* @param memberId The identifier of the member.
|
|
2198
2239
|
*/
|
|
2199
2240
|
async unbanChatMember(chatId, memberId) {
|
|
2200
|
-
await __classPrivateFieldGet(this,
|
|
2241
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").unbanChatMember(chatId, memberId);
|
|
2201
2242
|
}
|
|
2202
2243
|
/**
|
|
2203
2244
|
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
@@ -2207,8 +2248,8 @@ export class Client extends Composer {
|
|
|
2207
2248
|
* @param memberId The identifier of the member.
|
|
2208
2249
|
*/
|
|
2209
2250
|
async kickChatMember(chatId, memberId) {
|
|
2210
|
-
await __classPrivateFieldGet(this,
|
|
2211
|
-
await __classPrivateFieldGet(this,
|
|
2251
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").banChatMember(chatId, memberId);
|
|
2252
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").unbanChatMember(chatId, memberId);
|
|
2212
2253
|
}
|
|
2213
2254
|
/**
|
|
2214
2255
|
* Set the rights of a chat member.
|
|
@@ -2218,7 +2259,7 @@ export class Client extends Composer {
|
|
|
2218
2259
|
* @param memberId The identifier of a member.
|
|
2219
2260
|
*/
|
|
2220
2261
|
async setChatMemberRights(chatId, memberId, params) {
|
|
2221
|
-
await __classPrivateFieldGet(this,
|
|
2262
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").setChatMemberRights(chatId, memberId, params);
|
|
2222
2263
|
}
|
|
2223
2264
|
/**
|
|
2224
2265
|
* Get the administrators of a chat.
|
|
@@ -2237,7 +2278,7 @@ export class Client extends Composer {
|
|
|
2237
2278
|
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
2238
2279
|
*/
|
|
2239
2280
|
async enableJoinRequests(chatId) {
|
|
2240
|
-
await __classPrivateFieldGet(this,
|
|
2281
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").enableJoinRequests(chatId);
|
|
2241
2282
|
}
|
|
2242
2283
|
/**
|
|
2243
2284
|
* Disable join requests in a chat. User-only.
|
|
@@ -2246,7 +2287,7 @@ export class Client extends Composer {
|
|
|
2246
2287
|
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
2247
2288
|
*/
|
|
2248
2289
|
async disableJoinRequests(chatId) {
|
|
2249
|
-
await __classPrivateFieldGet(this,
|
|
2290
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").disableJoinRequests(chatId);
|
|
2250
2291
|
}
|
|
2251
2292
|
/**
|
|
2252
2293
|
* Get inactive chats. User-only.
|
|
@@ -2265,7 +2306,7 @@ export class Client extends Composer {
|
|
|
2265
2306
|
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
2266
2307
|
*/
|
|
2267
2308
|
async getCreatedInviteLinks(chatId, params) {
|
|
2268
|
-
return await __classPrivateFieldGet(this,
|
|
2309
|
+
return await __classPrivateFieldGet(this, _Client_chatManager, "f").getCreatedInviteLinks(chatId, params);
|
|
2269
2310
|
}
|
|
2270
2311
|
/**
|
|
2271
2312
|
* Join a chat. User-only.
|
|
@@ -2274,7 +2315,7 @@ export class Client extends Composer {
|
|
|
2274
2315
|
* @param chatId The identifier of the chat to join.
|
|
2275
2316
|
*/
|
|
2276
2317
|
async joinChat(chatId) {
|
|
2277
|
-
await __classPrivateFieldGet(this,
|
|
2318
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").joinChat(chatId);
|
|
2278
2319
|
}
|
|
2279
2320
|
/**
|
|
2280
2321
|
* Leave a chat.
|
|
@@ -2283,7 +2324,7 @@ export class Client extends Composer {
|
|
|
2283
2324
|
* @param chatId The identifier of the chat to leave.
|
|
2284
2325
|
*/
|
|
2285
2326
|
async leaveChat(chatId) {
|
|
2286
|
-
await __classPrivateFieldGet(this,
|
|
2327
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").leaveChat(chatId);
|
|
2287
2328
|
}
|
|
2288
2329
|
/**
|
|
2289
2330
|
* Get information on a user's chat membership.
|
|
@@ -2331,7 +2372,7 @@ export class Client extends Composer {
|
|
|
2331
2372
|
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
2332
2373
|
*/
|
|
2333
2374
|
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
2334
|
-
await __classPrivateFieldGet(this,
|
|
2375
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
2335
2376
|
}
|
|
2336
2377
|
/**
|
|
2337
2378
|
* Create an invite link.
|
|
@@ -2341,7 +2382,7 @@ export class Client extends Composer {
|
|
|
2341
2382
|
* @returns The newly created invite link.
|
|
2342
2383
|
*/
|
|
2343
2384
|
async createInviteLink(chatId, params) {
|
|
2344
|
-
return await __classPrivateFieldGet(this,
|
|
2385
|
+
return await __classPrivateFieldGet(this, _Client_chatManager, "f").createInviteLink(chatId, params);
|
|
2345
2386
|
}
|
|
2346
2387
|
/**
|
|
2347
2388
|
* Approve a join request.
|
|
@@ -2351,7 +2392,7 @@ export class Client extends Composer {
|
|
|
2351
2392
|
* @param userId The user who made the join request.
|
|
2352
2393
|
*/
|
|
2353
2394
|
async approveJoinRequest(chatId, userId) {
|
|
2354
|
-
await __classPrivateFieldGet(this,
|
|
2395
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").approveJoinRequest(chatId, userId);
|
|
2355
2396
|
}
|
|
2356
2397
|
/**
|
|
2357
2398
|
* Decline a join request.
|
|
@@ -2361,7 +2402,7 @@ export class Client extends Composer {
|
|
|
2361
2402
|
* @param userId The user who made the join request.
|
|
2362
2403
|
*/
|
|
2363
2404
|
async declineJoinRequest(chatId, userId) {
|
|
2364
|
-
await __classPrivateFieldGet(this,
|
|
2405
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").declineJoinRequest(chatId, userId);
|
|
2365
2406
|
}
|
|
2366
2407
|
/**
|
|
2367
2408
|
* Approve all join requests. User-only.
|
|
@@ -2370,7 +2411,7 @@ export class Client extends Composer {
|
|
|
2370
2411
|
* @param chatId The identifier of the chat that contains the join requests.
|
|
2371
2412
|
*/
|
|
2372
2413
|
async approveJoinRequests(chatId, params) {
|
|
2373
|
-
await __classPrivateFieldGet(this,
|
|
2414
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").approveJoinRequests(chatId, params);
|
|
2374
2415
|
}
|
|
2375
2416
|
/**
|
|
2376
2417
|
* Decline all join requests. User-only.
|
|
@@ -2379,7 +2420,7 @@ export class Client extends Composer {
|
|
|
2379
2420
|
* @param chatId The identifier of the chat that contains the join requests.
|
|
2380
2421
|
*/
|
|
2381
2422
|
async declineJoinRequests(chatId, params) {
|
|
2382
|
-
await __classPrivateFieldGet(this,
|
|
2423
|
+
await __classPrivateFieldGet(this, _Client_chatManager, "f").declineJoinRequests(chatId, params);
|
|
2383
2424
|
}
|
|
2384
2425
|
/**
|
|
2385
2426
|
* Add a single user to a chat.
|
|
@@ -2390,7 +2431,7 @@ export class Client extends Composer {
|
|
|
2390
2431
|
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
2391
2432
|
*/
|
|
2392
2433
|
async addChatMember(chatId, userId, params) {
|
|
2393
|
-
return await __classPrivateFieldGet(this,
|
|
2434
|
+
return await __classPrivateFieldGet(this, _Client_chatManager, "f").addChatMember(chatId, userId, params);
|
|
2394
2435
|
}
|
|
2395
2436
|
/**
|
|
2396
2437
|
* Add multiple users at once to a channel or a supergroup.
|
|
@@ -2400,7 +2441,7 @@ export class Client extends Composer {
|
|
|
2400
2441
|
* @param userId The identifiers of the users to add to the channel or supergroup.
|
|
2401
2442
|
*/
|
|
2402
2443
|
async addChatMembers(chatId, userIds) {
|
|
2403
|
-
return await __classPrivateFieldGet(this,
|
|
2444
|
+
return await __classPrivateFieldGet(this, _Client_chatManager, "f").addChatMembers(chatId, userIds);
|
|
2404
2445
|
}
|
|
2405
2446
|
/**
|
|
2406
2447
|
* Open a chat. User-only.
|
|
@@ -2942,6 +2983,25 @@ export class Client extends Composer {
|
|
|
2942
2983
|
async getTranslations(params) {
|
|
2943
2984
|
return await __classPrivateFieldGet(this, _Client_translationsManager, "f").getTranslations(params);
|
|
2944
2985
|
}
|
|
2986
|
+
//
|
|
2987
|
+
// ========================= GIFTS ========================= //
|
|
2988
|
+
//
|
|
2989
|
+
/**
|
|
2990
|
+
* Get available gifts.
|
|
2991
|
+
*
|
|
2992
|
+
* @method gf
|
|
2993
|
+
*/
|
|
2994
|
+
async getGifts() {
|
|
2995
|
+
return await __classPrivateFieldGet(this, _Client_giftManager, "f").getGifts();
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Get gifts claimed by a specific user. User-only.
|
|
2999
|
+
*
|
|
3000
|
+
* @method gf
|
|
3001
|
+
*/
|
|
3002
|
+
async getUserGifts(userId, params) {
|
|
3003
|
+
return await __classPrivateFieldGet(this, _Client_giftManager, "f").getUserGifts(userId, params);
|
|
3004
|
+
}
|
|
2945
3005
|
}
|
|
2946
3006
|
_a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
2947
3007
|
if (__classPrivateFieldGet(this, _Client_disableUpdates, "f") && !("authorizationState" in update) && !("connectionState" in update)) {
|
|
@@ -2970,18 +3030,18 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
2970
3030
|
await this.messageStorage.setEntity(entity);
|
|
2971
3031
|
}
|
|
2972
3032
|
}
|
|
2973
|
-
if (
|
|
3033
|
+
if (__classPrivateFieldGet(this, _Client_messageManager, "f").canHandleUpdate(update)) {
|
|
2974
3034
|
promises.push(async () => {
|
|
2975
|
-
const
|
|
2976
|
-
if (!
|
|
3035
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_messageManager, "f").handleUpdate(update);
|
|
3036
|
+
if (!ctxUpdate) {
|
|
2977
3037
|
return;
|
|
2978
3038
|
}
|
|
2979
3039
|
try {
|
|
2980
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this,
|
|
3040
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
2981
3041
|
}
|
|
2982
3042
|
finally {
|
|
2983
|
-
if ("deletedMessages" in
|
|
2984
|
-
for (const { chatId, messageId } of
|
|
3043
|
+
if ("deletedMessages" in ctxUpdate) {
|
|
3044
|
+
for (const { chatId, messageId } of ctxUpdate.deletedMessages) {
|
|
2985
3045
|
await this.messageStorage.setMessage(chatId, messageId, null);
|
|
2986
3046
|
await __classPrivateFieldGet(this, _Client_chatListManager, "f").reassignChatLastMessage(chatId);
|
|
2987
3047
|
}
|
|
@@ -2989,7 +3049,15 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
2989
3049
|
}
|
|
2990
3050
|
});
|
|
2991
3051
|
}
|
|
2992
|
-
if (
|
|
3052
|
+
if (__classPrivateFieldGet(this, _Client_chatManager, "f").canHandleUpdate(update)) {
|
|
3053
|
+
promises.push(async () => {
|
|
3054
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_chatManager, "f").handleUpdate(update);
|
|
3055
|
+
if (ctxUpdate) {
|
|
3056
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
3057
|
+
}
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
if (__classPrivateFieldGet(this, _Client_pollManager, "f").canHandleUpdate(update)) {
|
|
2993
3061
|
promises.push(async () => {
|
|
2994
3062
|
const ctxUpdate = await __classPrivateFieldGet(this, _Client_pollManager, "f").handleUpdate(update);
|
|
2995
3063
|
if (ctxUpdate) {
|
|
@@ -2997,7 +3065,7 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
2997
3065
|
}
|
|
2998
3066
|
});
|
|
2999
3067
|
}
|
|
3000
|
-
if (
|
|
3068
|
+
if (__classPrivateFieldGet(this, _Client_videoChatManager, "f").canHandleUpdate(update)) {
|
|
3001
3069
|
promises.push(async () => {
|
|
3002
3070
|
const ctxUpdate = await __classPrivateFieldGet(this, _Client_videoChatManager, "f").handleUpdate(update);
|
|
3003
3071
|
if (ctxUpdate) {
|
|
@@ -3005,13 +3073,13 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
3005
3073
|
}
|
|
3006
3074
|
});
|
|
3007
3075
|
}
|
|
3008
|
-
if (
|
|
3076
|
+
if (__classPrivateFieldGet(this, _Client_callbackQueryManager, "f").canHandleUpdate(update)) {
|
|
3009
3077
|
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").handleUpdate(update)));
|
|
3010
3078
|
}
|
|
3011
|
-
if (
|
|
3079
|
+
if (__classPrivateFieldGet(this, _Client_inlineQueryManager, "f").canHandleUpdate(update)) {
|
|
3012
3080
|
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").handleUpdate(update)));
|
|
3013
3081
|
}
|
|
3014
|
-
if (
|
|
3082
|
+
if (__classPrivateFieldGet(this, _Client_reactionManager, "f").canHandleUpdate(update)) {
|
|
3015
3083
|
promises.push(async () => {
|
|
3016
3084
|
const upd = await __classPrivateFieldGet(this, _Client_reactionManager, "f").handleUpdate(update);
|
|
3017
3085
|
if (upd) {
|
|
@@ -3019,20 +3087,44 @@ _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(up
|
|
|
3019
3087
|
}
|
|
3020
3088
|
});
|
|
3021
3089
|
}
|
|
3022
|
-
if (
|
|
3090
|
+
if (__classPrivateFieldGet(this, _Client_chatListManager, "f").canHandleUpdate(update)) {
|
|
3023
3091
|
promises.push(() => __classPrivateFieldGet(this, _Client_chatListManager, "f").handleUpdate(update));
|
|
3024
3092
|
}
|
|
3025
|
-
if (
|
|
3093
|
+
if (__classPrivateFieldGet(this, _Client_storyManager, "f").canHandleUpdate(update)) {
|
|
3026
3094
|
promises.push(async () => {
|
|
3027
|
-
const
|
|
3028
|
-
if (
|
|
3029
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this,
|
|
3095
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_storyManager, "f").handleUpdate(update);
|
|
3096
|
+
if (ctxUpdate) {
|
|
3097
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
3030
3098
|
}
|
|
3031
3099
|
});
|
|
3032
3100
|
}
|
|
3033
|
-
if (
|
|
3101
|
+
if (__classPrivateFieldGet(this, _Client_businessConnectionManager, "f").canHandleUpdate(update)) {
|
|
3034
3102
|
promises.push(async () => __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
|
|
3035
3103
|
}
|
|
3104
|
+
if (__classPrivateFieldGet(this, _Client_storyManager, "f").canHandleUpdate(update)) {
|
|
3105
|
+
promises.push(async () => {
|
|
3106
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_storyManager, "f").handleUpdate(update);
|
|
3107
|
+
if (ctxUpdate) {
|
|
3108
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
3109
|
+
}
|
|
3110
|
+
});
|
|
3111
|
+
}
|
|
3112
|
+
if (__classPrivateFieldGet(this, _Client_paymentManager, "f").canHandleUpdate(update)) {
|
|
3113
|
+
promises.push(async () => {
|
|
3114
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_paymentManager, "f").handleUpdate(update);
|
|
3115
|
+
if (ctxUpdate) {
|
|
3116
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
3117
|
+
}
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
if (__classPrivateFieldGet(this, _Client_translationsManager, "f").canHandleUpdate(update)) {
|
|
3121
|
+
promises.push(async () => {
|
|
3122
|
+
const ctxUpdate = await __classPrivateFieldGet(this, _Client_translationsManager, "f").handleUpdate(update);
|
|
3123
|
+
if (ctxUpdate) {
|
|
3124
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, ctxUpdate);
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
}
|
|
3036
3128
|
return () => Promise.all(promises.map((v) => v()));
|
|
3037
3129
|
}, _Client_getMe = async function _Client_getMe() {
|
|
3038
3130
|
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
|
package/esm/types/1_sticker.d.ts
CHANGED
|
@@ -57,4 +57,5 @@ export interface Sticker {
|
|
|
57
57
|
/** @unlisted */
|
|
58
58
|
export type StickerSetNameGetter = (inputStickerSet: Api.inputStickerSetID) => MaybePromise<string>;
|
|
59
59
|
export declare function constructSticker(document: Api.document, fileId: string, fileUniqueId: string, getStickerSetName: StickerSetNameGetter, customEmojiId?: string): Promise<Sticker>;
|
|
60
|
+
export declare function constructSticker2(document: Api.document, fileId: string, fileUniqueId: string, setName: string | undefined, customEmojiId?: string): Sticker;
|
|
60
61
|
//# sourceMappingURL=1_sticker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_sticker.d.ts","sourceRoot":"","sources":["../../src/types/1_sticker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAe,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAyB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEjE,iBAAiB;AACjB,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,kMAAkM;IAClM,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,aAAa,CAAC;IACzC,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IACpB,2GAA2G;IAC3G,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,sEAAsE;IACtE,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4MAA4M;IAC5M,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,iBAAiB,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;AAEpG,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,SAAK,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"1_sticker.d.ts","sourceRoot":"","sources":["../../src/types/1_sticker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAe,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAyB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEjE,iBAAiB;AACjB,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,kMAAkM;IAClM,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,aAAa,CAAC;IACzC,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IACpB,2GAA2G;IAC3G,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,sEAAsE;IACtE,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4MAA4M;IAC5M,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,iBAAiB,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;AAEpG,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,SAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAKlL;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,SAAK,GAAG,OAAO,CAuBxJ"}
|
package/esm/types/1_sticker.js
CHANGED
|
@@ -22,11 +22,15 @@ import { is } from "../2_tl.js";
|
|
|
22
22
|
import { constructMaskPosition } from "./0_mask_position.js";
|
|
23
23
|
import { constructThumbnail } from "./0_thumbnail.js";
|
|
24
24
|
export async function constructSticker(document, fileId, fileUniqueId, getStickerSetName, customEmojiId = "") {
|
|
25
|
+
const stickerAttribute = document.attributes.find((v) => is("documentAttributeSticker", v));
|
|
26
|
+
const setName = is("inputStickerSetID", stickerAttribute.stickerset) ? await getStickerSetName(stickerAttribute.stickerset) : undefined;
|
|
27
|
+
return constructSticker2(document, fileId, fileUniqueId, setName, customEmojiId);
|
|
28
|
+
}
|
|
29
|
+
export function constructSticker2(document, fileId, fileUniqueId, setName, customEmojiId = "") {
|
|
25
30
|
const stickerAttribute = document.attributes.find((v) => is("documentAttributeSticker", v));
|
|
26
31
|
const imageSizeAttribute = document.attributes.find((v) => is("documentAttributeImageSize", v));
|
|
27
32
|
const customEmojiAttribute = document.attributes.find((v) => is("documentAttributeCustomEmoji", v));
|
|
28
33
|
const videoAttribute = document.attributes.find((v) => is("documentAttributeVideo", v));
|
|
29
|
-
const setName = is("inputStickerSetID", stickerAttribute.stickerset) ? await getStickerSetName(stickerAttribute.stickerset) : undefined;
|
|
30
34
|
return cleanObject({
|
|
31
35
|
fileId,
|
|
32
36
|
fileUniqueId,
|
|
@@ -39,7 +43,7 @@ export async function constructSticker(document, fileId, fileUniqueId, getSticke
|
|
|
39
43
|
emoji: (customEmojiAttribute ? customEmojiAttribute.alt : stickerAttribute.alt) || undefined,
|
|
40
44
|
setName,
|
|
41
45
|
premiumAnimation: undefined, // TODO
|
|
42
|
-
maskPosition: stickerAttribute.mask_coords ? constructMaskPosition(stickerAttribute.mask_coords) : undefined,
|
|
46
|
+
maskPosition: stickerAttribute ? stickerAttribute.mask_coords ? constructMaskPosition(stickerAttribute.mask_coords) : undefined : undefined,
|
|
43
47
|
customEmojiId: customEmojiAttribute ? customEmojiId : undefined,
|
|
44
48
|
needsRepainting: customEmojiAttribute ? Boolean(customEmojiAttribute.text_color) : undefined,
|
|
45
49
|
fileSize: Number(document.size),
|