@mtkruto/node 0.1.800 → 0.2.1
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 +185 -164
- 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 +183 -162
- 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
|
@@ -56,8 +56,8 @@ class MessageManager {
|
|
|
56
56
|
configurable: true,
|
|
57
57
|
writable: true,
|
|
58
58
|
value: async (v) => {
|
|
59
|
-
const inputPeer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(v).then((v) =>
|
|
60
|
-
return
|
|
59
|
+
const inputPeer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(v).then((v) => (0, _2_tl_js_1.as)("inputPeerUser", v));
|
|
60
|
+
return { ...inputPeer, _: "inputUser" };
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
__classPrivateFieldSet(this, _MessageManager_c, c, "f");
|
|
@@ -82,21 +82,19 @@ class MessageManager {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
if (shouldFetch) {
|
|
85
|
-
if (
|
|
86
|
-
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
87
|
-
channel: new _2_tl_js_1.types.InputChannel(peer),
|
|
88
|
-
id: messageIds.map((v) => new _2_tl_js_1.types.InputMessageID({ id: v })),
|
|
89
|
-
}).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.messages.ChannelMessages).messages);
|
|
85
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
86
|
+
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.getMessages", channel: ({ ...peer, _: "inputChannel" }), id: messageIds.map((v) => ({ _: "inputMessageID", id: v })) }).then((v) => (0, _2_tl_js_1.as)("messages.channelMessages", v).messages);
|
|
90
87
|
}
|
|
91
88
|
else {
|
|
92
|
-
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
messages_ = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
90
|
+
_: "messages.getMessages",
|
|
91
|
+
id: messageIds.map((v) => ({ _: "inputMessageID", id: v })),
|
|
92
|
+
}).then((v) => (0, _2_tl_js_1.as)("messages.messages", v).messages);
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
const messages = new Array();
|
|
98
96
|
for (const message_ of messages_) {
|
|
99
|
-
if (
|
|
97
|
+
if ((0, _2_tl_js_1.is)("messageEmpty", message_)) {
|
|
100
98
|
continue;
|
|
101
99
|
}
|
|
102
100
|
const message = await this.constructMessage(message_);
|
|
@@ -159,18 +157,7 @@ class MessageManager {
|
|
|
159
157
|
}
|
|
160
158
|
async forwardMessages(from, to, messageIds, params) {
|
|
161
159
|
(0, _0_utilities_js_2.checkArray)(messageIds, _0_utilities_js_1.checkMessageId);
|
|
162
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
163
|
-
from_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(from),
|
|
164
|
-
to_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(to),
|
|
165
|
-
id: messageIds,
|
|
166
|
-
random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()),
|
|
167
|
-
silent: params?.disableNotification || undefined,
|
|
168
|
-
top_msg_id: params?.messageThreadId,
|
|
169
|
-
noforwards: params?.disableNotification || undefined,
|
|
170
|
-
send_as: params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined,
|
|
171
|
-
drop_author: params?.dropSenderName || undefined,
|
|
172
|
-
drop_media_captions: params?.dropCaption || undefined,
|
|
173
|
-
});
|
|
160
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.forwardMessages", from_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(from), to_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(to), id: messageIds, random_id: messageIds.map(() => (0, _1_utilities_js_1.getRandomId)()), silent: params?.disableNotification || undefined, top_msg_id: params?.messageThreadId, noforwards: params?.disableNotification || undefined, send_as: params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined, drop_author: params?.dropSenderName || undefined, drop_media_captions: params?.dropCaption || undefined });
|
|
174
161
|
return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, to, result);
|
|
175
162
|
}
|
|
176
163
|
async getHistory(chatId, params) {
|
|
@@ -191,16 +178,7 @@ class MessageManager {
|
|
|
191
178
|
if (messages.length > 0) {
|
|
192
179
|
offsetId = messages[messages.length - 1].id; // TODO: track id of oldest message and don't send requests for it
|
|
193
180
|
}
|
|
194
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
195
|
-
peer: peer,
|
|
196
|
-
offset_id: offsetId,
|
|
197
|
-
offset_date: 0,
|
|
198
|
-
add_offset: 0,
|
|
199
|
-
limit,
|
|
200
|
-
max_id: 0,
|
|
201
|
-
min_id: 0,
|
|
202
|
-
hash: 0n,
|
|
203
|
-
});
|
|
181
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.getHistory", peer: peer, offset_id: offsetId, offset_date: 0, add_offset: 0, limit, max_id: 0, min_id: 0, hash: 0n });
|
|
204
182
|
if (!("messages" in result)) {
|
|
205
183
|
(0, _0_deps_js_1.unreachable)();
|
|
206
184
|
}
|
|
@@ -222,10 +200,12 @@ class MessageManager {
|
|
|
222
200
|
const sendAs = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveSendAs).call(this, params);
|
|
223
201
|
let result;
|
|
224
202
|
if (!noWebpage && params?.linkPreview?.url) {
|
|
225
|
-
result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
203
|
+
result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
204
|
+
_: "messages.sendMedia",
|
|
226
205
|
peer,
|
|
227
206
|
random_id: randomId,
|
|
228
|
-
media:
|
|
207
|
+
media: ({
|
|
208
|
+
_: "inputMediaWebPage",
|
|
229
209
|
url: params.linkPreview.url,
|
|
230
210
|
force_large_media: params.linkPreview.largeMedia ? true : undefined,
|
|
231
211
|
force_small_media: params.linkPreview.smallMedia ? true : undefined,
|
|
@@ -239,10 +219,11 @@ class MessageManager {
|
|
|
239
219
|
send_as: sendAs,
|
|
240
220
|
entities,
|
|
241
221
|
reply_markup: replyMarkup,
|
|
242
|
-
}
|
|
222
|
+
}, params?.businessConnectionId);
|
|
243
223
|
}
|
|
244
224
|
else {
|
|
245
|
-
result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
225
|
+
result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
226
|
+
_: "messages.sendMessage",
|
|
246
227
|
peer,
|
|
247
228
|
random_id: randomId,
|
|
248
229
|
message,
|
|
@@ -254,7 +235,7 @@ class MessageManager {
|
|
|
254
235
|
send_as: sendAs,
|
|
255
236
|
entities,
|
|
256
237
|
reply_markup: replyMarkup,
|
|
257
|
-
}
|
|
238
|
+
}, params?.businessConnectionId);
|
|
258
239
|
}
|
|
259
240
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
260
241
|
return (0, _3_types_js_2.assertMessageType)(message_, "text");
|
|
@@ -264,9 +245,10 @@ class MessageManager {
|
|
|
264
245
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
265
246
|
const silent = params?.disableNotification ? true : undefined;
|
|
266
247
|
const noforwards = params?.protectContent ? true : undefined;
|
|
267
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
248
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
268
249
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
269
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
250
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
251
|
+
_: "messages.sendMedia",
|
|
270
252
|
peer,
|
|
271
253
|
random_id: randomId,
|
|
272
254
|
silent,
|
|
@@ -274,8 +256,10 @@ class MessageManager {
|
|
|
274
256
|
reply_to: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyTo).call(this, params),
|
|
275
257
|
send_as: sendAs,
|
|
276
258
|
reply_markup: replyMarkup,
|
|
277
|
-
media:
|
|
278
|
-
|
|
259
|
+
media: ({
|
|
260
|
+
_: "inputMediaVenue",
|
|
261
|
+
geo_point: ({
|
|
262
|
+
_: "inputGeoPoint",
|
|
279
263
|
lat: latitude,
|
|
280
264
|
long: longitude,
|
|
281
265
|
}),
|
|
@@ -286,7 +270,7 @@ class MessageManager {
|
|
|
286
270
|
provider: "foursquare",
|
|
287
271
|
}),
|
|
288
272
|
message: "",
|
|
289
|
-
}
|
|
273
|
+
}, params?.businessConnectionId);
|
|
290
274
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
291
275
|
return (0, _3_types_js_2.assertMessageType)(message, "venue");
|
|
292
276
|
}
|
|
@@ -295,9 +279,10 @@ class MessageManager {
|
|
|
295
279
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
296
280
|
const silent = params?.disableNotification ? true : undefined;
|
|
297
281
|
const noforwards = params?.protectContent ? true : undefined;
|
|
298
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
282
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
299
283
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
300
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
284
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
285
|
+
_: "messages.sendMedia",
|
|
301
286
|
peer,
|
|
302
287
|
random_id: randomId,
|
|
303
288
|
silent,
|
|
@@ -305,14 +290,15 @@ class MessageManager {
|
|
|
305
290
|
reply_to: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyTo).call(this, params),
|
|
306
291
|
send_as: sendAs,
|
|
307
292
|
reply_markup: replyMarkup,
|
|
308
|
-
media:
|
|
293
|
+
media: ({
|
|
294
|
+
_: "inputMediaContact",
|
|
309
295
|
phone_number: number,
|
|
310
296
|
first_name: firstName,
|
|
311
297
|
last_name: params?.lastName ?? "",
|
|
312
298
|
vcard: params?.vcard ?? "",
|
|
313
299
|
}),
|
|
314
300
|
message: "",
|
|
315
|
-
}
|
|
301
|
+
}, params?.businessConnectionId);
|
|
316
302
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
317
303
|
return (0, _3_types_js_2.assertMessageType)(message, "contact");
|
|
318
304
|
}
|
|
@@ -321,9 +307,10 @@ class MessageManager {
|
|
|
321
307
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
322
308
|
const silent = params?.disableNotification ? true : undefined;
|
|
323
309
|
const noforwards = params?.protectContent ? true : undefined;
|
|
324
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
310
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
325
311
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
326
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
312
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
313
|
+
_: "messages.sendMedia",
|
|
327
314
|
peer,
|
|
328
315
|
random_id: randomId,
|
|
329
316
|
silent,
|
|
@@ -331,11 +318,12 @@ class MessageManager {
|
|
|
331
318
|
reply_to: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyTo).call(this, params),
|
|
332
319
|
send_as: sendAs,
|
|
333
320
|
reply_markup: replyMarkup,
|
|
334
|
-
media:
|
|
321
|
+
media: ({
|
|
322
|
+
_: "inputMediaDice",
|
|
335
323
|
emoticon: params?.emoji ?? "🎲",
|
|
336
324
|
}),
|
|
337
325
|
message: "",
|
|
338
|
-
}
|
|
326
|
+
}, params?.businessConnectionId);
|
|
339
327
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
340
328
|
return (0, _3_types_js_2.assertMessageType)(message, "dice");
|
|
341
329
|
}
|
|
@@ -344,9 +332,10 @@ class MessageManager {
|
|
|
344
332
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
345
333
|
const silent = params?.disableNotification ? true : undefined;
|
|
346
334
|
const noforwards = params?.protectContent ? true : undefined;
|
|
347
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
335
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
348
336
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
349
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
337
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
338
|
+
_: "messages.sendMedia",
|
|
350
339
|
peer,
|
|
351
340
|
random_id: randomId,
|
|
352
341
|
silent,
|
|
@@ -355,8 +344,10 @@ class MessageManager {
|
|
|
355
344
|
send_as: sendAs,
|
|
356
345
|
reply_markup: replyMarkup,
|
|
357
346
|
media: params?.livePeriod !== undefined
|
|
358
|
-
?
|
|
359
|
-
|
|
347
|
+
? ({
|
|
348
|
+
_: "inputMediaGeoLive",
|
|
349
|
+
geo_point: ({
|
|
350
|
+
_: "inputGeoPoint",
|
|
360
351
|
lat: latitude,
|
|
361
352
|
long: longitude,
|
|
362
353
|
accuracy_radius: params?.horizontalAccuracy,
|
|
@@ -365,68 +356,48 @@ class MessageManager {
|
|
|
365
356
|
period: params.livePeriod,
|
|
366
357
|
proximity_notification_radius: params?.proximityAlertRadius,
|
|
367
358
|
})
|
|
368
|
-
:
|
|
369
|
-
|
|
359
|
+
: ({
|
|
360
|
+
_: "inputMediaGeoPoint",
|
|
361
|
+
geo_point: ({
|
|
362
|
+
_: "inputGeoPoint",
|
|
370
363
|
lat: latitude,
|
|
371
364
|
long: longitude,
|
|
372
365
|
accuracy_radius: params?.horizontalAccuracy,
|
|
373
366
|
}),
|
|
374
367
|
}),
|
|
375
368
|
message: "",
|
|
376
|
-
}
|
|
369
|
+
}, params?.businessConnectionId);
|
|
377
370
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
378
371
|
return (0, _3_types_js_2.assertMessageType)(message, "location");
|
|
379
372
|
}
|
|
380
373
|
async sendVideoNote(chatId, audio, params) {
|
|
381
374
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params, _3_types_js_2.FileType.VideoNote, [
|
|
382
|
-
|
|
383
|
-
round_message: true,
|
|
384
|
-
w: params?.length ?? 0,
|
|
385
|
-
h: params?.length ?? 0,
|
|
386
|
-
duration: params?.duration ?? 0,
|
|
387
|
-
}),
|
|
375
|
+
{ _: "documentAttributeVideo", round_message: true, w: params?.length ?? 0, h: params?.length ?? 0, duration: params?.duration ?? 0 },
|
|
388
376
|
], false);
|
|
389
377
|
return (0, _3_types_js_2.assertMessageType)(message, "videoNote");
|
|
390
378
|
}
|
|
391
379
|
async sendAudio(chatId, audio, params) {
|
|
392
380
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, audio, params, _3_types_js_2.FileType.Audio, [
|
|
393
|
-
|
|
394
|
-
duration: params?.duration ?? 0,
|
|
395
|
-
performer: params?.performer,
|
|
396
|
-
title: params?.title,
|
|
397
|
-
}),
|
|
381
|
+
{ _: "documentAttributeAudio", duration: params?.duration ?? 0, performer: params?.performer, title: params?.title },
|
|
398
382
|
]);
|
|
399
383
|
return (0, _3_types_js_2.assertMessageType)(message, "audio");
|
|
400
384
|
}
|
|
401
385
|
async sendVoice(chatId, voice, params) {
|
|
402
386
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, voice, params, _3_types_js_2.FileType.VoiceNote, [
|
|
403
|
-
|
|
404
|
-
voice: true,
|
|
405
|
-
duration: params?.duration ?? 0,
|
|
406
|
-
}),
|
|
387
|
+
{ _: "documentAttributeAudio", voice: true, duration: params?.duration ?? 0 },
|
|
407
388
|
]);
|
|
408
389
|
return (0, _3_types_js_2.assertMessageType)(message, "voice");
|
|
409
390
|
}
|
|
410
391
|
async sendAnimation(chatId, animation, params) {
|
|
411
392
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, animation, params, _3_types_js_2.FileType.Animation, [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
supports_streaming: true,
|
|
415
|
-
w: params?.width ?? 0,
|
|
416
|
-
h: params?.height ?? 0,
|
|
417
|
-
duration: params?.duration ?? 0,
|
|
418
|
-
}),
|
|
393
|
+
{ _: "documentAttributeAnimated" },
|
|
394
|
+
{ _: "documentAttributeVideo", supports_streaming: true, w: params?.width ?? 0, h: params?.height ?? 0, duration: params?.duration ?? 0 },
|
|
419
395
|
]);
|
|
420
396
|
return (0, _3_types_js_2.assertMessageType)(message, "animation");
|
|
421
397
|
}
|
|
422
398
|
async sendVideo(chatId, video, params) {
|
|
423
399
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, video, params, _3_types_js_2.FileType.Video, [
|
|
424
|
-
|
|
425
|
-
supports_streaming: params?.supportsStreaming ? true : undefined,
|
|
426
|
-
w: params?.width ?? 0,
|
|
427
|
-
h: params?.height ?? 0,
|
|
428
|
-
duration: params?.duration ?? 0,
|
|
429
|
-
}),
|
|
400
|
+
{ _: "documentAttributeVideo", supports_streaming: params?.supportsStreaming ? true : undefined, w: params?.width ?? 0, h: params?.height ?? 0, duration: params?.duration ?? 0 },
|
|
430
401
|
]);
|
|
431
402
|
return (0, _3_types_js_2.assertMessageType)(message, "video");
|
|
432
403
|
}
|
|
@@ -435,7 +406,7 @@ class MessageManager {
|
|
|
435
406
|
return (0, _3_types_js_2.assertMessageType)(message, "document");
|
|
436
407
|
}
|
|
437
408
|
async sendSticker(chatId, sticker, params) {
|
|
438
|
-
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, sticker, params, _3_types_js_2.FileType.Sticker, [
|
|
409
|
+
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendDocumentInner).call(this, chatId, sticker, params, _3_types_js_2.FileType.Sticker, [{ _: "documentAttributeSticker", alt: params?.emoji || "", stickerset: { _: "inputStickerSetEmpty" } }], undefined, STICKER_MIME_TYPES);
|
|
439
410
|
return (0, _3_types_js_2.assertMessageType)(message, "sticker");
|
|
440
411
|
}
|
|
441
412
|
async sendPhoto(chatId, photo, params) {
|
|
@@ -445,28 +416,16 @@ class MessageManager {
|
|
|
445
416
|
if (typeof photo === "string") {
|
|
446
417
|
const fileId = this.resolveFileId(photo, [_3_types_js_2.FileType.Photo, _3_types_js_2.FileType.ProfilePhoto]);
|
|
447
418
|
if (fileId != null) {
|
|
448
|
-
media =
|
|
449
|
-
id: new _2_tl_js_1.types.InputPhoto(fileId),
|
|
450
|
-
spoiler,
|
|
451
|
-
ttl_seconds,
|
|
452
|
-
});
|
|
419
|
+
media = { _: "inputMediaPhoto", id: { ...fileId, _: "inputPhoto" }, spoiler, ttl_seconds };
|
|
453
420
|
}
|
|
454
421
|
}
|
|
455
422
|
if (media == null) {
|
|
456
423
|
if (typeof photo === "string" && (0, _0_utilities_js_3.isHttpUrl)(photo)) {
|
|
457
|
-
media =
|
|
458
|
-
url: photo,
|
|
459
|
-
spoiler,
|
|
460
|
-
ttl_seconds: (params && "selfDestruct" in params && params.selfDestruct !== undefined) ? (0, _3_types_js_1.selfDestructOptionToInt)(params.selfDestruct) : undefined,
|
|
461
|
-
});
|
|
424
|
+
media = { _: "inputMediaPhotoExternal", url: photo, spoiler, ttl_seconds: (params && "selfDestruct" in params && params.selfDestruct !== undefined) ? (0, _3_types_js_1.selfDestructOptionToInt)(params.selfDestruct) : undefined };
|
|
462
425
|
}
|
|
463
426
|
else {
|
|
464
427
|
const file = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(photo, params, null, false);
|
|
465
|
-
media =
|
|
466
|
-
file,
|
|
467
|
-
spoiler,
|
|
468
|
-
ttl_seconds: (params && "selfDestruct" in params && params.selfDestruct !== undefined) ? (0, _3_types_js_1.selfDestructOptionToInt)(params.selfDestruct) : undefined,
|
|
469
|
-
});
|
|
428
|
+
media = { _: "inputMediaUploadedPhoto", file, spoiler, ttl_seconds: (params && "selfDestruct" in params && params.selfDestruct !== undefined) ? (0, _3_types_js_1.selfDestructOptionToInt)(params.selfDestruct) : undefined };
|
|
470
429
|
}
|
|
471
430
|
}
|
|
472
431
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendMedia).call(this, chatId, media, params);
|
|
@@ -505,31 +464,17 @@ class MessageManager {
|
|
|
505
464
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
506
465
|
const silent = params?.disableNotification ? true : undefined;
|
|
507
466
|
const noforwards = params?.protectContent ? true : undefined;
|
|
508
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
467
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
509
468
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
510
469
|
const explanation = params?.explanation;
|
|
511
470
|
const parseResult = explanation !== undefined ? await this.parseText(explanation, { parseMode: params?.explanationParseMode, entities: params?.explanationEntities }) : undefined;
|
|
512
471
|
const solution = parseResult === undefined ? undefined : parseResult[0];
|
|
513
472
|
const solutionEntities = parseResult === undefined ? undefined : parseResult[1];
|
|
514
|
-
const answers = options.map((v, i) =>
|
|
515
|
-
const poll =
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
closed: params?.isClosed ? true : undefined,
|
|
520
|
-
close_date: params?.closeDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.closeDate) : undefined,
|
|
521
|
-
close_period: params?.openPeriod ? params.openPeriod : undefined,
|
|
522
|
-
multiple_choice: params?.allowMultipleAnswers ? true : undefined,
|
|
523
|
-
public_voters: params?.isAnonymous === false ? true : undefined,
|
|
524
|
-
quiz: params?.type == "quiz" ? true : undefined,
|
|
525
|
-
});
|
|
526
|
-
const media = new _2_tl_js_1.types.InputMediaPoll({
|
|
527
|
-
poll,
|
|
528
|
-
correct_answers: params?.correctOptionIndex ? [new Uint8Array([params.correctOptionIndex])] : undefined,
|
|
529
|
-
solution,
|
|
530
|
-
solution_entities: solutionEntities,
|
|
531
|
-
});
|
|
532
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
|
|
473
|
+
const answers = options.map((v, i) => ({ _: "pollAnswer", option: new Uint8Array([i]), text: v }));
|
|
474
|
+
const poll = { _: "poll", id: (0, _1_utilities_js_1.getRandomId)(), answers, question, closed: params?.isClosed ? true : undefined, close_date: params?.closeDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.closeDate) : undefined, close_period: params?.openPeriod ? params.openPeriod : undefined, multiple_choice: params?.allowMultipleAnswers ? true : undefined, public_voters: params?.isAnonymous === false ? true : undefined, quiz: params?.type == "quiz" ? true : undefined };
|
|
475
|
+
const media = { _: "inputMediaPoll", poll, correct_answers: params?.correctOptionIndex ? [new Uint8Array([params.correctOptionIndex])] : undefined, solution, solution_entities: solutionEntities };
|
|
476
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
477
|
+
_: "messages.sendMedia",
|
|
533
478
|
peer,
|
|
534
479
|
random_id: randomId,
|
|
535
480
|
silent,
|
|
@@ -539,25 +484,18 @@ class MessageManager {
|
|
|
539
484
|
send_as: sendAs,
|
|
540
485
|
media,
|
|
541
486
|
message: "",
|
|
542
|
-
}
|
|
487
|
+
}, params?.businessConnectionId);
|
|
543
488
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
544
489
|
return (0, _3_types_js_2.assertMessageType)(message, "poll");
|
|
545
490
|
}
|
|
546
491
|
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
547
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
548
|
-
id: (0, _0_utilities_js_1.checkMessageId)(messageId),
|
|
549
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
550
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
551
|
-
});
|
|
492
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editMessage", id: (0, _0_utilities_js_1.checkMessageId)(messageId), peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
552
493
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
553
494
|
return message_;
|
|
554
495
|
}
|
|
555
496
|
async editInlineMessageReplyMarkup(inlineMessageId, params) {
|
|
556
497
|
const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
|
|
557
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
558
|
-
id,
|
|
559
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
560
|
-
});
|
|
498
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
561
499
|
}
|
|
562
500
|
async editMessageText(chatId, messageId, text, params) {
|
|
563
501
|
const [message, entities] = await this.parseText(text, params);
|
|
@@ -565,23 +503,9 @@ class MessageManager {
|
|
|
565
503
|
const invertMedia = params?.linkPreview?.aboveText ? true : undefined;
|
|
566
504
|
let media = undefined;
|
|
567
505
|
if (!noWebpage && params?.linkPreview?.url) {
|
|
568
|
-
media =
|
|
569
|
-
url: params.linkPreview.url,
|
|
570
|
-
force_large_media: params.linkPreview.largeMedia ? true : undefined,
|
|
571
|
-
force_small_media: params.linkPreview.smallMedia ? true : undefined,
|
|
572
|
-
optional: message.length ? undefined : true,
|
|
573
|
-
});
|
|
506
|
+
media = { _: "inputMediaWebPage", url: params.linkPreview.url, force_large_media: params.linkPreview.largeMedia ? true : undefined, force_small_media: params.linkPreview.smallMedia ? true : undefined, optional: message.length ? undefined : true };
|
|
574
507
|
}
|
|
575
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
576
|
-
id: (0, _0_utilities_js_1.checkMessageId)(messageId),
|
|
577
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
578
|
-
entities,
|
|
579
|
-
message,
|
|
580
|
-
media,
|
|
581
|
-
no_webpage: noWebpage,
|
|
582
|
-
invert_media: invertMedia,
|
|
583
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
584
|
-
});
|
|
508
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editMessage", id: (0, _0_utilities_js_1.checkMessageId)(messageId), peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), entities, message, media, no_webpage: noWebpage, invert_media: invertMedia, reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
585
509
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
586
510
|
return (0, _3_types_js_2.assertMessageType)(message_, "text");
|
|
587
511
|
}
|
|
@@ -592,22 +516,9 @@ class MessageManager {
|
|
|
592
516
|
const invertMedia = params?.linkPreview?.aboveText ? true : undefined;
|
|
593
517
|
let media = undefined;
|
|
594
518
|
if (!noWebpage && params?.linkPreview?.url) {
|
|
595
|
-
media =
|
|
596
|
-
url: params.linkPreview.url,
|
|
597
|
-
force_large_media: params.linkPreview.largeMedia ? true : undefined,
|
|
598
|
-
force_small_media: params.linkPreview.smallMedia ? true : undefined,
|
|
599
|
-
optional: message.length ? undefined : true,
|
|
600
|
-
});
|
|
519
|
+
media = { _: "inputMediaWebPage", url: params.linkPreview.url, force_large_media: params.linkPreview.largeMedia ? true : undefined, force_small_media: params.linkPreview.smallMedia ? true : undefined, optional: message.length ? undefined : true };
|
|
601
520
|
}
|
|
602
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
603
|
-
id,
|
|
604
|
-
entities,
|
|
605
|
-
message,
|
|
606
|
-
media,
|
|
607
|
-
no_webpage: noWebpage,
|
|
608
|
-
invert_media: invertMedia,
|
|
609
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
610
|
-
});
|
|
521
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, entities, message, media, no_webpage: noWebpage, invert_media: invertMedia, reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
611
522
|
}
|
|
612
523
|
async editMessageMedia(chatId, messageId, media, params) {
|
|
613
524
|
const message = await this.getMessage(chatId, messageId);
|
|
@@ -617,63 +528,41 @@ class MessageManager {
|
|
|
617
528
|
if (!("animation" in message) && !("audio" in message) && !("document" in message) && !("photo" in message) && !("video" in message)) {
|
|
618
529
|
throw new _0_errors_js_1.InputError("Unexpected message type.");
|
|
619
530
|
}
|
|
620
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
621
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
622
|
-
id: messageId,
|
|
623
|
-
media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media),
|
|
624
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
625
|
-
});
|
|
531
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editMessage", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), id: messageId, media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
626
532
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
627
533
|
return message_;
|
|
628
534
|
}
|
|
629
535
|
async editInlineMessageMedia(inlineMessageId, media, params) {
|
|
630
536
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageMedia");
|
|
631
537
|
const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
|
|
632
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
633
|
-
id,
|
|
634
|
-
media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media),
|
|
635
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
636
|
-
});
|
|
538
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
637
539
|
}
|
|
638
540
|
async deleteMessages(chatId, messageIds, params) {
|
|
639
541
|
(0, _0_utilities_js_2.checkArray)(messageIds, _0_utilities_js_1.checkMessageId);
|
|
640
542
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
641
|
-
if (
|
|
642
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
543
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
544
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.deleteMessages", channel: { ...peer, _: "inputChannel" }, id: messageIds });
|
|
643
545
|
}
|
|
644
546
|
else {
|
|
645
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
547
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteMessages", id: messageIds, revoke: params?.onlyForMe ? undefined : true });
|
|
646
548
|
}
|
|
647
549
|
}
|
|
648
550
|
async deleteChatMemberMessages(chatId, memberId) {
|
|
649
551
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
650
552
|
const participant = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
|
|
651
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
553
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.deleteParticipantHistory", channel, participant });
|
|
652
554
|
}
|
|
653
555
|
async pinMessage(chatId, messageId, params) {
|
|
654
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
655
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
656
|
-
id: (0, _0_utilities_js_1.checkMessageId)(messageId),
|
|
657
|
-
silent: params?.disableNotification ? true : undefined,
|
|
658
|
-
pm_oneside: params?.bothSides ? undefined : true,
|
|
659
|
-
});
|
|
556
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.updatePinnedMessage", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), id: (0, _0_utilities_js_1.checkMessageId)(messageId), silent: params?.disableNotification ? true : undefined, pm_oneside: params?.bothSides ? undefined : true });
|
|
660
557
|
}
|
|
661
558
|
async unpinMessage(chatId, messageId) {
|
|
662
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
663
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
664
|
-
id: (0, _0_utilities_js_1.checkMessageId)(messageId),
|
|
665
|
-
unpin: true,
|
|
666
|
-
});
|
|
559
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.updatePinnedMessage", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), id: (0, _0_utilities_js_1.checkMessageId)(messageId), unpin: true });
|
|
667
560
|
}
|
|
668
561
|
async unpinMessages(chatId) {
|
|
669
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
562
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.unpinAllMessages", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId) });
|
|
670
563
|
}
|
|
671
564
|
async setAvailableReactions(chatId, availableReactions) {
|
|
672
|
-
|
|
673
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.setChatAvailableReactions({
|
|
674
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
675
|
-
available_reactions: availableReactions == "none" ? new _2_tl_js_1.types.ChatReactionsNone() : availableReactions == "all" ? new _2_tl_js_1.types.ChatReactionsAll() : Array.isArray(availableReactions) ? new _2_tl_js_1.types.ChatReactionsSome({ reactions: availableReactions.map((v) => v.type == "emoji" ? new _2_tl_js_1.types.ReactionEmoji({ emoticon: v.emoji }) : new _2_tl_js_1.types.ReactionCustomEmoji({ document_id: BigInt(v.id) })) }) : (0, _0_deps_js_1.unreachable)(),
|
|
676
|
-
});
|
|
565
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.setChatAvailableReactions", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), available_reactions: availableReactions == "none" ? { _: "chatReactionsNone" } : availableReactions == "all" ? { _: "chatReactionsAll" } : Array.isArray(availableReactions) ? ({ _: "chatReactionsSome", reactions: availableReactions.map((v) => v.type == "emoji" ? ({ _: "reactionEmoji", emoticon: v.emoji }) : ({ _: "reactionCustomEmoji", document_id: BigInt(v.id) })) }) : (0, _0_deps_js_1.unreachable)() });
|
|
677
566
|
}
|
|
678
567
|
async setReactions(chatId, messageId, reactions, params) {
|
|
679
568
|
await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendReaction).call(this, chatId, messageId, reactions, params);
|
|
@@ -707,32 +596,32 @@ class MessageManager {
|
|
|
707
596
|
}
|
|
708
597
|
}
|
|
709
598
|
static canHandleUpdate(update) {
|
|
710
|
-
return
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
599
|
+
return (0, _2_tl_js_1.is)("updateNewMessage", update) ||
|
|
600
|
+
(0, _2_tl_js_1.is)("updateNewChannelMessage", update) ||
|
|
601
|
+
(0, _2_tl_js_1.is)("updateEditMessage", update) ||
|
|
602
|
+
(0, _2_tl_js_1.is)("updateEditChannelMessage", update) ||
|
|
603
|
+
(0, _2_tl_js_1.is)("updateBotNewBusinessMessage", update) ||
|
|
604
|
+
(0, _2_tl_js_1.is)("updateBotEditBusinessMessage", update) ||
|
|
605
|
+
(0, _2_tl_js_1.is)("updateBotDeleteBusinessMessage", update) ||
|
|
606
|
+
(0, _2_tl_js_1.is)("updateDeleteMessages", update) ||
|
|
607
|
+
(0, _2_tl_js_1.is)("updateDeleteChannelMessages", update) ||
|
|
608
|
+
(0, _2_tl_js_1.is)("updateChannelParticipant", update) ||
|
|
609
|
+
(0, _2_tl_js_1.is)("updateChatParticipant", update);
|
|
721
610
|
}
|
|
722
611
|
async handleUpdate(update) {
|
|
723
|
-
if (
|
|
724
|
-
if (
|
|
612
|
+
if ((0, _2_tl_js_1.is)("updateNewMessage", update) || (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateEditMessage", update) || (0, _2_tl_js_1.is)("updateEditChannelMessage", update)) {
|
|
613
|
+
if ((0, _2_tl_js_1.is)("message", update.message) || (0, _2_tl_js_1.is)("messageService", update.message)) {
|
|
725
614
|
const chatId = (0, _2_tl_js_1.peerToChatId)(update.message.peer_id);
|
|
726
615
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").messageStorage.setMessage(chatId, update.message.id, update.message);
|
|
727
616
|
}
|
|
728
617
|
}
|
|
729
|
-
if (
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
if (!(
|
|
618
|
+
if ((0, _2_tl_js_1.is)("updateNewMessage", update) ||
|
|
619
|
+
(0, _2_tl_js_1.is)("updateNewChannelMessage", update) ||
|
|
620
|
+
(0, _2_tl_js_1.is)("updateEditMessage", update) ||
|
|
621
|
+
(0, _2_tl_js_1.is)("updateEditChannelMessage", update) ||
|
|
622
|
+
(0, _2_tl_js_1.is)("updateBotNewBusinessMessage", update) ||
|
|
623
|
+
(0, _2_tl_js_1.is)("updateBotEditBusinessMessage", update)) {
|
|
624
|
+
if (!((0, _2_tl_js_1.is)("messageEmpty", update.message))) {
|
|
736
625
|
const isOutgoing = update.message.out;
|
|
737
626
|
let shouldIgnore = isOutgoing ? (await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.getAccountType()) == "user" ? false : true : false;
|
|
738
627
|
if (__classPrivateFieldGet(this, _MessageManager_c, "f").ignoreOutgoing != null && isOutgoing) {
|
|
@@ -741,16 +630,16 @@ class MessageManager {
|
|
|
741
630
|
if (!shouldIgnore) {
|
|
742
631
|
const business = "connection_id" in update ? { connectionId: update.connection_id, replyToMessage: update.reply_to_message } : undefined;
|
|
743
632
|
const message = await this.constructMessage(update.message, undefined, business);
|
|
744
|
-
if (
|
|
745
|
-
return
|
|
633
|
+
if ((0, _2_tl_js_1.is)("updateNewMessage", update) || (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateBotNewBusinessMessage", update)) {
|
|
634
|
+
return { message };
|
|
746
635
|
}
|
|
747
636
|
else {
|
|
748
|
-
return
|
|
637
|
+
return { editedMessage: message };
|
|
749
638
|
}
|
|
750
639
|
}
|
|
751
640
|
}
|
|
752
641
|
}
|
|
753
|
-
if (
|
|
642
|
+
if ((0, _2_tl_js_1.is)("updateDeleteMessages", update)) {
|
|
754
643
|
const deletedMessages = new Array();
|
|
755
644
|
for (const messageId of update.messages) {
|
|
756
645
|
const chatId = await __classPrivateFieldGet(this, _MessageManager_c, "f").messageStorage.getMessageChat(messageId);
|
|
@@ -762,7 +651,7 @@ class MessageManager {
|
|
|
762
651
|
return { deletedMessages };
|
|
763
652
|
}
|
|
764
653
|
}
|
|
765
|
-
else if (
|
|
654
|
+
else if ((0, _2_tl_js_1.is)("updateDeleteChannelMessages", update)) {
|
|
766
655
|
const chatId = (0, _2_tl_js_1.getChannelChatId)(update.channel_id);
|
|
767
656
|
const deletedMessages = new Array();
|
|
768
657
|
for (const messageId of update.messages) {
|
|
@@ -773,12 +662,12 @@ class MessageManager {
|
|
|
773
662
|
}
|
|
774
663
|
return { deletedMessages };
|
|
775
664
|
}
|
|
776
|
-
else if (
|
|
665
|
+
else if ((0, _2_tl_js_1.is)("updateBotDeleteBusinessMessage", update)) {
|
|
777
666
|
const chatId = (0, _2_tl_js_1.peerToChatId)(update.peer);
|
|
778
667
|
const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
|
|
779
668
|
return { deletedMessages, businessConnectionId: update.connection_id };
|
|
780
669
|
}
|
|
781
|
-
if (
|
|
670
|
+
if ((0, _2_tl_js_1.is)("updateChannelParticipant", update) || (0, _2_tl_js_1.is)("updateChatParticipant", update)) {
|
|
782
671
|
const chatMember = await (0, _3_types_js_1.constructChatMemberUpdated)(update, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
783
672
|
const selfId = await __classPrivateFieldGet(this, _MessageManager_c, "f").getSelfId();
|
|
784
673
|
if (chatMember.oldChatMember.user.id == selfId) {
|
|
@@ -794,76 +683,76 @@ class MessageManager {
|
|
|
794
683
|
let action_;
|
|
795
684
|
switch (action) {
|
|
796
685
|
case "type":
|
|
797
|
-
action_ =
|
|
686
|
+
action_ = { _: "sendMessageTypingAction" };
|
|
798
687
|
break;
|
|
799
688
|
case "uploadPhoto":
|
|
800
|
-
action_ =
|
|
689
|
+
action_ = { _: "sendMessageUploadPhotoAction", progress: 0 };
|
|
801
690
|
break;
|
|
802
691
|
case "recordVideo":
|
|
803
|
-
action_ =
|
|
692
|
+
action_ = { _: "sendMessageRecordVideoAction" };
|
|
804
693
|
break;
|
|
805
694
|
case "uploadVideo":
|
|
806
|
-
action_ =
|
|
695
|
+
action_ = { _: "sendMessageRecordVideoAction" };
|
|
807
696
|
break;
|
|
808
697
|
case "recordVoice":
|
|
809
|
-
action_ =
|
|
698
|
+
action_ = { _: "sendMessageRecordAudioAction" };
|
|
810
699
|
break;
|
|
811
700
|
case "uploadAudio":
|
|
812
|
-
action_ =
|
|
701
|
+
action_ = { _: "sendMessageUploadAudioAction", progress: 0 };
|
|
813
702
|
break;
|
|
814
703
|
case "uploadDocument":
|
|
815
|
-
action_ =
|
|
704
|
+
action_ = { _: "sendMessageUploadDocumentAction", progress: 0 };
|
|
816
705
|
break;
|
|
817
706
|
case "chooseSticker":
|
|
818
|
-
action_ =
|
|
707
|
+
action_ = { _: "sendMessageChooseStickerAction" };
|
|
819
708
|
break;
|
|
820
709
|
case "findLocation":
|
|
821
|
-
action_ =
|
|
710
|
+
action_ = { _: "sendMessageGeoLocationAction" };
|
|
822
711
|
break;
|
|
823
712
|
case "recordVideoNote":
|
|
824
|
-
action_ =
|
|
713
|
+
action_ = { _: "sendMessageRecordRoundAction" };
|
|
825
714
|
break;
|
|
826
715
|
case "uploadVideoNote":
|
|
827
|
-
action_ =
|
|
716
|
+
action_ = { _: "sendMessageUploadRoundAction", progress: 0 };
|
|
828
717
|
break;
|
|
829
718
|
default:
|
|
830
719
|
throw new _0_errors_js_1.InputError(`Invalid chat action: ${action}`);
|
|
831
720
|
}
|
|
832
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
721
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.setTyping", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), action: action_, top_msg_id: params?.messageThreadId }, params?.businessConnectionId);
|
|
833
722
|
}
|
|
834
723
|
async deleteChatPhoto(chatId) {
|
|
835
724
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
836
|
-
if (!(
|
|
725
|
+
if (!((0, _2_tl_js_1.is)("inputPeerChannel", peer)) && !((0, _2_tl_js_1.is)("inputPeerChat", peer))) {
|
|
837
726
|
(0, _0_deps_js_1.unreachable)();
|
|
838
727
|
}
|
|
839
|
-
if (
|
|
840
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
728
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
729
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel: { ...peer, _: "inputChannel" }, photo: { _: "inputChatPhotoEmpty" } });
|
|
841
730
|
}
|
|
842
|
-
else if (
|
|
843
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
731
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
732
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: { _: "inputChatPhotoEmpty" } });
|
|
844
733
|
}
|
|
845
734
|
}
|
|
846
735
|
async setChatPhoto(chatId, photo, params) {
|
|
847
736
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
848
|
-
if (!(
|
|
737
|
+
if (!((0, _2_tl_js_1.is)("inputPeerChannel", peer)) && !((0, _2_tl_js_1.is)("inputPeerChat", peer))) {
|
|
849
738
|
(0, _0_deps_js_1.unreachable)();
|
|
850
739
|
}
|
|
851
740
|
const file = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(photo, params);
|
|
852
|
-
const photo_ =
|
|
853
|
-
if (
|
|
854
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
741
|
+
const photo_ = { _: "inputChatUploadedPhoto", file };
|
|
742
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
743
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editPhoto", channel: { ...peer, _: "inputChannel" }, photo: photo_ });
|
|
855
744
|
}
|
|
856
|
-
else if (
|
|
857
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
745
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
746
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: photo_ });
|
|
858
747
|
}
|
|
859
748
|
}
|
|
860
749
|
async banChatMember(chatId, memberId, params) {
|
|
861
750
|
const chat = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
862
|
-
if (!(
|
|
751
|
+
if (!((0, _2_tl_js_1.is)("inputPeerChannel", chat)) && !((0, _2_tl_js_1.is)("inputPeerChat", chat))) {
|
|
863
752
|
throw new _0_errors_js_1.InputError("Expected a channel, supergroup, or group ID.");
|
|
864
753
|
}
|
|
865
754
|
const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
|
|
866
|
-
if (
|
|
755
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", chat)) {
|
|
867
756
|
if (params?.deleteMessages) {
|
|
868
757
|
try {
|
|
869
758
|
await this.deleteChatMemberMessages(chatId, memberId);
|
|
@@ -872,11 +761,13 @@ class MessageManager {
|
|
|
872
761
|
//
|
|
873
762
|
}
|
|
874
763
|
}
|
|
875
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
876
|
-
|
|
764
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
765
|
+
_: "channels.editBanned",
|
|
766
|
+
channel: { ...chat, _: "inputChannel" },
|
|
877
767
|
participant: member,
|
|
878
|
-
banned_rights:
|
|
879
|
-
|
|
768
|
+
banned_rights: ({
|
|
769
|
+
_: "chatBannedRights",
|
|
770
|
+
until_date: params?.untilDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.untilDate) : 0,
|
|
880
771
|
view_messages: true,
|
|
881
772
|
send_messages: true,
|
|
882
773
|
send_media: true,
|
|
@@ -888,69 +779,22 @@ class MessageManager {
|
|
|
888
779
|
}),
|
|
889
780
|
});
|
|
890
781
|
}
|
|
891
|
-
else if (
|
|
892
|
-
if (!(
|
|
782
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", chat)) {
|
|
783
|
+
if (!((0, _2_tl_js_1.is)("inputPeerUser", member))) {
|
|
893
784
|
throw new _0_errors_js_1.InputError(`Invalid user ID: ${memberId}`);
|
|
894
785
|
}
|
|
895
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
896
|
-
chat_id: chat.chat_id,
|
|
897
|
-
user_id: new _2_tl_js_1.types.InputUser(member),
|
|
898
|
-
revoke_history: params?.deleteMessages ? true : undefined,
|
|
899
|
-
});
|
|
786
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: chat.chat_id, user_id: { ...member, _: "inputUser" }, revoke_history: params?.deleteMessages ? true : undefined });
|
|
900
787
|
}
|
|
901
788
|
}
|
|
902
789
|
async unbanChatMember(chatId, memberId) {
|
|
903
790
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
904
791
|
const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
|
|
905
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
906
|
-
channel,
|
|
907
|
-
participant: member,
|
|
908
|
-
banned_rights: new _2_tl_js_1.types.ChatBannedRights({ until_date: 0 }),
|
|
909
|
-
});
|
|
792
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: ({ _: "chatBannedRights", until_date: 0 }) });
|
|
910
793
|
}
|
|
911
794
|
async setChatMemberRights(chatId, memberId, params) {
|
|
912
795
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
913
796
|
const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
|
|
914
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
915
|
-
channel,
|
|
916
|
-
participant: member,
|
|
917
|
-
banned_rights: (0, _3_types_js_2.chatMemberRightsToTlObject)(params?.rights, params?.untilDate),
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
async getChatAdministrators(chatId) {
|
|
921
|
-
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
922
|
-
if (peer instanceof _2_tl_js_1.types.InputPeerChannel) {
|
|
923
|
-
const channel = new _2_tl_js_1.types.InputChannel(peer);
|
|
924
|
-
const participants = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.getParticipants({
|
|
925
|
-
channel,
|
|
926
|
-
filter: new _2_tl_js_1.types.ChannelParticipantsAdmins(),
|
|
927
|
-
offset: 0,
|
|
928
|
-
limit: 100,
|
|
929
|
-
hash: 0n,
|
|
930
|
-
});
|
|
931
|
-
if (participants instanceof _2_tl_js_1.types.channels.ChannelParticipantsNotModified) {
|
|
932
|
-
(0, _0_deps_js_1.unreachable)();
|
|
933
|
-
}
|
|
934
|
-
const chatMembers = new Array();
|
|
935
|
-
for (const p of participants.participants) {
|
|
936
|
-
chatMembers.push(await (0, _3_types_js_2.constructChatMember)(p, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity));
|
|
937
|
-
}
|
|
938
|
-
return chatMembers;
|
|
939
|
-
}
|
|
940
|
-
else if (peer instanceof _2_tl_js_1.types.InputPeerChat) {
|
|
941
|
-
const fullChat = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.getFullChat(peer); // TODO: full chat cache
|
|
942
|
-
if (!(fullChat.full_chat instanceof _2_tl_js_1.types.ChatFull) || !(fullChat.full_chat.participants instanceof _2_tl_js_1.types.ChatParticipants)) {
|
|
943
|
-
(0, _0_deps_js_1.unreachable)();
|
|
944
|
-
}
|
|
945
|
-
const chatMembers = new Array();
|
|
946
|
-
for (const p of fullChat.full_chat.participants.participants) {
|
|
947
|
-
chatMembers.push(await (0, _3_types_js_2.constructChatMember)(p, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity));
|
|
948
|
-
}
|
|
949
|
-
return chatMembers;
|
|
950
|
-
}
|
|
951
|
-
else {
|
|
952
|
-
(0, _0_deps_js_1.unreachable)();
|
|
953
|
-
}
|
|
797
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: (0, _3_types_js_2.chatMemberRightsToTlObject)(params?.rights, params?.untilDate) });
|
|
954
798
|
}
|
|
955
799
|
async enableJoinRequests(chatId) {
|
|
956
800
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("enableJoinRequests");
|
|
@@ -961,20 +805,7 @@ class MessageManager {
|
|
|
961
805
|
await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_toggleJoinRequests).call(this, chatId, false);
|
|
962
806
|
}
|
|
963
807
|
async searchMessages(chatId, query, params) {
|
|
964
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
965
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
966
|
-
q: query,
|
|
967
|
-
add_offset: 0,
|
|
968
|
-
filter: (0, _0_message_search_filter_js_1.messageSearchFilterToTlObject)(params?.filter ?? "empty"),
|
|
969
|
-
hash: 0n,
|
|
970
|
-
limit: params?.limit ?? 100,
|
|
971
|
-
max_date: 0,
|
|
972
|
-
max_id: 0,
|
|
973
|
-
min_date: 0,
|
|
974
|
-
min_id: 0,
|
|
975
|
-
offset_id: params?.after ? params.after : 0,
|
|
976
|
-
from_id: params?.from ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.from) : undefined,
|
|
977
|
-
});
|
|
808
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.search", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), q: query, add_offset: 0, filter: (0, _0_message_search_filter_js_1.messageSearchFilterToTlObject)(params?.filter ?? "empty"), hash: 0n, limit: params?.limit ?? 100, max_date: 0, max_id: 0, min_date: 0, min_id: 0, offset_id: params?.after ? params.after : 0, from_id: params?.from ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.from) : undefined });
|
|
978
809
|
if (!("messages" in result)) {
|
|
979
810
|
(0, _0_deps_js_1.unreachable)();
|
|
980
811
|
}
|
|
@@ -987,44 +818,31 @@ class MessageManager {
|
|
|
987
818
|
}
|
|
988
819
|
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
989
820
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
990
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
821
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.setBoostsToUnblockRestrictions", channel, boosts });
|
|
991
822
|
}
|
|
992
823
|
async createInviteLink(chatId, params) {
|
|
993
824
|
if (params?.requireApproval && params?.limit) {
|
|
994
825
|
throw new _0_errors_js_1.InputError("requireApproval cannot be true while limit is specified.");
|
|
995
826
|
}
|
|
996
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
997
|
-
|
|
998
|
-
title: params?.title,
|
|
999
|
-
expire_date: params?.expireAt ? (0, _1_utilities_js_1.toUnixTimestamp)(params.expireAt) : undefined,
|
|
1000
|
-
request_needed: params?.requireApproval ? true : undefined,
|
|
1001
|
-
usage_limit: params?.limit,
|
|
1002
|
-
});
|
|
1003
|
-
return await (0, _3_types_js_1.constructInviteLink)(result[_2_tl_js_1.as](_2_tl_js_1.types.ChatInviteExported), __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
827
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.exportChatInvite", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), title: params?.title, expire_date: params?.expireAt ? (0, _1_utilities_js_1.toUnixTimestamp)(params.expireAt) : undefined, request_needed: params?.requireApproval ? true : undefined, usage_limit: params?.limit });
|
|
828
|
+
return await (0, _3_types_js_1.constructInviteLink)((0, _2_tl_js_1.as)("chatInviteExported", result), __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
1004
829
|
}
|
|
1005
830
|
async getCreatedInviteLinks(chatId, params) {
|
|
1006
831
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("getCreatedInviteLinks");
|
|
1007
|
-
const { invites } = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1008
|
-
|
|
1009
|
-
revoked: params?.revoked ? true : undefined,
|
|
1010
|
-
admin_id: params?.by ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputUser(params.by) : new _2_tl_js_1.types.InputUserEmpty(),
|
|
1011
|
-
limit: params?.limit ?? 100,
|
|
1012
|
-
offset_date: params?.afterDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.afterDate) : undefined,
|
|
1013
|
-
offset_link: params?.afterInviteLink,
|
|
1014
|
-
});
|
|
1015
|
-
return await Promise.all(invites.map((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.ChatInviteExported)).map((v) => (0, _3_types_js_1.constructInviteLink)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity)));
|
|
832
|
+
const { invites } = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.getExportedChatInvites", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), revoked: params?.revoked ? true : undefined, admin_id: params?.by ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputUser(params.by) : { _: "inputUserEmpty" }, limit: params?.limit ?? 100, offset_date: params?.afterDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.afterDate) : undefined, offset_link: params?.afterInviteLink });
|
|
833
|
+
return await Promise.all(invites.map((v) => (0, _2_tl_js_1.as)("chatInviteExported", v)).map((v) => (0, _3_types_js_1.constructInviteLink)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity)));
|
|
1016
834
|
}
|
|
1017
835
|
async joinChat(chatId) {
|
|
1018
836
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("joinChat");
|
|
1019
837
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
1020
|
-
if (
|
|
838
|
+
if ((0, _2_tl_js_1.is)("inputPeerUser", peer)) {
|
|
1021
839
|
throw new _0_errors_js_1.InputError("Cannot join private chats.");
|
|
1022
840
|
}
|
|
1023
|
-
else if (
|
|
1024
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
841
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
842
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.joinChannel", channel: { ...peer, _: "inputChannel" } });
|
|
1025
843
|
}
|
|
1026
|
-
else if (
|
|
1027
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
844
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
845
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.addChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" }, fwd_limit: 0 }); // TODO: use potential high-level method for adding participants to chats
|
|
1028
846
|
}
|
|
1029
847
|
else {
|
|
1030
848
|
(0, _0_deps_js_1.unreachable)();
|
|
@@ -1032,14 +850,14 @@ class MessageManager {
|
|
|
1032
850
|
}
|
|
1033
851
|
async leaveChat(chatId) {
|
|
1034
852
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
1035
|
-
if (
|
|
853
|
+
if ((0, _2_tl_js_1.is)("inputPeerUser", peer)) {
|
|
1036
854
|
throw new _0_errors_js_1.InputError("Cannot leave private chats.");
|
|
1037
855
|
}
|
|
1038
|
-
else if (
|
|
1039
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
856
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
857
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.leaveChannel", channel: { ...peer, _: "inputChannel" } });
|
|
1040
858
|
}
|
|
1041
|
-
else if (
|
|
1042
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
859
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
860
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" } }); // TODO: use potential high-level method for adding participants to chats
|
|
1043
861
|
}
|
|
1044
862
|
else {
|
|
1045
863
|
(0, _0_deps_js_1.unreachable)();
|
|
@@ -1048,32 +866,29 @@ class MessageManager {
|
|
|
1048
866
|
async blockUser(userId) {
|
|
1049
867
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("blockUser");
|
|
1050
868
|
const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
|
|
1051
|
-
if (!(
|
|
869
|
+
if (!((0, _2_tl_js_1.is)("user", id))) {
|
|
1052
870
|
throw new _0_errors_js_1.InputError("Only users can be blocked or unblocked.");
|
|
1053
871
|
}
|
|
1054
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
872
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "contacts.block", id });
|
|
1055
873
|
}
|
|
1056
874
|
async unblockUser(userId) {
|
|
1057
875
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("unblockUser");
|
|
1058
876
|
const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
|
|
1059
|
-
if (!(
|
|
877
|
+
if (!((0, _2_tl_js_1.is)("user", id))) {
|
|
1060
878
|
throw new _0_errors_js_1.InputError("Only users can be blocked or unblocked.");
|
|
1061
879
|
}
|
|
1062
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
880
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "contacts.unblock", id });
|
|
1063
881
|
}
|
|
1064
882
|
async getChatMember(chatId, userId) {
|
|
1065
883
|
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
1066
|
-
if (
|
|
1067
|
-
const { participant } = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1068
|
-
channel: new _2_tl_js_1.types.InputChannel(peer),
|
|
1069
|
-
participant: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId),
|
|
1070
|
-
});
|
|
884
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
|
|
885
|
+
const { participant } = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.getParticipant", channel: { ...peer, _: "inputChannel" }, participant: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId) });
|
|
1071
886
|
return await (0, _3_types_js_2.constructChatMember)(participant, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
1072
887
|
}
|
|
1073
|
-
else if (
|
|
888
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
1074
889
|
const user = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputUser(userId);
|
|
1075
|
-
const fullChat = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1076
|
-
const participant =
|
|
890
|
+
const fullChat = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ ...peer, _: "messages.getFullChat" }).then((v) => (0, _2_tl_js_1.as)("chatFull", v.full_chat));
|
|
891
|
+
const participant = (0, _2_tl_js_1.as)("chatParticipants", fullChat.participants).participants.find((v) => v.user_id == user.user_id);
|
|
1077
892
|
return await (0, _3_types_js_2.constructChatMember)(participant, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
1078
893
|
}
|
|
1079
894
|
else {
|
|
@@ -1082,11 +897,11 @@ class MessageManager {
|
|
|
1082
897
|
}
|
|
1083
898
|
async setChatStickerSet(chatId, setName) {
|
|
1084
899
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
1085
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
900
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetShortName", short_name: setName } });
|
|
1086
901
|
}
|
|
1087
902
|
async deleteChatStickerSet(chatId) {
|
|
1088
903
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
1089
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
904
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetEmpty" } });
|
|
1090
905
|
}
|
|
1091
906
|
async stopPoll(chatId, messageId, params) {
|
|
1092
907
|
const message = await this.getMessage(chatId, messageId);
|
|
@@ -1099,39 +914,14 @@ class MessageManager {
|
|
|
1099
914
|
if (message.poll.isClosed) {
|
|
1100
915
|
throw new _0_errors_js_1.InputError("Poll is already stopped.");
|
|
1101
916
|
}
|
|
1102
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1103
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
1104
|
-
id: messageId,
|
|
1105
|
-
media: new _2_tl_js_1.types.InputMediaPoll({
|
|
1106
|
-
poll: new _2_tl_js_1.types.Poll({
|
|
1107
|
-
id: BigInt(message.poll.id),
|
|
1108
|
-
closed: true,
|
|
1109
|
-
question: "",
|
|
1110
|
-
answers: [],
|
|
1111
|
-
}),
|
|
1112
|
-
}),
|
|
1113
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
1114
|
-
});
|
|
917
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editMessage", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), id: messageId, media: ({ _: "inputMediaPoll", poll: ({ _: "poll", id: BigInt(message.poll.id), closed: true, question: "", answers: [] }) }), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
1115
918
|
const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
1116
919
|
return (0, _3_types_js_2.assertMessageType)(message_, "poll").poll;
|
|
1117
920
|
}
|
|
1118
921
|
async editMessageLiveLocation(chatId, messageId, latitude, longitude, params) {
|
|
1119
922
|
const message = await this.getMessage(chatId, messageId);
|
|
1120
923
|
if (message && "location" in message && message.location.livePeriod) {
|
|
1121
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1122
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
1123
|
-
id: messageId,
|
|
1124
|
-
media: new _2_tl_js_1.types.InputMediaGeoLive({
|
|
1125
|
-
geo_point: new _2_tl_js_1.types.InputGeoPoint({
|
|
1126
|
-
lat: latitude,
|
|
1127
|
-
long: longitude,
|
|
1128
|
-
accuracy_radius: params?.horizontalAccuracy,
|
|
1129
|
-
}),
|
|
1130
|
-
heading: params?.heading,
|
|
1131
|
-
proximity_notification_radius: params?.proximityAlertRadius,
|
|
1132
|
-
}),
|
|
1133
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
1134
|
-
});
|
|
924
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editMessage", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), id: messageId, media: ({ _: "inputMediaGeoLive", geo_point: ({ _: "inputGeoPoint", lat: latitude, long: longitude, accuracy_radius: params?.horizontalAccuracy }), heading: params?.heading, proximity_notification_radius: params?.proximityAlertRadius }), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
1135
925
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
1136
926
|
return (0, _3_types_js_2.assertMessageType)(message, "location");
|
|
1137
927
|
}
|
|
@@ -1140,44 +930,32 @@ class MessageManager {
|
|
|
1140
930
|
async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
|
|
1141
931
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageLiveLocation");
|
|
1142
932
|
const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
|
|
1143
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1144
|
-
id,
|
|
1145
|
-
media: new _2_tl_js_1.types.InputMediaGeoLive({
|
|
1146
|
-
geo_point: new _2_tl_js_1.types.InputGeoPoint({
|
|
1147
|
-
lat: latitude,
|
|
1148
|
-
long: longitude,
|
|
1149
|
-
accuracy_radius: params?.horizontalAccuracy,
|
|
1150
|
-
}),
|
|
1151
|
-
heading: params?.heading,
|
|
1152
|
-
proximity_notification_radius: params?.proximityAlertRadius,
|
|
1153
|
-
}),
|
|
1154
|
-
reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
|
|
1155
|
-
});
|
|
933
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: ({ _: "inputMediaGeoLive", geo_point: ({ _: "inputGeoPoint", lat: latitude, long: longitude, accuracy_radius: params?.horizontalAccuracy }), heading: params?.heading, proximity_notification_radius: params?.proximityAlertRadius }), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
|
|
1156
934
|
}
|
|
1157
935
|
}
|
|
1158
936
|
exports.MessageManager = MessageManager;
|
|
1159
937
|
_MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(), _MessageManager_instances = new WeakSet(), _MessageManager_updatesToMessages = async function _MessageManager_updatesToMessages(chatId, updates, businessConnectionId) {
|
|
1160
938
|
const messages = new Array();
|
|
1161
|
-
if (
|
|
939
|
+
if ((0, _2_tl_js_1.is)("updates", updates)) {
|
|
1162
940
|
for (const update of updates.updates) {
|
|
1163
|
-
if ("message" in update &&
|
|
941
|
+
if ("message" in update && (0, _2_tl_js_1.is)("messageEmpty", update.message)) {
|
|
1164
942
|
continue;
|
|
1165
943
|
}
|
|
1166
|
-
if (
|
|
944
|
+
if ((0, _2_tl_js_1.is)("updateNewMessage", update) || (0, _2_tl_js_1.is)("updateEditMessage", update)) {
|
|
1167
945
|
messages.push(await this.constructMessage(update.message));
|
|
1168
946
|
}
|
|
1169
|
-
else if (
|
|
947
|
+
else if ((0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateEditChannelMessage", update)) {
|
|
1170
948
|
messages.push(await this.constructMessage(update.message));
|
|
1171
949
|
}
|
|
1172
|
-
else if (
|
|
950
|
+
else if ((0, _2_tl_js_1.is)("updateBotNewBusinessMessage", update)) {
|
|
1173
951
|
messages.push(await this.constructMessage(update.message, false, { connectionId: businessConnectionId ?? update.connection_id, replyToMessage: update.reply_to_message }));
|
|
1174
952
|
}
|
|
1175
|
-
else if (
|
|
953
|
+
else if ((0, _2_tl_js_1.is)("updateBotEditBusinessMessage", update)) {
|
|
1176
954
|
messages.push(await this.constructMessage(update.message, false, { connectionId: businessConnectionId ?? update.connection_id, replyToMessage: update.reply_to_message }));
|
|
1177
955
|
}
|
|
1178
956
|
}
|
|
1179
957
|
}
|
|
1180
|
-
else if (
|
|
958
|
+
else if ((0, _2_tl_js_1.is)("updateShortSentMessage", updates)) {
|
|
1181
959
|
const message = await this.getMessage(chatId, updates.id);
|
|
1182
960
|
if (message != null) {
|
|
1183
961
|
messages.push(message);
|
|
@@ -1198,7 +976,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1198
976
|
}, _MessageManager_constructReplyTo = async function _MessageManager_constructReplyTo(params) {
|
|
1199
977
|
const topMsgId = params?.messageThreadId;
|
|
1200
978
|
const replyToMsgId = params?.replyToMessageId;
|
|
1201
|
-
return replyToMsgId !== undefined ?
|
|
979
|
+
return replyToMsgId !== undefined ? ({ _: "inputReplyToMessage", reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId, quote_text: params?.replyQuote?.text, quote_entities: await Promise.all(params?.replyQuote?.entities.map((v) => (0, _3_types_js_2.messageEntityToTlObject)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity)) ?? []), quote_offset: params?.replyQuote?.offset }) : undefined;
|
|
1202
980
|
}, _MessageManager_sendDocumentInner = async function _MessageManager_sendDocumentInner(chatId, document, params, fileType, otherAttribs, urlSupported = true, expectedMimeTypes) {
|
|
1203
981
|
let media = null;
|
|
1204
982
|
const spoiler = params?.hasSpoiler ? true : undefined;
|
|
@@ -1206,12 +984,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1206
984
|
if (typeof document === "string") {
|
|
1207
985
|
const fileId = this.resolveFileId(document, fileType);
|
|
1208
986
|
if (fileId != null) {
|
|
1209
|
-
media =
|
|
1210
|
-
id: new _2_tl_js_1.types.InputDocument(fileId),
|
|
1211
|
-
spoiler,
|
|
1212
|
-
query: otherAttribs.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeSticker)?.alt || undefined,
|
|
1213
|
-
ttl_seconds,
|
|
1214
|
-
});
|
|
987
|
+
media = { _: "inputMediaDocument", id: { ...fileId, _: "inputDocument" }, spoiler, query: otherAttribs.find((v) => (0, _2_tl_js_1.is)("documentAttributeSticker", v))?.alt || undefined, ttl_seconds };
|
|
1215
988
|
}
|
|
1216
989
|
}
|
|
1217
990
|
if (media == null) {
|
|
@@ -1219,7 +992,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1219
992
|
if (!urlSupported) {
|
|
1220
993
|
throw new _0_errors_js_1.InputError("URL not supported.");
|
|
1221
994
|
}
|
|
1222
|
-
media =
|
|
995
|
+
media = { _: "inputMediaDocumentExternal", url: document, spoiler, ttl_seconds };
|
|
1223
996
|
}
|
|
1224
997
|
else {
|
|
1225
998
|
let mimeType;
|
|
@@ -1237,15 +1010,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1237
1010
|
if (params?.thumbnail) {
|
|
1238
1011
|
thumb = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(params.thumbnail, { chunkSize: params?.chunkSize, signal: params?.signal });
|
|
1239
1012
|
}
|
|
1240
|
-
media =
|
|
1241
|
-
file,
|
|
1242
|
-
thumb,
|
|
1243
|
-
spoiler,
|
|
1244
|
-
attributes: [new _2_tl_js_1.types.DocumentAttributeFilename({ file_name: file.name }), ...otherAttribs],
|
|
1245
|
-
mime_type: mimeType,
|
|
1246
|
-
force_file: fileType == _3_types_js_2.FileType.Document ? true : undefined,
|
|
1247
|
-
ttl_seconds,
|
|
1248
|
-
});
|
|
1013
|
+
media = { _: "inputMediaUploadedDocument", file, thumb, spoiler, attributes: [{ _: "documentAttributeFilename", file_name: file.name }, ...otherAttribs], mime_type: mimeType, force_file: fileType == _3_types_js_2.FileType.Document ? true : undefined, ttl_seconds };
|
|
1249
1014
|
}
|
|
1250
1015
|
}
|
|
1251
1016
|
const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendMedia).call(this, chatId, media, params);
|
|
@@ -1255,13 +1020,14 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1255
1020
|
const randomId = (0, _1_utilities_js_1.getRandomId)();
|
|
1256
1021
|
const silent = params?.disableNotification ? true : undefined;
|
|
1257
1022
|
const noforwards = params?.protectContent ? true : undefined;
|
|
1258
|
-
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
1023
|
+
const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined;
|
|
1259
1024
|
const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
|
|
1260
1025
|
const caption_ = params?.caption;
|
|
1261
1026
|
const parseResult = caption_ !== undefined ? await this.parseText(caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
|
|
1262
1027
|
const caption = parseResult === undefined ? undefined : parseResult[0];
|
|
1263
1028
|
const captionEntities = parseResult === undefined ? undefined : parseResult[1];
|
|
1264
|
-
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(
|
|
1029
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({
|
|
1030
|
+
_: "messages.sendMedia",
|
|
1265
1031
|
peer,
|
|
1266
1032
|
random_id: randomId,
|
|
1267
1033
|
silent,
|
|
@@ -1272,7 +1038,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1272
1038
|
media,
|
|
1273
1039
|
message: caption ?? "",
|
|
1274
1040
|
entities: captionEntities,
|
|
1275
|
-
}
|
|
1041
|
+
}, params?.businessConnectionId);
|
|
1276
1042
|
return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
|
|
1277
1043
|
}, _MessageManager_resolveInputMediaInner = async function _MessageManager_resolveInputMediaInner(document, media, fileType, otherAttribs) {
|
|
1278
1044
|
let media_ = null;
|
|
@@ -1280,16 +1046,12 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1280
1046
|
if (typeof document === "string") {
|
|
1281
1047
|
const fileId = this.resolveFileId(document, fileType);
|
|
1282
1048
|
if (fileId != null) {
|
|
1283
|
-
media_ =
|
|
1284
|
-
id: new _2_tl_js_1.types.InputDocument(fileId),
|
|
1285
|
-
spoiler,
|
|
1286
|
-
query: otherAttribs.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeSticker)?.alt || undefined,
|
|
1287
|
-
});
|
|
1049
|
+
media_ = { _: "inputMediaDocument", id: { ...fileId, _: "inputDocument" }, spoiler, query: otherAttribs.find((v) => (0, _2_tl_js_1.is)("documentAttributeSticker", v))?.alt || undefined };
|
|
1288
1050
|
}
|
|
1289
1051
|
}
|
|
1290
1052
|
if (media_ == null) {
|
|
1291
1053
|
if (typeof document === "string" && (0, _0_utilities_js_3.isHttpUrl)(document)) {
|
|
1292
|
-
media_ =
|
|
1054
|
+
media_ = { _: "inputMediaDocumentExternal", url: document, spoiler };
|
|
1293
1055
|
}
|
|
1294
1056
|
else {
|
|
1295
1057
|
let mimeType;
|
|
@@ -1304,36 +1066,20 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1304
1066
|
if ("thumbnail" in media && media.thumbnail) {
|
|
1305
1067
|
thumb = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(media.thumbnail, { chunkSize: media?.chunkSize, signal: media?.signal });
|
|
1306
1068
|
}
|
|
1307
|
-
media_ =
|
|
1308
|
-
file,
|
|
1309
|
-
thumb,
|
|
1310
|
-
spoiler,
|
|
1311
|
-
attributes: [new _2_tl_js_1.types.DocumentAttributeFilename({ file_name: file.name }), ...otherAttribs],
|
|
1312
|
-
mime_type: mimeType,
|
|
1313
|
-
force_file: fileType == _3_types_js_2.FileType.Document ? true : undefined,
|
|
1314
|
-
});
|
|
1069
|
+
media_ = { _: "inputMediaUploadedDocument", file, thumb, spoiler, attributes: [{ _: "documentAttributeFilename", file_name: file.name }, ...otherAttribs], mime_type: mimeType, force_file: fileType == _3_types_js_2.FileType.Document ? true : undefined };
|
|
1315
1070
|
}
|
|
1316
1071
|
}
|
|
1317
1072
|
return media_;
|
|
1318
1073
|
}, _MessageManager_resolveInputMedia = async function _MessageManager_resolveInputMedia(media) {
|
|
1319
1074
|
if ("animation" in media) {
|
|
1320
1075
|
return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMediaInner).call(this, media.animation, media, _3_types_js_2.FileType.Animation, [
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
supports_streaming: true,
|
|
1324
|
-
w: media?.width ?? 0,
|
|
1325
|
-
h: media?.height ?? 0,
|
|
1326
|
-
duration: media?.duration ?? 0,
|
|
1327
|
-
}),
|
|
1076
|
+
{ _: "documentAttributeAnimated" },
|
|
1077
|
+
{ _: "documentAttributeVideo", supports_streaming: true, w: media?.width ?? 0, h: media?.height ?? 0, duration: media?.duration ?? 0 },
|
|
1328
1078
|
]);
|
|
1329
1079
|
}
|
|
1330
1080
|
else if ("audio" in media) {
|
|
1331
1081
|
return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMediaInner).call(this, media.audio, media, _3_types_js_2.FileType.Audio, [
|
|
1332
|
-
|
|
1333
|
-
duration: media?.duration ?? 0,
|
|
1334
|
-
performer: media?.performer,
|
|
1335
|
-
title: media?.title,
|
|
1336
|
-
}),
|
|
1082
|
+
{ _: "documentAttributeAudio", duration: media?.duration ?? 0, performer: media?.performer, title: media?.title },
|
|
1337
1083
|
]);
|
|
1338
1084
|
}
|
|
1339
1085
|
else if ("document" in media) {
|
|
@@ -1346,20 +1092,16 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1346
1092
|
if (typeof media.photo === "string") {
|
|
1347
1093
|
const fileId = this.resolveFileId(media.photo, [_3_types_js_2.FileType.Photo, _3_types_js_2.FileType.ProfilePhoto]);
|
|
1348
1094
|
if (fileId != null) {
|
|
1349
|
-
media_ =
|
|
1350
|
-
id: new _2_tl_js_1.types.InputPhoto(fileId),
|
|
1351
|
-
spoiler,
|
|
1352
|
-
ttl_seconds,
|
|
1353
|
-
});
|
|
1095
|
+
media_ = { _: "inputMediaPhoto", id: { ...fileId, _: "inputPhoto" }, spoiler, ttl_seconds };
|
|
1354
1096
|
}
|
|
1355
1097
|
}
|
|
1356
1098
|
if (media_ == null) {
|
|
1357
1099
|
if (typeof media.photo === "string" && (0, _0_utilities_js_3.isHttpUrl)(media.photo)) {
|
|
1358
|
-
media_ =
|
|
1100
|
+
media_ = { _: "inputMediaPhotoExternal", url: media.photo, spoiler };
|
|
1359
1101
|
}
|
|
1360
1102
|
else {
|
|
1361
1103
|
const file = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(media.photo, media, null, false);
|
|
1362
|
-
media_ =
|
|
1104
|
+
media_ = { _: "inputMediaUploadedPhoto", file, spoiler, ttl_seconds };
|
|
1363
1105
|
}
|
|
1364
1106
|
}
|
|
1365
1107
|
return media_;
|
|
@@ -1367,12 +1109,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1367
1109
|
else if ("video" in media) {
|
|
1368
1110
|
const ttl_seconds = "selfDestruct" in media && media.selfDestruct !== undefined ? (0, _3_types_js_1.selfDestructOptionToInt)(media.selfDestruct) : undefined;
|
|
1369
1111
|
const media_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMediaInner).call(this, media.video, media, _3_types_js_2.FileType.Video, [
|
|
1370
|
-
|
|
1371
|
-
supports_streaming: media?.supportsStreaming ? true : undefined,
|
|
1372
|
-
w: media?.width ?? 0,
|
|
1373
|
-
h: media?.height ?? 0,
|
|
1374
|
-
duration: media?.duration ?? 0,
|
|
1375
|
-
}),
|
|
1112
|
+
{ _: "documentAttributeVideo", supports_streaming: media?.supportsStreaming ? true : undefined, w: media?.width ?? 0, h: media?.height ?? 0, duration: media?.duration ?? 0 },
|
|
1376
1113
|
]);
|
|
1377
1114
|
media_.ttl_seconds = ttl_seconds;
|
|
1378
1115
|
return media_;
|
|
@@ -1381,14 +1118,8 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
|
|
|
1381
1118
|
(0, _0_deps_js_1.unreachable)();
|
|
1382
1119
|
}
|
|
1383
1120
|
}, _MessageManager_sendReaction = async function _MessageManager_sendReaction(chatId, messageId, reactions, params) {
|
|
1384
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1385
|
-
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
1386
|
-
msg_id: (0, _0_utilities_js_1.checkMessageId)(messageId),
|
|
1387
|
-
reaction: reactions.map((v) => (0, _3_types_js_2.reactionToTlObject)(v)),
|
|
1388
|
-
big: params?.big ? true : undefined,
|
|
1389
|
-
add_to_recent: params?.addToRecents ? true : undefined,
|
|
1390
|
-
});
|
|
1121
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.sendReaction", peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), msg_id: (0, _0_utilities_js_1.checkMessageId)(messageId), reaction: reactions.map((v) => (0, _3_types_js_2.reactionToTlObject)(v)), big: params?.big ? true : undefined, add_to_recent: params?.addToRecents ? true : undefined });
|
|
1391
1122
|
}, _MessageManager_toggleJoinRequests = async function _MessageManager_toggleJoinRequests(chatId, enabled) {
|
|
1392
1123
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
1393
|
-
await __classPrivateFieldGet(this, _MessageManager_c, "f").
|
|
1124
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "channels.toggleJoinRequest", channel, enabled });
|
|
1394
1125
|
};
|