@mtkruto/node 0.137.0 → 0.139.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 +2 -3
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +2 -3
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +1 -3
- package/esm/client/0_params.d.ts +6 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +14 -9
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/1_client_generic.js +1 -3
- package/esm/client/1_client_plain.d.ts +2 -6
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +1 -3
- package/esm/client/1_types.d.ts +1 -0
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +1 -1
- package/esm/client/2_business_connection_manager.js +1 -1
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +2 -0
- package/esm/client/2_payment_manager.js +1 -1
- package/esm/client/2_reaction_manager.js +4 -4
- package/esm/client/2_story_album_manager.d.ts.map +1 -1
- package/esm/client/2_story_album_manager.js +1 -2
- package/esm/client/2_translations_manager.js +2 -2
- package/esm/client/2_update_manager.js +1 -1
- package/esm/client/3_account_manager.d.ts +2 -1
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +11 -4
- package/esm/client/3_filters.d.ts +94 -18
- package/esm/client/3_filters.d.ts.map +1 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +16 -19
- package/esm/client/3_video_chat_manager.js +1 -1
- package/esm/client/4_callback_query_manager.js +1 -1
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +4 -5
- package/esm/client/4_context.d.ts +154 -462
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +220 -505
- package/esm/client/4_inline_query_manager.js +3 -3
- package/esm/client/4_link_preview_manager.js +1 -1
- package/esm/client/4_poll_manager.js +2 -2
- package/esm/client/4_story_manager.js +5 -5
- package/esm/client/6_client.d.ts +13 -14
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +26 -14
- package/esm/client/6_client_dispatcher.d.ts +14 -9
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +15 -6
- package/esm/session/1_session.d.ts +2 -6
- package/esm/session/1_session.d.ts.map +1 -1
- package/esm/types/0_bot_token_check_result.d.ts +0 -1
- package/esm/types/0_bot_token_check_result.d.ts.map +1 -1
- package/esm/types/0_callback_query_question.d.ts +0 -3
- package/esm/types/0_callback_query_question.d.ts.map +1 -1
- package/esm/types/0_chat_action_type.d.ts +0 -13
- package/esm/types/0_chat_action_type.d.ts.map +1 -1
- package/esm/types/0_code_check_result.d.ts +0 -3
- package/esm/types/0_code_check_result.d.ts.map +1 -1
- package/esm/types/0_emoji_status.d.ts +0 -2
- package/esm/types/0_emoji_status.d.ts.map +1 -1
- package/esm/types/0_gift_component_rarity.d.ts +0 -5
- package/esm/types/0_gift_component_rarity.d.ts.map +1 -1
- package/esm/types/0_id.d.ts +1 -3
- package/esm/types/0_id.d.ts.map +1 -1
- package/{script/types/1_inline_query_result_button.d.ts → esm/types/0_inline_query_result_button.d.ts} +3 -4
- package/esm/types/0_inline_query_result_button.d.ts.map +1 -0
- package/esm/types/0_input_emoji_status.d.ts +0 -2
- package/esm/types/0_input_emoji_status.d.ts.map +1 -1
- package/esm/types/0_password_check_result.d.ts +0 -2
- package/esm/types/0_password_check_result.d.ts.map +1 -1
- package/esm/types/0_reaction.d.ts +0 -3
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_user_status.d.ts +0 -5
- package/esm/types/0_user_status.d.ts.map +1 -1
- package/esm/types/0_video_chat.d.ts +0 -3
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/1_available_reactions.d.ts +0 -3
- package/esm/types/1_available_reactions.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.d.ts +0 -7
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_chat_p.d.ts +1 -7
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_inline_keyboard_button.d.ts +25 -42
- package/esm/types/1_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_inline_keyboard_button.js +57 -64
- package/esm/types/1_input_gift.d.ts +0 -3
- package/esm/types/1_input_gift.d.ts.map +1 -1
- package/esm/types/1_input_story_content.d.ts +2 -2
- package/esm/types/1_input_story_content.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.d.ts +33 -34
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +81 -88
- package/esm/types/2_chat.d.ts +1 -3
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat_member.d.ts +6 -24
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_message_entity.d.ts +0 -20
- package/esm/types/2_message_entity.d.ts.map +1 -1
- package/esm/types/{0_mini_app_button_info.js → 2_profile_photo_list.d.ts} +10 -2
- package/esm/types/2_profile_photo_list.d.ts.map +1 -0
- package/esm/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.js} +6 -5
- package/esm/types/2_reply_markup.d.ts +4 -12
- package/esm/types/2_reply_markup.d.ts.map +1 -1
- package/esm/types/2_reply_markup.js +13 -17
- package/esm/types/2_star_transaction_peer.d.ts +0 -8
- package/esm/types/2_star_transaction_peer.d.ts.map +1 -1
- package/esm/types/2_story_album_icon.d.ts +0 -2
- package/esm/types/2_story_album_icon.d.ts.map +1 -1
- package/esm/types/2_story_content.d.ts +3 -4
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +3 -3
- package/esm/types/2_story_privacy.d.ts +6 -7
- package/esm/types/2_story_privacy.d.ts.map +1 -1
- package/esm/types/2_story_privacy.js +23 -20
- package/esm/types/3_checklist_item.d.ts +2 -8
- package/esm/types/3_checklist_item.d.ts.map +1 -1
- package/esm/types/3_forward_header.d.ts +0 -5
- package/esm/types/3_forward_header.d.ts.map +1 -1
- package/esm/types/3_gift_upgraded_component.d.ts +0 -4
- package/esm/types/3_gift_upgraded_component.d.ts.map +1 -1
- package/esm/types/3_input_media.d.ts +10 -20
- package/esm/types/3_input_media.d.ts.map +1 -1
- package/esm/types/4_gift.d.ts +0 -2
- package/esm/types/4_gift.d.ts.map +1 -1
- package/esm/types/4_reply_to.d.ts +6 -14
- package/esm/types/4_reply_to.d.ts.map +1 -1
- package/esm/types/5_link_preview.d.ts +2 -18
- package/esm/types/5_link_preview.d.ts.map +1 -1
- package/esm/types/6_message.d.ts +90 -179
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message.js +104 -120
- package/esm/types/6_message_content.d.ts +0 -5
- package/esm/types/6_message_content.d.ts.map +1 -1
- package/esm/types/7_inline_query_result.d.ts +10 -47
- package/esm/types/7_inline_query_result.d.ts.map +1 -1
- package/esm/types/7_inline_query_result.js +219 -152
- package/esm/types/8_update.d.ts +58 -105
- package/esm/types/8_update.d.ts.map +1 -1
- package/esm/utilities/0_int.d.ts +1 -3
- package/esm/utilities/0_int.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +2 -3
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +2 -3
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +1 -3
- package/script/client/0_params.d.ts +6 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +14 -9
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/1_client_generic.js +1 -3
- package/script/client/1_client_plain.d.ts +2 -6
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +1 -3
- package/script/client/1_types.d.ts +1 -0
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +1 -1
- package/script/client/2_business_connection_manager.js +1 -1
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +2 -0
- package/script/client/2_payment_manager.js +1 -1
- package/script/client/2_reaction_manager.js +4 -4
- package/script/client/2_story_album_manager.d.ts.map +1 -1
- package/script/client/2_story_album_manager.js +1 -2
- package/script/client/2_translations_manager.js +2 -2
- package/script/client/2_update_manager.js +1 -1
- package/script/client/3_account_manager.d.ts +2 -1
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +9 -2
- package/script/client/3_filters.d.ts +94 -18
- package/script/client/3_filters.d.ts.map +1 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +15 -18
- package/script/client/3_video_chat_manager.js +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +4 -5
- package/script/client/4_context.d.ts +154 -462
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +220 -505
- package/script/client/4_inline_query_manager.js +3 -3
- package/script/client/4_link_preview_manager.js +1 -1
- package/script/client/4_poll_manager.js +2 -2
- package/script/client/4_story_manager.js +5 -5
- package/script/client/6_client.d.ts +13 -14
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +25 -13
- package/script/client/6_client_dispatcher.d.ts +14 -9
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +15 -6
- package/script/session/1_session.d.ts +2 -6
- package/script/session/1_session.d.ts.map +1 -1
- package/script/types/0_bot_token_check_result.d.ts +0 -1
- package/script/types/0_bot_token_check_result.d.ts.map +1 -1
- package/script/types/0_callback_query_question.d.ts +0 -3
- package/script/types/0_callback_query_question.d.ts.map +1 -1
- package/script/types/0_chat_action_type.d.ts +0 -13
- package/script/types/0_chat_action_type.d.ts.map +1 -1
- package/script/types/0_code_check_result.d.ts +0 -3
- package/script/types/0_code_check_result.d.ts.map +1 -1
- package/script/types/0_emoji_status.d.ts +0 -2
- package/script/types/0_emoji_status.d.ts.map +1 -1
- package/script/types/0_gift_component_rarity.d.ts +0 -5
- package/script/types/0_gift_component_rarity.d.ts.map +1 -1
- package/script/types/0_id.d.ts +1 -3
- package/script/types/0_id.d.ts.map +1 -1
- package/{esm/types/1_inline_query_result_button.d.ts → script/types/0_inline_query_result_button.d.ts} +3 -4
- package/script/types/0_inline_query_result_button.d.ts.map +1 -0
- package/script/types/0_input_emoji_status.d.ts +0 -2
- package/script/types/0_input_emoji_status.d.ts.map +1 -1
- package/script/types/0_password_check_result.d.ts +0 -2
- package/script/types/0_password_check_result.d.ts.map +1 -1
- package/script/types/0_reaction.d.ts +0 -3
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_user_status.d.ts +0 -5
- package/script/types/0_user_status.d.ts.map +1 -1
- package/script/types/0_video_chat.d.ts +0 -3
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/1_available_reactions.d.ts +0 -3
- package/script/types/1_available_reactions.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.d.ts +0 -7
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_chat_p.d.ts +1 -7
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_inline_keyboard_button.d.ts +25 -42
- package/script/types/1_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/1_inline_keyboard_button.js +57 -64
- package/script/types/1_input_gift.d.ts +0 -3
- package/script/types/1_input_gift.d.ts.map +1 -1
- package/script/types/1_input_story_content.d.ts +2 -2
- package/script/types/1_input_story_content.d.ts.map +1 -1
- package/script/types/1_keyboard_button.d.ts +33 -34
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +81 -88
- package/script/types/2_chat.d.ts +1 -3
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat_member.d.ts +6 -24
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_message_entity.d.ts +0 -20
- package/script/types/2_message_entity.d.ts.map +1 -1
- package/script/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.d.ts} +10 -5
- package/script/types/2_profile_photo_list.d.ts.map +1 -0
- package/script/types/{0_mini_app_button_info.js → 2_profile_photo_list.js} +7 -3
- package/script/types/2_reply_markup.d.ts +4 -12
- package/script/types/2_reply_markup.d.ts.map +1 -1
- package/script/types/2_reply_markup.js +13 -17
- package/script/types/2_star_transaction_peer.d.ts +0 -8
- package/script/types/2_star_transaction_peer.d.ts.map +1 -1
- package/script/types/2_story_album_icon.d.ts +0 -2
- package/script/types/2_story_album_icon.d.ts.map +1 -1
- package/script/types/2_story_content.d.ts +3 -4
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +3 -3
- package/script/types/2_story_privacy.d.ts +6 -7
- package/script/types/2_story_privacy.d.ts.map +1 -1
- package/script/types/2_story_privacy.js +23 -20
- package/script/types/3_checklist_item.d.ts +2 -8
- package/script/types/3_checklist_item.d.ts.map +1 -1
- package/script/types/3_forward_header.d.ts +0 -5
- package/script/types/3_forward_header.d.ts.map +1 -1
- package/script/types/3_gift_upgraded_component.d.ts +0 -4
- package/script/types/3_gift_upgraded_component.d.ts.map +1 -1
- package/script/types/3_input_media.d.ts +10 -20
- package/script/types/3_input_media.d.ts.map +1 -1
- package/script/types/4_gift.d.ts +0 -2
- package/script/types/4_gift.d.ts.map +1 -1
- package/script/types/4_reply_to.d.ts +6 -14
- package/script/types/4_reply_to.d.ts.map +1 -1
- package/script/types/5_link_preview.d.ts +2 -18
- package/script/types/5_link_preview.d.ts.map +1 -1
- package/script/types/6_message.d.ts +90 -179
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message.js +105 -121
- package/script/types/6_message_content.d.ts +0 -5
- package/script/types/6_message_content.d.ts.map +1 -1
- package/script/types/7_inline_query_result.d.ts +10 -47
- package/script/types/7_inline_query_result.d.ts.map +1 -1
- package/script/types/7_inline_query_result.js +219 -152
- package/script/types/8_update.d.ts +58 -105
- package/script/types/8_update.d.ts.map +1 -1
- package/script/utilities/0_int.d.ts +1 -3
- package/script/utilities/0_int.d.ts.map +1 -1
- package/esm/types/0_keyboard_button_poll_type.d.ts.map +0 -1
- package/esm/types/0_mini_app_button_info.d.ts +0 -26
- package/esm/types/0_mini_app_button_info.d.ts.map +0 -1
- package/esm/types/1_inline_query_result_button.d.ts.map +0 -1
- package/esm/types/1_inline_query_result_button.js +0 -20
- package/script/types/0_keyboard_button_poll_type.d.ts.map +0 -1
- package/script/types/0_mini_app_button_info.d.ts +0 -26
- package/script/types/0_mini_app_button_info.d.ts.map +0 -1
- package/script/types/1_inline_query_result_button.d.ts.map +0 -1
- package/script/types/1_inline_query_result_button.js +0 -21
- /package/esm/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
- /package/script/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
|
@@ -82,13 +82,14 @@ function constructInlineQueryResult(result) {
|
|
|
82
82
|
if (_2_tl_js_1.Api.is("botInlineMediaResult", result)) {
|
|
83
83
|
if (result.photo) {
|
|
84
84
|
photo = _2_tl_js_1.Api.as("photo", result.photo);
|
|
85
|
-
ref = { fileId: (0, _file_id_js_1.getPhotoFileId)(photo).fileId };
|
|
85
|
+
ref = { type: "fileId", fileId: (0, _file_id_js_1.getPhotoFileId)(photo).fileId };
|
|
86
86
|
const { largest } = photoSizes = (0, _1_photo_js_1.getPhotoSizes)(photo);
|
|
87
87
|
attributes = [{ _: "documentAttributeImageSize", w: largest.w, h: largest.h }];
|
|
88
88
|
}
|
|
89
89
|
else if (result.document) {
|
|
90
90
|
const document = _2_tl_js_1.Api.as("document", result.document);
|
|
91
91
|
ref = {
|
|
92
|
+
type: "fileId",
|
|
92
93
|
fileId: (0, _file_id_js_1.serializeFileId)({
|
|
93
94
|
type: _file_id_js_1.FileType.Document, // Should this be changed? The type is already known.
|
|
94
95
|
dcId: document.dc_id,
|
|
@@ -103,7 +104,7 @@ function constructInlineQueryResult(result) {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
else if (result.content) {
|
|
106
|
-
ref = { url: result.content.url };
|
|
107
|
+
ref = { type: "url", url: result.content.url };
|
|
107
108
|
attributes = result.content.attributes;
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
@@ -120,90 +121,182 @@ function constructInlineQueryResult(result) {
|
|
|
120
121
|
switch (type) {
|
|
121
122
|
case "audio": {
|
|
122
123
|
const a = attributes?.find((v) => _2_tl_js_1.Api.is("documentAttributeAudio", v));
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
if (ref.type === "fileId") {
|
|
125
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
126
|
+
id,
|
|
127
|
+
type: "cachedAudio",
|
|
128
|
+
title,
|
|
129
|
+
fileId: ref.fileId,
|
|
130
|
+
messageContent,
|
|
131
|
+
replyMarkup,
|
|
132
|
+
performer: a?.performer,
|
|
133
|
+
audioDuration: a?.duration,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
138
|
+
id,
|
|
139
|
+
type,
|
|
140
|
+
title,
|
|
141
|
+
url: ref.url,
|
|
142
|
+
messageContent,
|
|
143
|
+
replyMarkup,
|
|
144
|
+
performer: a?.performer,
|
|
145
|
+
audioDuration: a?.duration,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
133
148
|
}
|
|
134
149
|
case "gif":
|
|
135
150
|
case "mpeg4Gif": {
|
|
136
151
|
const a = attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeVideo", v));
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
if (ref.type === "fileId") {
|
|
153
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
154
|
+
id,
|
|
155
|
+
type: type === "gif" ? "cachedGif" : "cachedMpeg4Gif",
|
|
156
|
+
title,
|
|
157
|
+
fileId: ref.fileId,
|
|
158
|
+
messageContent,
|
|
159
|
+
replyMarkup,
|
|
160
|
+
thumbnailUrl,
|
|
161
|
+
width: a?.w,
|
|
162
|
+
height: a?.h,
|
|
163
|
+
duration: a?.duration,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
168
|
+
id,
|
|
169
|
+
type,
|
|
170
|
+
title,
|
|
171
|
+
url: ref.url,
|
|
172
|
+
messageContent,
|
|
173
|
+
replyMarkup,
|
|
174
|
+
thumbnailUrl,
|
|
175
|
+
width: a?.w,
|
|
176
|
+
height: a?.h,
|
|
177
|
+
duration: a?.duration,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
149
180
|
}
|
|
150
181
|
case "photo": {
|
|
151
182
|
const a = attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeImageSize", v));
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
183
|
+
if (ref.type === "fileId") {
|
|
184
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
185
|
+
id,
|
|
186
|
+
type: "cachedPhoto",
|
|
187
|
+
title,
|
|
188
|
+
description,
|
|
189
|
+
fileId: ref.fileId,
|
|
190
|
+
messageContent,
|
|
191
|
+
replyMarkup,
|
|
192
|
+
thumbnailUrl: thumbnailUrl,
|
|
193
|
+
thumbnails: photo ? photoSizes?.sizes.slice(0, -1).map((v) => (0, _0_thumbnail_js_1.constructThumbnail)(v, photo)) : undefined,
|
|
194
|
+
width: a?.w,
|
|
195
|
+
height: a?.h,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
200
|
+
id,
|
|
201
|
+
type,
|
|
202
|
+
title,
|
|
203
|
+
description,
|
|
204
|
+
url: ref.url,
|
|
205
|
+
messageContent,
|
|
206
|
+
replyMarkup,
|
|
207
|
+
thumbnailUrl: thumbnailUrl,
|
|
208
|
+
thumbnails: photo ? photoSizes?.sizes.slice(0, -1).map((v) => (0, _0_thumbnail_js_1.constructThumbnail)(v, photo)) : undefined,
|
|
209
|
+
width: a?.w,
|
|
210
|
+
height: a?.h,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
165
213
|
}
|
|
166
214
|
case "video": {
|
|
167
215
|
const a = attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeVideo", v));
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
216
|
+
if (ref.type === "fileId") {
|
|
217
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
218
|
+
id,
|
|
219
|
+
type: "cachedVideo",
|
|
220
|
+
title,
|
|
221
|
+
description,
|
|
222
|
+
fileId: ref.fileId,
|
|
223
|
+
messageContent,
|
|
224
|
+
replyMarkup,
|
|
225
|
+
mimeType: "content" in result && result.content ? result.content.mime_type : "video/mp4",
|
|
226
|
+
thumbnailUrl: thumbnailUrl,
|
|
227
|
+
width: a?.w,
|
|
228
|
+
height: a?.h,
|
|
229
|
+
videoDuration: a?.duration,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
234
|
+
id,
|
|
235
|
+
type: "video",
|
|
236
|
+
title,
|
|
237
|
+
description,
|
|
238
|
+
url: ref.url,
|
|
239
|
+
messageContent,
|
|
240
|
+
replyMarkup,
|
|
241
|
+
mimeType: "content" in result && result.content ? result.content.mime_type : "video/mp4",
|
|
242
|
+
thumbnailUrl: thumbnailUrl,
|
|
243
|
+
width: a?.w,
|
|
244
|
+
height: a?.h,
|
|
245
|
+
videoDuration: a?.duration,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
182
248
|
}
|
|
183
249
|
case "voice": {
|
|
184
250
|
const a = attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeAudio", v));
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
251
|
+
if (ref.type === "fileId") {
|
|
252
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
253
|
+
id,
|
|
254
|
+
type: "cachedVoice",
|
|
255
|
+
title,
|
|
256
|
+
fileId: ref.fileId,
|
|
257
|
+
messageContent,
|
|
258
|
+
replyMarkup,
|
|
259
|
+
thumbnailUrl,
|
|
260
|
+
voiceDuration: a?.duration,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
265
|
+
id,
|
|
266
|
+
type: "voice",
|
|
267
|
+
title,
|
|
268
|
+
url: ref.url,
|
|
269
|
+
messageContent,
|
|
270
|
+
replyMarkup,
|
|
271
|
+
thumbnailUrl,
|
|
272
|
+
voiceDuration: a?.duration,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
195
275
|
}
|
|
196
276
|
case "document":
|
|
197
277
|
case "file": // Does it really return this?
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
278
|
+
if (ref.type === "fileId") {
|
|
279
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
280
|
+
type: "cachedDocument",
|
|
281
|
+
id,
|
|
282
|
+
title: result.title ?? "",
|
|
283
|
+
fileId: ref.fileId,
|
|
284
|
+
messageContent,
|
|
285
|
+
replyMarkup,
|
|
286
|
+
thumbnailUrl,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
291
|
+
type: "document",
|
|
292
|
+
id,
|
|
293
|
+
title: result.title ?? "",
|
|
294
|
+
url: ref.url,
|
|
295
|
+
messageContent,
|
|
296
|
+
replyMarkup,
|
|
297
|
+
thumbnailUrl,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
207
300
|
}
|
|
208
301
|
}
|
|
209
302
|
(0, _0_deps_js_1.unreachable)();
|
|
@@ -215,103 +308,77 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver)
|
|
|
215
308
|
let fileId_ = null;
|
|
216
309
|
switch (result_.type) {
|
|
217
310
|
case "audio":
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
fileId_ = result_.fileId;
|
|
231
|
-
}
|
|
311
|
+
document = {
|
|
312
|
+
_: "inputWebDocument",
|
|
313
|
+
url: result_.url,
|
|
314
|
+
size: 0,
|
|
315
|
+
mime_type: "audio/mpeg",
|
|
316
|
+
attributes: [
|
|
317
|
+
{ _: "documentAttributeAudio", duration: result_.audioDuration ?? 0, title: result_.title, performer: result_.performer },
|
|
318
|
+
],
|
|
319
|
+
};
|
|
232
320
|
break;
|
|
233
321
|
case "video":
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
fileId_ = result_.fileId;
|
|
247
|
-
}
|
|
322
|
+
document = {
|
|
323
|
+
_: "inputWebDocument",
|
|
324
|
+
url: result_.url,
|
|
325
|
+
size: 0,
|
|
326
|
+
mime_type: result_.mimeType ?? "video/mp4",
|
|
327
|
+
attributes: [
|
|
328
|
+
{ _: "documentAttributeVideo", duration: result_.videoDuration ?? 0, h: result_.height ?? 0, w: result_.width ?? 0 },
|
|
329
|
+
],
|
|
330
|
+
};
|
|
248
331
|
break;
|
|
249
332
|
case "document":
|
|
250
|
-
|
|
251
|
-
document = { _: "inputWebDocument", url: result_.url, mime_type: "application/octet-stream", attributes: [], size: 0 };
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
fileId_ = result_.fileId;
|
|
255
|
-
}
|
|
333
|
+
document = { _: "inputWebDocument", url: result_.url, mime_type: "application/octet-stream", attributes: [], size: 0 };
|
|
256
334
|
break;
|
|
257
335
|
case "gif":
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
fileId_ = result_.fileId;
|
|
271
|
-
}
|
|
336
|
+
document = {
|
|
337
|
+
_: "inputWebDocument",
|
|
338
|
+
url: result_.url,
|
|
339
|
+
size: 0,
|
|
340
|
+
mime_type: "image/gif",
|
|
341
|
+
attributes: [
|
|
342
|
+
{ _: "documentAttributeVideo", duration: result_.duration ?? 0, w: result_.width ?? 0, h: result_.height ?? 0 },
|
|
343
|
+
],
|
|
344
|
+
};
|
|
272
345
|
break;
|
|
273
346
|
case "mpeg4Gif":
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
fileId_ = result_.fileId;
|
|
287
|
-
}
|
|
347
|
+
document = {
|
|
348
|
+
_: "inputWebDocument",
|
|
349
|
+
url: result_.url,
|
|
350
|
+
size: 0,
|
|
351
|
+
mime_type: "video/mp4",
|
|
352
|
+
attributes: [
|
|
353
|
+
{ _: "documentAttributeVideo", nosound: true, duration: result_.duration ?? 0, w: result_.width ?? 0, h: result_.height ?? 0, supports_streaming: true },
|
|
354
|
+
],
|
|
355
|
+
};
|
|
288
356
|
break;
|
|
289
357
|
case "photo":
|
|
290
|
-
|
|
291
|
-
document = { _: "inputWebDocument", url: result_.url, size: 0, mime_type: "image/jpeg", attributes: [{ _: "documentAttributeImageSize", w: result_.width ?? 0, h: result_.height ?? 0 }] };
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
fileId_ = result_.fileId;
|
|
295
|
-
}
|
|
358
|
+
document = { _: "inputWebDocument", url: result_.url, size: 0, mime_type: "image/jpeg", attributes: [{ _: "documentAttributeImageSize", w: result_.width ?? 0, h: result_.height ?? 0 }] };
|
|
296
359
|
break;
|
|
297
360
|
case "sticker":
|
|
298
361
|
fileId_ = result_.fileId;
|
|
299
362
|
break;
|
|
300
363
|
case "voice":
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
364
|
+
document = {
|
|
365
|
+
_: "inputWebDocument",
|
|
366
|
+
url: result_.url,
|
|
367
|
+
size: 0,
|
|
368
|
+
mime_type: "audio/mpeg",
|
|
369
|
+
attributes: [
|
|
370
|
+
{ _: "documentAttributeAudio", duration: result_.voiceDuration ?? 0, voice: true },
|
|
371
|
+
],
|
|
372
|
+
};
|
|
373
|
+
break;
|
|
374
|
+
case "cachedAudio":
|
|
375
|
+
case "cachedDocument":
|
|
376
|
+
case "cachedGif":
|
|
377
|
+
case "cachedMpeg4Gif":
|
|
378
|
+
case "cachedPhoto":
|
|
379
|
+
case "cachedVideo":
|
|
380
|
+
case "cachedVoice":
|
|
381
|
+
fileId_ = result_.fileId;
|
|
315
382
|
break;
|
|
316
383
|
}
|
|
317
384
|
const replyMarkup = "replyMarkup" in result_ && result_.replyMarkup ? await (0, _2_reply_markup_js_1.replyMarkupToTlObject)(result_.replyMarkup, usernameResolver) : undefined;
|