@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
|
@@ -99,7 +99,7 @@ function assertMessageType(message, type) {
|
|
|
99
99
|
}
|
|
100
100
|
exports.assertMessageType = assertMessageType;
|
|
101
101
|
async function getSender(message_, getEntity) {
|
|
102
|
-
if (
|
|
102
|
+
if ((0, _2_tl_js_1.is)("peerUser", message_.from_id)) {
|
|
103
103
|
const entity = await getEntity(message_.from_id);
|
|
104
104
|
if (entity) {
|
|
105
105
|
return { from: (0, _1_user_js_1.constructUser)(entity) };
|
|
@@ -108,7 +108,7 @@ async function getSender(message_, getEntity) {
|
|
|
108
108
|
(0, _0_deps_js_1.unreachable)();
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
else if (
|
|
111
|
+
else if ((0, _2_tl_js_1.is)("peerChannel", message_.from_id)) {
|
|
112
112
|
const entity = await getEntity(message_.from_id);
|
|
113
113
|
if (entity) {
|
|
114
114
|
return { senderChat: (0, _1_chat_p_js_1.constructChatP)(entity) };
|
|
@@ -117,9 +117,18 @@ async function getSender(message_, getEntity) {
|
|
|
117
117
|
(0, _0_deps_js_1.unreachable)();
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
else if ((0, _2_tl_js_1.is)("peerUser", message_.peer_id)) {
|
|
121
|
+
const entity = await getEntity(message_.peer_id);
|
|
122
|
+
if (entity) {
|
|
123
|
+
return { from: (0, _1_user_js_1.constructUser)(entity) };
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
(0, _0_deps_js_1.unreachable)();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
120
129
|
}
|
|
121
130
|
async function getReply(message_, chat, getMessage) {
|
|
122
|
-
if (getMessage &&
|
|
131
|
+
if (getMessage && (0, _2_tl_js_1.is)("messageReplyHeader", message_.reply_to) && message_.reply_to.reply_to_msg_id) {
|
|
123
132
|
let isTopicMessage = false;
|
|
124
133
|
if (message_.reply_to.forum_topic) {
|
|
125
134
|
isTopicMessage = true;
|
|
@@ -143,11 +152,11 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
143
152
|
isTopicMessage: false,
|
|
144
153
|
};
|
|
145
154
|
Object.assign(message, await getSender(message_, getEntity));
|
|
146
|
-
if (
|
|
155
|
+
if ((0, _2_tl_js_1.is)("messageActionChatAddUser", message_.action) || (0, _2_tl_js_1.is)("messageActionChatJoinedByLink", message_.action) || (0, _2_tl_js_1.is)("messageActionChatJoinedByRequest", message_.action)) {
|
|
147
156
|
const newChatMembers = new Array();
|
|
148
157
|
const users = "users" in message_.action ? message_.action.users : [message_.from_id && "user_id" in message_.from_id ? message_.from_id.user_id : (0, _0_deps_js_1.unreachable)()];
|
|
149
158
|
for (const user_ of users) {
|
|
150
|
-
const entity = await getEntity(
|
|
159
|
+
const entity = await getEntity({ _: "peerUser", user_id: user_ });
|
|
151
160
|
if (entity) {
|
|
152
161
|
const user = (0, _1_user_js_1.constructUser)(entity);
|
|
153
162
|
newChatMembers.push(user);
|
|
@@ -158,31 +167,31 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
158
167
|
}
|
|
159
168
|
return { ...message, newChatMembers };
|
|
160
169
|
}
|
|
161
|
-
else if (
|
|
162
|
-
const entity = await getEntity(
|
|
170
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatDeleteUser", message_.action)) {
|
|
171
|
+
const entity = await getEntity({ _: "peerUser", user_id: message_.action.user_id });
|
|
163
172
|
if (entity) {
|
|
164
173
|
const user = (0, _1_user_js_1.constructUser)(entity);
|
|
165
174
|
const leftChatMember = user;
|
|
166
175
|
return { ...message, leftChatMember };
|
|
167
176
|
}
|
|
168
177
|
}
|
|
169
|
-
else if (
|
|
178
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatEditTitle", message_.action)) {
|
|
170
179
|
const newChatTitle = message_.action.title;
|
|
171
180
|
return { ...message, newChatTitle };
|
|
172
181
|
}
|
|
173
|
-
else if (
|
|
174
|
-
const newChatPhoto = (0, _1_photo_js_1.constructPhoto)(
|
|
182
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatEditPhoto", message_.action)) {
|
|
183
|
+
const newChatPhoto = (0, _1_photo_js_1.constructPhoto)((0, _2_tl_js_1.as)("photo", message_.action.photo));
|
|
175
184
|
return { ...message, newChatPhoto };
|
|
176
185
|
}
|
|
177
|
-
else if (
|
|
186
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatDeletePhoto", message_.action)) {
|
|
178
187
|
const deletedChatPhoto = true;
|
|
179
188
|
return { ...message, deletedChatPhoto };
|
|
180
189
|
}
|
|
181
|
-
else if (
|
|
190
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatCreate", message_.action)) {
|
|
182
191
|
const groupCreated = true;
|
|
183
192
|
const newChatMembers = new Array();
|
|
184
193
|
for (const user_ of message_.action.users) {
|
|
185
|
-
const entity = await getEntity(
|
|
194
|
+
const entity = await getEntity({ _: "peerUser", user_id: user_ });
|
|
186
195
|
if (entity) {
|
|
187
196
|
const user = (0, _1_user_js_1.constructUser)(entity);
|
|
188
197
|
newChatMembers.push(user);
|
|
@@ -190,7 +199,7 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
190
199
|
}
|
|
191
200
|
return { ...message, groupCreated, newChatMembers };
|
|
192
201
|
}
|
|
193
|
-
else if (
|
|
202
|
+
else if ((0, _2_tl_js_1.is)("messageActionChannelCreate", message_.action)) {
|
|
194
203
|
if (message.chat.type == "channel") {
|
|
195
204
|
const channelCreated = true;
|
|
196
205
|
return { ...message, channelCreated };
|
|
@@ -203,32 +212,32 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
203
212
|
// unreachable();
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
|
-
else if (
|
|
215
|
+
else if ((0, _2_tl_js_1.is)("messageActionChatMigrateTo", message_.action)) {
|
|
207
216
|
const chatMigratedTo = _1_utilities_js_1.ZERO_CHANNEL_ID + Number(-message_.action.channel_id);
|
|
208
217
|
return { ...message, chatMigratedTo };
|
|
209
218
|
}
|
|
210
|
-
else if (
|
|
219
|
+
else if ((0, _2_tl_js_1.is)("messageActionChannelMigrateFrom", message_.action)) {
|
|
211
220
|
const chatMigratedFrom = Number(-message_.action.chat_id);
|
|
212
221
|
return { ...message, chatMigratedFrom };
|
|
213
222
|
}
|
|
214
|
-
else if (
|
|
223
|
+
else if ((0, _2_tl_js_1.is)("messageActionPinMessage", message_.action)) {
|
|
215
224
|
const { replyToMessage } = await getReply(message_, chat, getMessage);
|
|
216
225
|
if (replyToMessage) {
|
|
217
226
|
const pinnedMessage = replyToMessage;
|
|
218
227
|
return { ...message, pinnedMessage };
|
|
219
228
|
}
|
|
220
229
|
}
|
|
221
|
-
else if (
|
|
222
|
-
const user = message_.action.peers[0]
|
|
230
|
+
else if ((0, _2_tl_js_1.is)("messageActionRequestedPeer", message_.action)) {
|
|
231
|
+
const user = (0, _2_tl_js_1.as)("peerUser", message_.action.peers[0]);
|
|
223
232
|
const userShared = { requestId: message_.action.button_id, userId: Number(user.user_id) };
|
|
224
233
|
return { ...message, userShared };
|
|
225
234
|
}
|
|
226
|
-
else if (
|
|
227
|
-
const miniAppName = message_.action.app ?
|
|
235
|
+
else if ((0, _2_tl_js_1.is)("messageActionBotAllowed", message_.action)) {
|
|
236
|
+
const miniAppName = message_.action.app ? (0, _2_tl_js_1.as)("botApp", message_.action.app).title : undefined;
|
|
228
237
|
const writeAccessAllowed = { miniAppName };
|
|
229
238
|
return { ...message, writeAccessAllowed };
|
|
230
239
|
}
|
|
231
|
-
else if (
|
|
240
|
+
else if ((0, _2_tl_js_1.is)("messageActionTopicCreate", message_.action)) {
|
|
232
241
|
const forumTopicCreated = {
|
|
233
242
|
name: message_.action.title,
|
|
234
243
|
iconColor: "#" + message_.action.icon_color.toString(16).padStart(6, "0"),
|
|
@@ -236,7 +245,7 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
236
245
|
};
|
|
237
246
|
return { ...message, forumTopicCreated };
|
|
238
247
|
}
|
|
239
|
-
else if (
|
|
248
|
+
else if ((0, _2_tl_js_1.is)("messageActionTopicEdit", message_.action)) {
|
|
240
249
|
if (message_.action.closed) {
|
|
241
250
|
const forumTopicClosed = true;
|
|
242
251
|
return { ...message, forumTopicClosed };
|
|
@@ -253,11 +262,11 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
253
262
|
return { ...message, forumTopicReopened };
|
|
254
263
|
}
|
|
255
264
|
}
|
|
256
|
-
else if (
|
|
265
|
+
else if ((0, _2_tl_js_1.is)("messageActionGroupCallScheduled", message_.action)) {
|
|
257
266
|
const videoChatScheduled = { startDate: new Date(message_.action.schedule_date * 1000) };
|
|
258
267
|
return { ...message, videoChatScheduled };
|
|
259
268
|
}
|
|
260
|
-
else if (
|
|
269
|
+
else if ((0, _2_tl_js_1.is)("messageActionGroupCall", message_.action)) {
|
|
261
270
|
if (message_.action.duration) {
|
|
262
271
|
const videoChatEnded = { duration: message_.action.duration };
|
|
263
272
|
return { ...message, videoChatEnded };
|
|
@@ -267,19 +276,19 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
267
276
|
return { ...message, videoChatStarted };
|
|
268
277
|
}
|
|
269
278
|
}
|
|
270
|
-
else if (
|
|
279
|
+
else if ((0, _2_tl_js_1.is)("messageActionSetMessagesTTL", message_.action)) {
|
|
271
280
|
const newAutoDeleteTime = message_.action.period || 0;
|
|
272
281
|
return { ...message, newAutoDeleteTime };
|
|
273
282
|
}
|
|
274
283
|
return { ...message, unsupported: true };
|
|
275
284
|
}
|
|
276
285
|
async function constructMessage(message_, getEntity, getMessage, getStickerSetName, getReply_ = true, business) {
|
|
277
|
-
if (!(
|
|
286
|
+
if (!((0, _2_tl_js_1.is)("message", message_)) && !((0, _2_tl_js_1.is)("messageService", message_))) {
|
|
278
287
|
(0, _0_deps_js_1.unreachable)();
|
|
279
288
|
}
|
|
280
289
|
let link;
|
|
281
290
|
let chat_ = null;
|
|
282
|
-
if (
|
|
291
|
+
if ((0, _2_tl_js_1.is)("peerUser", message_.peer_id)) {
|
|
283
292
|
const entity = await getEntity(message_.peer_id);
|
|
284
293
|
if (entity) {
|
|
285
294
|
chat_ = (0, _1_chat_p_js_1.constructChatP)(entity);
|
|
@@ -288,7 +297,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
288
297
|
(0, _0_deps_js_1.unreachable)();
|
|
289
298
|
}
|
|
290
299
|
}
|
|
291
|
-
else if (
|
|
300
|
+
else if ((0, _2_tl_js_1.is)("peerChat", message_.peer_id)) {
|
|
292
301
|
const entity = await getEntity(message_.peer_id);
|
|
293
302
|
if (entity) {
|
|
294
303
|
chat_ = (0, _1_chat_p_js_1.constructChatP)(entity);
|
|
@@ -297,7 +306,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
297
306
|
(0, _0_deps_js_1.unreachable)();
|
|
298
307
|
}
|
|
299
308
|
}
|
|
300
|
-
else if (
|
|
309
|
+
else if ((0, _2_tl_js_1.is)("peerChannel", message_.peer_id)) {
|
|
301
310
|
link = `https://t.me/c/${message_.peer_id.channel_id}/${message_.id}`;
|
|
302
311
|
const entity = await getEntity(message_.peer_id);
|
|
303
312
|
if (entity) {
|
|
@@ -310,7 +319,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
310
319
|
else {
|
|
311
320
|
(0, _0_deps_js_1.unreachable)();
|
|
312
321
|
}
|
|
313
|
-
if (
|
|
322
|
+
if ((0, _2_tl_js_1.is)("messageService", message_)) {
|
|
314
323
|
return await constructServiceMessage(message_, chat_, getEntity, getMessage);
|
|
315
324
|
}
|
|
316
325
|
const message = {
|
|
@@ -321,7 +330,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
321
330
|
date: (0, _1_utilities_js_1.fromUnixTimestamp)(message_.date),
|
|
322
331
|
views: message_.views,
|
|
323
332
|
forwards: message_.forwards,
|
|
324
|
-
isTopicMessage: message_.reply_to &&
|
|
333
|
+
isTopicMessage: message_.reply_to && (0, _2_tl_js_1.is)("messageReplyHeader", message_.reply_to) && message_.reply_to.reply_to_top_id ? true : false,
|
|
325
334
|
hasProtectedContent: message_.noforwards || false,
|
|
326
335
|
senderBoostCount: message_.from_boosts_applied,
|
|
327
336
|
};
|
|
@@ -329,7 +338,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
329
338
|
const recentReactions = message_.reactions.recent_reactions ?? [];
|
|
330
339
|
message.reactions = message_.reactions.results.map((v) => (0, _1_message_reaction_js_1.constructMessageReaction)(v, recentReactions));
|
|
331
340
|
}
|
|
332
|
-
if (
|
|
341
|
+
if ((0, _2_tl_js_1.is)("messageReplyHeader", message_.reply_to) && message_.reply_to.reply_to_msg_id) {
|
|
333
342
|
if (message_.reply_to.quote) {
|
|
334
343
|
message.replyQuote = (0, _1_reply_quote_js_1.constructReplyQuote)(message_.reply_to.quote_text, message_.reply_to.quote_offset, message_.reply_to.quote_entities);
|
|
335
344
|
}
|
|
@@ -350,7 +359,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
350
359
|
message.replyMarkup = (0, _3_reply_markup_js_1.constructReplyMarkup)(message_.reply_markup);
|
|
351
360
|
}
|
|
352
361
|
if (message_.via_bot_id != undefined) {
|
|
353
|
-
const viaBot = await getEntity(
|
|
362
|
+
const viaBot = await getEntity({ _: "peerUser", user_id: message_.via_bot_id });
|
|
354
363
|
if (viaBot) {
|
|
355
364
|
message.viaBot = (0, _1_user_js_1.constructUser)(viaBot);
|
|
356
365
|
}
|
|
@@ -359,7 +368,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
359
368
|
}
|
|
360
369
|
}
|
|
361
370
|
if (message_.via_business_bot_id != undefined) {
|
|
362
|
-
const viaBusinessBot = await getEntity(
|
|
371
|
+
const viaBusinessBot = await getEntity({ _: "peerUser", user_id: message_.via_business_bot_id });
|
|
363
372
|
if (viaBusinessBot) {
|
|
364
373
|
message.viaBusinessBot = (0, _1_user_js_1.constructUser)(viaBusinessBot);
|
|
365
374
|
}
|
|
@@ -370,25 +379,25 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
370
379
|
if (message_.post_author != undefined) {
|
|
371
380
|
message.authorSignature = message_.post_author;
|
|
372
381
|
}
|
|
373
|
-
if (
|
|
382
|
+
if ((0, _2_tl_js_1.is)("messageFwdHeader", message_.fwd_from)) {
|
|
374
383
|
message.isAutomaticForward = message_.fwd_from.saved_from_peer != undefined && message_.fwd_from.saved_from_msg_id != undefined;
|
|
375
384
|
message.forwardSenderName = message_.fwd_from.from_name;
|
|
376
385
|
message.forwardId = message_.fwd_from.channel_post;
|
|
377
386
|
message.forwardSignature = message_.fwd_from.post_author;
|
|
378
387
|
message.forwardDate = (0, _1_utilities_js_1.fromUnixTimestamp)(message_.fwd_from.date);
|
|
379
|
-
if (message_.fwd_from.from_id
|
|
388
|
+
if ((0, _2_tl_js_1.is)("peerUser", message_.fwd_from.from_id)) {
|
|
380
389
|
const entity = await getEntity(message_.fwd_from.from_id);
|
|
381
390
|
if (entity) {
|
|
382
391
|
message.forwardFrom = (0, _1_user_js_1.constructUser)(entity);
|
|
383
392
|
}
|
|
384
393
|
}
|
|
385
|
-
else if (message_.fwd_from.from_id
|
|
394
|
+
else if ((0, _2_tl_js_1.is)("peerChat", message_.fwd_from.from_id)) {
|
|
386
395
|
const entity = await getEntity(message_.fwd_from.from_id);
|
|
387
396
|
if (entity) {
|
|
388
397
|
message.forwardFromChat = (0, _1_chat_p_js_1.constructChatP)(entity);
|
|
389
398
|
}
|
|
390
399
|
}
|
|
391
|
-
else if (message_.fwd_from.from_id
|
|
400
|
+
else if ((0, _2_tl_js_1.is)("peerChannel", message_.fwd_from.from_id)) {
|
|
392
401
|
const entity = await getEntity(message_.fwd_from.from_id);
|
|
393
402
|
if (entity) {
|
|
394
403
|
message.forwardFromChat = (0, _1_chat_p_js_1.constructChatP)(entity);
|
|
@@ -414,35 +423,35 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
414
423
|
caption: message_.message,
|
|
415
424
|
captionEntities: message_.entities?.map(_0_message_entity_js_1.constructMessageEntity).filter((v) => !!v) ?? [],
|
|
416
425
|
};
|
|
417
|
-
if (
|
|
426
|
+
if ((0, _2_tl_js_1.is)("messageMediaPhoto", message_.media) || (0, _2_tl_js_1.is)("messageMediaDocument", message_.media)) {
|
|
418
427
|
messageMedia.hasMediaSpoiler = message_.media.spoiler || false;
|
|
419
428
|
}
|
|
420
429
|
let m = null;
|
|
421
|
-
if (
|
|
430
|
+
if ((0, _2_tl_js_1.is)("messageMediaPhoto", message_.media)) {
|
|
422
431
|
if (!message_.media.photo) {
|
|
423
432
|
(0, _0_deps_js_1.unreachable)();
|
|
424
433
|
}
|
|
425
|
-
const photo = (0, _1_photo_js_1.constructPhoto)(
|
|
434
|
+
const photo = (0, _1_photo_js_1.constructPhoto)((0, _2_tl_js_1.as)("photo", message_.media.photo));
|
|
426
435
|
m = { ...messageMedia, photo };
|
|
427
436
|
}
|
|
428
|
-
else if (
|
|
437
|
+
else if ((0, _2_tl_js_1.is)("messageMediaDice", message_.media)) {
|
|
429
438
|
const dice = (0, _0_dice_js_1.constructDice)(message_.media);
|
|
430
439
|
m = { ...message, dice };
|
|
431
440
|
}
|
|
432
|
-
else if (
|
|
441
|
+
else if ((0, _2_tl_js_1.is)("messageMediaDocument", message_.media)) {
|
|
433
442
|
const { document } = message_.media;
|
|
434
|
-
if (
|
|
443
|
+
if ((0, _2_tl_js_1.is)("document", document)) {
|
|
435
444
|
const getFileId = (type) => ({
|
|
436
445
|
type,
|
|
437
446
|
dcId: document.dc_id,
|
|
438
447
|
fileReference: document.file_reference,
|
|
439
448
|
location: { type: "common", id: document.id, accessHash: document.access_hash },
|
|
440
449
|
});
|
|
441
|
-
const animated = document.attributes.find((v) =>
|
|
442
|
-
const audio = document.attributes.find((v) =>
|
|
443
|
-
const fileName = document.attributes.find((v) =>
|
|
444
|
-
const sticker = document.attributes.find((v) =>
|
|
445
|
-
const video = document.attributes.find((v) =>
|
|
450
|
+
const animated = document.attributes.find((v) => (0, _2_tl_js_1.is)("documentAttributeAnimated", v));
|
|
451
|
+
const audio = document.attributes.find((v) => (0, _2_tl_js_1.is)("documentAttributeAudio", v));
|
|
452
|
+
const fileName = document.attributes.find((v) => (0, _2_tl_js_1.is)("documentAttributeFilename", v));
|
|
453
|
+
const sticker = document.attributes.find((v) => (0, _2_tl_js_1.is)("documentAttributeSticker", v));
|
|
454
|
+
const video = document.attributes.find((v) => (0, _2_tl_js_1.is)("documentAttributeVideo", v));
|
|
446
455
|
if (animated) {
|
|
447
456
|
const fileId = getFileId(_file_id_js_1.FileType.Animation);
|
|
448
457
|
const animation = (0, _1_animation_js_1.constructAnimation)(document, video, fileName, (0, _file_id_js_2.serializeFileId)(fileId), (0, _file_id_js_1.toUniqueFileId)(fileId));
|
|
@@ -479,32 +488,32 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
479
488
|
}
|
|
480
489
|
else {
|
|
481
490
|
const fileId = getFileId(_file_id_js_1.FileType.Document);
|
|
482
|
-
const document_ = (0, _1_document_js_1.constructDocument)(document, fileName ??
|
|
491
|
+
const document_ = (0, _1_document_js_1.constructDocument)(document, fileName ?? ({ _: "documentAttributeFilename", file_name: "Unknown" }), (0, _file_id_js_2.serializeFileId)(fileId), (0, _file_id_js_1.toUniqueFileId)(fileId));
|
|
483
492
|
m = { ...messageMedia, document: document_ };
|
|
484
493
|
}
|
|
485
494
|
}
|
|
486
495
|
}
|
|
487
|
-
else if (
|
|
496
|
+
else if ((0, _2_tl_js_1.is)("messageMediaContact", message_.media)) {
|
|
488
497
|
const contact = (0, _0_contact_js_1.constructContact)(message_.media);
|
|
489
498
|
m = { ...messageMedia, contact };
|
|
490
499
|
}
|
|
491
|
-
else if (
|
|
500
|
+
else if ((0, _2_tl_js_1.is)("messageMediaGame", message_.media)) {
|
|
492
501
|
const game = (0, _2_game_js_1.constructGame)(message_.media);
|
|
493
502
|
m = { ...message, game };
|
|
494
503
|
}
|
|
495
|
-
else if (
|
|
504
|
+
else if ((0, _2_tl_js_1.is)("messageMediaPoll", message_.media)) {
|
|
496
505
|
const poll = (0, _1_poll_js_1.constructPoll)(message_.media);
|
|
497
506
|
m = { ...message, poll };
|
|
498
507
|
}
|
|
499
|
-
else if (
|
|
508
|
+
else if ((0, _2_tl_js_1.is)("messageMediaVenue", message_.media)) {
|
|
500
509
|
const venue = (0, _1_venue_js_1.constructVenue)(message_.media);
|
|
501
510
|
m = { ...message, venue };
|
|
502
511
|
}
|
|
503
|
-
else if (
|
|
512
|
+
else if ((0, _2_tl_js_1.is)("messageMediaGeo", message_.media) || (0, _2_tl_js_1.is)("messageMediaGeoLive", message_.media)) {
|
|
504
513
|
const location = (0, _0_location_js_1.constructLocation)(message_.media);
|
|
505
514
|
m = { ...message, location };
|
|
506
515
|
}
|
|
507
|
-
else if (
|
|
516
|
+
else if ((0, _2_tl_js_1.is)("messageMediaWebPage", message_.media)) {
|
|
508
517
|
const linkPreview = (0, _0_link_preview_js_1.constructLinkPreview)(message_.media, message_.invert_media);
|
|
509
518
|
if (message_.message) {
|
|
510
519
|
m = { ...messageText, linkPreview };
|
|
@@ -513,7 +522,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
513
522
|
m = { ...message, linkPreview: { ...linkPreview, url: linkPreview.url ? linkPreview.url : (0, _0_deps_js_1.unreachable)() } };
|
|
514
523
|
}
|
|
515
524
|
}
|
|
516
|
-
else if (
|
|
525
|
+
else if ((0, _2_tl_js_1.is)("messageMediaGiveaway", message_.media)) {
|
|
517
526
|
const giveaway = (0, _1_giveaway_js_1.constructGiveaway)(message_.media);
|
|
518
527
|
m = { ...message, giveaway };
|
|
519
528
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { EntityGetter } from "./_getters.js";
|
|
22
22
|
import { User } from "./1_user.js";
|
|
23
23
|
import { Message, MessageGetter } from "./4_message.js";
|
|
@@ -38,6 +38,6 @@ export interface CallbackQuery {
|
|
|
38
38
|
/** The short name of the game to be returned. */
|
|
39
39
|
gameShortName?: string;
|
|
40
40
|
}
|
|
41
|
-
export declare function deserializeInlineMessageId(inlineMessageId: string):
|
|
42
|
-
export declare function constructCallbackQuery(callbackQuery:
|
|
41
|
+
export declare function deserializeInlineMessageId(inlineMessageId: string): Api.InputBotInlineMessageID;
|
|
42
|
+
export declare function constructCallbackQuery(callbackQuery: Api.updateBotCallbackQuery | Api.updateInlineBotCallbackQuery, getEntity: EntityGetter, getMessage: MessageGetter): Promise<CallbackQuery>;
|
|
43
43
|
//# sourceMappingURL=5_callback_query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5_callback_query.d.ts","sourceRoot":"","sources":["../../src/types/5_callback_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"5_callback_query.d.ts","sourceRoot":"","sources":["../../src/types/5_callback_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAyC,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAExD,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,IAAI,EAAE,IAAI,CAAC;IACX,uGAAuG;IACvG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oKAAoK;IACpK,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gHAAgH;IAChH,YAAY,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,GAAG,CAAC,uBAAuB,CAa/F;AAED,wBAAsB,sBAAsB,CAAC,aAAa,EAAE,GAAG,CAAC,sBAAsB,GAAG,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBrM"}
|
|
@@ -31,7 +31,7 @@ function deserializeInlineMessageId(inlineMessageId) {
|
|
|
31
31
|
const buffer = (0, _1_utilities_js_1.base64DecodeUrlSafe)(inlineMessageId);
|
|
32
32
|
const reader = new _2_tl_js_1.TLReader(buffer);
|
|
33
33
|
const object = reader.readObject();
|
|
34
|
-
if (
|
|
34
|
+
if ((0, _2_tl_js_1.is)("inputBotInlineMessageID64", object) || (0, _2_tl_js_1.is)("inputBotInlineMessageID", object)) {
|
|
35
35
|
return object;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -42,7 +42,7 @@ function deserializeInlineMessageId(inlineMessageId) {
|
|
|
42
42
|
}
|
|
43
43
|
exports.deserializeInlineMessageId = deserializeInlineMessageId;
|
|
44
44
|
async function constructCallbackQuery(callbackQuery, getEntity, getMessage) {
|
|
45
|
-
const user_ = await getEntity(
|
|
45
|
+
const user_ = await getEntity({ _: "peerUser", user_id: callbackQuery.user_id });
|
|
46
46
|
if (!user_) {
|
|
47
47
|
(0, _0_deps_js_1.unreachable)();
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ async function constructCallbackQuery(callbackQuery, getEntity, getMessage) {
|
|
|
51
51
|
const gameShortName = callbackQuery.game_short_name;
|
|
52
52
|
const data = callbackQuery.data !== undefined ? new TextDecoder().decode(callbackQuery.data) : undefined;
|
|
53
53
|
const chatInstance = callbackQuery.chat_instance == 0n ? "" : String(callbackQuery.chat_instance);
|
|
54
|
-
if (
|
|
54
|
+
if ((0, _2_tl_js_1.is)("updateBotCallbackQuery", callbackQuery)) {
|
|
55
55
|
const message = await getMessage((0, _2_tl_js_1.peerToChatId)(callbackQuery.peer), Number(callbackQuery.msg_id));
|
|
56
56
|
if (message == null) {
|
|
57
57
|
(0, _0_deps_js_1.unreachable)();
|
|
@@ -59,7 +59,7 @@ async function constructCallbackQuery(callbackQuery, getEntity, getMessage) {
|
|
|
59
59
|
return (0, _1_utilities_js_1.cleanObject)({ id, from: user, message, chatInstance, data, gameShortName });
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
return (0, _1_utilities_js_1.cleanObject)({ id, from: user, inlineMessageId: (0, _1_utilities_js_1.base64EncodeUrlSafe)(
|
|
62
|
+
return (0, _1_utilities_js_1.cleanObject)({ id, from: user, inlineMessageId: (0, _1_utilities_js_1.base64EncodeUrlSafe)((0, _2_tl_js_1.serialize)(callbackQuery.msg_id)), chatInstance, data, gameShortName });
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
exports.constructCallbackQuery = constructCallbackQuery;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { EntityGetter } from "./_getters.js";
|
|
22
22
|
import { ChatP } from "./1_chat_p.js";
|
|
23
23
|
import { StickerSetNameGetter } from "./1_sticker.js";
|
|
@@ -30,7 +30,7 @@ export interface ChatListItem {
|
|
|
30
30
|
}
|
|
31
31
|
export declare function getChatListItemOrder(lastMessage: Omit<Message, "replyToMessage"> | undefined, pinned: number): string;
|
|
32
32
|
export declare function constructChatListItem(chatId: number, pinned: number, lastMessageId: number, getEntity: EntityGetter, getMessage: MessageGetter): Promise<ChatListItem | null>;
|
|
33
|
-
export declare function constructChatListItem2(entity:
|
|
33
|
+
export declare function constructChatListItem2(entity: Api.user | Api.chat | Api.chatForbidden | Api.channel | Api.channelForbidden, pinned: number, lastMessage: Omit<Message, "replyToMessage"> | undefined): ChatListItem;
|
|
34
34
|
export declare function constructChatListItem3(chatId: number, pinned: number, lastMessage: Omit<Message, "replyToMessage"> | undefined, getEntity: EntityGetter): Promise<ChatListItem | null>;
|
|
35
|
-
export declare function constructChatListItem4(dialog:
|
|
35
|
+
export declare function constructChatListItem4(dialog: Api.Dialog, dialogs: Api.messages_dialogs | Api.messages_dialogsSlice, pinnedChats: number[], getEntity: EntityGetter, getMessage: MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<ChatListItem>;
|
|
36
36
|
//# sourceMappingURL=5_chat_list_item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5_chat_list_item.d.ts","sourceRoot":"","sources":["../../src/types/5_chat_list_item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"5_chat_list_item.d.ts","sourceRoot":"","sources":["../../src/types/5_chat_list_item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAkC,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAoB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE1E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;CAC/C;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMrH;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAenL;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG,SAAS,GAAG,YAAY,CAOnN;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG,SAAS,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAW5L;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,qBAAqB,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAqBrQ"}
|
|
@@ -80,7 +80,7 @@ async function constructChatListItem4(dialog, dialogs, pinnedChats, getEntity, g
|
|
|
80
80
|
const userId = "user_id" in dialog.peer ? dialog.peer.user_id : null;
|
|
81
81
|
const chatId = "chat_id" in dialog.peer ? dialog.peer.chat_id : null;
|
|
82
82
|
const channelId = "channel_id" in dialog.peer ? dialog.peer.channel_id : null;
|
|
83
|
-
const chat__ = chatId != null ? dialogs.chats.find((v) =>
|
|
83
|
+
const chat__ = chatId != null ? dialogs.chats.find((v) => (0, _2_tl_js_1.is)("chat", v) && v.id == chatId) : channelId != null ? dialogs.chats.find((v) => (0, _2_tl_js_1.is)("channel", v) && v.id == channelId) : userId != null ? dialogs.users.find((v) => (0, _2_tl_js_1.is)("user", v) && v.id == userId) : (0, _0_deps_js_1.unreachable)();
|
|
84
84
|
if (!chat__) {
|
|
85
85
|
(0, _0_deps_js_1.unreachable)();
|
|
86
86
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { InlineQueryResult } from "./4_inline_query_result.js";
|
|
22
22
|
/** An answer to an inline query. */
|
|
23
23
|
export interface InlineQueryAnswer {
|
|
@@ -28,5 +28,5 @@ export interface InlineQueryAnswer {
|
|
|
28
28
|
/** A parameter that can be passed to next queries with the same text to yield more results. */
|
|
29
29
|
nextOffset?: string;
|
|
30
30
|
}
|
|
31
|
-
export declare function constructInlineQueryAnswer(results:
|
|
31
|
+
export declare function constructInlineQueryAnswer(results: Api.messages_BotResults): InlineQueryAnswer;
|
|
32
32
|
//# sourceMappingURL=5_inline_query_answer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5_inline_query_answer.d.ts","sourceRoot":"","sources":["../../src/types/5_inline_query_answer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"5_inline_query_answer.d.ts","sourceRoot":"","sources":["../../src/types/5_inline_query_answer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA8B,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE3F,oCAAoC;AACpC,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,GAAG,CAAC,mBAAmB,GAAG,iBAAiB,CAM9F"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
export declare enum FileType {
|
|
22
22
|
Thumbnail = 0,
|
|
23
23
|
ProfilePhoto = 1,
|
|
@@ -120,7 +120,7 @@ export interface FileId {
|
|
|
120
120
|
export declare function deserializeFileId(fileId: string): FileId;
|
|
121
121
|
export declare function serializeFileId(fileId: FileId): string;
|
|
122
122
|
export declare function toUniqueFileId(fileId: FileId): string;
|
|
123
|
-
export declare function getPhotoFileId(photo:
|
|
123
|
+
export declare function getPhotoFileId(photo: Api.photo): {
|
|
124
124
|
fileId: string;
|
|
125
125
|
fileUniqueId: string;
|
|
126
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_file_id.d.ts","sourceRoot":"","sources":["../../src/types/_file_id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"_file_id.d.ts","sourceRoot":"","sources":["../../src/types/_file_id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAA0B,MAAM,YAAY,CAAC;AAOzD,oBAAY,QAAQ;IAClB,SAAS,IAAA;IACT,YAAY,IAAA;IACZ,KAAK,IAAA;IACL,SAAS,IAAA;IACT,KAAK,IAAA;IACL,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,KAAK,IAAA;IACL,SAAS,KAAA;IACT,kBAAkB,KAAA;IAClB,SAAS,KAAA;IACT,SAAS,KAAA;IACT,eAAe,KAAA;IACf,eAAe,KAAA;IACf,UAAU,KAAA;IACV,cAAc,KAAA;IACd,QAAQ,KAAA;IACR,OAAO,KAAA;IACP,UAAU,KAAA;IACV,UAAU,KAAA;IACV,IAAI,KAAA;IACJ,IAAI,KAAA;CACL;AAUD,oBAAY,eAAe;IACzB,MAAM,IAAA;IACN,SAAS,IAAA;IACT,cAAc,IAAA;IACd,YAAY,IAAA;IACZ,mBAAmB,IAAA;IACnB,UAAU,IAAA;IACV,oBAAoB,IAAA;IACpB,kBAAkB,IAAA;IAClB,yBAAyB,IAAA;IACzB,0BAA0B,IAAA;CAC3B;AAED,KAAK,WAAW,GACZ;IAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAChF;IAAE,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,eAAe,CAAC,mBAAmB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,GACjG;IAAE,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACvF;IAAE,IAAI,EAAE,eAAe,CAAC,oBAAoB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,eAAe,CAAC,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,IAAI,EAAE,eAAe,CAAC,yBAAyB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,eAAe,CAAC,0BAA0B,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA0H1E,KAAK,YAAY,GACb;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,gBAAgB;AAChB,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;CACxB;AA8CD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAyBxD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA8BtD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiCrD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CA6BzF"}
|
package/script/types/_file_id.js
CHANGED
|
@@ -330,14 +330,14 @@ exports.toUniqueFileId = toUniqueFileId;
|
|
|
330
330
|
function getPhotoFileId(photo) {
|
|
331
331
|
const sizes = photo.sizes
|
|
332
332
|
.map((v) => {
|
|
333
|
-
if (
|
|
334
|
-
return
|
|
333
|
+
if ((0, _2_tl_js_1.is)("photoSizeProgressive", v)) {
|
|
334
|
+
return { _: "photoSize", type: v.type, w: v.w, h: v.h, size: Math.max(...v.sizes) };
|
|
335
335
|
}
|
|
336
336
|
else {
|
|
337
337
|
return v;
|
|
338
338
|
}
|
|
339
339
|
})
|
|
340
|
-
.filter((v) =>
|
|
340
|
+
.filter((v) => (0, _2_tl_js_1.is)("photoSize", v))
|
|
341
341
|
.sort((a, b) => a.size - b.size);
|
|
342
342
|
const largest = sizes.slice(-1)[0];
|
|
343
343
|
const { dc_id: dcId, id, access_hash: accessHash, file_reference: fileReference } = photo;
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { MaybePromise } from "../1_utilities.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { ID } from "./0_id.js";
|
|
23
23
|
/** @unlisted */
|
|
24
24
|
export interface EntityGetter {
|
|
25
|
-
(peer:
|
|
26
|
-
(peer:
|
|
27
|
-
(peer:
|
|
28
|
-
(peer:
|
|
25
|
+
(peer: Api.peerUser): MaybePromise<Api.user | null>;
|
|
26
|
+
(peer: Api.peerChat): MaybePromise<Api.chat | Api.chatForbidden | null>;
|
|
27
|
+
(peer: Api.peerChannel): MaybePromise<Api.channel | Api.channelForbidden | null>;
|
|
28
|
+
(peer: Api.peerUser | Api.peerChat | Api.peerChannel): MaybePromise<Api.user | Api.chat | Api.chatForbidden | Api.channel | Api.channelForbidden | null>;
|
|
29
29
|
}
|
|
30
30
|
/** @unlisted */
|
|
31
31
|
export interface InputPeerGetter {
|
|
32
|
-
(id: ID): Promise<
|
|
32
|
+
(id: ID): Promise<Api.InputPeer>;
|
|
33
33
|
}
|
|
34
34
|
/** @unlisted */
|
|
35
35
|
export interface UsernameResolver {
|
|
36
|
-
(username: string): MaybePromise<
|
|
36
|
+
(username: string): MaybePromise<Api.inputUser>;
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=_getters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_getters.d.ts","sourceRoot":"","sources":["../../src/types/_getters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"_getters.d.ts","sourceRoot":"","sources":["../../src/types/_getters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE/B,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACxE,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACjF,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CAC1J;AAED,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CAClC;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAgB;IAC/B,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CACjD"}
|