@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
|
@@ -35,6 +35,7 @@ exports.UpdateManager = void 0;
|
|
|
35
35
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
36
36
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
37
37
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
38
|
+
const _3_errors_js_1 = require("../3_errors.js");
|
|
38
39
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
39
40
|
class UpdateManager {
|
|
40
41
|
constructor(c) {
|
|
@@ -65,46 +66,26 @@ class UpdateManager {
|
|
|
65
66
|
__classPrivateFieldSet(this, _UpdateManager_LfetchState, L.branch("fetchState"), "f");
|
|
66
67
|
}
|
|
67
68
|
static isPtsUpdate(v) {
|
|
68
|
-
return
|
|
69
|
-
v instanceof _2_tl_js_1.types.UpdateDeleteMessages ||
|
|
70
|
-
v instanceof _2_tl_js_1.types.UpdateReadHistoryInbox ||
|
|
71
|
-
v instanceof _2_tl_js_1.types.UpdateReadHistoryOutbox ||
|
|
72
|
-
v instanceof _2_tl_js_1.types.UpdatePinnedChannelMessages ||
|
|
73
|
-
v instanceof _2_tl_js_1.types.UpdatePinnedMessages ||
|
|
74
|
-
v instanceof _2_tl_js_1.types.UpdateFolderPeers ||
|
|
75
|
-
v instanceof _2_tl_js_1.types.UpdateChannelWebPage ||
|
|
76
|
-
v instanceof _2_tl_js_1.types.UpdateEditMessage ||
|
|
77
|
-
v instanceof _2_tl_js_1.types.UpdateReadMessagesContents ||
|
|
78
|
-
v instanceof _2_tl_js_1.types.UpdateWebPage;
|
|
69
|
+
return (0, _2_tl_js_1.isOneOf)(["updateNewMessage", "updateDeleteMessages", "updateReadHistoryInbox", "updateReadHistoryOutbox", "updatePinnedChannelMessages", "updatePinnedMessages", "updateFolderPeers", "updateChannelWebPage", "updateEditMessage", "updateReadMessagesContents", "updateWebPage"], v);
|
|
79
70
|
}
|
|
80
71
|
static isQtsUpdate(v) {
|
|
81
|
-
return
|
|
82
|
-
v instanceof _2_tl_js_1.types.UpdateMessagePollVote ||
|
|
83
|
-
v instanceof _2_tl_js_1.types.UpdateBotStopped ||
|
|
84
|
-
v instanceof _2_tl_js_1.types.UpdateChatParticipant ||
|
|
85
|
-
v instanceof _2_tl_js_1.types.UpdateChannelParticipant ||
|
|
86
|
-
v instanceof _2_tl_js_1.types.UpdateBotChatInviteRequester ||
|
|
87
|
-
v instanceof _2_tl_js_1.types.UpdateBotChatBoost ||
|
|
88
|
-
v instanceof _2_tl_js_1.types.UpdateBotMessageReaction ||
|
|
89
|
-
v instanceof _2_tl_js_1.types.UpdateBotMessageReactions ||
|
|
90
|
-
v instanceof _2_tl_js_1.types.UpdateBotBusinessConnect ||
|
|
91
|
-
v instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage ||
|
|
92
|
-
v instanceof _2_tl_js_1.types.UpdateBotEditBusinessMessage ||
|
|
93
|
-
v instanceof _2_tl_js_1.types.UpdateBotDeleteBusinessMessage;
|
|
72
|
+
return (0, _2_tl_js_1.isOneOf)(["updateNewEncryptedMessage", "updateMessagePollVote", "updateBotStopped", "updateChatParticipant", "updateChannelParticipant", "updateBotChatInviteRequester", "updateBotChatBoost", "updateBotMessageReaction", "updateBotMessageReactions", "updateBotBusinessConnect", "updateBotNewBusinessMessage", "updateBotEditBusinessMessage", "updateBotDeleteBusinessMessage"], v);
|
|
94
73
|
}
|
|
95
74
|
static isChannelPtsUpdate(v) {
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
75
|
+
return (0, _2_tl_js_1.isOneOf)([
|
|
76
|
+
"updateNewChannelMessage",
|
|
77
|
+
"updateEditChannelMessage",
|
|
78
|
+
"updateDeleteChannelMessages",
|
|
79
|
+
"updateChannelTooLong",
|
|
80
|
+
], v);
|
|
100
81
|
}
|
|
101
82
|
async fetchState(source) {
|
|
102
|
-
let state = await __classPrivateFieldGet(this, _UpdateManager_c, "f").
|
|
103
|
-
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").
|
|
104
|
-
if (
|
|
83
|
+
let state = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({ _: "updates.getState" });
|
|
84
|
+
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({ ...state, _: "updates.getDifference" });
|
|
85
|
+
if ((0, _2_tl_js_1.is)("updates.difference", difference)) {
|
|
105
86
|
state = difference.state;
|
|
106
87
|
}
|
|
107
|
-
else if (
|
|
88
|
+
else if ((0, _2_tl_js_1.is)("updates.differenceSlice", difference)) {
|
|
108
89
|
state = difference.intermediate_state;
|
|
109
90
|
}
|
|
110
91
|
__classPrivateFieldSet(this, _UpdateManager_updateState, state, "f");
|
|
@@ -115,7 +96,7 @@ class UpdateManager {
|
|
|
115
96
|
}
|
|
116
97
|
async processChats(chats) {
|
|
117
98
|
for (const chat of chats) {
|
|
118
|
-
if (
|
|
99
|
+
if ((0, _2_tl_js_1.isOneOf)(["channel", "channelForbidden"], chat)) {
|
|
119
100
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(chat);
|
|
120
101
|
if ("username" in chat && chat.username) {
|
|
121
102
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames((0, _2_tl_js_1.peerToChatId)(chat), [chat.username]);
|
|
@@ -124,82 +105,84 @@ class UpdateManager {
|
|
|
124
105
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames((0, _2_tl_js_1.peerToChatId)(chat), chat.usernames.map((v) => v.username));
|
|
125
106
|
}
|
|
126
107
|
}
|
|
127
|
-
else if (
|
|
108
|
+
else if ((0, _2_tl_js_1.isOneOf)(["chat", "chatForbidden"], chat)) {
|
|
128
109
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(chat);
|
|
129
110
|
}
|
|
130
111
|
}
|
|
131
112
|
}
|
|
132
113
|
async processResult(result) {
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
114
|
+
if ((0, _2_tl_js_1.isOneOf)([
|
|
115
|
+
"account.authorizationForm",
|
|
116
|
+
"account.autoSaveSettings",
|
|
117
|
+
"account.privacyRules",
|
|
118
|
+
"account.webAuthorizations",
|
|
119
|
+
"attachMenuBots",
|
|
120
|
+
"attachMenuBotsBot",
|
|
121
|
+
"channels.adminLogResults",
|
|
122
|
+
"channels.channelParticipant",
|
|
123
|
+
"channels.channelParticipants",
|
|
124
|
+
"channels.sendAsPeers",
|
|
125
|
+
"chatInvite",
|
|
126
|
+
"chatlists.chatlistInvite",
|
|
127
|
+
"chatlists.chatlistInviteAlready",
|
|
128
|
+
"chatlists.chatlistUpdates",
|
|
129
|
+
"chatlists.exportedInvites",
|
|
130
|
+
"contacts.blocked",
|
|
131
|
+
"contacts.blockedSlice",
|
|
132
|
+
"contacts.contacts",
|
|
133
|
+
"contacts.found",
|
|
134
|
+
"contacts.importedContacts",
|
|
135
|
+
"contacts.resolvedPeer",
|
|
136
|
+
"contacts.topPeers",
|
|
137
|
+
"help.promoData",
|
|
138
|
+
"help.recentMeUrls",
|
|
139
|
+
"messages.botResults",
|
|
140
|
+
"messages.channelMessages",
|
|
141
|
+
"messages.chatAdminsWithInvites",
|
|
142
|
+
"messages.chatFull",
|
|
143
|
+
"messages.chatInviteImporters",
|
|
144
|
+
"messages.chats",
|
|
145
|
+
"messages.chatsSlice",
|
|
146
|
+
"messages.dialogs",
|
|
147
|
+
"messages.dialogsSlice",
|
|
148
|
+
"messages.discussionMessage",
|
|
149
|
+
"messages.exportedChatInvite",
|
|
150
|
+
"messages.exportedChatInviteReplaced",
|
|
151
|
+
"messages.exportedChatInvites",
|
|
152
|
+
"messages.forumTopics",
|
|
153
|
+
"messages.highScores",
|
|
154
|
+
"messages.inactiveChats",
|
|
155
|
+
"messages.messageReactionsList",
|
|
156
|
+
"messages.messages",
|
|
157
|
+
"messages.messagesSlice",
|
|
158
|
+
"messages.messageViews",
|
|
159
|
+
"messages.peerDialogs",
|
|
160
|
+
"messages.peerSettings",
|
|
161
|
+
"messages.searchResultsCalendar",
|
|
162
|
+
"messages.sponsoredMessages",
|
|
163
|
+
"messages.votesList",
|
|
164
|
+
"messages.webPage",
|
|
165
|
+
"payments.checkedGiftCode",
|
|
166
|
+
"payments.paymentForm",
|
|
167
|
+
"payments.paymentReceipt",
|
|
168
|
+
"phone.groupCall",
|
|
169
|
+
"phone.groupParticipants",
|
|
170
|
+
"phone.joinAsPeers",
|
|
171
|
+
"phone.phoneCall",
|
|
172
|
+
"photos.photo",
|
|
173
|
+
"photos.photos",
|
|
174
|
+
"photos.photosSlice",
|
|
175
|
+
"premium.boostsList",
|
|
176
|
+
"premium.myBoosts",
|
|
177
|
+
"stats.megagroupStats",
|
|
178
|
+
"stats.publicForwards",
|
|
179
|
+
"stories.allStories",
|
|
180
|
+
"stories.peerStories",
|
|
181
|
+
"stories.stories",
|
|
182
|
+
"stories.storyViews",
|
|
183
|
+
"stories.storyViewsList",
|
|
184
|
+
"users.userFull",
|
|
185
|
+
], result)) {
|
|
203
186
|
if ("chats" in result) {
|
|
204
187
|
await this.processChats(result.chats);
|
|
205
188
|
}
|
|
@@ -208,15 +191,15 @@ class UpdateManager {
|
|
|
208
191
|
}
|
|
209
192
|
if ("messages" in result && Array.isArray(result.messages)) {
|
|
210
193
|
for (const message of result.messages) {
|
|
211
|
-
if (
|
|
194
|
+
if ((0, _2_tl_js_1.is)("message", message) || (0, _2_tl_js_1.is)("messageService", message)) {
|
|
212
195
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage((0, _2_tl_js_1.peerToChatId)(message.peer_id), message.id, message);
|
|
213
196
|
}
|
|
214
197
|
}
|
|
215
198
|
}
|
|
216
199
|
}
|
|
217
|
-
if (
|
|
200
|
+
if ((0, _2_tl_js_1.is)("messages.messages", result)) {
|
|
218
201
|
for (const message of result.messages) {
|
|
219
|
-
if (
|
|
202
|
+
if ((0, _2_tl_js_1.is)("message", message) || (0, _2_tl_js_1.is)("messageService", message)) {
|
|
220
203
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setMessage((0, _2_tl_js_1.peerToChatId)(message.peer_id), message.id, message);
|
|
221
204
|
}
|
|
222
205
|
}
|
|
@@ -224,7 +207,7 @@ class UpdateManager {
|
|
|
224
207
|
}
|
|
225
208
|
async processUsers(users) {
|
|
226
209
|
for (const user of users) {
|
|
227
|
-
if (
|
|
210
|
+
if ((0, _2_tl_js_1.is)("user", user) && user.access_hash) {
|
|
228
211
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.setEntity(user);
|
|
229
212
|
if (user.username) {
|
|
230
213
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.updateUsernames((0, _2_tl_js_1.peerToChatId)(user), [user.username]);
|
|
@@ -252,38 +235,53 @@ class UpdateManager {
|
|
|
252
235
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug(`recovering from update gap [${source}]`);
|
|
253
236
|
__classPrivateFieldGet(this, _UpdateManager_c, "f").setConnectionState("updating");
|
|
254
237
|
try {
|
|
238
|
+
let tries = 0;
|
|
255
239
|
let state = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
256
240
|
while (true) {
|
|
257
|
-
|
|
258
|
-
|
|
241
|
+
let difference;
|
|
242
|
+
try {
|
|
243
|
+
difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({ _: "updates.getDifference", pts: state.pts, date: state.date, qts: state.qts ?? 0 });
|
|
244
|
+
}
|
|
245
|
+
catch (err) {
|
|
246
|
+
if (err instanceof _3_errors_js_1.PersistentTimestampEmpty || err instanceof _3_errors_js_1.PersistentTimestampInvalid && tries <= 5) {
|
|
247
|
+
await this.fetchState(err.errorMessage);
|
|
248
|
+
state = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
249
|
+
++tries;
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
throw err;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if ((0, _2_tl_js_1.is)("updates.difference", difference) || (0, _2_tl_js_1.is)("updates.differenceSlice", difference)) {
|
|
259
257
|
await this.processChats(difference.chats);
|
|
260
258
|
await this.processUsers(difference.users);
|
|
261
259
|
for (const message of difference.new_messages) {
|
|
262
|
-
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this,
|
|
260
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewMessage", message, pts: 0, pts_count: 0 }, false);
|
|
263
261
|
}
|
|
264
262
|
for (const update of difference.other_updates) {
|
|
265
263
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, update, false);
|
|
266
264
|
}
|
|
267
|
-
if (
|
|
265
|
+
if ((0, _2_tl_js_1.is)("updates.difference", difference)) {
|
|
268
266
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, difference.state);
|
|
269
267
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("recovered from update gap");
|
|
270
268
|
break;
|
|
271
269
|
}
|
|
272
|
-
else if (
|
|
270
|
+
else if ((0, _2_tl_js_1.is)("updates.differenceSlice", difference)) {
|
|
273
271
|
state = difference.intermediate_state;
|
|
274
272
|
}
|
|
275
273
|
else {
|
|
276
274
|
(0, _0_deps_js_1.unreachable)();
|
|
277
275
|
}
|
|
278
276
|
}
|
|
279
|
-
else if (
|
|
277
|
+
else if ((0, _2_tl_js_1.is)("updates.differenceTooLong", difference)) {
|
|
280
278
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").messageStorage.deleteMessages();
|
|
281
279
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.removeChats(0);
|
|
282
280
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.removeChats(1);
|
|
283
281
|
state.pts = difference.pts;
|
|
284
282
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("received differenceTooLong");
|
|
285
283
|
}
|
|
286
|
-
else if (
|
|
284
|
+
else if ((0, _2_tl_js_1.is)("updates.differenceEmpty", difference)) {
|
|
287
285
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, difference.date);
|
|
288
286
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverUpdateGap, "f").debug("there was no update gap");
|
|
289
287
|
break;
|
|
@@ -355,8 +353,8 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
355
353
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_recoverChannelUpdateGap).call(this, channelId, "processUpdates");
|
|
356
354
|
}
|
|
357
355
|
}, _UpdateManager_processChannelPtsUpdateInner = async function _UpdateManager_processChannelPtsUpdateInner(update, checkGap) {
|
|
358
|
-
const channelId =
|
|
359
|
-
if (
|
|
356
|
+
const channelId = (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateEditChannelMessage", update) ? (0, _2_tl_js_1.as)("peerChannel", update.message.peer_id).channel_id : update.channel_id;
|
|
357
|
+
if ((0, _2_tl_js_1.is)("updateChannelTooLong", update)) {
|
|
360
358
|
if (update.pts != undefined) {
|
|
361
359
|
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.setChannelPts(channelId, update.pts);
|
|
362
360
|
}
|
|
@@ -391,7 +389,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
391
389
|
}
|
|
392
390
|
});
|
|
393
391
|
}, _UpdateManager_processChannelPtsUpdate = function _UpdateManager_processChannelPtsUpdate(update, checkGap) {
|
|
394
|
-
const channelId =
|
|
392
|
+
const channelId = (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateEditChannelMessage", update) ? (0, _2_tl_js_1.as)("peerChannel", update.message.peer_id).channel_id : update.channel_id;
|
|
395
393
|
let queue = __classPrivateFieldGet(this, _UpdateManager_channelUpdateQueues, "f").get(channelId);
|
|
396
394
|
if (queue == undefined) {
|
|
397
395
|
queue = new _1_utilities_js_1.Queue(`channelUpdates-${channelId}`);
|
|
@@ -451,7 +449,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
451
449
|
/// [2]: https://core.telegram.org/type/Updates
|
|
452
450
|
/// [3]: https://core.telegram.org/constructor/updatesTooLong
|
|
453
451
|
let updates;
|
|
454
|
-
if (
|
|
452
|
+
if ((0, _2_tl_js_1.is)("updatesCombined", updates_) || (0, _2_tl_js_1.is)("updates", updates_)) {
|
|
455
453
|
updates = updates_.updates;
|
|
456
454
|
const seq = updates_.seq;
|
|
457
455
|
const seqStart = "seq_start" in updates_ ? updates_.seq_start : updates_.seq;
|
|
@@ -482,20 +480,22 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
482
480
|
}
|
|
483
481
|
}
|
|
484
482
|
}
|
|
485
|
-
else if (
|
|
483
|
+
else if ((0, _2_tl_js_1.is)("updateShort", updates_)) {
|
|
486
484
|
updates = [updates_.update];
|
|
487
485
|
}
|
|
488
|
-
else if (
|
|
486
|
+
else if ((0, _2_tl_js_1.is)("updateShortMessage", updates_)) {
|
|
489
487
|
updates = [
|
|
490
|
-
|
|
491
|
-
|
|
488
|
+
{
|
|
489
|
+
_: "updateNewMessage",
|
|
490
|
+
message: ({
|
|
491
|
+
_: "message",
|
|
492
492
|
out: updates_.out,
|
|
493
493
|
mentioned: updates_.mentioned,
|
|
494
494
|
media_unread: updates_.media_unread,
|
|
495
495
|
silent: updates_.silent,
|
|
496
496
|
id: updates_.id,
|
|
497
|
-
from_id: updates_.out ?
|
|
498
|
-
peer_id:
|
|
497
|
+
from_id: updates_.out ? ({ _: "peerUser", user_id: await __classPrivateFieldGet(this, _UpdateManager_c, "f").getSelfId().then(BigInt) }) : ({ _: "peerUser", user_id: updates_.user_id }),
|
|
498
|
+
peer_id: ({ _: "peerUser", user_id: updates_.user_id }),
|
|
499
499
|
message: updates_.message,
|
|
500
500
|
date: updates_.date,
|
|
501
501
|
fwd_from: updates_.fwd_from,
|
|
@@ -506,20 +506,21 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
506
506
|
}),
|
|
507
507
|
pts: updates_.pts,
|
|
508
508
|
pts_count: updates_.pts_count,
|
|
509
|
-
}
|
|
509
|
+
},
|
|
510
510
|
];
|
|
511
511
|
}
|
|
512
|
-
else if (
|
|
512
|
+
else if ((0, _2_tl_js_1.is)("updateShortChatMessage", updates_)) {
|
|
513
513
|
updates = [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
{
|
|
515
|
+
_: "updateNewMessage",
|
|
516
|
+
message: ({
|
|
517
|
+
_: "message",
|
|
517
518
|
mentioned: updates_.mentioned,
|
|
518
519
|
media_unread: updates_.media_unread,
|
|
519
520
|
silent: updates_.silent,
|
|
520
521
|
id: updates_.id,
|
|
521
|
-
from_id:
|
|
522
|
-
peer_id:
|
|
522
|
+
from_id: { _: "peerUser", user_id: updates_.from_id },
|
|
523
|
+
peer_id: { _: "peerChat", chat_id: updates_.chat_id },
|
|
523
524
|
fwd_from: updates_.fwd_from,
|
|
524
525
|
via_bot_id: updates_.via_bot_id,
|
|
525
526
|
reply_to: updates_.reply_to,
|
|
@@ -530,20 +531,21 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
530
531
|
}),
|
|
531
532
|
pts: updates_.pts,
|
|
532
533
|
pts_count: updates_.pts_count,
|
|
533
|
-
}
|
|
534
|
+
},
|
|
534
535
|
];
|
|
535
536
|
}
|
|
536
|
-
else if (
|
|
537
|
-
if (!(
|
|
537
|
+
else if ((0, _2_tl_js_1.is)("updateShortSentMessage", updates_)) {
|
|
538
|
+
if (!(0, _2_tl_js_1.is)("messages.sendMessage", call)) {
|
|
538
539
|
(0, _0_deps_js_1.unreachable)();
|
|
539
540
|
}
|
|
540
|
-
updates = [
|
|
541
|
-
|
|
542
|
-
message:
|
|
541
|
+
updates = [{
|
|
542
|
+
_: "updateNewMessage",
|
|
543
|
+
message: ({
|
|
544
|
+
_: "message",
|
|
543
545
|
out: updates_.out,
|
|
544
546
|
silent: call.silent,
|
|
545
547
|
id: updates_.id,
|
|
546
|
-
from_id:
|
|
548
|
+
from_id: { _: "peerUser", user_id: await __classPrivateFieldGet(this, _UpdateManager_c, "f").getSelfId().then(BigInt) },
|
|
547
549
|
peer_id: (0, _2_tl_js_1.inputPeerToPeer)(call.peer),
|
|
548
550
|
message: call.message,
|
|
549
551
|
media: updates_.media,
|
|
@@ -554,33 +556,32 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
554
556
|
}),
|
|
555
557
|
pts: updates_.pts,
|
|
556
558
|
pts_count: updates_.pts_count,
|
|
557
|
-
}
|
|
558
|
-
];
|
|
559
|
+
}];
|
|
559
560
|
}
|
|
560
|
-
else if (
|
|
561
|
+
else if ((0, _2_tl_js_1.is)("updatesTooLong", updates_)) {
|
|
561
562
|
await this.recoverUpdateGap("updatesTooLong");
|
|
562
563
|
return;
|
|
563
564
|
}
|
|
564
|
-
else if (
|
|
565
|
+
else if ((0, _2_tl_js_1.isOfEnum)("Update", updates_)) {
|
|
565
566
|
updates = [updates_];
|
|
566
567
|
}
|
|
567
568
|
else {
|
|
568
569
|
(0, _0_deps_js_1.unreachable)();
|
|
569
570
|
}
|
|
570
571
|
/// We process the updates when we are sure there is no gap.
|
|
571
|
-
if (
|
|
572
|
+
if ((0, _2_tl_js_1.is)("updates", updates_) || (0, _2_tl_js_1.is)("updatesCombined", updates_)) {
|
|
572
573
|
await this.processChats(updates_.chats);
|
|
573
574
|
await this.processUsers(updates_.users);
|
|
574
575
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, updates_.date);
|
|
575
576
|
}
|
|
576
|
-
else if (
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
else if ((0, _2_tl_js_1.is)("updateShort", updates_) ||
|
|
578
|
+
(0, _2_tl_js_1.is)("updateShortMessage", updates_) ||
|
|
579
|
+
(0, _2_tl_js_1.is)("updateShortChatMessage", updates_) ||
|
|
580
|
+
(0, _2_tl_js_1.is)("updateShortSentMessage", updates_)) {
|
|
580
581
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateStateDate).call(this, updates_.date);
|
|
581
582
|
}
|
|
582
583
|
for (const update of updates) {
|
|
583
|
-
if (
|
|
584
|
+
if ((0, _2_tl_js_1.is)("updatePtsChanged", update)) {
|
|
584
585
|
await this.fetchState("updatePtsChanged");
|
|
585
586
|
if (__classPrivateFieldGet(this, _UpdateManager_updateState, "f")) {
|
|
586
587
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, __classPrivateFieldGet(this, _UpdateManager_updateState, "f"));
|
|
@@ -638,18 +639,19 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
638
639
|
const pts_ = await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.getChannelPts(channelId);
|
|
639
640
|
let pts = pts_ == null ? 1 : pts_;
|
|
640
641
|
while (true) {
|
|
641
|
-
const { access_hash } = await __classPrivateFieldGet(this, _UpdateManager_c, "f").getInputPeer(_1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId)).then((v) =>
|
|
642
|
-
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").
|
|
642
|
+
const { access_hash } = await __classPrivateFieldGet(this, _UpdateManager_c, "f").getInputPeer(_1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId)).then((v) => (0, _2_tl_js_1.as)("inputPeerChannel", v));
|
|
643
|
+
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").invoke({
|
|
644
|
+
_: "updates.getChannelDifference",
|
|
643
645
|
pts,
|
|
644
|
-
channel:
|
|
645
|
-
filter:
|
|
646
|
+
channel: { _: "inputChannel", channel_id: channelId, access_hash },
|
|
647
|
+
filter: { _: "channelMessagesFilterEmpty" },
|
|
646
648
|
limit: await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.getAccountType() == "user" ? _4_constants_js_1.CHANNEL_DIFFERENCE_LIMIT_USER : _4_constants_js_1.CHANNEL_DIFFERENCE_LIMIT_BOT,
|
|
647
649
|
});
|
|
648
|
-
if (
|
|
650
|
+
if ((0, _2_tl_js_1.is)("updates.channelDifference", difference)) {
|
|
649
651
|
await this.processChats(difference.chats);
|
|
650
652
|
await this.processUsers(difference.users);
|
|
651
653
|
for (const message of difference.new_messages) {
|
|
652
|
-
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this,
|
|
654
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewChannelMessage", message, pts: 0, pts_count: 0 }, false);
|
|
653
655
|
}
|
|
654
656
|
for (const update of difference.other_updates) {
|
|
655
657
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, update, false);
|
|
@@ -658,15 +660,15 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
658
660
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug(`recovered from update gap [${channelId}, ${source}]`, channelId, source);
|
|
659
661
|
break;
|
|
660
662
|
}
|
|
661
|
-
else if (
|
|
663
|
+
else if ((0, _2_tl_js_1.is)("updates.channelDifferenceTooLong", difference)) {
|
|
662
664
|
// TODO: invalidate messages
|
|
663
665
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("received channelDifferenceTooLong");
|
|
664
666
|
await this.processChats(difference.chats);
|
|
665
667
|
await this.processUsers(difference.users);
|
|
666
668
|
for (const message of difference.messages) {
|
|
667
|
-
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this,
|
|
669
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processUpdates).call(this, { _: "updateNewChannelMessage", message, pts: 0, pts_count: 0 }, false);
|
|
668
670
|
}
|
|
669
|
-
const pts_ =
|
|
671
|
+
const pts_ = (0, _2_tl_js_1.as)("dialog", difference.dialog).pts;
|
|
670
672
|
if (pts_ != undefined) {
|
|
671
673
|
pts = pts_;
|
|
672
674
|
}
|
|
@@ -675,7 +677,7 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
675
677
|
}
|
|
676
678
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("processed channelDifferenceTooLong");
|
|
677
679
|
}
|
|
678
|
-
else if (
|
|
680
|
+
else if ((0, _2_tl_js_1.is)("updates.channelDifferenceEmpty", difference)) {
|
|
679
681
|
__classPrivateFieldGet(this, _UpdateManager_LrecoverChannelUpdateGap, "f").debug("there was no update gap");
|
|
680
682
|
break;
|
|
681
683
|
}
|
|
@@ -17,16 +17,16 @@
|
|
|
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 { InputMedia } from "../3_types.js";
|
|
22
|
-
import { ChatAction,
|
|
22
|
+
import { ChatAction, FileSource, FileType, ID, Message, MessageEntity, ParseMode, Reaction, Update, UsernameResolver } from "../3_types.js";
|
|
23
23
|
import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams } from "./0_params.js";
|
|
24
24
|
import { C as C_ } from "./1_types.js";
|
|
25
25
|
import { FileManager } from "./2_file_manager.js";
|
|
26
26
|
interface C extends C_ {
|
|
27
27
|
fileManager: FileManager;
|
|
28
28
|
}
|
|
29
|
-
type MessageManagerUpdate =
|
|
29
|
+
type MessageManagerUpdate = Api.updateNewMessage | Api.updateNewChannelMessage | Api.updateEditMessage | Api.updateEditChannelMessage | Api.updateBotNewBusinessMessage | Api.updateBotEditBusinessMessage | Api.updateBotDeleteBusinessMessage | Api.updateDeleteMessages | Api.updateDeleteChannelMessages | Api.updateChannelParticipant | Api.updateChatParticipant;
|
|
30
30
|
export declare class MessageManager {
|
|
31
31
|
#private;
|
|
32
32
|
constructor(c: C);
|
|
@@ -37,10 +37,10 @@ export declare class MessageManager {
|
|
|
37
37
|
parseText(text_: string, params?: {
|
|
38
38
|
parseMode?: ParseMode;
|
|
39
39
|
entities?: MessageEntity[];
|
|
40
|
-
}): Promise<readonly [string,
|
|
41
|
-
constructMessage(message_:
|
|
40
|
+
}): Promise<readonly [string, Api.MessageEntity[] | undefined]>;
|
|
41
|
+
constructMessage(message_: Api.Message, r?: boolean, business?: {
|
|
42
42
|
connectionId: string;
|
|
43
|
-
replyToMessage?:
|
|
43
|
+
replyToMessage?: Api.Message;
|
|
44
44
|
}): Promise<Message>;
|
|
45
45
|
forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
|
|
46
46
|
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
@@ -79,7 +79,7 @@ export declare class MessageManager {
|
|
|
79
79
|
setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
|
|
80
80
|
addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
|
|
81
81
|
removeReaction(chatId: ID, messageId: number, reaction: Reaction): Promise<void>;
|
|
82
|
-
static canHandleUpdate(update:
|
|
82
|
+
static canHandleUpdate(update: Api.Update): update is MessageManagerUpdate;
|
|
83
83
|
handleUpdate(update: MessageManagerUpdate): Promise<Update | null>;
|
|
84
84
|
sendChatAction(chatId: ID, action: ChatAction, params?: SendChatActionParams): Promise<void>;
|
|
85
85
|
deleteChatPhoto(chatId: number): Promise<void>;
|
|
@@ -87,7 +87,6 @@ export declare class MessageManager {
|
|
|
87
87
|
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
88
88
|
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
89
89
|
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
90
|
-
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
91
90
|
enableJoinRequests(chatId: ID): Promise<void>;
|
|
92
91
|
disableJoinRequests(chatId: ID): Promise<void>;
|
|
93
92
|
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
@@ -98,7 +97,7 @@ export declare class MessageManager {
|
|
|
98
97
|
leaveChat(chatId: ID): Promise<void>;
|
|
99
98
|
blockUser(userId: ID): Promise<void>;
|
|
100
99
|
unblockUser(userId: ID): Promise<void>;
|
|
101
|
-
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
100
|
+
getChatMember(chatId: ID, userId: ID): Promise<import("../3_types.js").ChatMember>;
|
|
102
101
|
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
103
102
|
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
104
103
|
stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise<import("../3_types.js").Poll>;
|