@mtkruto/browser 0.140.0 → 0.142.0
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/client/0_params.d.ts +33 -7
- package/esm/client/0_params.d.ts.map +1 -1
- 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 +12 -1
- package/esm/client/1_client_generic.d.ts +121 -10
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_managed_bot_manager.d.ts +28 -0
- package/esm/client/2_managed_bot_manager.d.ts.map +1 -0
- package/esm/client/2_managed_bot_manager.js +37 -0
- package/esm/client/3_message_manager.d.ts +0 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +5 -48
- package/esm/client/3_sticker_set_manager.d.ts +46 -0
- package/esm/client/3_sticker_set_manager.d.ts.map +1 -0
- package/esm/client/3_sticker_set_manager.js +197 -0
- package/esm/client/6_client.d.ts +121 -10
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +163 -10
- package/esm/client/6_client_dispatcher.d.ts +121 -10
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +155 -10
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +4 -4
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.js +3 -3
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.js +3 -3
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.13/types.js +3 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/esm/types/0_giveaway_parameters.d.ts +1 -1
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +1 -1
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_user_status.d.ts +1 -1
- package/esm/types/0_user_status.d.ts.map +1 -1
- package/esm/types/0_video_chat.d.ts +1 -1
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_working_hours_interval.d.ts +2 -2
- package/esm/types/0_working_hours_interval.d.ts.map +1 -1
- package/esm/types/1_bot_commands.d.ts +1 -1
- package/esm/types/1_bot_commands.d.ts.map +1 -1
- package/esm/types/1_chat_action.d.ts +2 -2
- package/esm/types/1_chat_action.d.ts.map +1 -1
- package/esm/types/1_input_sticker.d.ts +40 -0
- package/esm/types/1_input_sticker.d.ts.map +1 -0
- package/esm/types/1_input_sticker.js +20 -0
- package/esm/types/2_chat_member.d.ts +3 -3
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reaction_list_item.d.ts +1 -1
- package/esm/types/2_message_reaction_list_item.d.ts.map +1 -1
- package/esm/types/2_sticker_set.d.ts +1 -1
- package/esm/types/2_sticker_set.d.ts.map +1 -1
- package/esm/types/3_blocked_user.d.ts +1 -1
- package/esm/types/3_blocked_user.d.ts.map +1 -1
- package/esm/types/3_business_connection.d.ts +1 -1
- package/esm/types/3_business_connection.d.ts.map +1 -1
- package/esm/types/3_checklist_item.d.ts +1 -1
- package/esm/types/3_checklist_item.d.ts.map +1 -1
- package/esm/types/3_invite_link.d.ts +1 -1
- package/esm/types/3_invite_link.d.ts.map +1 -1
- package/esm/types/3_message_draft.d.ts +1 -1
- package/esm/types/3_message_draft.d.ts.map +1 -1
- package/esm/types/3_message_reactions.d.ts +1 -1
- package/esm/types/3_message_reactions.d.ts.map +1 -1
- package/esm/types/3_pre_checkout_query.d.ts +1 -1
- package/esm/types/3_pre_checkout_query.d.ts.map +1 -1
- package/esm/types/4_chat_member_updated.d.ts +2 -2
- package/esm/types/4_chat_member_updated.d.ts.map +1 -1
- package/esm/types/4_join_request.d.ts +1 -1
- package/esm/types/4_join_request.d.ts.map +1 -1
- package/esm/types/4_poll.d.ts +1 -1
- package/esm/types/4_poll.d.ts.map +1 -1
- package/esm/types/5_link_preview.d.ts +2 -2
- package/esm/types/5_link_preview.d.ts.map +1 -1
- package/esm/types/6_message.d.ts +3 -3
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message_content.d.ts +2 -2
- package/esm/types/6_message_content.d.ts.map +1 -1
- package/esm/types/7_callback_query.d.ts +1 -1
- package/esm/types/7_callback_query.d.ts.map +1 -1
- package/esm/types/7_topic.d.ts +1 -1
- package/esm/types/7_topic.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/client/0_params.d.ts +33 -7
- package/script/client/0_params.d.ts.map +1 -1
- 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 +12 -0
- package/script/client/1_client_generic.d.ts +121 -10
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_managed_bot_manager.d.ts +28 -0
- package/script/client/2_managed_bot_manager.d.ts.map +1 -0
- package/script/client/2_managed_bot_manager.js +41 -0
- package/script/client/3_message_manager.d.ts +0 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +2 -45
- package/script/client/3_sticker_set_manager.d.ts +46 -0
- package/script/client/3_sticker_set_manager.d.ts.map +1 -0
- package/script/client/3_sticker_set_manager.js +201 -0
- package/script/client/6_client.d.ts +121 -10
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +163 -10
- package/script/client/6_client_dispatcher.d.ts +121 -10
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +155 -10
- package/script/deps/jsr.io/@std/assert/1.0.19/equals.js +4 -4
- package/script/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.js +3 -3
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.js +3 -3
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/types.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/script/types/0_giveaway_parameters.d.ts +1 -1
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_location.d.ts +1 -1
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_user_status.d.ts +1 -1
- package/script/types/0_user_status.d.ts.map +1 -1
- package/script/types/0_video_chat.d.ts +1 -1
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_working_hours_interval.d.ts +2 -2
- package/script/types/0_working_hours_interval.d.ts.map +1 -1
- package/script/types/1_bot_commands.d.ts +1 -1
- package/script/types/1_bot_commands.d.ts.map +1 -1
- package/script/types/1_chat_action.d.ts +2 -2
- package/script/types/1_chat_action.d.ts.map +1 -1
- package/script/types/1_input_sticker.d.ts +40 -0
- package/script/types/1_input_sticker.d.ts.map +1 -0
- package/script/types/1_input_sticker.js +21 -0
- package/script/types/2_chat_member.d.ts +3 -3
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reaction_list_item.d.ts +1 -1
- package/script/types/2_message_reaction_list_item.d.ts.map +1 -1
- package/script/types/2_sticker_set.d.ts +1 -1
- package/script/types/2_sticker_set.d.ts.map +1 -1
- package/script/types/3_blocked_user.d.ts +1 -1
- package/script/types/3_blocked_user.d.ts.map +1 -1
- package/script/types/3_business_connection.d.ts +1 -1
- package/script/types/3_business_connection.d.ts.map +1 -1
- package/script/types/3_checklist_item.d.ts +1 -1
- package/script/types/3_checklist_item.d.ts.map +1 -1
- package/script/types/3_invite_link.d.ts +1 -1
- package/script/types/3_invite_link.d.ts.map +1 -1
- package/script/types/3_message_draft.d.ts +1 -1
- package/script/types/3_message_draft.d.ts.map +1 -1
- package/script/types/3_message_reactions.d.ts +1 -1
- package/script/types/3_message_reactions.d.ts.map +1 -1
- package/script/types/3_pre_checkout_query.d.ts +1 -1
- package/script/types/3_pre_checkout_query.d.ts.map +1 -1
- package/script/types/4_chat_member_updated.d.ts +2 -2
- package/script/types/4_chat_member_updated.d.ts.map +1 -1
- package/script/types/4_join_request.d.ts +1 -1
- package/script/types/4_join_request.d.ts.map +1 -1
- package/script/types/4_poll.d.ts +1 -1
- package/script/types/4_poll.d.ts.map +1 -1
- package/script/types/5_link_preview.d.ts +2 -2
- package/script/types/5_link_preview.d.ts.map +1 -1
- package/script/types/6_message.d.ts +3 -3
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message_content.d.ts +2 -2
- package/script/types/6_message_content.d.ts.map +1 -1
- package/script/types/7_callback_query.d.ts +1 -1
- package/script/types/7_callback_query.d.ts.map +1 -1
- package/script/types/7_topic.d.ts +1 -1
- package/script/types/7_topic.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.js +0 -3
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/format.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/types.d.ts +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ManagedBotManager = void 0;
|
|
23
|
+
class ManagedBotManager {
|
|
24
|
+
#c;
|
|
25
|
+
constructor(c) {
|
|
26
|
+
this.#c = c;
|
|
27
|
+
}
|
|
28
|
+
async getManagedBotToken(userId) {
|
|
29
|
+
this.#c.storage.assertBot("getManagedBotToken");
|
|
30
|
+
const bot = await this.#c.getInputUser(userId);
|
|
31
|
+
const result = await this.#c.invoke({ _: "bots.exportBotToken", bot, revoke: false });
|
|
32
|
+
return result.token;
|
|
33
|
+
}
|
|
34
|
+
async revokeManagedBotToken(userId) {
|
|
35
|
+
this.#c.storage.assertBot("revokeManagedBotToken");
|
|
36
|
+
const bot = await this.#c.getInputUser(userId);
|
|
37
|
+
const result = await this.#c.invoke({ _: "bots.exportBotToken", bot, revoke: true });
|
|
38
|
+
return result.token;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ManagedBotManager = ManagedBotManager;
|
|
@@ -109,7 +109,6 @@ export declare class MessageManager implements UpdateProcessor<MessageManagerUpd
|
|
|
109
109
|
transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
|
|
110
110
|
resolveMessageLink(link: string): Promise<Message>;
|
|
111
111
|
static parseMessageLink(link: string): [ID, number] | null;
|
|
112
|
-
getStickerSet(name: string): Promise<import("../3_types.js").StickerSet>;
|
|
113
112
|
openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise<import("../3_types.js").MiniAppInfo>;
|
|
114
113
|
getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise<Message[]>;
|
|
115
114
|
getSavedChats(params?: GetSavedChatsParams): Promise<import("../3_types.js").SavedChats>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAuO,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAiC,KAAK,QAAQ,EAAoD,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/c,OAAO,EAAqB,KAAK,cAAc,EAAqE,KAAK,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,KAAK,aAAa,EAA2B,KAAK,SAAS,EAAE,KAAK,QAAQ,EAA4D,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtW,OAAO,KAAK,EAA8E,iBAAiB,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,wB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mC5D,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB;IA0B1C,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAkBrF,kBAAkB,CAAC,QAAQ,EAAE,QAAQ;IAKrC,WAAW;IAKX,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB;CAMhF"}
|
|
@@ -24,7 +24,6 @@ const _0_deps_js_1 = require("../0_deps.js");
|
|
|
24
24
|
const _0_errors_js_1 = require("../0_errors.js");
|
|
25
25
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
26
26
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
27
|
-
const _3_errors_js_1 = require("../3_errors.js");
|
|
28
27
|
const _3_transport_js_1 = require("../3_transport.js");
|
|
29
28
|
const _3_types_js_1 = require("../3_types.js");
|
|
30
29
|
const _3_types_js_2 = require("../3_types.js");
|
|
@@ -219,7 +218,7 @@ class MessageManager {
|
|
|
219
218
|
}
|
|
220
219
|
async forwardMessages(from, to, messageIds, params) {
|
|
221
220
|
(0, _0_utilities_js_1.checkArray)(messageIds, _0_utilities_js_1.checkMessageId);
|
|
222
|
-
const result = await this.#c.invoke({ _: "messages.forwardMessages", from_peer: await this.#c.getInputPeer(from), to_peer: await this.#c.getInputPeer(to), id: messageIds, random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()), silent: params?.isSilent || undefined, top_msg_id: params?.messageThreadId, noforwards: params?.
|
|
221
|
+
const result = await this.#c.invoke({ _: "messages.forwardMessages", from_peer: await this.#c.getInputPeer(from), to_peer: await this.#c.getInputPeer(to), id: messageIds, random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()), silent: params?.isSilent || undefined, top_msg_id: params?.messageThreadId, noforwards: params?.isContentProtected || undefined, send_as: params?.sendAs ? await this.#c.getInputPeer(params.sendAs) : undefined, drop_author: params?.isSenderNameDropped || undefined, drop_media_captions: params?.isCaptionDropped || undefined });
|
|
223
222
|
return await this.updatesToMessages(to, result);
|
|
224
223
|
}
|
|
225
224
|
async getHistory(chatId, params) {
|
|
@@ -627,17 +626,7 @@ class MessageManager {
|
|
|
627
626
|
}
|
|
628
627
|
async sendSticker(chatId, sticker, params) {
|
|
629
628
|
this.#checkParams(params);
|
|
630
|
-
const message = await this.#sendDocumentInner(chatId, sticker, params, _3_types_js_2.FileType.Sticker, [{ _: "documentAttributeSticker", alt: params?.emoji || "", stickerset: { _: "inputStickerSetEmpty" } }], undefined, STICKER_MIME_TYPES,
|
|
631
|
-
if ((0, _0_deps_js_1.startsWith)(firstPart, new Uint8Array([0x1F, 0x8B]))) {
|
|
632
|
-
return "file.tgs";
|
|
633
|
-
}
|
|
634
|
-
else if (firstPart.length >= 12 && (0, _0_deps_js_1.equals)(firstPart.subarray(8, 12), new Uint8Array([0x57, 0x45, 0x42, 0x50]))) {
|
|
635
|
-
return "file.webp";
|
|
636
|
-
}
|
|
637
|
-
else {
|
|
638
|
-
return "file.webm";
|
|
639
|
-
}
|
|
640
|
-
});
|
|
629
|
+
const message = await this.#sendDocumentInner(chatId, sticker, params, _3_types_js_2.FileType.Sticker, [{ _: "documentAttributeSticker", alt: params?.emoji || "", stickerset: { _: "inputStickerSetEmpty" } }], undefined, STICKER_MIME_TYPES, _0_utilities_js_1.checkStickerName);
|
|
641
630
|
return (0, _3_types_js_2.assertMessageType)(message, "sticker");
|
|
642
631
|
}
|
|
643
632
|
async sendPhoto(chatId, photo, params) {
|
|
@@ -1671,38 +1660,6 @@ class MessageManager {
|
|
|
1671
1660
|
}
|
|
1672
1661
|
return [peer, id];
|
|
1673
1662
|
}
|
|
1674
|
-
async getStickerSet(name) {
|
|
1675
|
-
if (name.includes("/")) {
|
|
1676
|
-
let valid = false;
|
|
1677
|
-
try {
|
|
1678
|
-
const url = new URL(name);
|
|
1679
|
-
const pathname = "/addstickers/";
|
|
1680
|
-
valid = (url.protocol === "http:" || url.protocol === "https:") && url.hostname === "t.me" && url.pathname.startsWith(pathname) && url.pathname.length > _3_errors_js_1.PackShortNameInvalid.length;
|
|
1681
|
-
if (valid) {
|
|
1682
|
-
name = url.pathname.slice(pathname.length);
|
|
1683
|
-
if (name.endsWith("/")) {
|
|
1684
|
-
name = name.slice(0, -1);
|
|
1685
|
-
if (name === "") {
|
|
1686
|
-
valid = false;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
catch (err) {
|
|
1692
|
-
if (err instanceof TypeError) {
|
|
1693
|
-
valid = false;
|
|
1694
|
-
}
|
|
1695
|
-
else {
|
|
1696
|
-
throw err;
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
if (!valid) {
|
|
1700
|
-
throw new _0_errors_js_1.InputError("Invalid sticker set name or link.");
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
const result = await this.#c.invoke({ _: "messages.getStickerSet", hash: 0, stickerset: { _: "inputStickerSetShortName", short_name: name } });
|
|
1704
|
-
return (0, _3_types_js_1.constructStickerSet)(result);
|
|
1705
|
-
}
|
|
1706
1663
|
async openMiniApp(botId, chatId, params) {
|
|
1707
1664
|
this.#c.storage.assertUser("openMiniApp");
|
|
1708
1665
|
const from_bot_menu = params?.isFromMenu ? true : undefined;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { type InputSticker } from "../3_types.js";
|
|
21
|
+
import type { FileSource } from "../types/0_file_source.js";
|
|
22
|
+
import type { AddStickerToStickerSetParams, CreateStickerSetParams, ReplaceStickerInStickerSetParams, SetStickerSetThumbnailParams } from "./0_params.js";
|
|
23
|
+
import type { C as C_ } from "./1_types.js";
|
|
24
|
+
import type { FileManager } from "./2_file_manager.js";
|
|
25
|
+
interface C extends C_ {
|
|
26
|
+
fileManager: FileManager;
|
|
27
|
+
}
|
|
28
|
+
export declare class StickerSetManager {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(c: C);
|
|
31
|
+
createStickerSet(name: string, slug: string, stickers: InputSticker[], params?: CreateStickerSetParams): Promise<import("../3_types.js").StickerSet>;
|
|
32
|
+
checkStickerSetSlug(slug: string): Promise<NonNullable<boolean | undefined>>;
|
|
33
|
+
suggestStickerSetSlug(name: string): Promise<string>;
|
|
34
|
+
addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise<void>;
|
|
35
|
+
removeStickerFromStickerSet(fileId: string): Promise<void>;
|
|
36
|
+
replaceStickerEmoji(fileId: string, emoji: string): Promise<void>;
|
|
37
|
+
replaceStickerInStickerSet(currentStickerFileId: string, newSticker: InputSticker, params?: ReplaceStickerInStickerSetParams): Promise<void>;
|
|
38
|
+
deleteStickerSet(slug: string): Promise<void>;
|
|
39
|
+
setStickerSetTitle(slug: string, title: string): Promise<void>;
|
|
40
|
+
changeStickerPositionInStickerSet(fileId: string, position: number): Promise<void>;
|
|
41
|
+
setStickerSetThumbnail(slug: string, thumbnail: FileSource, params?: SetStickerSetThumbnailParams): Promise<void>;
|
|
42
|
+
setCustomEmojiAsStickerSetThumbnail(slug: string, customEmojiId: string): Promise<void>;
|
|
43
|
+
getStickerSet(slug: string): Promise<import("../3_types.js").StickerSet>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=3_sticker_set_manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_sticker_set_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_sticker_set_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAA0C,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAiB,4BAA4B,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEzK,OAAO,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,UAAU,CAAE,SAAQ,EAAE;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,qBAAa,iBAAiB;;gBAGhB,CAAC,EAAE,CAAC;IA2DV,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,sBAAsB;IAmCtG,mBAAmB,CAAC,IAAI,EAAE,MAAM;IAKhC,qBAAqB,CAAC,IAAI,EAAE,MAAM;IAKlC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,4BAA4B;IAiCjG,2BAA2B,CAAC,MAAM,EAAE,MAAM;IAO1C,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAIjD,0BAA0B,CAAC,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,gCAAgC;IAa5H,gBAAgB,CAAC,IAAI,EAAE,MAAM;IAK7B,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAK9C,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAIlE,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,4BAA4B;IAWjG,mCAAmC,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAKvE,aAAa,CAAC,IAAI,EAAE,MAAM;CAKjC"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.StickerSetManager = void 0;
|
|
23
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
25
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
26
|
+
const _3_types_js_1 = require("../3_types.js");
|
|
27
|
+
const _0_utilities_js_1 = require("./0_utilities.js");
|
|
28
|
+
class StickerSetManager {
|
|
29
|
+
#c;
|
|
30
|
+
constructor(c) {
|
|
31
|
+
this.#c = c;
|
|
32
|
+
}
|
|
33
|
+
static #getSlug(slug) {
|
|
34
|
+
if (slug.includes("/")) {
|
|
35
|
+
let valid = false;
|
|
36
|
+
try {
|
|
37
|
+
const url = new URL(slug);
|
|
38
|
+
const pathname = "/addstickers/";
|
|
39
|
+
valid = (url.protocol === "http:" || url.protocol === "https:") && url.hostname === "t.me" && url.pathname.startsWith(pathname) && url.pathname.length > pathname.length;
|
|
40
|
+
if (valid) {
|
|
41
|
+
slug = url.pathname.slice(pathname.length);
|
|
42
|
+
if (slug.endsWith("/")) {
|
|
43
|
+
slug = slug.slice(0, -1);
|
|
44
|
+
if (slug === "") {
|
|
45
|
+
valid = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
if (err instanceof TypeError) {
|
|
52
|
+
valid = false;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (!valid) {
|
|
59
|
+
throw new _0_errors_js_1.InputError("Invalid sticker set slug or link.");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return slug;
|
|
63
|
+
}
|
|
64
|
+
async #uploadSticker(sticker, emoji, params, user) {
|
|
65
|
+
let mimeType = params.mimeType;
|
|
66
|
+
const result = await this.#c.fileManager.upload(sticker, params, (name, firstPart) => {
|
|
67
|
+
if (firstPart) {
|
|
68
|
+
name = (0, _0_utilities_js_1.checkStickerName)(firstPart);
|
|
69
|
+
}
|
|
70
|
+
mimeType ??= (0, _0_deps_js_1.contentType)(name.split(".").slice(-1)[0]);
|
|
71
|
+
return name;
|
|
72
|
+
});
|
|
73
|
+
mimeType ??= "application/x-tgsticker";
|
|
74
|
+
const uploadedMedia = await this.#c.invoke({
|
|
75
|
+
_: "messages.uploadMedia",
|
|
76
|
+
peer: _2_tl_js_1.Api.is("inputUserSelf", user) ? { _: "inputPeerSelf" } : _2_tl_js_1.Api.is("inputUser", user) ? { _: "inputPeerUser", user_id: user.user_id, access_hash: user.access_hash } : (0, _0_deps_js_1.unreachable)(),
|
|
77
|
+
media: { _: "inputMediaUploadedDocument", file: result, attributes: [{ _: "documentAttributeSticker", alt: emoji, stickerset: { _: "inputStickerSetEmpty" } }], mime_type: mimeType },
|
|
78
|
+
});
|
|
79
|
+
const document = _2_tl_js_1.Api.as("document", _2_tl_js_1.Api.as("messageMediaDocument", uploadedMedia).document);
|
|
80
|
+
return {
|
|
81
|
+
_: "inputDocument",
|
|
82
|
+
id: document.id,
|
|
83
|
+
access_hash: document.access_hash,
|
|
84
|
+
file_reference: document.file_reference,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
async createStickerSet(name, slug, stickers, params) {
|
|
88
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
89
|
+
if (this.#c.storage.isBot && !params?.userId) {
|
|
90
|
+
throw new _0_errors_js_1.InputError("The parameter userId is required.");
|
|
91
|
+
}
|
|
92
|
+
const user_id = this.#c.storage.isBot ? await this.#c.getInputUser(params.userId) : { _: "inputUserSelf" };
|
|
93
|
+
const stickers_ = new Array();
|
|
94
|
+
for (const sticker of stickers) {
|
|
95
|
+
stickers_.push({
|
|
96
|
+
_: "inputStickerSetItem",
|
|
97
|
+
document: await this.#uploadSticker(sticker.sticker, sticker.emoji, sticker, user_id),
|
|
98
|
+
emoji: sticker.emoji,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const thumb = params?.thumbnail ? await this.#uploadSticker(params.thumbnail, "⭐️", params, user_id) : undefined;
|
|
102
|
+
const result = await this.#c.invoke({
|
|
103
|
+
_: "stickers.createStickerSet",
|
|
104
|
+
masks: params?.isMask ? true : undefined,
|
|
105
|
+
emojis: params?.isCustomEmoji ? true : undefined,
|
|
106
|
+
text_color: params?.isAdaptive ? true : undefined,
|
|
107
|
+
title: name,
|
|
108
|
+
user_id,
|
|
109
|
+
short_name: slug,
|
|
110
|
+
stickers: stickers_,
|
|
111
|
+
thumb,
|
|
112
|
+
software: params?.software,
|
|
113
|
+
});
|
|
114
|
+
return (0, _3_types_js_1.constructStickerSet)(result);
|
|
115
|
+
}
|
|
116
|
+
async checkStickerSetSlug(slug) {
|
|
117
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
118
|
+
return await this.#c.invoke({ _: "stickers.checkShortName", short_name: slug });
|
|
119
|
+
}
|
|
120
|
+
async suggestStickerSetSlug(name) {
|
|
121
|
+
const result = await this.#c.invoke({ _: "stickers.suggestShortName", title: name });
|
|
122
|
+
return result.short_name;
|
|
123
|
+
}
|
|
124
|
+
async addStickerToStickerSet(slug, sticker, params) {
|
|
125
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
126
|
+
if (this.#c.storage.isBot && !params?.userId) {
|
|
127
|
+
throw new _0_errors_js_1.InputError("The parameter userId is required.");
|
|
128
|
+
}
|
|
129
|
+
const user_id = this.#c.storage.isBot ? await this.#c.getInputUser(params.userId) : { _: "inputUserSelf" };
|
|
130
|
+
await this.#c.invoke({
|
|
131
|
+
_: "stickers.addStickerToSet",
|
|
132
|
+
stickerset: { _: "inputStickerSetShortName", short_name: slug },
|
|
133
|
+
sticker: {
|
|
134
|
+
_: "inputStickerSetItem",
|
|
135
|
+
document: await this.#uploadSticker(sticker.sticker, sticker.emoji, sticker, user_id),
|
|
136
|
+
emoji: sticker.emoji,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
#getStickerInputDocument(fileId) {
|
|
141
|
+
const deserializedFileId = (0, _3_types_js_1.deserializeFileId)(fileId);
|
|
142
|
+
if (!deserializedFileId.fileReference || deserializedFileId.location.type !== "common") {
|
|
143
|
+
(0, _0_deps_js_1.unreachable)();
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
_: "inputDocument",
|
|
147
|
+
id: deserializedFileId.location.id,
|
|
148
|
+
access_hash: deserializedFileId.location.accessHash,
|
|
149
|
+
file_reference: deserializedFileId.fileReference,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async removeStickerFromStickerSet(fileId) {
|
|
153
|
+
await this.#c.invoke({
|
|
154
|
+
_: "stickers.removeStickerFromSet",
|
|
155
|
+
sticker: this.#getStickerInputDocument(fileId),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async replaceStickerEmoji(fileId, emoji) {
|
|
159
|
+
await this.#c.invoke({ _: "stickers.changeSticker", sticker: this.#getStickerInputDocument(fileId), emoji });
|
|
160
|
+
}
|
|
161
|
+
async replaceStickerInStickerSet(currentStickerFileId, newSticker, params) {
|
|
162
|
+
const sticker = this.#getStickerInputDocument(currentStickerFileId);
|
|
163
|
+
if (this.#c.storage.isBot && !params?.userId) {
|
|
164
|
+
throw new _0_errors_js_1.InputError("The parameter userId is required.");
|
|
165
|
+
}
|
|
166
|
+
const user_id = this.#c.storage.isBot ? await this.#c.getInputUser(params.userId) : { _: "inputUserSelf" };
|
|
167
|
+
const inputDocument = await this.#uploadSticker(newSticker.sticker, newSticker.emoji, newSticker, user_id);
|
|
168
|
+
const new_sticker = { _: "inputStickerSetItem", document: inputDocument, emoji: newSticker.emoji };
|
|
169
|
+
await this.#c.invoke({ _: "stickers.replaceSticker", sticker, new_sticker });
|
|
170
|
+
}
|
|
171
|
+
async deleteStickerSet(slug) {
|
|
172
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
173
|
+
await this.#c.invoke({ _: "stickers.deleteStickerSet", stickerset: { _: "inputStickerSetShortName", short_name: slug } });
|
|
174
|
+
}
|
|
175
|
+
async setStickerSetTitle(slug, title) {
|
|
176
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
177
|
+
await this.#c.invoke({ _: "stickers.renameStickerSet", stickerset: { _: "inputStickerSetShortName", short_name: slug }, title });
|
|
178
|
+
}
|
|
179
|
+
async changeStickerPositionInStickerSet(fileId, position) {
|
|
180
|
+
await this.#c.invoke({ _: "stickers.changeStickerPosition", sticker: this.#getStickerInputDocument(fileId), position });
|
|
181
|
+
}
|
|
182
|
+
async setStickerSetThumbnail(slug, thumbnail, params) {
|
|
183
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
184
|
+
if (this.#c.storage.isBot && !params?.userId) {
|
|
185
|
+
throw new _0_errors_js_1.InputError("The parameter userId is required.");
|
|
186
|
+
}
|
|
187
|
+
const user_id = this.#c.storage.isBot ? await this.#c.getInputUser(params.userId) : { _: "inputUserSelf" };
|
|
188
|
+
const thumb = await this.#uploadSticker(thumbnail, "⭐️", params ?? {}, user_id);
|
|
189
|
+
await this.#c.invoke({ _: "stickers.setStickerSetThumb", stickerset: { _: "inputStickerSetShortName", short_name: slug }, thumb });
|
|
190
|
+
}
|
|
191
|
+
async setCustomEmojiAsStickerSetThumbnail(slug, customEmojiId) {
|
|
192
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
193
|
+
await this.#c.invoke({ _: "stickers.setStickerSetThumb", stickerset: { _: "inputStickerSetShortName", short_name: slug }, thumb_document_id: BigInt(customEmojiId) });
|
|
194
|
+
}
|
|
195
|
+
async getStickerSet(slug) {
|
|
196
|
+
slug = StickerSetManager.#getSlug(slug);
|
|
197
|
+
const result = await this.#c.invoke({ _: "messages.getStickerSet", hash: 0, stickerset: { _: "inputStickerSetShortName", short_name: slug } });
|
|
198
|
+
return (0, _3_types_js_1.constructStickerSet)(result);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.StickerSetManager = StickerSetManager;
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
import { type Storage } from "../2_storage.js";
|
|
21
21
|
import { Api, Mtproto } from "../2_tl.js";
|
|
22
22
|
import { type DC } from "../3_transport.js";
|
|
23
|
-
import { type AlbumStoryList, type AppSupport, type AvailableReactions, type Birthday, type BlockedUserList, type BotCommand, type BotTokenCheckResult, type BusinessConnection, type CallbackQueryAnswer, type CallbackQueryQuestion, type Chat, type ChatActionType, type ChatListItem, type ChatMember, type ChatP, type ChatPChannel, type ChatPGroup, type ChatPPrivate, type ChatPSupergroup, type ChatSettings, type ClaimedGifts, type Country, type FailedInvitation, type FileSource, type Gift, type GiftCollection, type ID, type InactiveChat, type InlineQueryAnswer, type InlineQueryResult, type InputChecklistItem, type InputEmojiStatus, type InputGift, type InputMedia, type InputPollOption, type InputStoryContent, type InviteLink, type JoinRequest, type LeftChannelList, type LinkPreview, type LiveStreamChannel, type Message, type MessageAnimation, type MessageAudio, type MessageChecklist, type MessageContact, type MessageDice, type MessageDocument, type MessageInvoice, type MessageList, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageVoice, type MiniAppInfo, type NetworkStatistics, type ParseMode, type PasswordCheckResult, type Poll, type PremiumSubscriptionDuration, type PriceTag, type ProfilePhotoList, type Reaction, type SavedChats, type SlowModeDuration, type StarAmount, type StarTransactionList, type Sticker, type StickerSet, type Story, type StoryAlbum, type SummarizedText, type Timezone, type Topic, type Translation, type User, type VideoChat, type VideoChatActive, type VideoChatScheduled, type VoiceTranscription } from "../3_types.js";
|
|
23
|
+
import { type AlbumStoryList, type AppSupport, type AvailableReactions, type Birthday, type BlockedUserList, type BotCommand, type BotTokenCheckResult, type BusinessConnection, type CallbackQueryAnswer, type CallbackQueryQuestion, type Chat, type ChatActionType, type ChatListItem, type ChatMember, type ChatP, type ChatPChannel, type ChatPGroup, type ChatPPrivate, type ChatPSupergroup, type ChatSettings, type ClaimedGifts, type Country, type FailedInvitation, type FileSource, type Gift, type GiftCollection, type ID, type InactiveChat, type InlineQueryAnswer, type InlineQueryResult, type InputChecklistItem, type InputEmojiStatus, type InputGift, type InputMedia, type InputPollOption, type InputSticker, type InputStoryContent, type InviteLink, type JoinRequest, type LeftChannelList, type LinkPreview, type LiveStreamChannel, type Message, type MessageAnimation, type MessageAudio, type MessageChecklist, type MessageContact, type MessageDice, type MessageDocument, type MessageInvoice, type MessageList, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageVoice, type MiniAppInfo, type NetworkStatistics, type ParseMode, type PasswordCheckResult, type Poll, type PremiumSubscriptionDuration, type PriceTag, type ProfilePhotoList, type Reaction, type SavedChats, type SlowModeDuration, type StarAmount, type StarTransactionList, type Sticker, type StickerSet, type Story, type StoryAlbum, type SummarizedText, type Timezone, type Topic, type Translation, type User, type VideoChat, type VideoChatActive, type VideoChatScheduled, type VoiceTranscription } from "../3_types.js";
|
|
24
24
|
import { Migrate } from "../4_errors.js";
|
|
25
25
|
import type { CodeCheckResult } from "../types/0_code_check_result.js";
|
|
26
|
-
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
26
|
+
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ReplaceStickerInStickerSetParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
27
27
|
import { StorageOperations } from "./0_storage_operations.js";
|
|
28
28
|
import type { ClientGeneric } from "./1_client_generic.js";
|
|
29
29
|
import type { ClientPlainParams } from "./1_client_plain.js";
|
|
@@ -944,13 +944,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
944
944
|
* @cache
|
|
945
945
|
*/
|
|
946
946
|
transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
|
|
947
|
-
/**
|
|
948
|
-
* Get a sticker set.
|
|
949
|
-
*
|
|
950
|
-
* @method ms
|
|
951
|
-
* @param name The name of the sticker set or its link.
|
|
952
|
-
*/
|
|
953
|
-
getStickerSet(name: string): Promise<StickerSet>;
|
|
954
947
|
getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise<LinkPreview | null>;
|
|
955
948
|
/**
|
|
956
949
|
* Open a mini app. User-only.
|
|
@@ -2041,7 +2034,7 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
2041
2034
|
*
|
|
2042
2035
|
* @method vc
|
|
2043
2036
|
* @param chatId The identifier of a chat to schedule the video chat in.
|
|
2044
|
-
* @param startAt A point in time
|
|
2037
|
+
* @param startAt A point in time in the future when the video chat will be started.
|
|
2045
2038
|
* @returns The scheduled video chat.
|
|
2046
2039
|
*/
|
|
2047
2040
|
scheduleVideoChat(chatId: ID, startAt: number, params?: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
|
|
@@ -2311,5 +2304,123 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
2311
2304
|
* @param takeoutId The identifier of a takeout session.
|
|
2312
2305
|
*/
|
|
2313
2306
|
getLeftChannels(takeoutId: string, params?: GetLeftChannelsParams): Promise<LeftChannelList>;
|
|
2307
|
+
/**
|
|
2308
|
+
* Get a sticker set.
|
|
2309
|
+
*
|
|
2310
|
+
* @method ss
|
|
2311
|
+
* @param slug The slug of the sticker set or its link.
|
|
2312
|
+
*/
|
|
2313
|
+
getStickerSet(name: string): Promise<StickerSet>;
|
|
2314
|
+
/**
|
|
2315
|
+
* Check the availability of a sticker set slug.
|
|
2316
|
+
*
|
|
2317
|
+
* @method ss
|
|
2318
|
+
* @param slug The slug of the sticker set or its link.
|
|
2319
|
+
* @returns Whether the slug is available.
|
|
2320
|
+
*/
|
|
2321
|
+
checkStickerSetSlug(slug: string): Promise<boolean>;
|
|
2322
|
+
/**
|
|
2323
|
+
* Suggest a sticker set slug from its title.
|
|
2324
|
+
*
|
|
2325
|
+
* @method ss
|
|
2326
|
+
* @param title A title of a sticker set.
|
|
2327
|
+
* @returns The suggested slug.
|
|
2328
|
+
*/
|
|
2329
|
+
suggestStickerSetSlug(title: string): Promise<string>;
|
|
2330
|
+
/**
|
|
2331
|
+
* Create a sticker set.
|
|
2332
|
+
*
|
|
2333
|
+
* @method ss
|
|
2334
|
+
* @param name The sticker set's name.
|
|
2335
|
+
* @param slug The sticker set's slug.
|
|
2336
|
+
* @param stickers The initial stickers of the set.
|
|
2337
|
+
*/
|
|
2338
|
+
createStickerSet(name: string, slug: string, stickers: InputSticker[], params?: CreateStickerSetParams): Promise<StickerSet>;
|
|
2339
|
+
/**
|
|
2340
|
+
* Add a sticker to a sticker set.
|
|
2341
|
+
*
|
|
2342
|
+
* @method ss
|
|
2343
|
+
* @param slug The slug of the sticker set or its link.
|
|
2344
|
+
* @param sticker The sticker to add.
|
|
2345
|
+
*/
|
|
2346
|
+
addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise<void>;
|
|
2347
|
+
/**
|
|
2348
|
+
* Remove a sticker from its set.
|
|
2349
|
+
*
|
|
2350
|
+
* @method ss
|
|
2351
|
+
* @param fileId The identifier of the sticker.
|
|
2352
|
+
*/
|
|
2353
|
+
removeStickerFromStickerSet(fileId: string): Promise<void>;
|
|
2354
|
+
/**
|
|
2355
|
+
* Replace a sticker's emoji.
|
|
2356
|
+
*
|
|
2357
|
+
* @method ss
|
|
2358
|
+
* @param fileId The identifier of the sticker.
|
|
2359
|
+
* @param emoji The new emoji to use for the sticker.
|
|
2360
|
+
*/
|
|
2361
|
+
replaceStickerEmoji(fileId: string, emoji: string): Promise<void>;
|
|
2362
|
+
/**
|
|
2363
|
+
* Replace a sticker in a sticker set.
|
|
2364
|
+
*
|
|
2365
|
+
* @method ss
|
|
2366
|
+
* @param currentStickerFileId The identifier of the current sticker.
|
|
2367
|
+
* @param newSticker The new sticker to use.
|
|
2368
|
+
*/
|
|
2369
|
+
replaceStickerInStickerSet(currentStickerFileId: string, newSticker: InputSticker, params?: ReplaceStickerInStickerSetParams): Promise<void>;
|
|
2370
|
+
/**
|
|
2371
|
+
* Delete a sticker set.
|
|
2372
|
+
*
|
|
2373
|
+
* @method ss
|
|
2374
|
+
* @param slug The slug of the sticker set or its link.
|
|
2375
|
+
*/
|
|
2376
|
+
deleteStickerSet(slug: string): Promise<void>;
|
|
2377
|
+
/**
|
|
2378
|
+
* Set the title of a sticker set.
|
|
2379
|
+
*
|
|
2380
|
+
* @method ss
|
|
2381
|
+
* @param slug The slug of the sticker set or its link.
|
|
2382
|
+
* @param title The sticker set's new title.
|
|
2383
|
+
*/
|
|
2384
|
+
setStickerSetTitle(slug: string, title: string): Promise<void>;
|
|
2385
|
+
/**
|
|
2386
|
+
* Change the position of a sticker in its set.
|
|
2387
|
+
*
|
|
2388
|
+
* @method ss
|
|
2389
|
+
* @param fileId The identifier of the sticker.
|
|
2390
|
+
* @param position The new position of the sticker.
|
|
2391
|
+
*/
|
|
2392
|
+
changeStickerPositionInStickerSet(slug: string, position: number): Promise<void>;
|
|
2393
|
+
/**
|
|
2394
|
+
* Set a sticker set's thumbnail.
|
|
2395
|
+
*
|
|
2396
|
+
* @method ss
|
|
2397
|
+
* @param slug The slug of the sticker set or its link.
|
|
2398
|
+
* @param thumbnail The new thumbnail of the sticker set.
|
|
2399
|
+
*/
|
|
2400
|
+
setStickerSetThumbnail(slug: string, thumbnail: FileSource): Promise<void>;
|
|
2401
|
+
/**
|
|
2402
|
+
* Set a custom emoji as a sticker set's thumbnail.
|
|
2403
|
+
*
|
|
2404
|
+
* @method ss
|
|
2405
|
+
* @param slug The slug of the sticker set or its link.
|
|
2406
|
+
* @param customEmojiId The identifier of the custom emoji to use as thumbnail.
|
|
2407
|
+
*/
|
|
2408
|
+
setCustomEmojiAsStickerSetThumbnail(slug: string, customEmojiId: string): Promise<void>;
|
|
2409
|
+
/**
|
|
2410
|
+
* Get the token of a managed bot. Bot-only.
|
|
2411
|
+
*
|
|
2412
|
+
* @method mb
|
|
2413
|
+
* @param userId The identifier of the bot user.
|
|
2414
|
+
* @returns The managed bot's token.
|
|
2415
|
+
*/
|
|
2416
|
+
getManagedBotToken(userId: ID): Promise<string>;
|
|
2417
|
+
/**
|
|
2418
|
+
* Revoke the token of a managed bot. Bot-only.
|
|
2419
|
+
*
|
|
2420
|
+
* @method mb
|
|
2421
|
+
* @param userId The identifier of the bot user.
|
|
2422
|
+
* @returns The managed bot's new token.
|
|
2423
|
+
*/
|
|
2424
|
+
revokeManagedBotToken(userId: ID): Promise<string>;
|
|
2314
2425
|
}
|
|
2315
2426
|
//# sourceMappingURL=6_client.d.ts.map
|