@mtkruto/node 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_errors.d.ts +7 -7
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +5 -5
- 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 -4
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +26 -23
- 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/1_utilities_test.d.ts.map +1 -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/2_serialize_test.d.ts.map +1 -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/tl/5_message_test.d.ts.map +1 -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 +1 -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_errors.d.ts +7 -7
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +6 -6
- 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 -4
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +25 -22
- 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/1_utilities_test.d.ts.map +1 -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/2_serialize_test.d.ts.map +1 -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/tl/5_message_test.d.ts.map +1 -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/1_tl_object_test.d.ts.map +0 -1
- 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/2_types_test.d.ts.map +0 -1
- 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/3_functions_test.d.ts.map +0 -1
- 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/7_message_test.d.ts.map +0 -1
- 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/1_tl_object_test.d.ts.map +0 -1
- 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/2_types_test.d.ts.map +0 -1
- 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/3_functions_test.d.ts.map +0 -1
- 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/7_message_test.d.ts.map +0 -1
- 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
|
@@ -17,7 +17,7 @@
|
|
|
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 { ID, Update, VideoChatActive, VideoChatScheduled } from "../3_types.js";
|
|
22
22
|
import { DownloadLiveStreamChunkParams, JoinVideoChatParams, StartVideoChatParams } from "./0_params.js";
|
|
23
23
|
import { C as C_ } from "./1_types.js";
|
|
@@ -25,7 +25,7 @@ import { FileManager } from "./2_file_manager.js";
|
|
|
25
25
|
interface C extends C_ {
|
|
26
26
|
fileManager: FileManager;
|
|
27
27
|
}
|
|
28
|
-
type VideoChatManagerUpdate =
|
|
28
|
+
type VideoChatManagerUpdate = Api.updateGroupCall;
|
|
29
29
|
export declare class VideoChatManager {
|
|
30
30
|
#private;
|
|
31
31
|
constructor(c: C);
|
|
@@ -35,7 +35,7 @@ export declare class VideoChatManager {
|
|
|
35
35
|
leaveVideoChat(id: string): Promise<void>;
|
|
36
36
|
joinLiveStream(id: string): Promise<void>;
|
|
37
37
|
getVideoChat(id: string): Promise<import("../3_types.js").VideoChat>;
|
|
38
|
-
static canHandleUpdate(update:
|
|
38
|
+
static canHandleUpdate(update: Api.Update): update is VideoChatManagerUpdate;
|
|
39
39
|
handleUpdate(update: VideoChatManagerUpdate): Promise<Update>;
|
|
40
40
|
getLiveStreamChannels(id: string): Promise<import("../3_types.js").LiveStreamChannel[]>;
|
|
41
41
|
downloadLiveStreamChunk(id: string, channel: number, scale: number, timestamp: number, params?: DownloadLiveStreamChunkParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAkD,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,UAAU,CAAE,SAAQ,EAAE;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,KAAK,sBAAsB,GAAG,GAAG,CAAC,eAAe,CAAC;AAElD,qBAAa,gBAAgB;;gBAGf,CAAC,EAAE,CAAC;IAkBV,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAKxD,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAc1E,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;IAUvE,cAAc,CAAC,EAAE,EAAE,MAAM;IAKzB,cAAc,CAAC,EAAE,EAAE,MAAM;IA+BzB,YAAY,CAAC,EAAE,EAAE,MAAM;IAK7B,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,sBAAsB;IAItE,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B7D,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAgB/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,6BAA6B;CAmBrI"}
|
|
@@ -32,7 +32,7 @@ var _VideoChatManager_instances, _VideoChatManager_c, _VideoChatManager_createGr
|
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
33
|
import { InputError } from "../0_errors.js";
|
|
34
34
|
import { getRandomId, toUnixTimestamp, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
35
|
-
import { as,
|
|
35
|
+
import { as, is } from "../2_tl.js";
|
|
36
36
|
import { constructLiveStreamChannel, constructVideoChat } from "../3_types.js";
|
|
37
37
|
export class VideoChatManager {
|
|
38
38
|
constructor(c) {
|
|
@@ -51,31 +51,26 @@ export class VideoChatManager {
|
|
|
51
51
|
async joinVideoChat(id, params, params_) {
|
|
52
52
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("joinVideoChat");
|
|
53
53
|
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
|
|
54
|
-
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").
|
|
55
|
-
call,
|
|
56
|
-
join_as: params_?.joinAs ? await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(params_.joinAs) : new types.InputPeerSelf(),
|
|
57
|
-
params: new types.DataJSON({ data: params }),
|
|
58
|
-
invite_hash: params_?.inviteHash,
|
|
59
|
-
muted: params_?.audio ? undefined : true,
|
|
60
|
-
video_stopped: params_?.video ? undefined : true,
|
|
61
|
-
}).then((v) => v[as](types.Updates));
|
|
54
|
+
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.joinGroupCall", call, join_as: params_?.joinAs ? await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(params_.joinAs) : { _: "inputPeerSelf" }, params: ({ _: "dataJSON", data: params }), invite_hash: params_?.inviteHash, muted: params_?.audio ? undefined : true, video_stopped: params_?.video ? undefined : true }).then((v) => as("updates", v));
|
|
62
55
|
const updateGroupCall = updates
|
|
63
|
-
.find((v) => v
|
|
56
|
+
.find((v) => is("updateGroupCallConnection", v));
|
|
64
57
|
if (!updateGroupCall)
|
|
65
58
|
unreachable();
|
|
66
59
|
return updateGroupCall.params.data;
|
|
67
60
|
}
|
|
68
61
|
async leaveVideoChat(id) {
|
|
69
62
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("leaveVideoChat");
|
|
70
|
-
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").
|
|
63
|
+
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.leaveGroupCall", call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id), source: 0 });
|
|
71
64
|
}
|
|
72
65
|
async joinLiveStream(id) {
|
|
73
66
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("joinLiveStream");
|
|
74
67
|
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
|
|
75
|
-
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").
|
|
68
|
+
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({
|
|
69
|
+
_: "phone.joinGroupCall",
|
|
76
70
|
call,
|
|
77
|
-
join_as:
|
|
78
|
-
params:
|
|
71
|
+
join_as: { _: "inputPeerSelf" },
|
|
72
|
+
params: ({
|
|
73
|
+
_: "dataJSON",
|
|
79
74
|
data: JSON.stringify({
|
|
80
75
|
fingerprints: [],
|
|
81
76
|
pwd: "",
|
|
@@ -84,9 +79,9 @@ export class VideoChatManager {
|
|
|
84
79
|
ufrag: "",
|
|
85
80
|
}),
|
|
86
81
|
}),
|
|
87
|
-
}).then((v) =>
|
|
82
|
+
}).then((v) => as("updates", v));
|
|
88
83
|
const updateGroupCall = updates
|
|
89
|
-
.find((v) => v
|
|
84
|
+
.find((v) => is("updateGroupCallConnection", v));
|
|
90
85
|
if (!updateGroupCall)
|
|
91
86
|
unreachable();
|
|
92
87
|
}
|
|
@@ -95,13 +90,13 @@ export class VideoChatManager {
|
|
|
95
90
|
return constructVideoChat(await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id));
|
|
96
91
|
}
|
|
97
92
|
static canHandleUpdate(update) {
|
|
98
|
-
return update
|
|
93
|
+
return is("updateGroupCall", update);
|
|
99
94
|
}
|
|
100
95
|
async handleUpdate(update) {
|
|
101
96
|
let chatId = Number(-update.chat_id);
|
|
102
97
|
const fullChat = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId).then((v) => v == null ? __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId = ZERO_CHANNEL_ID - Number(update.chat_id)) : v);
|
|
103
98
|
let updateFullChat = false;
|
|
104
|
-
if (update.call
|
|
99
|
+
if (is("groupCallDiscarded", update.call)) {
|
|
105
100
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCall(update.call.id, null);
|
|
106
101
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCallAccessHash(update.call.id, null);
|
|
107
102
|
if (fullChat != null) {
|
|
@@ -114,7 +109,7 @@ export class VideoChatManager {
|
|
|
114
109
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCallAccessHash(update.call.id, update.call.access_hash);
|
|
115
110
|
if (fullChat != null) {
|
|
116
111
|
if (!("call" in fullChat) || !fullChat.call || fullChat.call.id != update.call.id) {
|
|
117
|
-
fullChat.call =
|
|
112
|
+
fullChat.call = { ...update.call, _: "inputGroupCall" };
|
|
118
113
|
updateFullChat = true;
|
|
119
114
|
}
|
|
120
115
|
}
|
|
@@ -127,13 +122,13 @@ export class VideoChatManager {
|
|
|
127
122
|
async getLiveStreamChannels(id) {
|
|
128
123
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("getLiveStreamChannels");
|
|
129
124
|
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id);
|
|
130
|
-
if (!(call
|
|
125
|
+
if (!(is("groupCall", call)) || !call.rtmp_stream) {
|
|
131
126
|
throw new InputError("Not a live stream.");
|
|
132
127
|
}
|
|
133
128
|
const client = __classPrivateFieldGet(this, _VideoChatManager_c, "f").getCdnConnection(call.stream_dc_id);
|
|
134
129
|
await client.connect();
|
|
135
130
|
try {
|
|
136
|
-
const streams = await client.
|
|
131
|
+
const streams = await client.invoke({ _: "phone.getGroupCallStreamChannels", call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id) });
|
|
137
132
|
return streams.channels.map(constructLiveStreamChannel);
|
|
138
133
|
}
|
|
139
134
|
finally {
|
|
@@ -143,36 +138,31 @@ export class VideoChatManager {
|
|
|
143
138
|
async *downloadLiveStreamChunk(id, channel, scale, timestamp, params) {
|
|
144
139
|
await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("downloadLiveStreamChunk");
|
|
145
140
|
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id);
|
|
146
|
-
if (!(call
|
|
141
|
+
if (!(is("groupCall", call)) || !call.rtmp_stream) {
|
|
147
142
|
throw new InputError("Not a live stream.");
|
|
148
143
|
}
|
|
149
144
|
const quality = params?.quality ?? "low";
|
|
150
|
-
const location =
|
|
151
|
-
|
|
145
|
+
const location = {
|
|
146
|
+
_: "inputGroupCallStream",
|
|
147
|
+
call: { ...call, _: "inputGroupCall" },
|
|
152
148
|
scale,
|
|
153
149
|
time_ms: BigInt(timestamp),
|
|
154
150
|
video_channel: channel,
|
|
155
151
|
video_quality: quality == "low" ? 0 : quality == "medium" ? 1 : quality == "high" ? 2 : (() => {
|
|
156
152
|
throw new InputError("Got invalid quality.");
|
|
157
153
|
})(),
|
|
158
|
-
}
|
|
154
|
+
};
|
|
159
155
|
yield* __classPrivateFieldGet(this, _VideoChatManager_c, "f").fileManager.downloadInner(location, call.stream_dc_id ?? unreachable());
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
158
|
_VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet(), _VideoChatManager_createGroupCall = async function _VideoChatManager_createGroupCall(chatId, title, liveStream, scheduleDate) {
|
|
163
159
|
const peer = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(chatId);
|
|
164
|
-
if (peer
|
|
160
|
+
if (is("inputPeerUser", peer)) {
|
|
165
161
|
throw new InputError("Video chats are only available for groups and channels.");
|
|
166
162
|
}
|
|
167
|
-
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").
|
|
168
|
-
peer,
|
|
169
|
-
random_id: getRandomId(true),
|
|
170
|
-
title,
|
|
171
|
-
rtmp_stream: liveStream,
|
|
172
|
-
schedule_date: scheduleDate ? toUnixTimestamp(scheduleDate) : undefined,
|
|
173
|
-
}).then((v) => v[as](types.Updates));
|
|
163
|
+
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.createGroupCall", peer, random_id: getRandomId(true), title, rtmp_stream: liveStream, schedule_date: scheduleDate ? toUnixTimestamp(scheduleDate) : undefined }).then((v) => as("updates", v));
|
|
174
164
|
const updateGroupCall = updates
|
|
175
|
-
.find((v) => v
|
|
165
|
+
.find((v) => is("updateGroupCall", v));
|
|
176
166
|
if (!updateGroupCall) {
|
|
177
167
|
unreachable();
|
|
178
168
|
}
|
|
@@ -183,12 +173,12 @@ _VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet()
|
|
|
183
173
|
if (accessHash == null) {
|
|
184
174
|
throw new InputError("Video chat not found.");
|
|
185
175
|
}
|
|
186
|
-
return
|
|
176
|
+
return { _: "inputGroupCall", id, access_hash: accessHash };
|
|
187
177
|
}, _VideoChatManager_getCall = async function _VideoChatManager_getCall(id) {
|
|
188
178
|
let groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getGroupCall(BigInt(id));
|
|
189
179
|
if (groupCall == null) {
|
|
190
180
|
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
|
|
191
|
-
groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").
|
|
181
|
+
groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.getGroupCall", call, limit: 1 }).then((v) => v.call);
|
|
192
182
|
}
|
|
193
183
|
return groupCall;
|
|
194
184
|
};
|
|
@@ -17,7 +17,7 @@
|
|
|
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 { CallbackQueryQuestion, ID, Update } from "../3_types.js";
|
|
22
22
|
import { AnswerCallbackQueryParams } from "./0_params.js";
|
|
23
23
|
import { C as C_ } from "./1_types.js";
|
|
@@ -25,13 +25,13 @@ import { MessageManager } from "./3_message_manager.js";
|
|
|
25
25
|
type C = C_ & {
|
|
26
26
|
messageManager: MessageManager;
|
|
27
27
|
};
|
|
28
|
-
type CallbackQueryManagerUpdate =
|
|
28
|
+
type CallbackQueryManagerUpdate = Api.updateBotCallbackQuery | Api.updateInlineBotCallbackQuery;
|
|
29
29
|
export declare class CallbackQueryManager {
|
|
30
30
|
#private;
|
|
31
31
|
constructor(c: C);
|
|
32
32
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
33
33
|
sendCallbackQuery(chatId: ID, messageId: number, question: CallbackQueryQuestion): Promise<import("../3_types.js").CallbackQueryAnswer>;
|
|
34
|
-
static canHandleUpdate(update:
|
|
34
|
+
static canHandleUpdate(update: Api.Update): update is CallbackQueryManagerUpdate;
|
|
35
35
|
handleUpdate(update: CallbackQueryManagerUpdate): Promise<Update>;
|
|
36
36
|
}
|
|
37
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAyB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwD,EAAE,EAAE,MAAM,EAAiC,MAAM,eAAe,CAAC;AACvJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,KAAK,0BAA0B,GAAG,GAAG,CAAC,sBAAsB,GAAG,GAAG,CAAC,4BAA4B,CAAC;AAEhG,qBAAa,oBAAoB;;gBAGnB,CAAC,EAAE,CAAC;IAIV,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAOlE,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB;IAyBtF,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,0BAA0B;IAI1E,YAAY,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC;CAGxE"}
|
|
@@ -29,7 +29,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
30
|
};
|
|
31
31
|
var _CallbackQueryManager_instances, _a, _CallbackQueryManager_c, _CallbackQueryManager_enc, _CallbackQueryManager_isExpired, _CallbackQueryManager_getPasswordCheck;
|
|
32
|
-
import {
|
|
32
|
+
import { isOneOf, peerToChatId } from "../2_tl.js";
|
|
33
33
|
import { constructCallbackQuery, constructCallbackQueryAnswer, validateCallbackQueryQuestion } from "../3_types.js";
|
|
34
34
|
import { checkCallbackQueryId, checkMessageId } from "./0_utilities.js";
|
|
35
35
|
import { checkPassword } from "./0_password.js";
|
|
@@ -42,12 +42,7 @@ export class CallbackQueryManager {
|
|
|
42
42
|
async answerCallbackQuery(id, params) {
|
|
43
43
|
await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").storage.assertBot("answerCallbackQuery");
|
|
44
44
|
checkCallbackQueryId(id);
|
|
45
|
-
await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").
|
|
46
|
-
query_id: BigInt(id),
|
|
47
|
-
cache_time: params?.cacheTime ?? 0,
|
|
48
|
-
message: params?.text,
|
|
49
|
-
alert: params?.alert ? true : undefined,
|
|
50
|
-
});
|
|
45
|
+
await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "messages.setBotCallbackAnswer", query_id: BigInt(id), cache_time: params?.cacheTime ?? 0, message: params?.text, alert: params?.alert ? true : undefined });
|
|
51
46
|
}
|
|
52
47
|
async sendCallbackQuery(chatId, messageId, question) {
|
|
53
48
|
await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").storage.assertUser("sendCallbackQuery");
|
|
@@ -58,20 +53,14 @@ export class CallbackQueryManager {
|
|
|
58
53
|
if (maybeAnswer != null && !__classPrivateFieldGet(_a, _a, "m", _CallbackQueryManager_isExpired).call(_a, maybeAnswer[1], maybeAnswer[0].cache_time)) {
|
|
59
54
|
return constructCallbackQueryAnswer(maybeAnswer[0]);
|
|
60
55
|
}
|
|
61
|
-
const answer = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").
|
|
62
|
-
peer,
|
|
63
|
-
msg_id: messageId,
|
|
64
|
-
data: "data" in question ? __classPrivateFieldGet(_a, _a, "f", _CallbackQueryManager_enc).encode(question.data) : undefined,
|
|
65
|
-
game: question.type == "game" ? true : undefined,
|
|
66
|
-
password: question.type == "password" ? await __classPrivateFieldGet(this, _CallbackQueryManager_instances, "m", _CallbackQueryManager_getPasswordCheck).call(this, question.password) : undefined,
|
|
67
|
-
});
|
|
56
|
+
const answer = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "messages.getBotCallbackAnswer", peer, msg_id: messageId, data: "data" in question ? __classPrivateFieldGet(_a, _a, "f", _CallbackQueryManager_enc).encode(question.data) : undefined, game: question.type == "game" ? true : undefined, password: question.type == "password" ? await __classPrivateFieldGet(this, _CallbackQueryManager_instances, "m", _CallbackQueryManager_getPasswordCheck).call(this, question.password) : undefined });
|
|
68
57
|
if (answer.cache_time >= 0) {
|
|
69
58
|
await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageStorage.setCallbackQueryAnswer(peerId, messageId, questionKey, answer);
|
|
70
59
|
}
|
|
71
60
|
return constructCallbackQueryAnswer(answer);
|
|
72
61
|
}
|
|
73
62
|
static canHandleUpdate(update) {
|
|
74
|
-
return
|
|
63
|
+
return isOneOf(["updateBotCallbackQuery", "updateInlineBotCallbackQuery"], update);
|
|
75
64
|
}
|
|
76
65
|
async handleUpdate(update) {
|
|
77
66
|
return { callbackQuery: await constructCallbackQuery(update, __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").getEntity, __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageManager.getMessageWithReply.bind(__classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageManager)) };
|
|
@@ -80,7 +69,7 @@ export class CallbackQueryManager {
|
|
|
80
69
|
_a = CallbackQueryManager, _CallbackQueryManager_c = new WeakMap(), _CallbackQueryManager_instances = new WeakSet(), _CallbackQueryManager_isExpired = function _CallbackQueryManager_isExpired(date, cacheTime) {
|
|
81
70
|
return (Date.now() - date.getTime()) / 1000 > cacheTime;
|
|
82
71
|
}, _CallbackQueryManager_getPasswordCheck = async function _CallbackQueryManager_getPasswordCheck(password) {
|
|
83
|
-
const ap = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").
|
|
72
|
+
const ap = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "account.getPassword" });
|
|
84
73
|
return await checkPassword(password, ap);
|
|
85
74
|
};
|
|
86
75
|
_CallbackQueryManager_enc = { value: new TextEncoder() };
|
|
@@ -17,8 +17,8 @@
|
|
|
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 {
|
|
21
|
-
import { ChatListItem, ID } from "../3_types.js";
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { ChatListItem, ChatMember, ID } from "../3_types.js";
|
|
22
22
|
import { C as C_ } from "./1_types.js";
|
|
23
23
|
import { FileManager } from "./2_file_manager.js";
|
|
24
24
|
import { MessageManager } from "./3_message_manager.js";
|
|
@@ -26,15 +26,16 @@ type C = C_ & {
|
|
|
26
26
|
fileManager: FileManager;
|
|
27
27
|
messageManager: MessageManager;
|
|
28
28
|
};
|
|
29
|
-
type ChatListManagerUpdate =
|
|
29
|
+
type ChatListManagerUpdate = Api.updateNewMessage | Api.updateNewChannelMessage | Api.updatePinnedDialogs | Api.updateFolderPeers | Api.updateChannel | Api.updateChat | Api.updateUser | Api.updateUserName;
|
|
30
30
|
export declare class ChatListManager {
|
|
31
31
|
#private;
|
|
32
32
|
constructor(c: C);
|
|
33
33
|
reassignChatLastMessage(chatId: number, add?: boolean, sendUpdate?: boolean): Promise<() => Promise<void>>;
|
|
34
34
|
getChats(from?: "archived" | "main", after?: ChatListItem, limit?: number): Promise<ChatListItem[]>;
|
|
35
|
-
static canHandleUpdate(update:
|
|
35
|
+
static canHandleUpdate(update: Api.Update): update is ChatListManagerUpdate;
|
|
36
36
|
handleUpdate(update: ChatListManagerUpdate): Promise<void>;
|
|
37
37
|
getChat(chatId: ID): Promise<import("../3_types.js").Chat>;
|
|
38
|
+
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
38
39
|
}
|
|
39
40
|
export {};
|
|
40
41
|
//# sourceMappingURL=4_chat_list_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_chat_list_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_list_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"4_chat_list_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_list_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAoB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAmI,EAAE,EAAE,MAAM,eAAe,CAAC;AAC9L,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,KAAK,qBAAqB,GACtB,GAAG,CAAC,gBAAgB,GACpB,GAAG,CAAC,uBAAuB,GAC3B,GAAG,CAAC,mBAAmB,GACvB,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,aAAa,GACjB,GAAG,CAAC,UAAU,GACd,GAAG,CAAC,UAAU,GACd,GAAG,CAAC,cAAc,CAAC;AAEvB,qBAAa,eAAe;;gBAKd,CAAC,EAAE,CAAC;IAkBV,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAQ,EAAE,UAAU,UAAO;IAwTtE,QAAQ,CAAC,IAAI,GAAE,UAAU,GAAG,MAAe,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA4B9G,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,qBAAqB;IAIrE,YAAY,CAAC,MAAM,EAAE,qBAAqB;IA0C1C,OAAO,CAAC,MAAM,EAAE,EAAE;IAQlB,qBAAqB,CAAC,MAAM,EAAE,EAAE;CA2BvC"}
|
|
@@ -32,8 +32,8 @@ var _ChatListManager_instances, _ChatListManager_c, _ChatListManager_LgetChats,
|
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
33
|
import { InputError } from "../0_errors.js";
|
|
34
34
|
import { getLogger, toUnixTimestamp } from "../1_utilities.js";
|
|
35
|
-
import {
|
|
36
|
-
import { constructChat, constructChatListItem, constructChatListItem3, constructChatListItem4, getChatListItemOrder } from "../3_types.js";
|
|
35
|
+
import { is, peerToChatId } from "../2_tl.js";
|
|
36
|
+
import { constructChat, constructChatListItem, constructChatListItem3, constructChatListItem4, constructChatMember, getChatListItemOrder } from "../3_types.js";
|
|
37
37
|
import { getChatListId } from "./0_utilities.js";
|
|
38
38
|
export class ChatListManager {
|
|
39
39
|
constructor(c) {
|
|
@@ -141,28 +141,28 @@ export class ChatListManager {
|
|
|
141
141
|
return chats;
|
|
142
142
|
}
|
|
143
143
|
static canHandleUpdate(update) {
|
|
144
|
-
return update
|
|
144
|
+
return is("updateNewMessage", update) || is("updateNewChannelMessage", update) || is("updatePinnedDialogs", update) || is("updateFolderPeers", update) || is("updateChannel", update) || is("updateChat", update) || is("updateUser", update) || is("updateUserName", update);
|
|
145
145
|
}
|
|
146
146
|
async handleUpdate(update) {
|
|
147
|
-
if (update
|
|
148
|
-
if (update.message
|
|
147
|
+
if (is("updateNewMessage", update) || is("updateNewChannelMessage", update) || is("updateEditMessage", update) || is("updateEditChannelMessage", update)) {
|
|
148
|
+
if (is("message", update.message) || is("messageService", update.message)) {
|
|
149
149
|
const chatId = peerToChatId(update.message.peer_id);
|
|
150
150
|
await this.reassignChatLastMessage(chatId);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
else if (update
|
|
153
|
+
else if (is("updatePinnedDialogs", update)) {
|
|
154
154
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdatePinnedDialogs).call(this, update);
|
|
155
155
|
}
|
|
156
|
-
else if (update
|
|
156
|
+
else if (is("updateFolderPeers", update)) {
|
|
157
157
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateFolderPeers).call(this, update);
|
|
158
158
|
}
|
|
159
|
-
else if (update
|
|
159
|
+
else if (is("updateChannel", update)) {
|
|
160
160
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChannel).call(this, update);
|
|
161
161
|
}
|
|
162
|
-
else if (update
|
|
162
|
+
else if (is("updateChat", update)) {
|
|
163
163
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChat).call(this, update);
|
|
164
164
|
}
|
|
165
|
-
else if (update
|
|
165
|
+
else if (is("updateUser", update) || is("updateUserName", update)) {
|
|
166
166
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateUser).call(this, update);
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
@@ -176,6 +176,35 @@ export class ChatListManager {
|
|
|
176
176
|
}
|
|
177
177
|
return await constructChat(fullChat, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
|
|
178
178
|
}
|
|
179
|
+
async getChatAdministrators(chatId) {
|
|
180
|
+
const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
181
|
+
if (is("inputPeerChannel", peer)) {
|
|
182
|
+
const channel = { ...peer, _: "inputChannel" };
|
|
183
|
+
const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
|
|
184
|
+
if (is("channels.channelParticipantsNotModified", participants)) {
|
|
185
|
+
unreachable();
|
|
186
|
+
}
|
|
187
|
+
const chatMembers = new Array();
|
|
188
|
+
for (const p of participants.participants) {
|
|
189
|
+
chatMembers.push(await constructChatMember(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
|
|
190
|
+
}
|
|
191
|
+
return chatMembers;
|
|
192
|
+
}
|
|
193
|
+
else if (is("inputPeerChat", peer)) {
|
|
194
|
+
const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
|
|
195
|
+
if (!fullChat || !("participants" in fullChat) || !is("chatParticipants", fullChat.participants)) {
|
|
196
|
+
unreachable();
|
|
197
|
+
}
|
|
198
|
+
const chatMembers = new Array();
|
|
199
|
+
for (const p of fullChat.participants.participants) {
|
|
200
|
+
chatMembers.push(await constructChatMember(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
|
|
201
|
+
}
|
|
202
|
+
return chatMembers;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
unreachable();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
179
208
|
}
|
|
180
209
|
_ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(), _ChatListManager_chats = new WeakMap(), _ChatListManager_archivedChats = new WeakMap(), _ChatListManager_chatsLoadedFromStorage = new WeakMap(), _ChatListManager_pinnedChats = new WeakMap(), _ChatListManager_pinnedArchiveChats = new WeakMap(), _ChatListManager_storageHadPinnedChats = new WeakMap(), _ChatListManager_pinnedChatsLoaded = new WeakMap(), _ChatListManager_instances = new WeakSet(), _ChatListManager_sendChatUpdate = async function _ChatListManager_sendChatUpdate(chatId, added) {
|
|
181
210
|
try {
|
|
@@ -268,7 +297,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
268
297
|
__classPrivateFieldSet(this, _ChatListManager_pinnedChatsLoaded, true, "f");
|
|
269
298
|
}, _ChatListManager_fetchPinnedChats = async function _ChatListManager_fetchPinnedChats(listId = null) {
|
|
270
299
|
if (listId == null || listId == 0) {
|
|
271
|
-
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
300
|
+
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
|
|
272
301
|
const pinnedChats = new Array();
|
|
273
302
|
for (const dialog of dialogs.dialogs) {
|
|
274
303
|
pinnedChats.push(peerToChatId(dialog.peer));
|
|
@@ -277,7 +306,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
277
306
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(0, __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f"));
|
|
278
307
|
}
|
|
279
308
|
if (listId == null || listId == 1) {
|
|
280
|
-
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
309
|
+
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
|
|
281
310
|
const pinnedArchiveChats = new Array();
|
|
282
311
|
for (const dialog of dialogs.dialogs) {
|
|
283
312
|
pinnedArchiveChats.push(peerToChatId(dialog.peer));
|
|
@@ -358,35 +387,35 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
358
387
|
}
|
|
359
388
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(listId, await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId));
|
|
360
389
|
}, _ChatListManager_handleUpdateChannel = async function _ChatListManager_handleUpdateChannel(update) {
|
|
361
|
-
const peer =
|
|
390
|
+
const peer = { ...update, _: "peerChannel" };
|
|
362
391
|
const channel = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
363
392
|
const chatId = peerToChatId(peer);
|
|
364
393
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
365
394
|
if (channel != null && "left" in channel && channel.left) {
|
|
366
395
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
367
396
|
}
|
|
368
|
-
else if (channel
|
|
397
|
+
else if (is("channelForbidden", channel)) {
|
|
369
398
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
370
399
|
}
|
|
371
|
-
else if (channel
|
|
400
|
+
else if (is("channel", channel)) {
|
|
372
401
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
373
402
|
}
|
|
374
403
|
}, _ChatListManager_handleUpdateChat = async function _ChatListManager_handleUpdateChat(update) {
|
|
375
|
-
const peer =
|
|
404
|
+
const peer = { ...update, _: "peerChat" };
|
|
376
405
|
const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
377
406
|
const chatId = peerToChatId(peer);
|
|
378
407
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
379
408
|
if (chat != null && "left" in chat && chat.left) {
|
|
380
409
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
381
410
|
}
|
|
382
|
-
else if (chat
|
|
411
|
+
else if (is("chatForbidden", chat)) {
|
|
383
412
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
384
413
|
}
|
|
385
|
-
else if (chat
|
|
414
|
+
else if (is("chat", chat)) {
|
|
386
415
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
387
416
|
}
|
|
388
417
|
}, _ChatListManager_handleUpdateUser = async function _ChatListManager_handleUpdateUser(update) {
|
|
389
|
-
const peer =
|
|
418
|
+
const peer = { ...update, _: "peerUser" };
|
|
390
419
|
const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
391
420
|
const chatId = peerToChatId(peer);
|
|
392
421
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
@@ -394,16 +423,9 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
394
423
|
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
395
424
|
}
|
|
396
425
|
}, _ChatListManager_fetchChats = async function _ChatListManager_fetchChats(listId, limit, after) {
|
|
397
|
-
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
398
|
-
limit,
|
|
399
|
-
offset_id: after?.lastMessage?.id ?? 0,
|
|
400
|
-
offset_date: after?.lastMessage?.date ? toUnixTimestamp(after.lastMessage.date) : 0,
|
|
401
|
-
offset_peer: after ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(after.chat.id) : new types.InputPeerEmpty(),
|
|
402
|
-
hash: 0n,
|
|
403
|
-
folder_id: listId,
|
|
404
|
-
});
|
|
426
|
+
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getDialogs", limit, offset_id: after?.lastMessage?.id ?? 0, offset_date: after?.lastMessage?.date ? toUnixTimestamp(after.lastMessage.date) : 0, offset_peer: after ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(after.chat.id) : { _: "inputPeerEmpty" }, hash: 0n, folder_id: listId });
|
|
405
427
|
const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
|
|
406
|
-
if (!(dialogs
|
|
428
|
+
if (!(is("messages.dialogs", dialogs)) && !(is("messages.dialogsSlice", dialogs))) {
|
|
407
429
|
unreachable();
|
|
408
430
|
}
|
|
409
431
|
if (dialogs.dialogs.length < limit) {
|
|
@@ -422,14 +444,14 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
|
|
|
422
444
|
if (fullChat != null) {
|
|
423
445
|
return fullChat;
|
|
424
446
|
}
|
|
425
|
-
if (inputPeer
|
|
426
|
-
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
447
|
+
if (is("inputPeerUser", inputPeer)) {
|
|
448
|
+
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id: { ...inputPeer, _: "inputUser" } }).then((v) => v.full_user);
|
|
427
449
|
}
|
|
428
|
-
else if (inputPeer
|
|
429
|
-
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
450
|
+
else if (is("inputPeerChat", inputPeer)) {
|
|
451
|
+
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...inputPeer, _: "messages.getFullChat" }).then((v) => v.full_chat);
|
|
430
452
|
}
|
|
431
|
-
else if (inputPeer
|
|
432
|
-
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").
|
|
453
|
+
else if (is("inputPeerChannel", inputPeer)) {
|
|
454
|
+
fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel: { ...inputPeer, _: "inputChannel" } }).then((v) => v.full_chat);
|
|
433
455
|
}
|
|
434
456
|
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId_, fullChat);
|
|
435
457
|
if (fullChat != null && "call" in fullChat && fullChat.call) {
|
|
@@ -17,7 +17,7 @@
|
|
|
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 { ID, InlineQueryResult, Update } from "../3_types.js";
|
|
22
22
|
import { AnswerInlineQueryParams, SendInlineQueryParams } from "./0_params.js";
|
|
23
23
|
import { C as C_ } from "./1_types.js";
|
|
@@ -25,12 +25,12 @@ import { MessageManager } from "./3_message_manager.js";
|
|
|
25
25
|
type C = C_ & {
|
|
26
26
|
messageManager: MessageManager;
|
|
27
27
|
};
|
|
28
|
-
type InlineQueryManagerUpdate =
|
|
28
|
+
type InlineQueryManagerUpdate = Api.updateBotInlineQuery | Api.updateBotInlineSend;
|
|
29
29
|
export declare class InlineQueryManager {
|
|
30
30
|
#private;
|
|
31
31
|
constructor(c: C);
|
|
32
32
|
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
33
|
-
static canHandleUpdate(update:
|
|
33
|
+
static canHandleUpdate(update: Api.Update): update is InlineQueryManagerUpdate;
|
|
34
34
|
handleUpdate(update: InlineQueryManagerUpdate): Promise<Update>;
|
|
35
35
|
sendInlineQuery(userId: ID, chatId: ID, params?: SendInlineQueryParams): Promise<import("../3_types.js").InlineQueryAnswer>;
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_inline_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_inline_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"4_inline_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_inline_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAoB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAiF,EAAE,EAAE,iBAAiB,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1K,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,KAAK,wBAAwB,GAAG,GAAG,CAAC,oBAAoB,GAAG,GAAG,CAAC,mBAAmB,CAAC;AAEnF,qBAAa,kBAAkB;;gBAGjB,CAAC,EAAE,CAAC;IAIV,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,MAAM,CAAC,EAAE,uBAAuB;IAMlG,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,wBAAwB;IAIxE,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAU/D,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,qBAAqB;CAsB7E"}
|
|
@@ -30,7 +30,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
30
30
|
};
|
|
31
31
|
var _a, _InlineQueryManager_c, _InlineQueryManager_isExpired;
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
|
-
import {
|
|
33
|
+
import { is, peerToChatId } from "../2_tl.js";
|
|
34
34
|
import { constructChosenInlineResult, constructInlineQuery, constructInlineQueryAnswer, inlineQueryResultToTlObject } from "../3_types.js";
|
|
35
35
|
import { checkInlineQueryId } from "./0_utilities.js";
|
|
36
36
|
export class InlineQueryManager {
|
|
@@ -41,25 +41,16 @@ export class InlineQueryManager {
|
|
|
41
41
|
async answerInlineQuery(id, results, params) {
|
|
42
42
|
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").storage.assertBot("answerInlineQuery");
|
|
43
43
|
checkInlineQueryId(id);
|
|
44
|
-
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").
|
|
45
|
-
query_id: BigInt(id),
|
|
46
|
-
results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))),
|
|
47
|
-
cache_time: params?.cacheTime ?? 300,
|
|
48
|
-
private: params?.isPersonal ? true : undefined,
|
|
49
|
-
switch_webview: params?.button && params.button.miniApp ? new types.InlineBotWebView({ text: params.button.text, url: params.button.miniApp.url }) : undefined,
|
|
50
|
-
switch_pm: params?.button && params.button.startParameter ? new types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
|
|
51
|
-
gallery: params?.isGallery ? true : undefined,
|
|
52
|
-
next_offset: params?.nextOffset,
|
|
53
|
-
});
|
|
44
|
+
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.setInlineBotResults", query_id: BigInt(id), results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))), cache_time: params?.cacheTime ?? 300, private: params?.isPersonal ? true : undefined, switch_webview: params?.button && params.button.miniApp ? ({ _: "inlineBotWebView", text: params.button.text, url: params.button.miniApp.url }) : undefined, switch_pm: params?.button && params.button.startParameter ? ({ _: "inlineBotSwitchPM", text: params.button.text, start_param: params.button.startParameter }) : undefined, gallery: params?.isGallery ? true : undefined, next_offset: params?.nextOffset });
|
|
54
45
|
}
|
|
55
46
|
static canHandleUpdate(update) {
|
|
56
|
-
return update
|
|
47
|
+
return is("updateBotInlineQuery", update) || is("updateBotInlineSend", update);
|
|
57
48
|
}
|
|
58
49
|
async handleUpdate(update) {
|
|
59
|
-
if (update
|
|
50
|
+
if (is("updateBotInlineQuery", update)) {
|
|
60
51
|
return { inlineQuery: await constructInlineQuery(update, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").getEntity) };
|
|
61
52
|
}
|
|
62
|
-
else if (update
|
|
53
|
+
else if (is("updateBotInlineSend", update)) {
|
|
63
54
|
return { chosenInlineResult: await constructChosenInlineResult(update, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").getEntity) };
|
|
64
55
|
}
|
|
65
56
|
else {
|
|
@@ -75,7 +66,7 @@ export class InlineQueryManager {
|
|
|
75
66
|
return constructInlineQueryAnswer(maybeResults[0]);
|
|
76
67
|
}
|
|
77
68
|
const then = new Date();
|
|
78
|
-
const results = await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").
|
|
69
|
+
const results = await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.getInlineBotResults", bot, peer, query, offset });
|
|
79
70
|
if (results.cache_time > 0) {
|
|
80
71
|
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageStorage.setInlineQueryAnswer(botId, peerId, query, offset, results, then);
|
|
81
72
|
}
|