@mtkruto/node 0.1.145 → 0.1.147
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 +3 -1
- package/esm/3_types.js +3 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/1_reaction_manager.d.ts +4 -2
- package/esm/client/2_message_manager.d.ts +3 -2
- package/esm/client/2_message_manager.js +19 -2
- package/esm/client/3_callback_query_manager.d.ts +3 -2
- package/esm/client/3_chat_list_manager.d.ts +3 -2
- package/esm/client/3_inline_query_manager.d.ts +3 -2
- package/esm/client/3_inline_query_manager.js +1 -1
- package/esm/types/0_mini_app_info.d.ts +6 -0
- package/esm/types/0_mini_app_info.js +3 -0
- package/esm/types/0_network_statistics_entry.d.ts +1 -0
- package/esm/types/0_reaction.d.ts +1 -0
- package/esm/types/1_inline_query_result_button.d.ts +2 -2
- package/esm/types/1_input_message_content.d.ts +1 -0
- package/esm/types/1_keyboard_button.d.ts +5 -4
- package/esm/types/1_keyboard_button.js +3 -3
- package/esm/types/1_network_statistics.d.ts +1 -0
- package/esm/types/2_inline_keyboard_button.d.ts +4 -4
- package/esm/types/2_inline_keyboard_button.js +4 -4
- package/esm/types/2_inline_query.d.ts +1 -0
- package/esm/types/2_invite_link.d.ts +23 -0
- package/esm/types/2_invite_link.js +27 -0
- package/esm/types/2_message_reaction_count.d.ts +1 -0
- package/esm/types/3_chat_member_updated.d.ts +23 -0
- package/esm/types/3_chat_member_updated.js +33 -0
- package/esm/types/4_inline_query_result.d.ts +1 -0
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +8 -8
- package/esm/types/4_message.js +2 -2
- package/esm/types/6_update.d.ts +19 -2
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -1
- package/script/3_types.js +3 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/1_reaction_manager.d.ts +4 -2
- package/script/client/2_message_manager.d.ts +3 -2
- package/script/client/2_message_manager.js +51 -34
- package/script/client/3_callback_query_manager.d.ts +3 -2
- package/script/client/3_chat_list_manager.d.ts +3 -2
- package/script/client/3_inline_query_manager.d.ts +3 -2
- package/script/client/3_inline_query_manager.js +1 -1
- package/script/types/0_mini_app_info.d.ts +6 -0
- package/script/types/0_mini_app_info.js +7 -0
- package/script/types/0_network_statistics_entry.d.ts +1 -0
- package/script/types/0_reaction.d.ts +1 -0
- package/script/types/1_inline_query_result_button.d.ts +2 -2
- package/script/types/1_input_message_content.d.ts +1 -0
- package/script/types/1_keyboard_button.d.ts +5 -4
- package/script/types/1_keyboard_button.js +3 -3
- package/script/types/1_network_statistics.d.ts +1 -0
- package/script/types/2_inline_keyboard_button.d.ts +4 -4
- package/script/types/2_inline_keyboard_button.js +4 -4
- package/script/types/2_inline_query.d.ts +1 -0
- package/script/types/2_invite_link.d.ts +23 -0
- package/script/types/2_invite_link.js +31 -0
- package/script/types/2_message_reaction_count.d.ts +1 -0
- package/script/types/3_chat_member_updated.d.ts +23 -0
- package/script/types/3_chat_member_updated.js +37 -0
- package/script/types/4_inline_query_result.d.ts +1 -0
- package/script/types/4_inline_query_result.js +1 -1
- package/script/types/4_message.d.ts +8 -8
- package/script/types/4_message.js +2 -2
- package/script/types/6_update.d.ts +19 -2
- package/esm/types/0_web_app_info.d.ts +0 -5
- package/esm/types/0_web_app_info.js +0 -3
- package/script/types/0_web_app_info.d.ts +0 -5
- package/script/types/0_web_app_info.js +0 -7
package/esm/types/6_update.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { InlineQuery } from "./2_inline_query.js";
|
|
|
6
6
|
import { MessageInteractions } from "./2_message_interactions.js";
|
|
7
7
|
import { MessageReactionCount } from "./2_message_reaction_count.js";
|
|
8
8
|
import { MessageReactions } from "./2_message_reactions.js";
|
|
9
|
+
import { ChatMemberUpdated } from "./3_chat_member_updated.js";
|
|
9
10
|
import { Message } from "./4_message.js";
|
|
10
11
|
import { CallbackQuery } from "./5_callback_query.js";
|
|
11
12
|
import { Chat } from "./5_chat.js";
|
|
@@ -183,6 +184,20 @@ export interface UpdateMessageReactionCount {
|
|
|
183
184
|
export interface UpdateMessageReactions {
|
|
184
185
|
messageReactions: MessageReactions;
|
|
185
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* The status of a chat member was changed.
|
|
189
|
+
* @unlisted
|
|
190
|
+
*/
|
|
191
|
+
export interface UpdateChatMember {
|
|
192
|
+
chatMember: ChatMemberUpdated;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The status of the current account was changed in a chat.
|
|
196
|
+
* @unlisted
|
|
197
|
+
*/
|
|
198
|
+
export interface UpdateMyChatMember {
|
|
199
|
+
myChatMember: ChatMemberUpdated;
|
|
200
|
+
}
|
|
186
201
|
/** @unlisted */
|
|
187
202
|
export interface UpdateMap {
|
|
188
203
|
message: UpdateNewMessage;
|
|
@@ -199,8 +214,10 @@ export interface UpdateMap {
|
|
|
199
214
|
messageInteractions: UpdateMessageInteractions;
|
|
200
215
|
messageReactionCount: UpdateMessageReactionCount;
|
|
201
216
|
messageReactions: UpdateMessageReactions;
|
|
217
|
+
chatMember: UpdateChatMember;
|
|
218
|
+
myChatMember: UpdateMyChatMember;
|
|
202
219
|
}
|
|
203
220
|
/** @unlisted */
|
|
204
|
-
export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions>;
|
|
221
|
+
export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions & UpdateChatMember & UpdateMyChatMember>;
|
|
205
222
|
/** An incoming update. */
|
|
206
|
-
export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions;
|
|
223
|
+
export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions | UpdateChatMember | UpdateMyChatMember;
|
package/package.json
CHANGED
package/script/3_types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./types/0_login_url.js";
|
|
|
18
18
|
export * from "./types/0_mask_position.js";
|
|
19
19
|
export * from "./types/0_message_entity.js";
|
|
20
20
|
export * from "./types/0_message_identifier.js";
|
|
21
|
+
export * from "./types/0_mini_app_info.js";
|
|
21
22
|
export * from "./types/0_network_statistics_entry.js";
|
|
22
23
|
export * from "./types/0_parse_mode.js";
|
|
23
24
|
export * from "./types/0_poll_option.js";
|
|
@@ -26,7 +27,6 @@ export * from "./types/0_restriction_reason.js";
|
|
|
26
27
|
export * from "./types/0_thumbnail.js";
|
|
27
28
|
export * from "./types/0_venue.js";
|
|
28
29
|
export * from "./types/0_voice.js";
|
|
29
|
-
export * from "./types/0_web_app_info.js";
|
|
30
30
|
export * from "./types/1_animation.js";
|
|
31
31
|
export * from "./types/1_audio.js";
|
|
32
32
|
export * from "./types/1_bot_command_scope.js";
|
|
@@ -52,9 +52,11 @@ export * from "./types/2_chosen_inline_result.js";
|
|
|
52
52
|
export * from "./types/2_game.js";
|
|
53
53
|
export * from "./types/2_inline_keyboard_button.js";
|
|
54
54
|
export * from "./types/2_inline_query.js";
|
|
55
|
+
export * from "./types/2_invite_link.js";
|
|
55
56
|
export * from "./types/2_message_interactions.js";
|
|
56
57
|
export * from "./types/2_message_reaction_count.js";
|
|
57
58
|
export * from "./types/2_message_reactions.js";
|
|
59
|
+
export * from "./types/3_chat_member_updated.js";
|
|
58
60
|
export * from "./types/3_reply_markup.js";
|
|
59
61
|
export * from "./types/4_inline_query_result.js";
|
|
60
62
|
export * from "./types/4_message.js";
|
package/script/3_types.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./types/0_login_url.js"), exports);
|
|
|
34
34
|
__exportStar(require("./types/0_mask_position.js"), exports);
|
|
35
35
|
__exportStar(require("./types/0_message_entity.js"), exports);
|
|
36
36
|
__exportStar(require("./types/0_message_identifier.js"), exports);
|
|
37
|
+
__exportStar(require("./types/0_mini_app_info.js"), exports);
|
|
37
38
|
__exportStar(require("./types/0_network_statistics_entry.js"), exports);
|
|
38
39
|
__exportStar(require("./types/0_parse_mode.js"), exports);
|
|
39
40
|
__exportStar(require("./types/0_poll_option.js"), exports);
|
|
@@ -42,7 +43,6 @@ __exportStar(require("./types/0_restriction_reason.js"), exports);
|
|
|
42
43
|
__exportStar(require("./types/0_thumbnail.js"), exports);
|
|
43
44
|
__exportStar(require("./types/0_venue.js"), exports);
|
|
44
45
|
__exportStar(require("./types/0_voice.js"), exports);
|
|
45
|
-
__exportStar(require("./types/0_web_app_info.js"), exports);
|
|
46
46
|
__exportStar(require("./types/1_animation.js"), exports);
|
|
47
47
|
__exportStar(require("./types/1_audio.js"), exports);
|
|
48
48
|
__exportStar(require("./types/1_bot_command_scope.js"), exports);
|
|
@@ -68,9 +68,11 @@ __exportStar(require("./types/2_chosen_inline_result.js"), exports);
|
|
|
68
68
|
__exportStar(require("./types/2_game.js"), exports);
|
|
69
69
|
__exportStar(require("./types/2_inline_keyboard_button.js"), exports);
|
|
70
70
|
__exportStar(require("./types/2_inline_query.js"), exports);
|
|
71
|
+
__exportStar(require("./types/2_invite_link.js"), exports);
|
|
71
72
|
__exportStar(require("./types/2_message_interactions.js"), exports);
|
|
72
73
|
__exportStar(require("./types/2_message_reaction_count.js"), exports);
|
|
73
74
|
__exportStar(require("./types/2_message_reactions.js"), exports);
|
|
75
|
+
__exportStar(require("./types/3_chat_member_updated.js"), exports);
|
|
74
76
|
__exportStar(require("./types/3_reply_markup.js"), exports);
|
|
75
77
|
__exportStar(require("./types/4_inline_query_result.js"), exports);
|
|
76
78
|
__exportStar(require("./types/4_message.js"), exports);
|
package/script/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 172;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.147";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/script/4_constants.js
CHANGED
|
@@ -79,7 +79,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
79
79
|
]);
|
|
80
80
|
exports.INITIAL_DC = "2";
|
|
81
81
|
exports.LAYER = 172;
|
|
82
|
-
exports.APP_VERSION = "MTKruto 0.1.
|
|
82
|
+
exports.APP_VERSION = "MTKruto 0.1.147";
|
|
83
83
|
// @ts-ignore: lib
|
|
84
84
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
85
85
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { enums, types } from "../2_tl.js";
|
|
2
2
|
import { Update } from "../3_types.js";
|
|
3
3
|
import { C } from "./0_types.js";
|
|
4
|
+
type ReactionManagerUpdate = types.UpdateBotMessageReactions | types.UpdateBotMessageReaction | types.UpdateMessageReactions | types.UpdateChannelMessageViews | types.UpdateChannelMessageForwards;
|
|
4
5
|
export declare class ReactionManager {
|
|
5
6
|
#private;
|
|
6
7
|
constructor(c: C);
|
|
7
|
-
static canHandleUpdate(update: enums.Update): update is
|
|
8
|
-
handleUpdate(update:
|
|
8
|
+
static canHandleUpdate(update: enums.Update): update is ReactionManagerUpdate;
|
|
9
|
+
handleUpdate(update: ReactionManagerUpdate): Promise<Update | null>;
|
|
9
10
|
}
|
|
11
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import { FileManager } from "./1_file_manager.js";
|
|
|
7
7
|
interface C extends C_ {
|
|
8
8
|
fileManager: FileManager;
|
|
9
9
|
}
|
|
10
|
+
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
|
|
10
11
|
export declare class MessageManager {
|
|
11
12
|
#private;
|
|
12
13
|
constructor(c: C);
|
|
@@ -46,8 +47,8 @@ export declare class MessageManager {
|
|
|
46
47
|
setReactions(chatId: number, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
|
|
47
48
|
addReaction(chatId: number, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
|
|
48
49
|
removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
|
|
49
|
-
static canHandleUpdate(update: enums.Update): update is
|
|
50
|
-
handleUpdate(update:
|
|
50
|
+
static canHandleUpdate(update: enums.Update): update is MessageManagerUpdate;
|
|
51
|
+
handleUpdate(update: MessageManagerUpdate): Promise<Update | null>;
|
|
51
52
|
sendChatAction(chatId: ID, action: ChatAction, params?: {
|
|
52
53
|
messageThreadId?: number;
|
|
53
54
|
}): Promise<void>;
|
|
@@ -17,6 +17,7 @@ const _0_deps_js_1 = require("../0_deps.js");
|
|
|
17
17
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
18
18
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
19
19
|
const _3_types_js_1 = require("../3_types.js");
|
|
20
|
+
const _3_types_js_2 = require("../3_types.js");
|
|
20
21
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
21
22
|
const _0_html_js_1 = require("./0_html.js");
|
|
22
23
|
const _0_utilities_js_1 = require("./0_utilities.js");
|
|
@@ -103,7 +104,7 @@ class MessageManager {
|
|
|
103
104
|
default:
|
|
104
105
|
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
105
106
|
}
|
|
106
|
-
const entities = entities_?.length > 0 ? await Promise.all(entities_.map((v) => (0,
|
|
107
|
+
const entities = entities_?.length > 0 ? await Promise.all(entities_.map((v) => (0, _3_types_js_2.messageEntityToTlObject)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity))) : undefined;
|
|
107
108
|
return [text, entities];
|
|
108
109
|
}
|
|
109
110
|
async getStickerSetName(inputStickerSet, hash = 0) {
|
|
@@ -119,7 +120,7 @@ class MessageManager {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
async constructMessage(message_, r) {
|
|
122
|
-
return await (0,
|
|
123
|
+
return await (0, _3_types_js_2.constructMessage)(message_, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity, this.getMessage.bind(this), this.getStickerSetName.bind(this), r);
|
|
123
124
|
}
|
|
124
125
|
async forwardMessages(from, to, messageIds, params) {
|
|
125
126
|
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.forwardMessages({
|
|
@@ -201,7 +202,7 @@ class MessageManager {
|
|
|
201
202
|
reply_markup: replyMarkup,
|
|
202
203
|
});
|
|
203
204
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
204
|
-
return (0,
|
|
205
|
+
return (0, _3_types_js_2.assertMessageType)(message_, "text");
|
|
205
206
|
}
|
|
206
207
|
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
207
208
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -232,7 +233,7 @@ class MessageManager {
|
|
|
232
233
|
message: "",
|
|
233
234
|
});
|
|
234
235
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
235
|
-
return (0,
|
|
236
|
+
return (0, _3_types_js_2.assertMessageType)(message, "venue");
|
|
236
237
|
}
|
|
237
238
|
async sendContact(chatId, firstName, number, params) {
|
|
238
239
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -258,7 +259,7 @@ class MessageManager {
|
|
|
258
259
|
message: "",
|
|
259
260
|
});
|
|
260
261
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
261
|
-
return (0,
|
|
262
|
+
return (0, _3_types_js_2.assertMessageType)(message, "contact");
|
|
262
263
|
}
|
|
263
264
|
async sendDice(chatId, params) {
|
|
264
265
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -281,7 +282,7 @@ class MessageManager {
|
|
|
281
282
|
message: "",
|
|
282
283
|
});
|
|
283
284
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
284
|
-
return (0,
|
|
285
|
+
return (0, _3_types_js_2.assertMessageType)(message, "dice");
|
|
285
286
|
}
|
|
286
287
|
async sendLocation(chatId, latitude, longitude, params) {
|
|
287
288
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -319,10 +320,10 @@ class MessageManager {
|
|
|
319
320
|
message: "",
|
|
320
321
|
});
|
|
321
322
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
322
|
-
return (0,
|
|
323
|
+
return (0, _3_types_js_2.assertMessageType)(message, "location");
|
|
323
324
|
}
|
|
324
325
|
async sendVideoNote(chatId, audio, params) {
|
|
325
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params,
|
|
326
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params, _3_types_js_2.FileType.VideoNote, [
|
|
326
327
|
new _2_tl_js_1.types.DocumentAttributeVideo({
|
|
327
328
|
round_message: true,
|
|
328
329
|
w: params?.length ?? 0,
|
|
@@ -330,29 +331,29 @@ class MessageManager {
|
|
|
330
331
|
duration: params?.duration ?? 0,
|
|
331
332
|
}),
|
|
332
333
|
], false);
|
|
333
|
-
return (0,
|
|
334
|
+
return (0, _3_types_js_2.assertMessageType)(message, "videoNote");
|
|
334
335
|
}
|
|
335
336
|
async sendAudio(chatId, audio, params) {
|
|
336
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params,
|
|
337
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params, _3_types_js_2.FileType.Audio, [
|
|
337
338
|
new _2_tl_js_1.types.DocumentAttributeAudio({
|
|
338
339
|
duration: params?.duration ?? 0,
|
|
339
340
|
performer: params?.performer,
|
|
340
341
|
title: params?.title,
|
|
341
342
|
}),
|
|
342
343
|
]);
|
|
343
|
-
return (0,
|
|
344
|
+
return (0, _3_types_js_2.assertMessageType)(message, "audio");
|
|
344
345
|
}
|
|
345
346
|
async sendVoice(chatId, voice, params) {
|
|
346
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, voice, params,
|
|
347
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, voice, params, _3_types_js_2.FileType.Voice, [
|
|
347
348
|
new _2_tl_js_1.types.DocumentAttributeAudio({
|
|
348
349
|
voice: true,
|
|
349
350
|
duration: params?.duration ?? 0,
|
|
350
351
|
}),
|
|
351
352
|
]);
|
|
352
|
-
return (0,
|
|
353
|
+
return (0, _3_types_js_2.assertMessageType)(message, "voice");
|
|
353
354
|
}
|
|
354
355
|
async sendAnimation(chatId, animation, params) {
|
|
355
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, animation, params,
|
|
356
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, animation, params, _3_types_js_2.FileType.Animation, [
|
|
356
357
|
new _2_tl_js_1.types.DocumentAttributeAnimated(),
|
|
357
358
|
new _2_tl_js_1.types.DocumentAttributeVideo({
|
|
358
359
|
supports_streaming: true,
|
|
@@ -361,10 +362,10 @@ class MessageManager {
|
|
|
361
362
|
duration: params?.duration ?? 0,
|
|
362
363
|
}),
|
|
363
364
|
]);
|
|
364
|
-
return (0,
|
|
365
|
+
return (0, _3_types_js_2.assertMessageType)(message, "animation");
|
|
365
366
|
}
|
|
366
367
|
async sendVideo(chatId, video, params) {
|
|
367
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, video, params,
|
|
368
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, video, params, _3_types_js_2.FileType.Video, [
|
|
368
369
|
new _2_tl_js_1.types.DocumentAttributeVideo({
|
|
369
370
|
supports_streaming: params?.supportsStreaming ? true : undefined,
|
|
370
371
|
w: params?.width ?? 0,
|
|
@@ -372,17 +373,17 @@ class MessageManager {
|
|
|
372
373
|
duration: params?.duration ?? 0,
|
|
373
374
|
}),
|
|
374
375
|
]);
|
|
375
|
-
return (0,
|
|
376
|
+
return (0, _3_types_js_2.assertMessageType)(message, "video");
|
|
376
377
|
}
|
|
377
378
|
async sendDocument(chatId, document, params) {
|
|
378
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, document, params,
|
|
379
|
-
return (0,
|
|
379
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, document, params, _3_types_js_2.FileType.Document, []);
|
|
380
|
+
return (0, _3_types_js_2.assertMessageType)(message, "document");
|
|
380
381
|
}
|
|
381
382
|
async sendPhoto(chatId, photo, params) {
|
|
382
383
|
let media = null;
|
|
383
384
|
const spoiler = params?.hasSpoiler ? true : undefined;
|
|
384
385
|
if (typeof photo === "string") {
|
|
385
|
-
const fileId = __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveFileId).call(this, photo,
|
|
386
|
+
const fileId = __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveFileId).call(this, photo, _3_types_js_2.FileType.Photo);
|
|
386
387
|
if (fileId != null) {
|
|
387
388
|
media = new _2_tl_js_1.types.InputMediaPhoto({
|
|
388
389
|
id: new _2_tl_js_1.types.InputPhoto(fileId),
|
|
@@ -401,7 +402,7 @@ class MessageManager {
|
|
|
401
402
|
}
|
|
402
403
|
}
|
|
403
404
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendMedia).call(this, chatId, media, params);
|
|
404
|
-
return (0,
|
|
405
|
+
return (0, _3_types_js_2.assertMessageType)(message, "photo");
|
|
405
406
|
}
|
|
406
407
|
async sendPoll(chatId, question, options, params) {
|
|
407
408
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -444,7 +445,7 @@ class MessageManager {
|
|
|
444
445
|
message: "",
|
|
445
446
|
});
|
|
446
447
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
447
|
-
return (0,
|
|
448
|
+
return (0, _3_types_js_2.assertMessageType)(message, "poll");
|
|
448
449
|
}
|
|
449
450
|
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
450
451
|
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.editMessage({
|
|
@@ -466,7 +467,7 @@ class MessageManager {
|
|
|
466
467
|
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
467
468
|
});
|
|
468
469
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
469
|
-
return (0,
|
|
470
|
+
return (0, _3_types_js_2.assertMessageType)(message_, "text");
|
|
470
471
|
}
|
|
471
472
|
async deleteMessages(chatId, messageIds, params) {
|
|
472
473
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
@@ -516,7 +517,7 @@ class MessageManager {
|
|
|
516
517
|
async addReaction(chatId, messageId, reaction, params) {
|
|
517
518
|
const chosenReactions = await this.getMessage(chatId, messageId).then((v) => v?.reactions ?? []).then((v) => v.filter((v) => v.chosen));
|
|
518
519
|
for (const r of chosenReactions) {
|
|
519
|
-
if ((0,
|
|
520
|
+
if ((0, _3_types_js_2.reactionEqual)(r.reaction, reaction)) {
|
|
520
521
|
return;
|
|
521
522
|
}
|
|
522
523
|
}
|
|
@@ -526,7 +527,7 @@ class MessageManager {
|
|
|
526
527
|
async removeReaction(chatId, messageId, reaction) {
|
|
527
528
|
const chosenReactions = await this.getMessage(chatId, messageId).then((v) => v?.reactions ?? []).then((v) => v.filter((v) => v.chosen));
|
|
528
529
|
for (const r of chosenReactions) {
|
|
529
|
-
if ((0,
|
|
530
|
+
if ((0, _3_types_js_2.reactionEqual)(r.reaction, reaction)) {
|
|
530
531
|
const reactions = chosenReactions.filter((v) => v != r).map((v) => v.reaction);
|
|
531
532
|
await this.setReactions(chatId, messageId, reactions);
|
|
532
533
|
break;
|
|
@@ -534,14 +535,20 @@ class MessageManager {
|
|
|
534
535
|
}
|
|
535
536
|
}
|
|
536
537
|
static canHandleUpdate(update) {
|
|
537
|
-
return update instanceof _2_tl_js_1.types.UpdateNewMessage ||
|
|
538
|
+
return update instanceof _2_tl_js_1.types.UpdateNewMessage ||
|
|
539
|
+
update instanceof _2_tl_js_1.types.UpdateNewChannelMessage ||
|
|
540
|
+
update instanceof _2_tl_js_1.types.UpdateEditMessage ||
|
|
541
|
+
update instanceof _2_tl_js_1.types.UpdateEditChannelMessage ||
|
|
542
|
+
update instanceof _2_tl_js_1.types.UpdateDeleteMessages ||
|
|
543
|
+
update instanceof _2_tl_js_1.types.UpdateDeleteChannelMessages ||
|
|
544
|
+
update instanceof _2_tl_js_1.types.UpdateChannelParticipant ||
|
|
545
|
+
update instanceof _2_tl_js_1.types.UpdateChatParticipant;
|
|
538
546
|
}
|
|
539
547
|
async handleUpdate(update) {
|
|
540
548
|
if (update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage || update instanceof _2_tl_js_1.types.UpdateEditMessage || update instanceof _2_tl_js_1.types.UpdateEditChannelMessage) {
|
|
541
549
|
if (update.message instanceof _2_tl_js_1.types.Message || update.message instanceof _2_tl_js_1.types.MessageService) {
|
|
542
550
|
const chatId = (0, _2_tl_js_1.peerToChatId)(update.message.peer_id);
|
|
543
551
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.setMessage(chatId, update.message.id, update.message);
|
|
544
|
-
// promises.push(this.#chatListManager.reassignChatLastMessage(chatId));
|
|
545
552
|
}
|
|
546
553
|
}
|
|
547
554
|
if (update instanceof _2_tl_js_1.types.UpdateNewMessage ||
|
|
@@ -588,6 +595,16 @@ class MessageManager {
|
|
|
588
595
|
}
|
|
589
596
|
return { deletedMessages };
|
|
590
597
|
}
|
|
598
|
+
if (update instanceof _2_tl_js_1.types.UpdateChannelParticipant || update instanceof _2_tl_js_1.types.UpdateChatParticipant) {
|
|
599
|
+
const chatMember = await (0, _3_types_js_1.constructChatMemberUpdated)(update, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
600
|
+
const selfId = await __classPrivateFieldGet(this, _MessageManager_c, "f").getSelfId();
|
|
601
|
+
if (chatMember.oldChatMember.user.id == selfId) {
|
|
602
|
+
return { myChatMember: chatMember };
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
return { chatMember };
|
|
606
|
+
}
|
|
607
|
+
}
|
|
591
608
|
return null;
|
|
592
609
|
}
|
|
593
610
|
async sendChatAction(chatId, action, params) {
|
|
@@ -721,7 +738,7 @@ class MessageManager {
|
|
|
721
738
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.editBanned({
|
|
722
739
|
channel: new _2_tl_js_1.types.InputChannel(chat),
|
|
723
740
|
participant: member,
|
|
724
|
-
banned_rights: (0,
|
|
741
|
+
banned_rights: (0, _3_types_js_2.chatMemberRightsToTlObject)(params?.rights, params?.untilDate),
|
|
725
742
|
});
|
|
726
743
|
}
|
|
727
744
|
async getChatAdministrators(chatId) {
|
|
@@ -740,7 +757,7 @@ class MessageManager {
|
|
|
740
757
|
}
|
|
741
758
|
const chatMembers = new Array();
|
|
742
759
|
for (const p of participants.participants) {
|
|
743
|
-
chatMembers.push(await (0,
|
|
760
|
+
chatMembers.push(await (0, _3_types_js_2.constructChatMember)(p, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity));
|
|
744
761
|
}
|
|
745
762
|
return chatMembers;
|
|
746
763
|
}
|
|
@@ -751,7 +768,7 @@ class MessageManager {
|
|
|
751
768
|
}
|
|
752
769
|
const chatMembers = new Array();
|
|
753
770
|
for (const p of fullChat.full_chat.participants.participants) {
|
|
754
|
-
chatMembers.push(await (0,
|
|
771
|
+
chatMembers.push(await (0, _3_types_js_2.constructChatMember)(p, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity));
|
|
755
772
|
}
|
|
756
773
|
return chatMembers;
|
|
757
774
|
}
|
|
@@ -786,7 +803,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_instances = new WeakSet(), _M
|
|
|
786
803
|
}, _MessageManager_constructReplyMarkup = async function _MessageManager_constructReplyMarkup(params) {
|
|
787
804
|
if (params?.replyMarkup) {
|
|
788
805
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("replyMarkup");
|
|
789
|
-
return (0,
|
|
806
|
+
return (0, _3_types_js_2.replyMarkupToTlObject)(params.replyMarkup, this.usernameResolver.bind(this));
|
|
790
807
|
}
|
|
791
808
|
}, _MessageManager_resolveSendAs = async function _MessageManager_resolveSendAs(params) {
|
|
792
809
|
const sendAs = params?.sendAs;
|
|
@@ -797,7 +814,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_instances = new WeakSet(), _M
|
|
|
797
814
|
}, _MessageManager_constructReplyTo = async function _MessageManager_constructReplyTo(params) {
|
|
798
815
|
const topMsgId = params?.messageThreadId;
|
|
799
816
|
const replyToMsgId = params?.replyToMessageId;
|
|
800
|
-
return replyToMsgId !== undefined ? new _2_tl_js_1.types.InputReplyToMessage({ reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId, quote_text: params?.replyQuote?.text, quote_entities: await Promise.all(params?.replyQuote?.entities.map((v) => (0,
|
|
817
|
+
return replyToMsgId !== undefined ? new _2_tl_js_1.types.InputReplyToMessage({ reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId, quote_text: params?.replyQuote?.text, quote_entities: await Promise.all(params?.replyQuote?.entities.map((v) => (0, _3_types_js_2.messageEntityToTlObject)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity)) ?? []), quote_offset: params?.replyQuote?.offset }) : undefined;
|
|
801
818
|
}, _MessageManager_sendDocumentInner = async function _MessageManager_sendDocumentInner(chatId, document, params, fileType, otherAttribs, urlSupported = false) {
|
|
802
819
|
let media = null;
|
|
803
820
|
const spoiler = params?.hasSpoiler ? true : undefined;
|
|
@@ -865,7 +882,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_instances = new WeakSet(), _M
|
|
|
865
882
|
}, _MessageManager_resolveFileId = function _MessageManager_resolveFileId(maybeFileId, expectedFileType) {
|
|
866
883
|
let fileId = null;
|
|
867
884
|
try {
|
|
868
|
-
fileId =
|
|
885
|
+
fileId = _3_types_js_2.FileID.decode(maybeFileId);
|
|
869
886
|
}
|
|
870
887
|
catch (err) {
|
|
871
888
|
d("fileId: %o", err);
|
|
@@ -888,7 +905,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_instances = new WeakSet(), _M
|
|
|
888
905
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendReaction({
|
|
889
906
|
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
890
907
|
msg_id: messageId,
|
|
891
|
-
reaction: reactions.map((v) => (0,
|
|
908
|
+
reaction: reactions.map((v) => (0, _3_types_js_2.reactionToTlObject)(v)),
|
|
892
909
|
big: params?.big ? true : undefined,
|
|
893
910
|
add_to_recent: params?.addToRecents ? true : undefined,
|
|
894
911
|
});
|
|
@@ -6,11 +6,12 @@ import { MessageManager } from "./2_message_manager.js";
|
|
|
6
6
|
type C = C_ & {
|
|
7
7
|
messageManager: MessageManager;
|
|
8
8
|
};
|
|
9
|
+
type CallbackQueryManagerUpdate = types.UpdateBotCallbackQuery | types.UpdateInlineBotCallbackQuery;
|
|
9
10
|
export declare class CallbackQueryManager {
|
|
10
11
|
#private;
|
|
11
12
|
constructor(c: C);
|
|
12
13
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
13
|
-
static canHandleUpdate(update: enums.Update): update is
|
|
14
|
-
handleUpdate(update:
|
|
14
|
+
static canHandleUpdate(update: enums.Update): update is CallbackQueryManagerUpdate;
|
|
15
|
+
handleUpdate(update: CallbackQueryManagerUpdate): Promise<Update>;
|
|
15
16
|
}
|
|
16
17
|
export {};
|
|
@@ -5,13 +5,14 @@ import { MessageManager } from "./2_message_manager.js";
|
|
|
5
5
|
type C = C_ & {
|
|
6
6
|
messageManager: MessageManager;
|
|
7
7
|
};
|
|
8
|
+
type ChatListManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdatePinnedDialogs | types.UpdateFolderPeers | types.UpdateChannel | types.UpdateChat | types.UpdateUser | types.UpdateUserName;
|
|
8
9
|
export declare class ChatListManager {
|
|
9
10
|
#private;
|
|
10
11
|
constructor(c: C);
|
|
11
12
|
reassignChatLastMessage(chatId: number, add?: boolean, sendUpdate?: boolean): Promise<() => Promise<void>>;
|
|
12
13
|
getChats(from?: "archived" | "main", after?: Chat, limit?: number): Promise<Chat[]>;
|
|
13
|
-
static canHandleUpdate(update: enums.Update): update is
|
|
14
|
-
handleUpdate(update:
|
|
14
|
+
static canHandleUpdate(update: enums.Update): update is ChatListManagerUpdate;
|
|
15
|
+
handleUpdate(update: ChatListManagerUpdate): Promise<void>;
|
|
15
16
|
getChat(chatId: ID): Promise<Chat>;
|
|
16
17
|
}
|
|
17
18
|
export {};
|
|
@@ -6,11 +6,12 @@ import { MessageManager } from "./2_message_manager.js";
|
|
|
6
6
|
type C = C_ & {
|
|
7
7
|
messageManager: MessageManager;
|
|
8
8
|
};
|
|
9
|
+
type InlineQueryManagerUpdate = types.UpdateBotInlineQuery | types.UpdateBotInlineSend;
|
|
9
10
|
export declare class InlineQueryManager {
|
|
10
11
|
#private;
|
|
11
12
|
constructor(c: C);
|
|
12
13
|
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
13
|
-
static canHandleUpdate(update: enums.Update): update is
|
|
14
|
-
handleUpdate(update:
|
|
14
|
+
static canHandleUpdate(update: enums.Update): update is InlineQueryManagerUpdate;
|
|
15
|
+
handleUpdate(update: InlineQueryManagerUpdate): Promise<Update>;
|
|
15
16
|
}
|
|
16
17
|
export {};
|
|
@@ -28,7 +28,7 @@ class InlineQueryManager {
|
|
|
28
28
|
results: await Promise.all(results.map((v) => (0, _3_types_js_1.inlineQueryResultToTlObject)(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))),
|
|
29
29
|
cache_time: params?.cacheTime ?? 300,
|
|
30
30
|
private: params?.isPersonal ? true : undefined,
|
|
31
|
-
switch_webview: params?.button && params.button.
|
|
31
|
+
switch_webview: params?.button && params.button.miniApp ? new _2_tl_js_1.types.InlineBotWebView({ text: params.button.text, url: params.button.miniApp.url }) : undefined,
|
|
32
32
|
switch_pm: params?.button && params.button.startParameter ? new _2_tl_js_1.types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
|
|
33
33
|
gallery: params?.isGallery ? true : undefined,
|
|
34
34
|
next_offset: params?.nextOffset,
|
|
@@ -9,6 +9,7 @@ export interface ReactionCustomEmoji {
|
|
|
9
9
|
type: "customEmoji";
|
|
10
10
|
id: string;
|
|
11
11
|
}
|
|
12
|
+
/** A reaction type. */
|
|
12
13
|
export type Reaction = ReactionEmoji | ReactionCustomEmoji;
|
|
13
14
|
export declare function constructReaction(reaction: enums.Reaction): Reaction;
|
|
14
15
|
export declare function reactionToTlObject(reaction: Reaction): enums.Reaction;
|
|
@@ -85,4 +85,5 @@ export interface InputMessageContentInvoice {
|
|
|
85
85
|
sendEmailToProvider?: boolean;
|
|
86
86
|
isFlexible?: boolean;
|
|
87
87
|
}
|
|
88
|
+
/** The content of a message to be returned as an inline query result. */
|
|
88
89
|
export type InputMessageContent = InputMessageContentText | InputMessageContentLocation | InputMessageContentVenue | InputMessageContentContact | InputMessageContentInvoice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
3
3
|
import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
5
5
|
/** @unlisted */
|
|
6
6
|
export interface KeyboardButtonText {
|
|
7
7
|
text: string;
|
|
@@ -40,9 +40,10 @@ export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
|
|
|
40
40
|
requestPoll: KeyboardButtonPollType;
|
|
41
41
|
}
|
|
42
42
|
/** @unlisted */
|
|
43
|
-
export interface
|
|
44
|
-
|
|
43
|
+
export interface KeyboardButtonMiniApp extends KeyboardButtonText {
|
|
44
|
+
miniApp: MiniAppInfo;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** A button of a custom keyboard. */
|
|
47
|
+
export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonMiniApp;
|
|
47
48
|
export declare function constructKeyboardButton(button_: enums.KeyboardButton): KeyboardButton;
|
|
48
49
|
export declare function keyboardButtonToTlObject(button: KeyboardButton): import("../tl/2_types.js").KeyboardButton_ | import("../tl/2_types.js").KeyboardButtonRequestPhone_ | import("../tl/2_types.js").KeyboardButtonRequestGeoLocation_ | import("../tl/2_types.js").KeyboardButtonRequestPoll_ | import("../tl/2_types.js").KeyboardButtonWebView_ | import("../tl/2_types.js").KeyboardButtonRequestPeer_;
|
|
@@ -75,7 +75,7 @@ function constructKeyboardButton(button_) {
|
|
|
75
75
|
return button;
|
|
76
76
|
}
|
|
77
77
|
else if (button_ instanceof _2_tl_js_1.types.KeyboardButtonWebView || button_ instanceof _2_tl_js_1.types.KeyboardButtonSimpleWebView) {
|
|
78
|
-
return { text: button_.text,
|
|
78
|
+
return { text: button_.text, miniApp: { url: button_.url } };
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
@@ -130,8 +130,8 @@ function keyboardButtonToTlObject(button) {
|
|
|
130
130
|
else if ("requestPoll" in button) {
|
|
131
131
|
return new _2_tl_js_1.types.KeyboardButtonRequestPoll({ text: button.text, quiz: button.requestPoll.type == "quiz" });
|
|
132
132
|
}
|
|
133
|
-
else if ("
|
|
134
|
-
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.
|
|
133
|
+
else if ("miniApp" in button) {
|
|
134
|
+
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.miniApp.url });
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
137
137
|
return new _2_tl_js_1.types.KeyboardButton({ text: button.text });
|