@mtkruto/browser 0.1.800 → 0.2.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.d.ts +2 -0
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +2 -1
- package/esm/2_tl.d.ts +7 -8
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +7 -8
- package/esm/3_errors.d.ts +519 -515
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +527 -512
- package/esm/3_transport.d.ts +1 -0
- package/esm/3_transport.d.ts.map +1 -1
- package/esm/3_transport.js +1 -0
- package/esm/4_constants.d.ts +0 -19
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +2 -1
- package/esm/4_errors.d.ts +7 -7
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +5 -5
- package/esm/_dnt.shims.d.ts +1 -0
- package/esm/_dnt.shims.d.ts.map +1 -1
- package/esm/client/0_client_abstract.d.ts +1 -21
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +17 -15
- package/esm/client/0_message.d.ts +3 -3
- package/esm/client/0_message.d.ts.map +1 -1
- package/esm/client/0_message.js +4 -20
- package/esm/client/0_params.d.ts +1 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +3 -8
- package/esm/client/0_storage_operations.d.ts +23 -23
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +13 -12
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +13 -10
- package/esm/client/1_client_encrypted.d.ts +3 -5
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +44 -28
- package/esm/client/1_client_plain.d.ts +2 -2
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +27 -19
- package/esm/client/1_types.d.ts +9 -22
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +2 -2
- package/esm/client/2_account_manager.js +16 -16
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +7 -6
- package/esm/client/2_business_connection_manager.d.ts +3 -3
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +6 -5
- package/esm/client/2_file_manager.d.ts +4 -23
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +40 -36
- package/esm/client/2_reaction_manager.d.ts +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +16 -10
- package/esm/client/2_update_manager.d.ts +11 -11
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +162 -160
- package/esm/client/3_message_manager.d.ts +8 -9
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +205 -474
- package/esm/client/3_video_chat_manager.d.ts +3 -3
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +26 -36
- package/esm/client/4_callback_query_manager.d.ts +3 -3
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +5 -16
- package/esm/client/4_chat_list_manager.d.ts +5 -4
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +56 -34
- package/esm/client/4_inline_query_manager.d.ts +3 -3
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +6 -15
- package/esm/client/4_story_manager.d.ts +3 -3
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +15 -32
- package/esm/client/5_client.d.ts +10 -12
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +60 -114
- package/esm/{tl/7_message.d.ts → connection/1_connection_tcp.d.ts} +14 -12
- package/esm/connection/1_connection_tcp.d.ts.map +1 -0
- package/esm/connection/1_connection_tcp.js +169 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.js +4 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.js +86 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.js +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.js +49 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +253 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +13 -0
- package/esm/mod.d.ts +0 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +0 -1
- package/esm/tl/0_api.d.ts +14813 -0
- package/esm/tl/0_api.d.ts.map +1 -0
- package/esm/tl/0_api.js +23222 -0
- package/esm/tl/1_utilities.d.ts +32 -0
- package/esm/tl/1_utilities.d.ts.map +1 -0
- package/esm/tl/1_utilities.js +65 -0
- package/esm/tl/2_deserialize.d.ts +23 -0
- package/esm/tl/2_deserialize.d.ts.map +1 -0
- package/esm/tl/{3_deserialize.js → 2_deserialize.js} +16 -17
- package/esm/tl/2_serialize.d.ts +22 -0
- package/esm/tl/2_serialize.d.ts.map +1 -0
- package/esm/tl/2_serialize.js +160 -0
- package/esm/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/esm/tl/3_tl_reader.d.ts.map +1 -0
- package/esm/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/esm/tl/3_utilities.d.ts +5 -5
- package/esm/tl/3_utilities.d.ts.map +1 -1
- package/esm/tl/3_utilities.js +9 -10
- package/esm/tl/4_rpc_result.d.ts +27 -0
- package/esm/tl/4_rpc_result.d.ts.map +1 -0
- package/esm/tl/4_rpc_result.js +28 -0
- package/{script/tl/5_tl_writer.d.ts → esm/tl/4_tl_writer.d.ts} +2 -2
- package/esm/tl/4_tl_writer.d.ts.map +1 -0
- package/esm/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/esm/tl/5_message.d.ts +39 -0
- package/esm/tl/5_message.d.ts.map +1 -0
- package/esm/tl/5_message.js +98 -0
- package/esm/transport/3_transport_provider_tcp.d.ts +14 -0
- package/esm/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/esm/transport/3_transport_provider_tcp.js +15 -0
- package/esm/types/0_birthday.d.ts +2 -2
- package/esm/types/0_birthday.d.ts.map +1 -1
- package/esm/types/0_callback_query_answer.d.ts +2 -2
- package/esm/types/0_callback_query_answer.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +3 -3
- package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.js +1 -11
- package/esm/types/0_chat_member_rights.d.ts +3 -3
- package/esm/types/0_chat_member_rights.d.ts.map +1 -1
- package/esm/types/0_chat_member_rights.js +3 -3
- package/esm/types/0_chat_photo.d.ts +2 -2
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +2 -2
- package/esm/types/0_contact.d.ts +2 -2
- package/esm/types/0_contact.d.ts.map +1 -1
- package/esm/types/0_dice.d.ts +2 -2
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.d.ts +2 -2
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +3 -3
- package/esm/types/0_link_preview.d.ts +2 -2
- package/esm/types/0_link_preview.d.ts.map +1 -1
- package/esm/types/0_live_stream_channel.d.ts +2 -2
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +2 -2
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_mask_position.d.ts +2 -2
- package/esm/types/0_mask_position.d.ts.map +1 -1
- package/esm/types/0_message_entity.d.ts +3 -3
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +42 -42
- package/esm/types/0_message_search_filter.d.ts +2 -2
- package/esm/types/0_message_search_filter.d.ts.map +1 -1
- package/esm/types/0_message_search_filter.js +14 -15
- package/esm/types/0_opening_hours.d.ts +2 -2
- package/esm/types/0_opening_hours.d.ts.map +1 -1
- package/esm/types/0_poll_option.d.ts +2 -2
- package/esm/types/0_poll_option.d.ts.map +1 -1
- package/esm/types/0_reaction.d.ts +3 -3
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_restriction_reason.d.ts +2 -2
- package/esm/types/0_restriction_reason.d.ts.map +1 -1
- package/esm/types/0_thumbnail.d.ts +2 -2
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_video_chat.d.ts +2 -2
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +2 -2
- package/esm/types/0_voice.d.ts +2 -2
- package/esm/types/0_voice.d.ts.map +1 -1
- package/esm/types/1_animation.d.ts +2 -2
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_animation.js +2 -2
- package/esm/types/1_audio.d.ts +2 -2
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts +9 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +9 -9
- package/esm/types/1_chat_p.d.ts +5 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +6 -6
- package/esm/types/1_document.d.ts +2 -2
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_giveaway.d.ts +2 -2
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.d.ts +3 -3
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +18 -45
- package/esm/types/1_message_reaction.d.ts +2 -2
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +5 -5
- package/esm/types/1_photo.d.ts +5 -5
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +4 -4
- package/esm/types/1_poll.d.ts +2 -2
- package/esm/types/1_poll.d.ts.map +1 -1
- package/esm/types/1_reaction_count.d.ts +2 -2
- package/esm/types/1_reaction_count.d.ts.map +1 -1
- package/esm/types/1_reply_quote.d.ts +2 -2
- package/esm/types/1_reply_quote.d.ts.map +1 -1
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +9 -9
- package/esm/types/1_story_privacy.d.ts +3 -3
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +14 -14
- package/esm/types/1_story_reaction.d.ts +2 -2
- package/esm/types/1_story_reaction.d.ts.map +1 -1
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/1_user.d.ts.map +1 -1
- package/esm/types/1_user.js +2 -2
- package/esm/types/1_venue.d.ts +2 -2
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_venue.js +2 -2
- package/esm/types/1_video.d.ts +2 -2
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video.js +2 -2
- package/esm/types/1_video_note.d.ts +2 -2
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_business_connection.d.ts +2 -2
- package/esm/types/2_business_connection.d.ts.map +1 -1
- package/esm/types/2_business_connection.js +1 -2
- package/esm/types/2_chat.d.ts +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +11 -11
- package/esm/types/2_chat_member.d.ts +2 -2
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chosen_inline_result.d.ts +2 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +5 -5
- package/esm/types/2_game.d.ts +2 -2
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_inactive_chat.d.ts +2 -2
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.js +2 -2
- package/esm/types/2_inline_keyboard_button.d.ts +3 -3
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +15 -21
- package/esm/types/2_inline_query.d.ts +2 -2
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +8 -8
- package/esm/types/2_invite_link.d.ts +2 -2
- package/esm/types/2_invite_link.d.ts.map +1 -1
- package/esm/types/2_invite_link.js +1 -2
- package/esm/types/2_message_reaction_count.d.ts +2 -2
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reactions.d.ts +2 -2
- package/esm/types/2_message_reactions.d.ts.map +1 -1
- package/esm/types/2_message_reactions.js +2 -2
- package/esm/types/2_story_content.d.ts +2 -2
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactions.d.ts +2 -2
- package/esm/types/2_story_interactions.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.d.ts +3 -3
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +19 -29
- package/esm/types/3_chat_member_updated.d.ts +2 -2
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +7 -7
- package/esm/types/3_reply_markup.d.ts +3 -3
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +12 -22
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.d.ts +3 -3
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +53 -161
- package/esm/types/4_message.d.ts +3 -3
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +68 -59
- package/esm/types/5_callback_query.d.ts +3 -3
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +5 -5
- package/esm/types/5_chat_list_item.d.ts +3 -3
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +2 -2
- package/esm/types/5_inline_query_answer.d.ts +2 -2
- package/esm/types/5_inline_query_answer.d.ts.map +1 -1
- package/esm/types/_file_id.d.ts +2 -2
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +4 -4
- package/esm/types/_getters.d.ts +7 -7
- package/esm/types/_getters.d.ts.map +1 -1
- package/package.json +4 -1
- package/script/0_deps.d.ts +2 -0
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +5 -2
- package/script/2_tl.d.ts +7 -8
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +20 -11
- package/script/3_errors.d.ts +519 -515
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +543 -514
- package/script/3_transport.d.ts +1 -0
- package/script/3_transport.d.ts.map +1 -1
- package/script/3_transport.js +1 -0
- package/script/4_constants.d.ts +0 -19
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +27 -3
- package/script/4_errors.d.ts +7 -7
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +6 -6
- package/script/_dnt.shims.d.ts +1 -0
- package/script/_dnt.shims.d.ts.map +1 -1
- package/script/client/0_client_abstract.d.ts +1 -21
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +41 -16
- package/script/client/0_message.d.ts +3 -3
- package/script/client/0_message.d.ts.map +1 -1
- package/script/client/0_message.js +3 -19
- package/script/client/0_params.d.ts +1 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +2 -7
- package/script/client/0_storage_operations.d.ts +23 -23
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +12 -11
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +12 -9
- package/script/client/1_client_encrypted.d.ts +3 -5
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +42 -26
- package/script/client/1_client_plain.d.ts +2 -2
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -17
- package/script/client/1_types.d.ts +9 -22
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +2 -2
- package/script/client/2_account_manager.js +15 -15
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +7 -6
- package/script/client/2_business_connection_manager.d.ts +3 -3
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +5 -4
- package/script/client/2_file_manager.d.ts +4 -23
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +64 -37
- package/script/client/2_reaction_manager.d.ts +3 -3
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +15 -9
- package/script/client/2_update_manager.d.ts +11 -11
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +161 -159
- package/script/client/3_message_manager.d.ts +8 -9
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +204 -473
- package/script/client/3_video_chat_manager.d.ts +3 -3
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +25 -35
- package/script/client/4_callback_query_manager.d.ts +3 -3
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +4 -15
- package/script/client/4_chat_list_manager.d.ts +5 -4
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +54 -32
- package/script/client/4_inline_query_manager.d.ts +3 -3
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +5 -14
- package/script/client/4_story_manager.d.ts +3 -3
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +14 -31
- package/script/client/5_client.d.ts +10 -12
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +59 -113
- package/{esm/tl/6_rpc_result.d.ts → script/connection/1_connection_tcp.d.ts} +14 -10
- package/script/connection/1_connection_tcp.d.ts.map +1 -0
- package/script/connection/1_connection_tcp.js +196 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.js +7 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.js +91 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/types.js +4 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.js +54 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +280 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +5 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +40 -0
- package/script/mod.d.ts +0 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +0 -1
- package/script/tl/0_api.d.ts +14813 -0
- package/script/tl/0_api.d.ts.map +1 -0
- package/script/tl/0_api.js +23248 -0
- package/script/tl/1_utilities.d.ts +32 -0
- package/script/tl/1_utilities.d.ts.map +1 -0
- package/script/tl/1_utilities.js +76 -0
- package/script/tl/2_deserialize.d.ts +23 -0
- package/script/tl/2_deserialize.d.ts.map +1 -0
- package/script/tl/{3_deserialize.js → 2_deserialize.js} +19 -20
- package/script/tl/2_serialize.d.ts +22 -0
- package/script/tl/2_serialize.d.ts.map +1 -0
- package/script/tl/2_serialize.js +164 -0
- package/script/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/script/tl/3_tl_reader.d.ts.map +1 -0
- package/script/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/script/tl/3_utilities.d.ts +5 -5
- package/script/tl/3_utilities.d.ts.map +1 -1
- package/script/tl/3_utilities.js +9 -10
- package/script/tl/4_rpc_result.d.ts +27 -0
- package/script/tl/4_rpc_result.d.ts.map +1 -0
- package/{esm/tl/8_message_container.d.ts → script/tl/4_rpc_result.js} +12 -12
- package/{esm/tl/5_tl_writer.d.ts → script/tl/4_tl_writer.d.ts} +2 -2
- package/script/tl/4_tl_writer.d.ts.map +1 -0
- package/script/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/script/tl/5_message.d.ts +39 -0
- package/script/tl/5_message.d.ts.map +1 -0
- package/script/tl/5_message.js +106 -0
- package/script/transport/3_transport_provider_tcp.d.ts +14 -0
- package/script/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/script/transport/3_transport_provider_tcp.js +19 -0
- package/script/types/0_birthday.d.ts +2 -2
- package/script/types/0_birthday.d.ts.map +1 -1
- package/script/types/0_callback_query_answer.d.ts +2 -2
- package/script/types/0_callback_query_answer.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +3 -3
- package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.js +1 -11
- package/script/types/0_chat_member_rights.d.ts +3 -3
- package/script/types/0_chat_member_rights.d.ts.map +1 -1
- package/script/types/0_chat_member_rights.js +3 -3
- package/script/types/0_chat_photo.d.ts +2 -2
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_contact.d.ts +2 -2
- package/script/types/0_contact.d.ts.map +1 -1
- package/script/types/0_dice.d.ts +2 -2
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.d.ts +2 -2
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_link_preview.d.ts +2 -2
- package/script/types/0_link_preview.d.ts.map +1 -1
- package/script/types/0_live_stream_channel.d.ts +2 -2
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_location.d.ts +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_mask_position.d.ts +2 -2
- package/script/types/0_mask_position.d.ts.map +1 -1
- package/script/types/0_message_entity.d.ts +3 -3
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +41 -41
- package/script/types/0_message_search_filter.d.ts +2 -2
- package/script/types/0_message_search_filter.d.ts.map +1 -1
- package/script/types/0_message_search_filter.js +14 -15
- package/script/types/0_opening_hours.d.ts +2 -2
- package/script/types/0_opening_hours.d.ts.map +1 -1
- package/script/types/0_poll_option.d.ts +2 -2
- package/script/types/0_poll_option.d.ts.map +1 -1
- package/script/types/0_reaction.d.ts +3 -3
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_restriction_reason.d.ts +2 -2
- package/script/types/0_restriction_reason.d.ts.map +1 -1
- package/script/types/0_thumbnail.d.ts +2 -2
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_video_chat.d.ts +2 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- package/script/types/0_voice.d.ts +2 -2
- package/script/types/0_voice.d.ts.map +1 -1
- package/script/types/1_animation.d.ts +2 -2
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_animation.js +1 -1
- package/script/types/1_audio.d.ts +2 -2
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts +9 -2
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +8 -8
- package/script/types/1_chat_p.d.ts +5 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +5 -5
- package/script/types/1_document.d.ts +2 -2
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_giveaway.d.ts +2 -2
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_keyboard_button.d.ts +3 -3
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +17 -44
- package/script/types/1_message_reaction.d.ts +2 -2
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +4 -4
- package/script/types/1_photo.d.ts +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +3 -3
- package/script/types/1_poll.d.ts +2 -2
- package/script/types/1_poll.d.ts.map +1 -1
- package/script/types/1_reaction_count.d.ts +2 -2
- package/script/types/1_reaction_count.d.ts.map +1 -1
- package/script/types/1_reply_quote.d.ts +2 -2
- package/script/types/1_reply_quote.d.ts.map +1 -1
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +8 -8
- package/script/types/1_story_privacy.d.ts +3 -3
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +13 -13
- package/script/types/1_story_reaction.d.ts +2 -2
- package/script/types/1_story_reaction.d.ts.map +1 -1
- package/script/types/1_user.d.ts +2 -2
- package/script/types/1_user.d.ts.map +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts +2 -2
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_venue.js +1 -1
- package/script/types/1_video.d.ts +2 -2
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video.js +1 -1
- package/script/types/1_video_note.d.ts +2 -2
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_business_connection.d.ts +2 -2
- package/script/types/2_business_connection.d.ts.map +1 -1
- package/script/types/2_business_connection.js +1 -2
- package/script/types/2_chat.d.ts +2 -2
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +10 -10
- package/script/types/2_chat_member.d.ts +2 -2
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chosen_inline_result.d.ts +2 -2
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +4 -4
- package/script/types/2_game.d.ts +2 -2
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inactive_chat.d.ts +2 -2
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inactive_chat.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +3 -3
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/2_inline_keyboard_button.js +14 -20
- package/script/types/2_inline_query.d.ts +2 -2
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +7 -7
- package/script/types/2_invite_link.d.ts +2 -2
- package/script/types/2_invite_link.d.ts.map +1 -1
- package/script/types/2_invite_link.js +1 -2
- package/script/types/2_message_reaction_count.d.ts +2 -2
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reactions.d.ts +2 -2
- package/script/types/2_message_reactions.d.ts.map +1 -1
- package/script/types/2_message_reactions.js +1 -1
- package/script/types/2_story_content.d.ts +2 -2
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactions.d.ts +2 -2
- package/script/types/2_story_interactions.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.d.ts +3 -3
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +18 -28
- package/script/types/3_chat_member_updated.d.ts +2 -2
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +6 -6
- package/script/types/3_reply_markup.d.ts +3 -3
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +11 -21
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/4_inline_query_result.d.ts +3 -3
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +52 -160
- package/script/types/4_message.d.ts +3 -3
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +67 -58
- package/script/types/5_callback_query.d.ts +3 -3
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +4 -4
- package/script/types/5_chat_list_item.d.ts +3 -3
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +1 -1
- package/script/types/5_inline_query_answer.d.ts +2 -2
- package/script/types/5_inline_query_answer.d.ts.map +1 -1
- package/script/types/_file_id.d.ts +2 -2
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +3 -3
- package/script/types/_getters.d.ts +7 -7
- package/script/types/_getters.d.ts.map +1 -1
- package/esm/tl/1_tl_object.d.ts +0 -64
- package/esm/tl/1_tl_object.d.ts.map +0 -1
- package/esm/tl/1_tl_object.js +0 -221
- package/esm/tl/2_types.d.ts +0 -28060
- package/esm/tl/2_types.d.ts.map +0 -1
- package/esm/tl/2_types.js +0 -68685
- package/esm/tl/3_deserialize.d.ts +0 -23
- package/esm/tl/3_deserialize.d.ts.map +0 -1
- package/esm/tl/3_functions.d.ts +0 -14094
- package/esm/tl/3_functions.d.ts.map +0 -1
- package/esm/tl/3_functions.js +0 -28475
- package/esm/tl/4_tl_reader.d.ts.map +0 -1
- package/esm/tl/5_tl_writer.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.js +0 -49
- package/esm/tl/7_message.d.ts.map +0 -1
- package/esm/tl/7_message.js +0 -90
- package/esm/tl/8_message_container.d.ts.map +0 -1
- package/esm/tl/8_message_container.js +0 -72
- package/script/tl/1_tl_object.d.ts +0 -64
- package/script/tl/1_tl_object.d.ts.map +0 -1
- package/script/tl/1_tl_object.js +0 -228
- package/script/tl/2_types.d.ts +0 -28060
- package/script/tl/2_types.d.ts.map +0 -1
- package/script/tl/2_types.js +0 -70558
- package/script/tl/3_deserialize.d.ts +0 -23
- package/script/tl/3_deserialize.d.ts.map +0 -1
- package/script/tl/3_functions.d.ts +0 -14094
- package/script/tl/3_functions.d.ts.map +0 -1
- package/script/tl/3_functions.js +0 -29121
- package/script/tl/4_tl_reader.d.ts.map +0 -1
- package/script/tl/5_tl_writer.d.ts.map +0 -1
- package/script/tl/6_rpc_result.d.ts +0 -30
- package/script/tl/6_rpc_result.d.ts.map +0 -1
- package/script/tl/6_rpc_result.js +0 -53
- package/script/tl/7_message.d.ts +0 -32
- package/script/tl/7_message.d.ts.map +0 -1
- package/script/tl/7_message.js +0 -95
- package/script/tl/8_message_container.d.ts +0 -32
- package/script/tl/8_message_container.d.ts.map +0 -1
- package/script/tl/8_message_container.js +0 -76
|
@@ -32,7 +32,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
32
32
|
var _BotInfoManager_instances, _BotInfoManager_c, _BotInfoManager_setMyInfo, _BotInfoManager_getMyInfo;
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.BotInfoManager = void 0;
|
|
35
|
-
const _2_tl_js_1 = require("../2_tl.js");
|
|
36
35
|
const _3_types_js_1 = require("../3_types.js");
|
|
37
36
|
class BotInfoManager {
|
|
38
37
|
constructor(c) {
|
|
@@ -66,7 +65,8 @@ class BotInfoManager {
|
|
|
66
65
|
}
|
|
67
66
|
async getMyCommands(params) {
|
|
68
67
|
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").storage.assertBot("getMyCommands");
|
|
69
|
-
const commands_ = await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
68
|
+
const commands_ = await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({
|
|
69
|
+
_: "bots.getBotCommands",
|
|
70
70
|
lang_code: params?.languageCode ?? "",
|
|
71
71
|
scope: await (0, _3_types_js_1.botCommandScopeToTlObject)(params?.scope ?? { type: "default" }, __classPrivateFieldGet(this, _BotInfoManager_c, "f").getInputPeer),
|
|
72
72
|
});
|
|
@@ -74,8 +74,9 @@ class BotInfoManager {
|
|
|
74
74
|
}
|
|
75
75
|
async setMyCommands(commands, params) {
|
|
76
76
|
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").storage.assertBot("setMyCommands");
|
|
77
|
-
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
78
|
-
|
|
77
|
+
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({
|
|
78
|
+
_: "bots.setBotCommands",
|
|
79
|
+
commands: commands.map((v) => ({ ...v, _: "botCommand" })),
|
|
79
80
|
lang_code: params?.languageCode ?? "",
|
|
80
81
|
scope: await (0, _3_types_js_1.botCommandScopeToTlObject)(params?.scope ?? { type: "default" }, __classPrivateFieldGet(this, _BotInfoManager_c, "f").getInputPeer),
|
|
81
82
|
});
|
|
@@ -83,7 +84,7 @@ class BotInfoManager {
|
|
|
83
84
|
}
|
|
84
85
|
exports.BotInfoManager = BotInfoManager;
|
|
85
86
|
_BotInfoManager_c = new WeakMap(), _BotInfoManager_instances = new WeakSet(), _BotInfoManager_setMyInfo = async function _BotInfoManager_setMyInfo(info) {
|
|
86
|
-
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
87
|
+
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({ _: "bots.setBotInfo", bot: { _: "inputUserSelf" }, ...info });
|
|
87
88
|
}, _BotInfoManager_getMyInfo = function _BotInfoManager_getMyInfo(languageCode) {
|
|
88
|
-
return __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
89
|
+
return __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({ _: "bots.getBotInfo", bot: { _: "inputUserSelf" }, lang_code: languageCode ?? "" });
|
|
89
90
|
};
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { Update } from "../3_types.js";
|
|
22
22
|
import { C } from "./1_types.js";
|
|
23
|
-
export type BusinessConnectionManagerUpdate =
|
|
23
|
+
export type BusinessConnectionManagerUpdate = Api.updateBotBusinessConnect;
|
|
24
24
|
export declare class BusinessConnectionManager {
|
|
25
25
|
#private;
|
|
26
26
|
constructor(c: C);
|
|
27
27
|
getBusinessConnection(id: string): Promise<import("../3_types.js").BusinessConnection>;
|
|
28
|
-
static canHandleUpdate(update:
|
|
28
|
+
static canHandleUpdate(update: Api.Update): update is BusinessConnectionManagerUpdate;
|
|
29
29
|
handleUpdate(update: BusinessConnectionManagerUpdate): Promise<Update>;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=2_business_connection_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_business_connection_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_business_connection_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"2_business_connection_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_business_connection_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,MAAM,MAAM,+BAA+B,GAAG,GAAG,CAAC,wBAAwB,CAAC;AAE3E,qBAAa,yBAAyB;;gBAGxB,CAAC,EAAE,CAAC;IAIV,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAatC,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,+BAA+B;IAI/E,YAAY,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,MAAM,CAAC;CAS7E"}
|
|
@@ -33,6 +33,7 @@ var _BusinessConnectionManager_c;
|
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.BusinessConnectionManager = void 0;
|
|
35
35
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
36
|
+
const _2_tl_js_2 = require("../2_tl.js");
|
|
36
37
|
const _3_types_js_1 = require("../3_types.js");
|
|
37
38
|
class BusinessConnectionManager {
|
|
38
39
|
constructor(c) {
|
|
@@ -42,9 +43,9 @@ class BusinessConnectionManager {
|
|
|
42
43
|
async getBusinessConnection(id) {
|
|
43
44
|
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.getBusinessConnection(id);
|
|
44
45
|
if (!connection_) {
|
|
45
|
-
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").
|
|
46
|
-
.then((v) =>
|
|
47
|
-
.then((v) => v.updates[0]
|
|
46
|
+
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").invoke({ _: "account.getBotBusinessConnection", connection_id: id })
|
|
47
|
+
.then((v) => (0, _2_tl_js_2.as)("updates", v))
|
|
48
|
+
.then((v) => (0, _2_tl_js_2.as)("updateBotBusinessConnect", v.updates[0]).connection);
|
|
48
49
|
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(id, connection_);
|
|
49
50
|
return await (0, _3_types_js_1.constructBusinessConnection)(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
50
51
|
}
|
|
@@ -53,7 +54,7 @@ class BusinessConnectionManager {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
static canHandleUpdate(update) {
|
|
56
|
-
return
|
|
57
|
+
return (0, _2_tl_js_1.is)("updateBotBusinessConnect", update);
|
|
57
58
|
}
|
|
58
59
|
async handleUpdate(update) {
|
|
59
60
|
if (update.connection.disabled) {
|
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
4
|
-
*
|
|
5
|
-
* This file is part of MTKruto.
|
|
6
|
-
*
|
|
7
|
-
* This program is free software: you can redistribute it and/or modify
|
|
8
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
-
* (at your option) any later version.
|
|
11
|
-
*
|
|
12
|
-
* This program is distributed in the hope that it will be useful,
|
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
* GNU Lesser General Public License for more details.
|
|
16
|
-
*
|
|
17
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
-
*/
|
|
20
|
-
import { enums, types } from "../2_tl.js";
|
|
1
|
+
import { Api } from "../2_tl.js";
|
|
21
2
|
import { FileSource, Sticker } from "../3_types.js";
|
|
22
3
|
import { DownloadParams, UploadParams } from "./0_params.js";
|
|
23
4
|
import { C } from "./1_types.js";
|
|
24
5
|
export declare class FileManager {
|
|
25
6
|
#private;
|
|
26
7
|
constructor(c: C);
|
|
27
|
-
upload(file: FileSource, params?: UploadParams, checkName?: null | ((name: string) => string), allowStream?: boolean): Promise<
|
|
28
|
-
downloadInner(location:
|
|
8
|
+
upload(file: FileSource, params?: UploadParams, checkName?: null | ((name: string) => string), allowStream?: boolean): Promise<Api.InputFile>;
|
|
9
|
+
downloadInner(location: Api.InputFileLocation, dcId: number, params?: {
|
|
29
10
|
chunkSize?: number;
|
|
30
11
|
offset?: number;
|
|
31
12
|
}): AsyncGenerator<Uint8Array, void, unknown>;
|
|
32
13
|
static validateChunkSize(chunkSize: number, max: number): void;
|
|
33
14
|
static validateOffset(offset: number): void;
|
|
34
15
|
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
35
|
-
getStickerSetName(inputStickerSet:
|
|
16
|
+
getStickerSetName(inputStickerSet: Api.inputStickerSetID, hash?: number): Promise<string>;
|
|
36
17
|
getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
|
|
37
18
|
}
|
|
38
19
|
//# sourceMappingURL=2_file_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_file_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_file_manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"2_file_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_file_manager.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,GAAG,EAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAA+C,UAAU,EAA8C,OAAO,EAAkB,MAAM,eAAe,CAAC;AAG7J,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAkB,MAAM,cAAc,CAAC;AAEjD,qBAAa,WAAW;;gBAQV,CAAC,EAAE,CAAC;IAOV,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,EAAE,WAAW,UAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IAmNzI,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAmDpH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAevD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM;IAY7B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc;IAmDjD,iBAAiB,CAAC,eAAe,EAAE,GAAG,CAAC,iBAAiB,EAAE,IAAI,SAAI;IAalE,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;CA6CnD"}
|
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
+
};
|
|
36
|
+
var _FileManager_instances, _a, _FileManager_c, _FileManager_Lupload, _FileManager_UPLOAD_MAX_CHUNK_SIZE, _FileManager_DOWNLOAD_MAX_CHUNK_SIZE, _FileManager_BIG_FILE_THRESHOLD, _FileManager_UPLOAD_REQUEST_PER_CONNECTION, _FileManager_uploadStream, _FileManager_uploadBuffer, _FileManager_handleUploadError, _FileManager_getFileContents, _FileManager_CUSTOM_EMOJI_TTL;
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.FileManager = void 0;
|
|
2
39
|
/**
|
|
3
40
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
41
|
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
@@ -18,20 +55,7 @@
|
|
|
18
55
|
* You should have received a copy of the GNU Lesser General Public License
|
|
19
56
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
57
|
*/
|
|
21
|
-
|
|
22
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
23
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
-
};
|
|
27
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
28
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
-
};
|
|
32
|
-
var _FileManager_instances, _a, _FileManager_c, _FileManager_Lupload, _FileManager_UPLOAD_MAX_CHUNK_SIZE, _FileManager_DOWNLOAD_MAX_CHUNK_SIZE, _FileManager_BIG_FILE_THRESHOLD, _FileManager_UPLOAD_REQUEST_PER_CONNECTION, _FileManager_uploadStream, _FileManager_uploadBuffer, _FileManager_handleUploadError, _FileManager_getFileContents, _FileManager_CUSTOM_EMOJI_TTL;
|
|
33
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.FileManager = void 0;
|
|
58
|
+
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
35
59
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
36
60
|
const _0_errors_js_1 = require("../0_errors.js");
|
|
37
61
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
@@ -80,10 +104,10 @@ class FileManager {
|
|
|
80
104
|
}
|
|
81
105
|
__classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded ` + result.parts + " part(s)");
|
|
82
106
|
if (result.small) {
|
|
83
|
-
return
|
|
107
|
+
return { _: "inputFile", id: fileId, name, parts: result.parts, md5_checksum: "" };
|
|
84
108
|
}
|
|
85
109
|
else {
|
|
86
|
-
return
|
|
110
|
+
return { _: "inputFileBig", id: fileId, name, parts: result.parts };
|
|
87
111
|
}
|
|
88
112
|
}
|
|
89
113
|
async *downloadInner(location, dcId, params) {
|
|
@@ -108,8 +132,8 @@ class FileManager {
|
|
|
108
132
|
let part = 0;
|
|
109
133
|
try {
|
|
110
134
|
while (true) {
|
|
111
|
-
const file = await connection.
|
|
112
|
-
if (
|
|
135
|
+
const file = await connection.invoke({ _: "upload.getFile", location, offset, limit });
|
|
136
|
+
if ((0, _2_tl_js_1.is)("upload.file", file)) {
|
|
113
137
|
yield file.bytes;
|
|
114
138
|
if (id != null) {
|
|
115
139
|
await __classPrivateFieldGet(this, _FileManager_c, "f").storage.saveFilePart(id, part, file.bytes);
|
|
@@ -168,40 +192,43 @@ class FileManager {
|
|
|
168
192
|
(0, _0_deps_js_1.unreachable)();
|
|
169
193
|
}
|
|
170
194
|
const big = fileId_.location.source.type == _3_types_js_1.PhotoSourceType.ChatPhotoBig;
|
|
171
|
-
const peer = await __classPrivateFieldGet(this, _FileManager_c, "f").getInputPeer(Number(fileId_.location.source.chatId));
|
|
172
|
-
const location =
|
|
195
|
+
const peer = await __classPrivateFieldGet(this, _FileManager_c, "f").getInputPeer(Number(fileId_.location.source.chatId));
|
|
196
|
+
const location = { _: "inputPeerPhotoFileLocation", big: big ? true : undefined, peer, photo_id: fileId_.location.id };
|
|
173
197
|
yield* this.downloadInner(location, fileId_.dcId, params);
|
|
174
198
|
break;
|
|
175
199
|
}
|
|
176
200
|
case _3_types_js_1.FileType.Photo: {
|
|
177
|
-
const location =
|
|
201
|
+
const location = {
|
|
202
|
+
_: "inputPhotoFileLocation",
|
|
178
203
|
id: fileId_.location.id,
|
|
179
204
|
access_hash: fileId_.location.accessHash,
|
|
180
205
|
file_reference: fileId_.fileReference ?? new Uint8Array(),
|
|
181
206
|
thumb_size: "thumbnailType" in fileId_.location.source ? String.fromCharCode(fileId_.location.source.thumbnailType) : "",
|
|
182
|
-
}
|
|
207
|
+
};
|
|
183
208
|
yield* this.downloadInner(location, fileId_.dcId, params);
|
|
184
209
|
break;
|
|
185
210
|
}
|
|
186
211
|
case _3_types_js_1.FileType.Thumbnail: {
|
|
187
|
-
const location =
|
|
212
|
+
const location = {
|
|
213
|
+
_: "inputDocumentFileLocation",
|
|
188
214
|
id: fileId_.location.id,
|
|
189
215
|
access_hash: fileId_.location.accessHash,
|
|
190
216
|
file_reference: fileId_.fileReference ?? new Uint8Array(),
|
|
191
217
|
thumb_size: "thumbnailType" in fileId_.location.source ? String.fromCharCode(fileId_.location.source.thumbnailType) : (0, _0_deps_js_1.unreachable)(),
|
|
192
|
-
}
|
|
218
|
+
};
|
|
193
219
|
yield* this.downloadInner(location, fileId_.dcId, params);
|
|
194
220
|
break;
|
|
195
221
|
}
|
|
196
222
|
}
|
|
197
223
|
}
|
|
198
224
|
else if (fileId_.location.type == "common") {
|
|
199
|
-
const location =
|
|
225
|
+
const location = {
|
|
226
|
+
_: "inputDocumentFileLocation",
|
|
200
227
|
id: fileId_.location.id,
|
|
201
228
|
access_hash: fileId_.location.accessHash,
|
|
202
229
|
file_reference: fileId_.fileReference ?? new Uint8Array(),
|
|
203
230
|
thumb_size: "",
|
|
204
|
-
}
|
|
231
|
+
};
|
|
205
232
|
yield* this.downloadInner(location, fileId_.dcId, params);
|
|
206
233
|
}
|
|
207
234
|
else {
|
|
@@ -214,8 +241,8 @@ class FileManager {
|
|
|
214
241
|
return maybeStickerSetName[0];
|
|
215
242
|
}
|
|
216
243
|
else {
|
|
217
|
-
const stickerSet = await __classPrivateFieldGet(this, _FileManager_c, "f").
|
|
218
|
-
const name =
|
|
244
|
+
const stickerSet = await __classPrivateFieldGet(this, _FileManager_c, "f").invoke({ _: "messages.getStickerSet", stickerset: inputStickerSet, hash });
|
|
245
|
+
const name = (0, _2_tl_js_1.as)("messages.stickerSet", stickerSet).set.short_name;
|
|
219
246
|
await __classPrivateFieldGet(this, _FileManager_c, "f").messageStorage.updateStickerSetName(inputStickerSet.id, inputStickerSet.access_hash, name);
|
|
220
247
|
return name;
|
|
221
248
|
}
|
|
@@ -250,7 +277,7 @@ class FileManager {
|
|
|
250
277
|
if (!shouldFetch) {
|
|
251
278
|
return stickers;
|
|
252
279
|
}
|
|
253
|
-
const documents_ = await __classPrivateFieldGet(this, _FileManager_c, "f").
|
|
280
|
+
const documents_ = await __classPrivateFieldGet(this, _FileManager_c, "f").invoke({ _: "messages.getCustomEmojiDocuments", document_id: id.map(BigInt) }).then((v) => v.map((v) => (0, _2_tl_js_1.as)("document", v)));
|
|
254
281
|
for (const [i, document_] of documents_.entries()) {
|
|
255
282
|
await __classPrivateFieldGet(this, _FileManager_c, "f").messageStorage.setCustomEmojiDocument(document_.id, document_);
|
|
256
283
|
const fileId_ = {
|
|
@@ -271,17 +298,17 @@ exports.FileManager = FileManager;
|
|
|
271
298
|
_a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new WeakMap(), _FileManager_instances = new WeakSet(), _FileManager_uploadStream = async function _FileManager_uploadStream(stream, fileId, chunkSize, signal, pool) {
|
|
272
299
|
let part;
|
|
273
300
|
let promises = new Array();
|
|
274
|
-
let
|
|
301
|
+
let invoke = pool.invoke();
|
|
275
302
|
let apiPromiseCount = 0;
|
|
276
303
|
for await (part of (0, _1_utilities_js_1.iterateReadableStream)(stream.pipeThrough(new _1_utilities_js_1.PartStream(chunkSize)))) {
|
|
277
304
|
promises.push(Promise.resolve().then(async () => {
|
|
278
305
|
while (true) {
|
|
279
306
|
try {
|
|
280
307
|
if (part.small) {
|
|
281
|
-
await
|
|
308
|
+
await invoke({ _: "upload.saveFilePart", file_id: fileId, bytes: part.bytes, file_part: part.part });
|
|
282
309
|
}
|
|
283
310
|
else {
|
|
284
|
-
await
|
|
311
|
+
await invoke({ _: "upload.saveBigFilePart", file_id: fileId, file_part: part.part, bytes: part.bytes, file_total_parts: part.totalParts });
|
|
285
312
|
}
|
|
286
313
|
__classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded part ` + (part.part + 1));
|
|
287
314
|
break;
|
|
@@ -294,7 +321,7 @@ _a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new Wea
|
|
|
294
321
|
}
|
|
295
322
|
}));
|
|
296
323
|
if (++apiPromiseCount >= __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION)) {
|
|
297
|
-
|
|
324
|
+
invoke = pool.invoke();
|
|
298
325
|
apiPromiseCount = 0;
|
|
299
326
|
}
|
|
300
327
|
if (promises.length == pool.size * __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION)) {
|
|
@@ -310,7 +337,7 @@ _a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new Wea
|
|
|
310
337
|
let promises = new Array();
|
|
311
338
|
main: for (let part = 0; part < partCount;) {
|
|
312
339
|
for (let i = 0; i < pool.size; ++i) {
|
|
313
|
-
const
|
|
340
|
+
const invoke = pool.invoke();
|
|
314
341
|
for (let i = 0; i < __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION); ++i) {
|
|
315
342
|
const start = part * chunkSize;
|
|
316
343
|
const end = start + chunkSize;
|
|
@@ -324,10 +351,10 @@ _a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new Wea
|
|
|
324
351
|
try {
|
|
325
352
|
signal?.throwIfAborted();
|
|
326
353
|
if (isBig) {
|
|
327
|
-
await
|
|
354
|
+
await invoke({ _: "upload.saveBigFilePart", file_id: fileId, file_part: thisPart, bytes, file_total_parts: partCount });
|
|
328
355
|
}
|
|
329
356
|
else {
|
|
330
|
-
await
|
|
357
|
+
await invoke({ _: "upload.saveFilePart", file_id: fileId, bytes, file_part: thisPart });
|
|
331
358
|
}
|
|
332
359
|
__classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded part ` + (thisPart + 1) + " / " + partCount);
|
|
333
360
|
break;
|
|
@@ -397,7 +424,7 @@ _a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new Wea
|
|
|
397
424
|
}
|
|
398
425
|
else {
|
|
399
426
|
// @ts-ignore: lib
|
|
400
|
-
path_ = _0_deps_js_1.path.join(Deno.cwd(), source);
|
|
427
|
+
path_ = _0_deps_js_1.path.join(dntShim.Deno.cwd(), source);
|
|
401
428
|
}
|
|
402
429
|
url = _0_deps_js_1.path.toFileUrl(path_).toString();
|
|
403
430
|
name = _0_deps_js_1.path.basename(path_);
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { Update } from "../3_types.js";
|
|
22
22
|
import { C } from "./1_types.js";
|
|
23
|
-
type ReactionManagerUpdate =
|
|
23
|
+
type ReactionManagerUpdate = Api.updateBotMessageReactions | Api.updateBotMessageReaction | Api.updateMessageReactions | Api.updateChannelMessageViews | Api.updateChannelMessageForwards;
|
|
24
24
|
export declare class ReactionManager {
|
|
25
25
|
#private;
|
|
26
26
|
constructor(c: C);
|
|
27
|
-
static canHandleUpdate(update:
|
|
27
|
+
static canHandleUpdate(update: Api.Update): update is ReactionManagerUpdate;
|
|
28
28
|
handleUpdate(update: ReactionManagerUpdate): Promise<Update | null>;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_reaction_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_reaction_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"2_reaction_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_reaction_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAA6B,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAsF,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3H,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,KAAK,qBAAqB,GACtB,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,sBAAsB,GAC1B,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,4BAA4B,CAAC;AAErC,qBAAa,eAAe;;gBAGd,CAAC,EAAE,CAAC;IAIhB,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,qBAAqB;IAUrE,YAAY,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAmD1E"}
|
|
@@ -41,10 +41,16 @@ class ReactionManager {
|
|
|
41
41
|
__classPrivateFieldSet(this, _ReactionManager_c, c, "f");
|
|
42
42
|
}
|
|
43
43
|
static canHandleUpdate(update) {
|
|
44
|
-
return
|
|
44
|
+
return (0, _2_tl_js_1.isOneOf)([
|
|
45
|
+
"updateBotMessageReactions",
|
|
46
|
+
"updateBotMessageReaction",
|
|
47
|
+
"updateMessageReactions",
|
|
48
|
+
"updateChannelMessageViews",
|
|
49
|
+
"updateChannelMessageForwards",
|
|
50
|
+
], update);
|
|
45
51
|
}
|
|
46
52
|
async handleUpdate(update) {
|
|
47
|
-
if (
|
|
53
|
+
if ((0, _2_tl_js_1.is)("updateBotMessageReactions", update)) {
|
|
48
54
|
const messageReactionCount = await (0, _3_types_js_1.constructMessageReactionCount)(update, __classPrivateFieldGet(this, _ReactionManager_c, "f").getEntity);
|
|
49
55
|
if (messageReactionCount) {
|
|
50
56
|
return { messageReactionCount };
|
|
@@ -53,7 +59,7 @@ class ReactionManager {
|
|
|
53
59
|
return null;
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
|
-
else if (
|
|
62
|
+
else if ((0, _2_tl_js_1.is)("updateBotMessageReaction", update)) {
|
|
57
63
|
const messageReactions = await (0, _3_types_js_1.constructMessageReactions)(update, __classPrivateFieldGet(this, _ReactionManager_c, "f").getEntity);
|
|
58
64
|
if (messageReactions) {
|
|
59
65
|
return { messageReactions };
|
|
@@ -62,26 +68,26 @@ class ReactionManager {
|
|
|
62
68
|
return null;
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
|
-
else if (
|
|
71
|
+
else if ((0, _2_tl_js_1.is)("updateMessageReactions", update)) {
|
|
66
72
|
const chatId = (0, _2_tl_js_1.peerToChatId)(update.peer);
|
|
67
73
|
const message = await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.getMessage(chatId, update.msg_id);
|
|
68
|
-
if (
|
|
74
|
+
if ((0, _2_tl_js_1.is)("message", message)) {
|
|
69
75
|
message.reactions = update.reactions;
|
|
70
76
|
await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.setMessage(chatId, update.msg_id, message);
|
|
71
77
|
const views = message.views ?? 0;
|
|
72
78
|
const forwards = message.forwards ?? 0;
|
|
73
79
|
const recentReactions = update.reactions.recent_reactions ?? [];
|
|
74
80
|
const reactions = update.reactions.results.map((v) => (0, _3_types_js_1.constructMessageReaction)(v, recentReactions));
|
|
75
|
-
return
|
|
81
|
+
return { messageInteractions: { chatId, messageId: update.msg_id, reactions, views, forwards } };
|
|
76
82
|
}
|
|
77
83
|
else {
|
|
78
84
|
return null;
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
|
-
else if (
|
|
82
|
-
const chatId = (0, _2_tl_js_1.peerToChatId)(
|
|
87
|
+
else if ((0, _2_tl_js_1.isOneOf)(["updateChannelMessageViews", "updateChannelMessageForwards"], update)) {
|
|
88
|
+
const chatId = (0, _2_tl_js_1.peerToChatId)({ ...update, _: "peerChannel" });
|
|
83
89
|
const message = await __classPrivateFieldGet(this, _ReactionManager_c, "f").messageStorage.getMessage(chatId, update.id);
|
|
84
|
-
if (
|
|
90
|
+
if ((0, _2_tl_js_1.is)("message", message)) {
|
|
85
91
|
if ("views" in update) {
|
|
86
92
|
message.views = update.views;
|
|
87
93
|
}
|
|
@@ -18,26 +18,26 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { Queue } from "../1_utilities.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api, ReadObject } from "../2_tl.js";
|
|
22
22
|
import { C } from "./1_types.js";
|
|
23
|
-
type UpdateHandler = (update:
|
|
24
|
-
export type PtsUpdate =
|
|
25
|
-
export type ChannelPtsUpdate =
|
|
26
|
-
export type QtsUpdate =
|
|
23
|
+
type UpdateHandler = (update: Api.Update) => Promise<(() => Promise<unknown>)>;
|
|
24
|
+
export type PtsUpdate = Api.updateNewMessage | Api.updateDeleteMessages | Api.updateReadHistoryInbox | Api.updateReadHistoryOutbox | Api.updatePinnedChannelMessages | Api.updatePinnedMessages | Api.updateFolderPeers | Api.updateChannelWebPage | Api.updateEditMessage | Api.updateReadMessagesContents | Api.updateWebPage;
|
|
25
|
+
export type ChannelPtsUpdate = Api.updateNewChannelMessage | Api.updateEditChannelMessage | Api.updateDeleteChannelMessages | Api.updateChannelTooLong;
|
|
26
|
+
export type QtsUpdate = Api.updateNewEncryptedMessage | Api.updateMessagePollVote | Api.updateBotStopped | Api.updateChatParticipant | Api.updateChannelParticipant | Api.updateBotChatInviteRequester | Api.updateBotChatBoost | Api.updateBotMessageReaction | Api.updateBotMessageReactions | Api.updateBotBusinessConnect | Api.updateBotNewBusinessMessage | Api.updateBotEditBusinessMessage | Api.updateBotDeleteBusinessMessage;
|
|
27
27
|
export declare class UpdateManager {
|
|
28
28
|
#private;
|
|
29
29
|
static readonly QTS_COUNT = 1;
|
|
30
30
|
static readonly MAIN_BOX_ID = 0n;
|
|
31
31
|
constructor(c: C);
|
|
32
|
-
static isPtsUpdate(v:
|
|
33
|
-
static isQtsUpdate(v:
|
|
34
|
-
static isChannelPtsUpdate(v:
|
|
32
|
+
static isPtsUpdate(v: Api.Update): v is PtsUpdate;
|
|
33
|
+
static isQtsUpdate(v: Api.Update): v is QtsUpdate;
|
|
34
|
+
static isChannelPtsUpdate(v: Api.Update | Api.Updates): v is ChannelPtsUpdate;
|
|
35
35
|
fetchState(source: string): Promise<void>;
|
|
36
|
-
processChats(chats:
|
|
36
|
+
processChats(chats: Api.Chat[]): Promise<void>;
|
|
37
37
|
processResult(result: ReadObject): Promise<void>;
|
|
38
|
-
processUsers(users:
|
|
38
|
+
processUsers(users: Api.User[]): Promise<void>;
|
|
39
39
|
getHandleUpdateQueue(boxId: bigint): Queue;
|
|
40
|
-
processUpdates(updates:
|
|
40
|
+
processUpdates(updates: Api.Update | Api.Updates, checkGap: boolean, call?: Api.AnyObject | null, callback?: () => void): void;
|
|
41
41
|
recoverUpdateGap(source: string): Promise<void>;
|
|
42
42
|
setUpdateHandler(handler: UpdateHandler): void;
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_update_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_update_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAqB,KAAK,EAAmB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"2_update_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_update_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAqB,KAAK,EAAmB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,GAAG,EAA4D,UAAU,EAAE,MAAM,YAAY,CAAC;AAGvG,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,MAAM,SAAS,GACjB,GAAG,CAAC,gBAAgB,GACpB,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,sBAAsB,GAC1B,GAAG,CAAC,uBAAuB,GAC3B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,oBAAoB,GACxB,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,0BAA0B,GAC9B,GAAG,CAAC,aAAa,CAAC;AAEtB,MAAM,MAAM,gBAAgB,GACxB,GAAG,CAAC,uBAAuB,GAC3B,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,oBAAoB,CAAC;AAE7B,MAAM,MAAM,SAAS,GACjB,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,qBAAqB,GACzB,GAAG,CAAC,gBAAgB,GACpB,GAAG,CAAC,qBAAqB,GACzB,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,4BAA4B,GAChC,GAAG,CAAC,kBAAkB,GACtB,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,yBAAyB,GAC7B,GAAG,CAAC,wBAAwB,GAC5B,GAAG,CAAC,2BAA2B,GAC/B,GAAG,CAAC,4BAA4B,GAChC,GAAG,CAAC,8BAA8B,CAAC;AAEvC,qBAAa,aAAa;;IACxB,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK;IAC9B,MAAM,CAAC,QAAQ,CAAC,WAAW,MAAM;gBAYrB,CAAC,EAAE,CAAC;IAWhB,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS;IAIjD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS;IAIjD,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,gBAAgB;IAuCvE,UAAU,CAAC,MAAM,EAAE,MAAM;IAezB,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE;IAgB9B,aAAa,CAAC,MAAM,EAAE,UAAU;IAqGhC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE;IAepC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IA2JlC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAE,GAAG,CAAC,SAAS,GAAG,IAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IAiMvH,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAmJrC,gBAAgB,CAAC,OAAO,EAAE,aAAa;CAGxC"}
|