@mtkruto/browser 0.136.0 → 0.138.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/0_deps.js +3 -3
- package/esm/3_errors.d.ts +2 -2
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +2 -2
- 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 +17 -11
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +1 -1
- package/esm/client/1_client_generic.d.ts +19 -14
- 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/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_translations_manager.js +2 -2
- package/esm/client/2_update_manager.js +2 -2
- 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 +18 -21
- 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.js +3 -3
- package/esm/client/4_context.d.ts +155 -463
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +221 -506
- 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.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +4 -2
- package/esm/client/4_story_manager.js +4 -4
- package/esm/client/6_client.d.ts +20 -21
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +22 -19
- package/esm/client/6_client_dispatcher.d.ts +19 -14
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +20 -11
- package/esm/connection/1_connection_socks5.js +3 -3
- package/esm/connection/1_connection_socks5.node.js +3 -3
- package/esm/session/1_session.d.ts +2 -6
- package/esm/session/1_session.d.ts.map +1 -1
- package/esm/storage/2_storage_local_storage.d.ts.map +1 -1
- package/esm/storage/2_storage_local_storage.js +10 -6
- package/esm/storage/2_storage_memory.d.ts.map +1 -1
- package/esm/storage/2_storage_memory.js +9 -5
- package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
- package/esm/storage/2_storage_session_storage.js +10 -6
- 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_chat_administrator_rights.d.ts +4 -4
- package/esm/types/0_chat_administrator_rights.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_premium_subscription_duration.d.ts +1 -0
- package/esm/types/0_premium_subscription_duration.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 +3 -8
- 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 +1 -8
- 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/1_order_info.d.ts +1 -1
- 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 +5 -13
- 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 +8 -9
- 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_inline_query.d.ts.map +1 -1
- package/esm/types/3_inline_query.js +3 -2
- package/esm/types/3_input_media.d.ts +10 -20
- package/esm/types/3_input_media.d.ts.map +1 -1
- package/esm/types/3_invite_link.d.ts +0 -2
- package/esm/types/3_invite_link.d.ts.map +1 -1
- package/esm/types/3_invite_link.js +3 -4
- package/esm/types/4_gift.d.ts +1 -3
- 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_gift_upgraded_information.d.ts +1 -1
- package/esm/types/5_gift_upgraded_information.d.ts.map +1 -1
- package/esm/types/5_gift_upgraded_information.js +2 -2
- 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 +91 -180
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message.js +105 -121
- package/esm/types/6_message_content.d.ts +2 -7
- 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/7_topic.js +3 -3
- package/esm/types/8_update.d.ts +59 -106
- 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/esm/utilities/1_logger.js +1 -1
- package/package.json +1 -1
- package/script/0_deps.js +3 -3
- package/script/3_errors.d.ts +2 -2
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +4 -4
- 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 +17 -11
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +1 -1
- package/script/client/1_client_generic.d.ts +19 -14
- 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/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_translations_manager.js +2 -2
- package/script/client/2_update_manager.js +2 -2
- 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 +17 -20
- 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.js +3 -3
- package/script/client/4_context.d.ts +155 -463
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +221 -506
- 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.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +4 -2
- package/script/client/4_story_manager.js +4 -4
- package/script/client/6_client.d.ts +20 -21
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +22 -19
- package/script/client/6_client_dispatcher.d.ts +19 -14
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +20 -11
- package/script/connection/1_connection_socks5.js +3 -3
- package/script/connection/1_connection_socks5.node.js +3 -3
- package/script/session/1_session.d.ts +2 -6
- package/script/session/1_session.d.ts.map +1 -1
- package/script/storage/2_storage_local_storage.d.ts.map +1 -1
- package/script/storage/2_storage_local_storage.js +10 -6
- package/script/storage/2_storage_memory.d.ts.map +1 -1
- package/script/storage/2_storage_memory.js +9 -5
- package/script/storage/2_storage_session_storage.d.ts.map +1 -1
- package/script/storage/2_storage_session_storage.js +10 -6
- 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_chat_administrator_rights.d.ts +4 -4
- package/script/types/0_chat_administrator_rights.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_premium_subscription_duration.d.ts +1 -0
- package/script/types/0_premium_subscription_duration.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 +3 -8
- 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 +1 -8
- 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/1_order_info.d.ts +1 -1
- 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 +5 -13
- 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 +8 -9
- 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_inline_query.d.ts.map +1 -1
- package/script/types/3_inline_query.js +3 -2
- package/script/types/3_input_media.d.ts +10 -20
- package/script/types/3_input_media.d.ts.map +1 -1
- package/script/types/3_invite_link.d.ts +0 -2
- package/script/types/3_invite_link.d.ts.map +1 -1
- package/script/types/3_invite_link.js +3 -4
- package/script/types/4_gift.d.ts +1 -3
- 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_gift_upgraded_information.d.ts +1 -1
- package/script/types/5_gift_upgraded_information.d.ts.map +1 -1
- package/script/types/5_gift_upgraded_information.js +2 -2
- 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 +91 -180
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message.js +106 -122
- package/script/types/6_message_content.d.ts +2 -7
- 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/7_topic.js +3 -3
- package/script/types/8_update.d.ts +59 -106
- 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/script/utilities/1_logger.js +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
|
@@ -78,13 +78,14 @@ export function constructInlineQueryResult(result) {
|
|
|
78
78
|
if (Api.is("botInlineMediaResult", result)) {
|
|
79
79
|
if (result.photo) {
|
|
80
80
|
photo = Api.as("photo", result.photo);
|
|
81
|
-
ref = { fileId: getPhotoFileId(photo).fileId };
|
|
81
|
+
ref = { type: "fileId", fileId: getPhotoFileId(photo).fileId };
|
|
82
82
|
const { largest } = photoSizes = getPhotoSizes(photo);
|
|
83
83
|
attributes = [{ _: "documentAttributeImageSize", w: largest.w, h: largest.h }];
|
|
84
84
|
}
|
|
85
85
|
else if (result.document) {
|
|
86
86
|
const document = Api.as("document", result.document);
|
|
87
87
|
ref = {
|
|
88
|
+
type: "fileId",
|
|
88
89
|
fileId: serializeFileId({
|
|
89
90
|
type: FileType.Document, // Should this be changed? The type is already known.
|
|
90
91
|
dcId: document.dc_id,
|
|
@@ -99,7 +100,7 @@ export function constructInlineQueryResult(result) {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
else if (result.content) {
|
|
102
|
-
ref = { url: result.content.url };
|
|
103
|
+
ref = { type: "url", url: result.content.url };
|
|
103
104
|
attributes = result.content.attributes;
|
|
104
105
|
}
|
|
105
106
|
else {
|
|
@@ -116,90 +117,182 @@ export function constructInlineQueryResult(result) {
|
|
|
116
117
|
switch (type) {
|
|
117
118
|
case "audio": {
|
|
118
119
|
const a = attributes?.find((v) => Api.is("documentAttributeAudio", v));
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
if (ref.type === "fileId") {
|
|
121
|
+
return cleanObject({
|
|
122
|
+
id,
|
|
123
|
+
type: "cachedAudio",
|
|
124
|
+
title,
|
|
125
|
+
fileId: ref.fileId,
|
|
126
|
+
messageContent,
|
|
127
|
+
replyMarkup,
|
|
128
|
+
performer: a?.performer,
|
|
129
|
+
audioDuration: a?.duration,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return cleanObject({
|
|
134
|
+
id,
|
|
135
|
+
type,
|
|
136
|
+
title,
|
|
137
|
+
url: ref.url,
|
|
138
|
+
messageContent,
|
|
139
|
+
replyMarkup,
|
|
140
|
+
performer: a?.performer,
|
|
141
|
+
audioDuration: a?.duration,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
129
144
|
}
|
|
130
145
|
case "gif":
|
|
131
146
|
case "mpeg4Gif": {
|
|
132
147
|
const a = attributes.find((v) => Api.is("documentAttributeVideo", v));
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
if (ref.type === "fileId") {
|
|
149
|
+
return cleanObject({
|
|
150
|
+
id,
|
|
151
|
+
type: type === "gif" ? "cachedGif" : "cachedMpeg4Gif",
|
|
152
|
+
title,
|
|
153
|
+
fileId: ref.fileId,
|
|
154
|
+
messageContent,
|
|
155
|
+
replyMarkup,
|
|
156
|
+
thumbnailUrl,
|
|
157
|
+
width: a?.w,
|
|
158
|
+
height: a?.h,
|
|
159
|
+
duration: a?.duration,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
return cleanObject({
|
|
164
|
+
id,
|
|
165
|
+
type,
|
|
166
|
+
title,
|
|
167
|
+
url: ref.url,
|
|
168
|
+
messageContent,
|
|
169
|
+
replyMarkup,
|
|
170
|
+
thumbnailUrl,
|
|
171
|
+
width: a?.w,
|
|
172
|
+
height: a?.h,
|
|
173
|
+
duration: a?.duration,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
145
176
|
}
|
|
146
177
|
case "photo": {
|
|
147
178
|
const a = attributes.find((v) => Api.is("documentAttributeImageSize", v));
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
179
|
+
if (ref.type === "fileId") {
|
|
180
|
+
return cleanObject({
|
|
181
|
+
id,
|
|
182
|
+
type: "cachedPhoto",
|
|
183
|
+
title,
|
|
184
|
+
description,
|
|
185
|
+
fileId: ref.fileId,
|
|
186
|
+
messageContent,
|
|
187
|
+
replyMarkup,
|
|
188
|
+
thumbnailUrl: thumbnailUrl,
|
|
189
|
+
thumbnails: photo ? photoSizes?.sizes.slice(0, -1).map((v) => constructThumbnail(v, photo)) : undefined,
|
|
190
|
+
width: a?.w,
|
|
191
|
+
height: a?.h,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
return cleanObject({
|
|
196
|
+
id,
|
|
197
|
+
type,
|
|
198
|
+
title,
|
|
199
|
+
description,
|
|
200
|
+
url: ref.url,
|
|
201
|
+
messageContent,
|
|
202
|
+
replyMarkup,
|
|
203
|
+
thumbnailUrl: thumbnailUrl,
|
|
204
|
+
thumbnails: photo ? photoSizes?.sizes.slice(0, -1).map((v) => constructThumbnail(v, photo)) : undefined,
|
|
205
|
+
width: a?.w,
|
|
206
|
+
height: a?.h,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
161
209
|
}
|
|
162
210
|
case "video": {
|
|
163
211
|
const a = attributes.find((v) => Api.is("documentAttributeVideo", v));
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
212
|
+
if (ref.type === "fileId") {
|
|
213
|
+
return cleanObject({
|
|
214
|
+
id,
|
|
215
|
+
type: "cachedVideo",
|
|
216
|
+
title,
|
|
217
|
+
description,
|
|
218
|
+
fileId: ref.fileId,
|
|
219
|
+
messageContent,
|
|
220
|
+
replyMarkup,
|
|
221
|
+
mimeType: "content" in result && result.content ? result.content.mime_type : "video/mp4",
|
|
222
|
+
thumbnailUrl: thumbnailUrl,
|
|
223
|
+
width: a?.w,
|
|
224
|
+
height: a?.h,
|
|
225
|
+
videoDuration: a?.duration,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
return cleanObject({
|
|
230
|
+
id,
|
|
231
|
+
type: "video",
|
|
232
|
+
title,
|
|
233
|
+
description,
|
|
234
|
+
url: ref.url,
|
|
235
|
+
messageContent,
|
|
236
|
+
replyMarkup,
|
|
237
|
+
mimeType: "content" in result && result.content ? result.content.mime_type : "video/mp4",
|
|
238
|
+
thumbnailUrl: thumbnailUrl,
|
|
239
|
+
width: a?.w,
|
|
240
|
+
height: a?.h,
|
|
241
|
+
videoDuration: a?.duration,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
178
244
|
}
|
|
179
245
|
case "voice": {
|
|
180
246
|
const a = attributes.find((v) => Api.is("documentAttributeAudio", v));
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
247
|
+
if (ref.type === "fileId") {
|
|
248
|
+
return cleanObject({
|
|
249
|
+
id,
|
|
250
|
+
type: "cachedVoice",
|
|
251
|
+
title,
|
|
252
|
+
fileId: ref.fileId,
|
|
253
|
+
messageContent,
|
|
254
|
+
replyMarkup,
|
|
255
|
+
thumbnailUrl,
|
|
256
|
+
voiceDuration: a?.duration,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
return cleanObject({
|
|
261
|
+
id,
|
|
262
|
+
type: "voice",
|
|
263
|
+
title,
|
|
264
|
+
url: ref.url,
|
|
265
|
+
messageContent,
|
|
266
|
+
replyMarkup,
|
|
267
|
+
thumbnailUrl,
|
|
268
|
+
voiceDuration: a?.duration,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
191
271
|
}
|
|
192
272
|
case "document":
|
|
193
273
|
case "file": // Does it really return this?
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
274
|
+
if (ref.type === "fileId") {
|
|
275
|
+
return cleanObject({
|
|
276
|
+
type: "cachedDocument",
|
|
277
|
+
id,
|
|
278
|
+
title: result.title ?? "",
|
|
279
|
+
fileId: ref.fileId,
|
|
280
|
+
messageContent,
|
|
281
|
+
replyMarkup,
|
|
282
|
+
thumbnailUrl,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
return cleanObject({
|
|
287
|
+
type: "document",
|
|
288
|
+
id,
|
|
289
|
+
title: result.title ?? "",
|
|
290
|
+
url: ref.url,
|
|
291
|
+
messageContent,
|
|
292
|
+
replyMarkup,
|
|
293
|
+
thumbnailUrl,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
203
296
|
}
|
|
204
297
|
}
|
|
205
298
|
unreachable();
|
|
@@ -211,103 +304,77 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
|
|
|
211
304
|
let fileId_ = null;
|
|
212
305
|
switch (result_.type) {
|
|
213
306
|
case "audio":
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
fileId_ = result_.fileId;
|
|
227
|
-
}
|
|
307
|
+
document = {
|
|
308
|
+
_: "inputWebDocument",
|
|
309
|
+
url: result_.url,
|
|
310
|
+
size: 0,
|
|
311
|
+
mime_type: "audio/mpeg",
|
|
312
|
+
attributes: [
|
|
313
|
+
{ _: "documentAttributeAudio", duration: result_.audioDuration ?? 0, title: result_.title, performer: result_.performer },
|
|
314
|
+
],
|
|
315
|
+
};
|
|
228
316
|
break;
|
|
229
317
|
case "video":
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
fileId_ = result_.fileId;
|
|
243
|
-
}
|
|
318
|
+
document = {
|
|
319
|
+
_: "inputWebDocument",
|
|
320
|
+
url: result_.url,
|
|
321
|
+
size: 0,
|
|
322
|
+
mime_type: result_.mimeType ?? "video/mp4",
|
|
323
|
+
attributes: [
|
|
324
|
+
{ _: "documentAttributeVideo", duration: result_.videoDuration ?? 0, h: result_.height ?? 0, w: result_.width ?? 0 },
|
|
325
|
+
],
|
|
326
|
+
};
|
|
244
327
|
break;
|
|
245
328
|
case "document":
|
|
246
|
-
|
|
247
|
-
document = { _: "inputWebDocument", url: result_.url, mime_type: "application/octet-stream", attributes: [], size: 0 };
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
fileId_ = result_.fileId;
|
|
251
|
-
}
|
|
329
|
+
document = { _: "inputWebDocument", url: result_.url, mime_type: "application/octet-stream", attributes: [], size: 0 };
|
|
252
330
|
break;
|
|
253
331
|
case "gif":
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
fileId_ = result_.fileId;
|
|
267
|
-
}
|
|
332
|
+
document = {
|
|
333
|
+
_: "inputWebDocument",
|
|
334
|
+
url: result_.url,
|
|
335
|
+
size: 0,
|
|
336
|
+
mime_type: "image/gif",
|
|
337
|
+
attributes: [
|
|
338
|
+
{ _: "documentAttributeVideo", duration: result_.duration ?? 0, w: result_.width ?? 0, h: result_.height ?? 0 },
|
|
339
|
+
],
|
|
340
|
+
};
|
|
268
341
|
break;
|
|
269
342
|
case "mpeg4Gif":
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
fileId_ = result_.fileId;
|
|
283
|
-
}
|
|
343
|
+
document = {
|
|
344
|
+
_: "inputWebDocument",
|
|
345
|
+
url: result_.url,
|
|
346
|
+
size: 0,
|
|
347
|
+
mime_type: "video/mp4",
|
|
348
|
+
attributes: [
|
|
349
|
+
{ _: "documentAttributeVideo", nosound: true, duration: result_.duration ?? 0, w: result_.width ?? 0, h: result_.height ?? 0, supports_streaming: true },
|
|
350
|
+
],
|
|
351
|
+
};
|
|
284
352
|
break;
|
|
285
353
|
case "photo":
|
|
286
|
-
|
|
287
|
-
document = { _: "inputWebDocument", url: result_.url, size: 0, mime_type: "image/jpeg", attributes: [{ _: "documentAttributeImageSize", w: result_.width ?? 0, h: result_.height ?? 0 }] };
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
fileId_ = result_.fileId;
|
|
291
|
-
}
|
|
354
|
+
document = { _: "inputWebDocument", url: result_.url, size: 0, mime_type: "image/jpeg", attributes: [{ _: "documentAttributeImageSize", w: result_.width ?? 0, h: result_.height ?? 0 }] };
|
|
292
355
|
break;
|
|
293
356
|
case "sticker":
|
|
294
357
|
fileId_ = result_.fileId;
|
|
295
358
|
break;
|
|
296
359
|
case "voice":
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
360
|
+
document = {
|
|
361
|
+
_: "inputWebDocument",
|
|
362
|
+
url: result_.url,
|
|
363
|
+
size: 0,
|
|
364
|
+
mime_type: "audio/mpeg",
|
|
365
|
+
attributes: [
|
|
366
|
+
{ _: "documentAttributeAudio", duration: result_.voiceDuration ?? 0, voice: true },
|
|
367
|
+
],
|
|
368
|
+
};
|
|
369
|
+
break;
|
|
370
|
+
case "cachedAudio":
|
|
371
|
+
case "cachedDocument":
|
|
372
|
+
case "cachedGif":
|
|
373
|
+
case "cachedMpeg4Gif":
|
|
374
|
+
case "cachedPhoto":
|
|
375
|
+
case "cachedVideo":
|
|
376
|
+
case "cachedVoice":
|
|
377
|
+
fileId_ = result_.fileId;
|
|
311
378
|
break;
|
|
312
379
|
}
|
|
313
380
|
const replyMarkup = "replyMarkup" in result_ && result_.replyMarkup ? await replyMarkupToTlObject(result_.replyMarkup, usernameResolver) : undefined;
|
package/esm/types/7_topic.js
CHANGED
|
@@ -42,10 +42,10 @@ export function constructTopic(message) {
|
|
|
42
42
|
const isHidden = false;
|
|
43
43
|
let name = forumTopicCreated.forumTopicCreated.name;
|
|
44
44
|
const color = forumTopicCreated.forumTopicCreated.color;
|
|
45
|
-
let
|
|
45
|
+
let customEmojiId = forumTopicCreated.forumTopicCreated.customEmojiId;
|
|
46
46
|
if (forumTopicEdited) {
|
|
47
47
|
name = forumTopicEdited.forumTopicEdited.name;
|
|
48
|
-
|
|
48
|
+
customEmojiId = forumTopicEdited.forumTopicEdited.customEmojiId;
|
|
49
49
|
}
|
|
50
50
|
return cleanObject({
|
|
51
51
|
id,
|
|
@@ -56,6 +56,6 @@ export function constructTopic(message) {
|
|
|
56
56
|
isHidden,
|
|
57
57
|
name,
|
|
58
58
|
color,
|
|
59
|
-
|
|
59
|
+
customEmojiId,
|
|
60
60
|
});
|
|
61
61
|
}
|