@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
|
@@ -219,7 +219,7 @@ class MessageManager {
|
|
|
219
219
|
}
|
|
220
220
|
async forwardMessages(from, to, messageIds, params) {
|
|
221
221
|
(0, _0_utilities_js_1.checkArray)(messageIds, _0_utilities_js_1.checkMessageId);
|
|
222
|
-
const result = await this.#c.invoke({ _: "messages.forwardMessages", from_peer: await this.#c.getInputPeer(from), to_peer: await this.#c.getInputPeer(to), id: messageIds, random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()), silent: params?.isSilent || undefined, top_msg_id: params?.messageThreadId, noforwards: params?.isSilent || undefined, send_as: params?.sendAs ? await this.#c.getInputPeer(params.sendAs) : undefined, drop_author: params?.
|
|
222
|
+
const result = await this.#c.invoke({ _: "messages.forwardMessages", from_peer: await this.#c.getInputPeer(from), to_peer: await this.#c.getInputPeer(to), id: messageIds, random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()), silent: params?.isSilent || undefined, top_msg_id: params?.messageThreadId, noforwards: params?.isSilent || undefined, send_as: params?.sendAs ? await this.#c.getInputPeer(params.sendAs) : undefined, drop_author: params?.isSenderNameDropped || undefined, drop_media_captions: params?.isCaptionDropped || undefined });
|
|
223
223
|
return await this.updatesToMessages(to, result);
|
|
224
224
|
}
|
|
225
225
|
async getHistory(chatId, params) {
|
|
@@ -842,7 +842,7 @@ class MessageManager {
|
|
|
842
842
|
if (!message) {
|
|
843
843
|
throw new _0_errors_js_1.InputError("Message not found.");
|
|
844
844
|
}
|
|
845
|
-
if (
|
|
845
|
+
if (message.type !== "link" && message.type !== "text") {
|
|
846
846
|
throw new _0_errors_js_1.InputError("The referenced message is not a text message.");
|
|
847
847
|
}
|
|
848
848
|
}
|
|
@@ -881,7 +881,7 @@ class MessageManager {
|
|
|
881
881
|
throw new _0_errors_js_1.InputError("Message not found.");
|
|
882
882
|
}
|
|
883
883
|
for (const type of MessageManager.#CAPTIONABLE_MESSAGE_TYPES) {
|
|
884
|
-
if (
|
|
884
|
+
if (message_.type !== type) {
|
|
885
885
|
canHaveCaption = true;
|
|
886
886
|
}
|
|
887
887
|
}
|
|
@@ -1205,14 +1205,14 @@ class MessageManager {
|
|
|
1205
1205
|
const business = "connection_id" in update ? { connectionId: update.connection_id, replyToMessage: update.reply_to_message } : undefined;
|
|
1206
1206
|
const message = await this.constructMessage(update.message, undefined, business);
|
|
1207
1207
|
if (_2_tl_js_1.Api.is("updateNewMessage", update) || _2_tl_js_1.Api.is("updateNewChannelMessage", update) || _2_tl_js_1.Api.is("updateBotNewBusinessMessage", update)) {
|
|
1208
|
-
return { message };
|
|
1208
|
+
return { type: "message", message };
|
|
1209
1209
|
}
|
|
1210
1210
|
else if (_2_tl_js_1.Api.is("updateNewScheduledMessage", update)) {
|
|
1211
1211
|
message.isScheduled = true;
|
|
1212
|
-
return { scheduledMessage: message };
|
|
1212
|
+
return { type: "scheduledMessage", scheduledMessage: message };
|
|
1213
1213
|
}
|
|
1214
1214
|
else {
|
|
1215
|
-
return { editedMessage: message };
|
|
1215
|
+
return { type: "editedMessage", editedMessage: message };
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
@@ -1226,7 +1226,7 @@ class MessageManager {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
if (deletedMessages.length > 0) {
|
|
1229
|
-
return { deletedMessages };
|
|
1229
|
+
return { type: "deletedMessages", deletedMessages };
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
else if (_2_tl_js_1.Api.is("updateDeleteChannelMessages", update)) {
|
|
@@ -1238,33 +1238,33 @@ class MessageManager {
|
|
|
1238
1238
|
deletedMessages.push({ chatId, messageId });
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
return { deletedMessages };
|
|
1241
|
+
return { type: "deletedMessages", deletedMessages };
|
|
1242
1242
|
}
|
|
1243
1243
|
else if (_2_tl_js_1.Api.is("updateDeleteScheduledMessages", update)) {
|
|
1244
1244
|
const chatId = _2_tl_js_1.Api.peerToChatId(update.peer);
|
|
1245
1245
|
const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
|
|
1246
|
-
return { deletedMessages, isScheduled: true };
|
|
1246
|
+
return { type: "deletedMessages", deletedMessages, isScheduled: true };
|
|
1247
1247
|
}
|
|
1248
1248
|
else if (_2_tl_js_1.Api.is("updateBotDeleteBusinessMessage", update)) {
|
|
1249
1249
|
const chatId = _2_tl_js_1.Api.peerToChatId(update.peer);
|
|
1250
1250
|
const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
|
|
1251
|
-
return { deletedMessages, businessConnectionId: update.connection_id };
|
|
1251
|
+
return { type: "deletedMessages", deletedMessages, businessConnectionId: update.connection_id };
|
|
1252
1252
|
}
|
|
1253
1253
|
if (_2_tl_js_1.Api.is("updateTranscribedAudio", update)) {
|
|
1254
1254
|
const voiceTranscription = (0, _3_types_js_1.constructVoiceTranscription)(update);
|
|
1255
1255
|
await this.#c.messageStorage.setVoiceTranscription(voiceTranscription);
|
|
1256
|
-
return { voiceTranscription };
|
|
1256
|
+
return { type: "voiceTranscription", voiceTranscription };
|
|
1257
1257
|
}
|
|
1258
1258
|
if (_2_tl_js_1.Api.isOneOf(["updateUserTyping", "updateChatUserTyping", "updateChannelUserTyping"], update)) {
|
|
1259
1259
|
const chatAction = (0, _3_types_js_1.constructChatAction)(update);
|
|
1260
1260
|
if (chatAction !== null) {
|
|
1261
|
-
return { chatAction };
|
|
1261
|
+
return { type: "chatAction", chatAction };
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
if (_2_tl_js_1.Api.is("updateUserTyping", update)) {
|
|
1265
1265
|
const messageDraft = (0, _3_types_js_1.constructMessageDraft)(update);
|
|
1266
1266
|
if (messageDraft !== null) {
|
|
1267
|
-
return { messageDraft };
|
|
1267
|
+
return { type: "messageDraft", messageDraft };
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
return null;
|
|
@@ -1482,12 +1482,9 @@ class MessageManager {
|
|
|
1482
1482
|
if (!Array.isArray(media) || !media.length) {
|
|
1483
1483
|
throw new _0_errors_js_1.InputError("Media group must not be empty.");
|
|
1484
1484
|
}
|
|
1485
|
-
|
|
1486
|
-
const firstMedia = media?.[0];
|
|
1487
|
-
const firstMediaType = firstMedia?.animation !== undefined ? "animation" : firstMedia?.audio !== undefined ? "audio" : firstMedia?.photo !== undefined ? "photo" : firstMedia?.video !== undefined ? "video" : "document";
|
|
1485
|
+
const firstMediaType = media[0].type;
|
|
1488
1486
|
for (const media_ of media) {
|
|
1489
|
-
|
|
1490
|
-
const thisMediaType = media_?.animation !== undefined ? "animation" : media_?.audio !== undefined ? "audio" : media_?.photo !== undefined ? "photo" : media_?.video !== undefined ? "video" : "document";
|
|
1487
|
+
const thisMediaType = media_.type;
|
|
1491
1488
|
if (thisMediaType === "animation") {
|
|
1492
1489
|
throw new _0_errors_js_1.InputError("Media groups cannot consist of animations.");
|
|
1493
1490
|
}
|
|
@@ -1560,7 +1557,7 @@ class MessageManager {
|
|
|
1560
1557
|
if (message === null) {
|
|
1561
1558
|
throw new _0_errors_js_1.InputError("Message not found.");
|
|
1562
1559
|
}
|
|
1563
|
-
if (
|
|
1560
|
+
if (message.type !== "voice") {
|
|
1564
1561
|
throw new _0_errors_js_1.InputError("Message not voice.");
|
|
1565
1562
|
}
|
|
1566
1563
|
const cachedTranscription = await this.#getCachedVoiceTranscription(message);
|
|
@@ -1590,7 +1587,7 @@ class MessageManager {
|
|
|
1590
1587
|
async resolveMessageLink(link) {
|
|
1591
1588
|
const parseResult = MessageManager.parseMessageLink(link);
|
|
1592
1589
|
if (parseResult === null) {
|
|
1593
|
-
throw new _0_errors_js_1.InputError("Invalid
|
|
1590
|
+
throw new _0_errors_js_1.InputError("Invalid message link.");
|
|
1594
1591
|
}
|
|
1595
1592
|
const [chatId, messageId] = parseResult;
|
|
1596
1593
|
return await this.getMessage(chatId, messageId);
|
|
@@ -145,7 +145,7 @@ class VideoChatManager {
|
|
|
145
145
|
if (updateFullChat) {
|
|
146
146
|
await this.#c.messageStorage.setFullChat(chatId, fullChat);
|
|
147
147
|
}
|
|
148
|
-
return { videoChat: (0, _3_types_js_1.constructVideoChat)(update.call) };
|
|
148
|
+
return { type: "videoChat", videoChat: (0, _3_types_js_1.constructVideoChat)(update.call) };
|
|
149
149
|
}
|
|
150
150
|
async getLiveStreamChannels(id) {
|
|
151
151
|
this.#c.storage.assertUser("getLiveStreamChannels");
|
|
@@ -66,7 +66,7 @@ class CallbackQueryManager {
|
|
|
66
66
|
return _2_tl_js_1.Api.isOneOf(callbackQueryManagerUpdates, update);
|
|
67
67
|
}
|
|
68
68
|
async handleUpdate(update) {
|
|
69
|
-
return { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, this.#c.getPeer, this.#c.messageManager.getMessageWithReply.bind(this.#c.messageManager)) };
|
|
69
|
+
return { type: "callbackQuery", callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, this.#c.getPeer, this.#c.messageManager.getMessageWithReply.bind(this.#c.messageManager)) };
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
exports.CallbackQueryManager = CallbackQueryManager;
|
|
@@ -46,15 +46,15 @@ class ChatManager {
|
|
|
46
46
|
const chatMember = (0, _3_types_js_1.constructChatMemberUpdated)(update, this.#c.getPeer);
|
|
47
47
|
const selfId = await this.#c.getSelfId();
|
|
48
48
|
if (chatMember.oldChatMember.member.id === selfId) {
|
|
49
|
-
return { myChatMember: chatMember };
|
|
49
|
+
return { type: "myChatMember", myChatMember: chatMember };
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
return { chatMember };
|
|
52
|
+
return { type: "chatMember", chatMember };
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (_2_tl_js_1.Api.is("updateBotChatInviteRequester", update)) {
|
|
56
56
|
const joinRequest = (0, _3_types_js_1.constructJoinRequest)(update, this.#c.getPeer);
|
|
57
|
-
return { joinRequest };
|
|
57
|
+
return { type: "joinRequest", joinRequest };
|
|
58
58
|
}
|
|
59
59
|
return null;
|
|
60
60
|
}
|