@mtkruto/node 0.62.1 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +6 -6
- package/esm/3_errors.d.ts +1 -2
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +2 -1
- package/esm/4_constants.d.ts +0 -1
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +0 -1
- package/esm/4_errors.d.ts +2 -2
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_session.d.ts +24 -0
- package/esm/4_session.d.ts.map +1 -0
- package/esm/4_session.js +23 -0
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_client_abstract.d.ts +28 -26
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +16 -88
- package/esm/client/0_params.d.ts +5 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_storage_operations.d.ts +4 -4
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +14 -14
- package/esm/client/0_update_processor.d.ts +19 -0
- package/esm/client/0_update_processor.d.ts.map +1 -1
- package/esm/client/0_update_processor.js +19 -0
- package/esm/client/0_utilities.d.ts +6 -2
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +21 -23
- package/esm/client/1_client_plain.d.ts +9 -6
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +26 -41
- package/esm/client/1_types.d.ts +4 -23
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +10 -10
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +4 -4
- package/esm/client/2_client_encrypted.d.ts +58 -0
- package/esm/client/2_client_encrypted.d.ts.map +1 -0
- package/esm/client/2_client_encrypted.js +265 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +54 -74
- package/esm/client/2_network_statistics_manager.d.ts +1 -1
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +3 -3
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +10 -10
- package/esm/client/2_translations_manager.d.ts +19 -0
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +24 -5
- package/esm/client/2_update_manager.d.ts +4 -4
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +69 -79
- package/esm/client/3_client_encrypted_pool.d.ts +30 -0
- package/esm/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/esm/client/3_client_encrypted_pool.js +70 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +96 -70
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +15 -20
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +2 -2
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +33 -33
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +25 -25
- package/esm/client/4_gift_manager.js +2 -2
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +4 -4
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +5 -5
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +10 -10
- package/esm/client/5_client.d.ts +3 -9
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +290 -306
- package/esm/connection/0_connection.d.ts +5 -4
- package/esm/connection/0_connection.d.ts.map +1 -1
- package/esm/connection/1_connection_web_socket.js +2 -2
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/{script/tl/2_tl_reader.d.ts → esm/session/0_session_error.d.ts} +4 -7
- package/esm/session/0_session_error.d.ts.map +1 -0
- package/esm/{tl/2_tl_reader.d.ts → session/0_session_error.js} +5 -7
- package/esm/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/esm/session/0_session_state.d.ts.map +1 -0
- package/esm/session/0_session_state.js +77 -0
- package/esm/session/1_session.d.ts +31 -0
- package/esm/session/1_session.d.ts.map +1 -0
- package/esm/session/1_session.js +149 -0
- package/esm/session/2_session_encrypted.d.ts +40 -0
- package/esm/session/2_session_encrypted.d.ts.map +1 -0
- package/esm/session/2_session_encrypted.js +416 -0
- package/esm/session/2_session_plain.d.ts +25 -0
- package/esm/session/2_session_plain.d.ts.map +1 -0
- package/esm/session/2_session_plain.js +56 -0
- package/esm/tl/0_tl_error.d.ts +22 -0
- package/esm/tl/0_tl_error.d.ts.map +1 -0
- package/esm/tl/0_tl_error.js +21 -0
- package/esm/tl/0_types.d.ts +25 -0
- package/esm/tl/0_types.d.ts.map +1 -0
- package/esm/tl/0_types.js +20 -0
- package/esm/tl/0_utilities.d.ts +32 -0
- package/esm/tl/0_utilities.d.ts.map +1 -0
- package/esm/tl/0_utilities.js +51 -0
- package/esm/tl/0_utilities_test.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.d.ts +371 -0
- package/esm/tl/1_mtproto_api.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.js +416 -0
- package/esm/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/esm/tl/1_telegram_api.d.ts.map +1 -0
- package/esm/tl/{0_api.js → 1_telegram_api.js} +4945 -11109
- package/{script/tl/0_tl_raw_reader.d.ts → esm/tl/1_tl_reader.d.ts} +5 -2
- package/esm/tl/1_tl_reader.d.ts.map +1 -0
- package/esm/tl/{2_tl_reader.js → 1_tl_reader.js} +107 -40
- package/esm/tl/1_tl_reader_test.d.ts.map +1 -0
- package/esm/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/esm/tl/1_tl_writer.d.ts.map +1 -0
- package/esm/tl/{2_tl_writer.js → 1_tl_writer.js} +80 -23
- package/esm/tl/1_tl_writer_test.d.ts.map +1 -0
- package/esm/tl/1_utilities.d.ts +9 -24
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +18 -64
- package/esm/tl/2_message.d.ts +2 -2
- package/esm/tl/2_message.d.ts.map +1 -1
- package/esm/tl/2_message.js +7 -7
- package/esm/tl/2_mtproto.d.ts +33 -0
- package/esm/tl/2_mtproto.d.ts.map +1 -0
- package/esm/tl/2_mtproto.js +53 -0
- package/{script/tl/2_utilities.d.ts → esm/tl/2_telegram.d.ts} +16 -2
- package/esm/tl/2_telegram.d.ts.map +1 -0
- package/esm/tl/{2_utilities.js → 2_telegram.js} +46 -1
- package/esm/transport/0_transport.d.ts +1 -1
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +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_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +20 -20
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_slow_mode_duration.d.ts +19 -0
- package/esm/types/0_slow_mode_duration.d.ts.map +1 -1
- package/esm/types/0_slow_mode_duration.js +19 -0
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_translation.d.ts +19 -0
- package/esm/types/0_translation.d.ts.map +1 -1
- package/esm/types/0_translation.js +22 -3
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +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.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +2 -2
- 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.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +10 -10
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +6 -6
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +8 -8
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +7 -7
- 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.map +1 -1
- package/esm/types/1_venue.js +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.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +8 -8
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chat_settings.d.ts +19 -0
- package/esm/types/2_chat_settings.d.ts.map +1 -1
- package/esm/types/2_chat_settings.js +21 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +4 -4
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/esm/types/2_gift_upgraded_component.js +3 -3
- 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.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +10 -10
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +7 -7
- 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.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +9 -9
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +2 -2
- package/esm/types/3_gift.d.ts.map +1 -1
- package/esm/types/3_gift.js +3 -3
- package/esm/types/3_join_request.d.ts.map +1 -1
- package/esm/types/3_join_request.js +2 -2
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +5 -5
- package/esm/types/4_claimed_gift.d.ts.map +1 -1
- package/esm/types/4_claimed_gift.js +2 -2
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +14 -14
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +57 -57
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +6 -7
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +5 -5
- package/esm/types/5_claimed_gifts.d.ts.map +1 -1
- package/esm/types/5_claimed_gifts.js +6 -6
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +3 -3
- package/package.json +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +11 -11
- package/script/3_errors.d.ts +1 -2
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +2 -1
- package/script/4_constants.d.ts +0 -1
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +1 -2
- package/script/4_errors.d.ts +2 -2
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_session.d.ts +24 -0
- package/script/4_session.d.ts.map +1 -0
- package/script/4_session.js +39 -0
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_client_abstract.d.ts +28 -26
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +18 -113
- package/script/client/0_params.d.ts +5 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +1 -1
- package/script/client/0_storage_operations.d.ts +4 -4
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +13 -13
- package/script/client/0_update_processor.d.ts +19 -0
- package/script/client/0_update_processor.d.ts.map +1 -1
- package/script/client/0_update_processor.js +19 -0
- package/script/client/0_utilities.d.ts +6 -2
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +22 -24
- package/script/client/1_client_plain.d.ts +9 -6
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -40
- package/script/client/1_types.d.ts +4 -23
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.js +9 -9
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +3 -3
- package/script/client/2_client_encrypted.d.ts +58 -0
- package/script/client/2_client_encrypted.d.ts.map +1 -0
- package/script/client/2_client_encrypted.js +269 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +52 -72
- package/script/client/2_network_statistics_manager.d.ts +1 -1
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +3 -3
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +9 -9
- package/script/client/2_translations_manager.d.ts +19 -0
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +23 -4
- package/script/client/2_update_manager.d.ts +4 -4
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +68 -78
- package/script/client/3_client_encrypted_pool.d.ts +30 -0
- package/script/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/script/client/3_client_encrypted_pool.js +74 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +95 -69
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +14 -19
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +32 -32
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +24 -24
- package/script/client/4_gift_manager.js +1 -1
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +3 -3
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +4 -4
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +9 -9
- package/script/client/5_client.d.ts +3 -9
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +284 -300
- package/script/connection/0_connection.d.ts +5 -4
- package/script/connection/0_connection.d.ts.map +1 -1
- package/script/connection/1_connection_web_socket.js +2 -2
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -2
- package/script/session/0_session_error.d.ts +24 -0
- package/script/session/0_session_error.d.ts.map +1 -0
- package/script/session/0_session_error.js +29 -0
- package/script/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/script/session/0_session_state.d.ts.map +1 -0
- package/script/session/0_session_state.js +81 -0
- package/script/session/1_session.d.ts +31 -0
- package/script/session/1_session.d.ts.map +1 -0
- package/script/session/1_session.js +176 -0
- package/script/session/2_session_encrypted.d.ts +40 -0
- package/script/session/2_session_encrypted.d.ts.map +1 -0
- package/script/session/2_session_encrypted.js +420 -0
- package/script/session/2_session_plain.d.ts +25 -0
- package/script/session/2_session_plain.d.ts.map +1 -0
- package/script/session/2_session_plain.js +60 -0
- package/script/tl/0_tl_error.d.ts +22 -0
- package/script/tl/0_tl_error.d.ts.map +1 -0
- package/script/tl/0_tl_error.js +25 -0
- package/script/tl/0_types.d.ts +25 -0
- package/script/tl/0_types.d.ts.map +1 -0
- package/script/tl/0_types.js +21 -0
- package/script/tl/0_utilities.d.ts +32 -0
- package/script/tl/0_utilities.d.ts.map +1 -0
- package/script/tl/0_utilities.js +59 -0
- package/script/tl/0_utilities_test.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.d.ts +371 -0
- package/script/tl/1_mtproto_api.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.js +419 -0
- package/script/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/script/tl/1_telegram_api.d.ts.map +1 -0
- package/script/tl/{0_api.js → 1_telegram_api.js} +4947 -11134
- package/{esm/tl/0_tl_raw_reader.d.ts → script/tl/1_tl_reader.d.ts} +5 -2
- package/script/tl/1_tl_reader.d.ts.map +1 -0
- package/script/tl/1_tl_reader.js +218 -0
- package/script/tl/1_tl_reader_test.d.ts.map +1 -0
- package/script/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/script/tl/1_tl_writer.d.ts.map +1 -0
- package/script/tl/{2_tl_writer.js → 1_tl_writer.js} +102 -45
- package/script/tl/1_tl_writer_test.d.ts.map +1 -0
- package/script/tl/1_utilities.d.ts +9 -24
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +19 -72
- package/script/tl/2_message.d.ts +2 -2
- package/script/tl/2_message.d.ts.map +1 -1
- package/script/tl/2_message.js +7 -7
- package/script/tl/2_mtproto.d.ts +33 -0
- package/script/tl/2_mtproto.d.ts.map +1 -0
- package/script/tl/2_mtproto.js +78 -0
- package/{esm/tl/2_utilities.d.ts → script/tl/2_telegram.d.ts} +16 -2
- package/script/tl/2_telegram.d.ts.map +1 -0
- package/script/tl/2_telegram.js +167 -0
- package/script/transport/0_transport.d.ts +1 -1
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +19 -19
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_slow_mode_duration.d.ts +19 -0
- package/script/types/0_slow_mode_duration.d.ts.map +1 -1
- package/script/types/0_slow_mode_duration.js +19 -0
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_translation.d.ts +19 -0
- package/script/types/0_translation.d.ts.map +1 -1
- package/script/types/0_translation.js +21 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- 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.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- 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.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +9 -9
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +2 -2
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +7 -7
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +6 -6
- 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.map +1 -1
- package/script/types/1_venue.js +1 -1
- 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.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +7 -7
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chat_settings.d.ts +19 -0
- package/script/types/2_chat_settings.d.ts.map +1 -1
- package/script/types/2_chat_settings.js +20 -1
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +3 -3
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/script/types/2_gift_upgraded_component.js +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.map +1 -1
- package/script/types/2_inline_keyboard_button.js +9 -9
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +6 -6
- 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.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +8 -8
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +1 -1
- package/script/types/3_gift.d.ts.map +1 -1
- package/script/types/3_gift.js +2 -2
- package/script/types/3_join_request.d.ts.map +1 -1
- package/script/types/3_join_request.js +1 -1
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +4 -4
- package/script/types/4_claimed_gift.d.ts.map +1 -1
- package/script/types/4_claimed_gift.js +1 -1
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +13 -13
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +56 -56
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +5 -6
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +4 -4
- package/script/types/5_claimed_gifts.d.ts.map +1 -1
- package/script/types/5_claimed_gifts.js +5 -5
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +2 -2
- package/esm/client/0_message.d.ts +0 -29
- package/esm/client/0_message.d.ts.map +0 -1
- package/esm/client/0_message.js +0 -83
- package/esm/client/1_client_encrypted.d.ts +0 -52
- package/esm/client/1_client_encrypted.d.ts.map +0 -1
- package/esm/client/1_client_encrypted.js +0 -381
- package/esm/tl/0_api.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.js +0 -97
- package/esm/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.js +0 -86
- package/esm/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/esm/tl/1_utilities_test.d.ts.map +0 -1
- package/esm/tl/2_tl_reader.d.ts.map +0 -1
- package/esm/tl/2_tl_reader_test.d.ts.map +0 -1
- package/esm/tl/2_tl_writer.d.ts.map +0 -1
- package/esm/tl/2_tl_writer_test.d.ts.map +0 -1
- package/esm/tl/2_utilities.d.ts.map +0 -1
- package/script/client/0_message.d.ts +0 -29
- package/script/client/0_message.d.ts.map +0 -1
- package/script/client/0_message.js +0 -90
- package/script/client/1_client_encrypted.d.ts +0 -52
- package/script/client/1_client_encrypted.d.ts.map +0 -1
- package/script/client/1_client_encrypted.js +0 -385
- package/script/tl/0_api.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.js +0 -102
- package/script/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.js +0 -90
- package/script/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/script/tl/1_utilities_test.d.ts.map +0 -1
- package/script/tl/2_tl_reader.d.ts.map +0 -1
- package/script/tl/2_tl_reader.js +0 -150
- package/script/tl/2_tl_reader_test.d.ts.map +0 -1
- package/script/tl/2_tl_writer.d.ts.map +0 -1
- package/script/tl/2_tl_writer_test.d.ts.map +0 -1
- package/script/tl/2_utilities.d.ts.map +0 -1
- package/script/tl/2_utilities.js +0 -98
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { constructChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
24
24
|
import { constructChatMemberRights } from "./0_chat_member_rights.js";
|
|
25
25
|
import { constructUser } from "./1_user.js";
|
|
26
26
|
export async function constructChatMember(participant, getEntity) {
|
|
27
|
-
const user_ = "user_id" in participant ? await getEntity({ ...participant, _: "peerUser" }) : "peer" in participant ? is("peerUser", participant.peer) ? await getEntity(participant.peer) : unreachable() : unreachable(); // TODO: support other peer types
|
|
27
|
+
const user_ = "user_id" in participant ? await getEntity({ ...participant, _: "peerUser" }) : "peer" in participant ? Api.is("peerUser", participant.peer) ? await getEntity(participant.peer) : unreachable() : unreachable(); // TODO: support other peer types
|
|
28
28
|
if (user_ == null)
|
|
29
29
|
unreachable();
|
|
30
30
|
const user = constructUser(user_);
|
|
31
|
-
if (is("channelParticipant", participant) || is("chatParticipant", participant)) {
|
|
31
|
+
if (Api.is("channelParticipant", participant) || Api.is("chatParticipant", participant)) {
|
|
32
32
|
return {
|
|
33
33
|
status: "member",
|
|
34
34
|
user,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
else if (is("channelParticipantCreator", participant)) {
|
|
37
|
+
else if (Api.is("channelParticipantCreator", participant)) {
|
|
38
38
|
return cleanObject({
|
|
39
39
|
status: "creator",
|
|
40
40
|
user,
|
|
@@ -42,7 +42,7 @@ export async function constructChatMember(participant, getEntity) {
|
|
|
42
42
|
title: participant.rank,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
else if (is("channelParticipantAdmin", participant)) {
|
|
45
|
+
else if (Api.is("channelParticipantAdmin", participant)) {
|
|
46
46
|
return cleanObject({
|
|
47
47
|
status: "administrator",
|
|
48
48
|
user,
|
|
@@ -50,7 +50,7 @@ export async function constructChatMember(participant, getEntity) {
|
|
|
50
50
|
title: participant.rank,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
else if (is("channelParticipantBanned", participant)) {
|
|
53
|
+
else if (Api.is("channelParticipantBanned", participant)) {
|
|
54
54
|
const untilDate = participant.banned_rights.until_date ? fromUnixTimestamp(participant.banned_rights.until_date) : undefined;
|
|
55
55
|
if (!participant.banned_rights.view_messages) {
|
|
56
56
|
participant.peer;
|
|
@@ -70,13 +70,13 @@ export async function constructChatMember(participant, getEntity) {
|
|
|
70
70
|
untilDate,
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
else if (is("channelParticipantSelf", participant)) {
|
|
73
|
+
else if (Api.is("channelParticipantSelf", participant)) {
|
|
74
74
|
unreachable(); // TODO: implement
|
|
75
75
|
}
|
|
76
|
-
else if (is("channelParticipantLeft", participant)) {
|
|
76
|
+
else if (Api.is("channelParticipantLeft", participant)) {
|
|
77
77
|
return { status: "left", user };
|
|
78
78
|
}
|
|
79
|
-
else if (is("chatParticipantAdmin", participant)) {
|
|
79
|
+
else if (Api.is("chatParticipantAdmin", participant)) {
|
|
80
80
|
return cleanObject({
|
|
81
81
|
status: "administrator",
|
|
82
82
|
user,
|
|
@@ -96,7 +96,7 @@ export async function constructChatMember(participant, getEntity) {
|
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
else if (is("chatParticipantCreator", participant)) {
|
|
99
|
+
else if (Api.is("chatParticipantCreator", participant)) {
|
|
100
100
|
return cleanObject({
|
|
101
101
|
status: "creator",
|
|
102
102
|
user,
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import { Api } from "../2_tl.js";
|
|
2
21
|
import { User } from "./1_user.js";
|
|
3
22
|
export interface ChatSettings {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_chat_settings.d.ts","sourceRoot":"","sources":["../../src/types/2_chat_settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"2_chat_settings.d.ts","sourceRoot":"","sources":["../../src/types/2_chat_settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,GAAG,YAAY,CA4BxF"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
2
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
3
22
|
import { constructUser } from "./1_user.js";
|
|
4
23
|
export function constructChatSettings(settings_) {
|
|
5
24
|
const settings = {
|
|
@@ -25,7 +44,7 @@ export function constructChatSettings(settings_) {
|
|
|
25
44
|
photoChangeDate: settings_.settings.photo_change_date ? fromUnixTimestamp(settings_.settings.photo_change_date) : undefined,
|
|
26
45
|
};
|
|
27
46
|
const bot = settings_.users.find((v) => v.id == settings_.settings.business_bot_id);
|
|
28
|
-
if (is("user", bot)) {
|
|
47
|
+
if (Api.is("user", bot)) {
|
|
29
48
|
settings.businessBot = constructUser(bot);
|
|
30
49
|
}
|
|
31
50
|
return cleanObject(settings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_chosen_inline_result.d.ts","sourceRoot":"","sources":["../../src/types/2_chosen_inline_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_chosen_inline_result.d.ts","sourceRoot":"","sources":["../../src/types/2_chosen_inline_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,8BAA8B;AAC9B,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,EAAE,IAAI,CAAC;IACX,qDAAqD;IACrD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,GAAG,CAAC,mBAAmB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAYrI"}
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { base64EncodeUrlSafe, cleanObject } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { constructLocation } from "./0_location.js";
|
|
24
24
|
import { constructUser } from "./1_user.js";
|
|
25
25
|
export async function constructChosenInlineResult(ubis, getEntity) {
|
|
26
26
|
const entity = await getEntity({ ...ubis, _: "peerUser" });
|
|
27
|
-
if (!entity || !(is("user", entity))) {
|
|
27
|
+
if (!entity || !(Api.is("user", entity))) {
|
|
28
28
|
unreachable();
|
|
29
29
|
}
|
|
30
30
|
return cleanObject({
|
|
31
31
|
resultId: ubis.id,
|
|
32
32
|
from: constructUser(entity),
|
|
33
|
-
location: is("geoPoint", ubis.geo) ? constructLocation(ubis.geo) : undefined,
|
|
34
|
-
inlineMessageId: ubis.msg_id === undefined ? undefined : base64EncodeUrlSafe(
|
|
33
|
+
location: Api.is("geoPoint", ubis.geo) ? constructLocation(ubis.geo) : undefined,
|
|
34
|
+
inlineMessageId: ubis.msg_id === undefined ? undefined : base64EncodeUrlSafe(Api.serializeObject(ubis.msg_id)),
|
|
35
35
|
query: ubis.query,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_game.d.ts","sourceRoot":"","sources":["../../src/types/2_game.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_game.d.ts","sourceRoot":"","sources":["../../src/types/2_game.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AAErD,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAC/B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CA0BhE"}
|
package/esm/types/2_game.js
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { cleanObject } from "../1_utilities.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
23
23
|
import { constructAnimation } from "./1_animation.js";
|
|
24
24
|
import { constructPhoto } from "./1_photo.js";
|
|
25
25
|
export function constructGame(media_) {
|
|
26
26
|
const game_ = media_.game;
|
|
27
|
-
const document_ = game_.document ? as("document", game_.document) : undefined;
|
|
27
|
+
const document_ = game_.document ? Api.as("document", game_.document) : undefined;
|
|
28
28
|
const fileId_ = document_
|
|
29
29
|
? {
|
|
30
30
|
type: FileType.Animation,
|
|
@@ -36,9 +36,9 @@ export function constructGame(media_) {
|
|
|
36
36
|
return cleanObject({
|
|
37
37
|
title: game_.title,
|
|
38
38
|
description: media_.game.description,
|
|
39
|
-
photo: constructPhoto(as("photo", game_.photo)),
|
|
39
|
+
photo: constructPhoto(Api.as("photo", game_.photo)),
|
|
40
40
|
animation: fileId_ && document_
|
|
41
|
-
? constructAnimation(document_, document_.attributes.find((v) => is("documentAttributeVideo", v)), document_.attributes.find((v) => is("documentAttributeFilename", v)), serializeFileId(fileId_), toUniqueFileId(fileId_))
|
|
41
|
+
? constructAnimation(document_, document_.attributes.find((v) => Api.is("documentAttributeVideo", v)), document_.attributes.find((v) => Api.is("documentAttributeFilename", v)), serializeFileId(fileId_), toUniqueFileId(fileId_))
|
|
42
42
|
: undefined,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_gift_upgraded_component.d.ts","sourceRoot":"","sources":["../../src/types/2_gift_upgraded_component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_gift_upgraded_component.d.ts","sourceRoot":"","sources":["../../src/types/2_gift_upgraded_component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAqB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qBAAqB;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,4BAA4B,GAAG,6BAA6B,GAAG,oCAAoC,CAAC;AAErK,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,GAAG,CAAC,iBAAiB,GAAG,qBAAqB,CA+DtG"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
24
24
|
import { constructMessageEntity } from "./0_message_entity.js";
|
|
25
25
|
import { constructSticker2 } from "./1_sticker.js";
|
|
@@ -28,7 +28,7 @@ export function constructGiftUpgradedComponent(attribute) {
|
|
|
28
28
|
const rarityLevel = "rarity_permille" in attribute ? attribute.rarity_permille : 0;
|
|
29
29
|
switch (attribute._) {
|
|
30
30
|
case "starGiftAttributeModel": {
|
|
31
|
-
if (!is("document", attribute.document)) {
|
|
31
|
+
if (!Api.is("document", attribute.document)) {
|
|
32
32
|
unreachable();
|
|
33
33
|
}
|
|
34
34
|
const fileId = {
|
|
@@ -46,7 +46,7 @@ export function constructGiftUpgradedComponent(attribute) {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
case "starGiftAttributePattern": {
|
|
49
|
-
if (!is("document", attribute.document)) {
|
|
49
|
+
if (!Api.is("document", attribute.document)) {
|
|
50
50
|
unreachable();
|
|
51
51
|
}
|
|
52
52
|
const fileId = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_inactive_chat.d.ts","sourceRoot":"","sources":["../../src/types/2_inactive_chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_inactive_chat.d.ts","sourceRoot":"","sources":["../../src/types/2_inactive_chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AAEtD,wBAAwB;AACxB,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,YAAY,EAAE,IAAI,CAAC;IACnB,iDAAiD;IACjD,IAAI,EAAE,KAAK,CAAC;CACb;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CASzF"}
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { constructChatP } from "./1_chat_p.js";
|
|
24
24
|
export function constructInactiveChat(chat_, lastActivity) {
|
|
25
|
-
if (is("chatEmpty", chat_)) {
|
|
25
|
+
if (Api.is("chatEmpty", chat_)) {
|
|
26
26
|
unreachable();
|
|
27
27
|
}
|
|
28
28
|
const chat = constructChatP(chat_);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAwB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,yBAAyB;IAC7E;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,gBAAgB;AAChB,MAAM,WAAW,2BAA4B,SAAQ,yBAAyB;IAC5E;;;OAGG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAiC,SAAQ,yBAAyB;IACjF;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,uCAAwC,SAAQ,yBAAyB;IACxF;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,sCAAuC,SAAQ,yBAAyB;IACvF,qBAAqB;IACrB,4BAA4B,EAAE;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,qBAAqB;IACrB,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE,qBAAqB;IACrB,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,2BAA2B,GAC3B,yBAAyB,GACzB,gCAAgC,GAChC,uCAAuC,GACvC,sCAAsC,GACtC,wBAAwB,GACxB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAgC/F;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAuClJ"}
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { InputError } from "../0_errors.js";
|
|
22
22
|
import { cleanObject } from "../1_utilities.js";
|
|
23
|
-
import {
|
|
23
|
+
import { Api } from "../2_tl.js";
|
|
24
24
|
import { constructMiniAppInfo } from "./0_mini_app_info.js";
|
|
25
25
|
export function constructInlineKeyboardButton(button_) {
|
|
26
|
-
if (is("keyboardButtonUrl", button_)) {
|
|
26
|
+
if (Api.is("keyboardButtonUrl", button_)) {
|
|
27
27
|
return { text: button_.text, url: button_.url };
|
|
28
28
|
}
|
|
29
|
-
else if (is("keyboardButtonCallback", button_)) {
|
|
29
|
+
else if (Api.is("keyboardButtonCallback", button_)) {
|
|
30
30
|
return { text: button_.text, callbackData: new TextDecoder().decode(button_.data) };
|
|
31
31
|
}
|
|
32
|
-
else if (is("keyboardButtonWebView", button_) || is("keyboardButtonSimpleWebView", button_)) {
|
|
32
|
+
else if (Api.is("keyboardButtonWebView", button_) || Api.is("keyboardButtonSimpleWebView", button_)) {
|
|
33
33
|
return { text: button_.text, miniApp: constructMiniAppInfo(button_.url) };
|
|
34
34
|
}
|
|
35
|
-
else if (is("keyboardButtonUrlAuth", button_)) {
|
|
35
|
+
else if (Api.is("keyboardButtonUrlAuth", button_)) {
|
|
36
36
|
return { text: button_.text, loginUrl: { url: button_.url, forwardText: button_.fwd_text } };
|
|
37
37
|
}
|
|
38
|
-
else if (is("keyboardButtonSwitchInline", button_)) {
|
|
38
|
+
else if (Api.is("keyboardButtonSwitchInline", button_)) {
|
|
39
39
|
if (button_.same_peer) {
|
|
40
40
|
return { text: button_.text, switchInlineQueryCurrentChat: button_.query };
|
|
41
41
|
}
|
|
@@ -50,16 +50,16 @@ export function constructInlineKeyboardButton(button_) {
|
|
|
50
50
|
return { text: button_.text, switchInlineQuery: button_.query };
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
else if (is("keyboardButtonBuy", button_)) {
|
|
53
|
+
else if (Api.is("keyboardButtonBuy", button_)) {
|
|
54
54
|
return { text: button_.text, pay: true };
|
|
55
55
|
}
|
|
56
|
-
else if (is("keyboardButtonGame", button_)) {
|
|
56
|
+
else if (Api.is("keyboardButtonGame", button_)) {
|
|
57
57
|
return { text: button_.text, callbackGame: {} };
|
|
58
58
|
}
|
|
59
|
-
else if (is("keyboardButtonCopy", button_)) {
|
|
59
|
+
else if (Api.is("keyboardButtonCopy", button_)) {
|
|
60
60
|
return { text: button_.text, copy: button_.copy_text };
|
|
61
61
|
}
|
|
62
|
-
else if (is("keyboardButtonRequestPeer", button_)) {
|
|
62
|
+
else if (Api.is("keyboardButtonRequestPeer", button_)) {
|
|
63
63
|
unreachable();
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_inline_query.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_inline_query.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;IACrE,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmC1H"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { constructLocation } from "./0_location.js";
|
|
23
23
|
import { constructUser } from "./1_user.js";
|
|
24
24
|
export async function constructInlineQuery(query_, getEntity) {
|
|
@@ -29,26 +29,26 @@ export async function constructInlineQuery(query_, getEntity) {
|
|
|
29
29
|
const user = constructUser(user_);
|
|
30
30
|
let chatType;
|
|
31
31
|
if (query_.peer_type !== undefined) {
|
|
32
|
-
if (is("inlineQueryPeerTypeSameBotPM", query_.peer_type)) {
|
|
32
|
+
if (Api.is("inlineQueryPeerTypeSameBotPM", query_.peer_type)) {
|
|
33
33
|
chatType = "private";
|
|
34
34
|
}
|
|
35
|
-
else if (is("inlineQueryPeerTypeBotPM", query_.peer_type) || is("inlineQueryPeerTypePM", query_.peer_type)) {
|
|
35
|
+
else if (Api.is("inlineQueryPeerTypeBotPM", query_.peer_type) || Api.is("inlineQueryPeerTypePM", query_.peer_type)) {
|
|
36
36
|
chatType = "sender";
|
|
37
37
|
}
|
|
38
|
-
else if (is("inlineQueryPeerTypeChat", query_.peer_type)) {
|
|
38
|
+
else if (Api.is("inlineQueryPeerTypeChat", query_.peer_type)) {
|
|
39
39
|
chatType = "group";
|
|
40
40
|
}
|
|
41
|
-
else if (is("inlineQueryPeerTypeMegagroup", query_.peer_type)) {
|
|
41
|
+
else if (Api.is("inlineQueryPeerTypeMegagroup", query_.peer_type)) {
|
|
42
42
|
chatType = "supergroup";
|
|
43
43
|
}
|
|
44
|
-
else if (is("inlineQueryPeerTypeBroadcast", query_.peer_type)) {
|
|
44
|
+
else if (Api.is("inlineQueryPeerTypeBroadcast", query_.peer_type)) {
|
|
45
45
|
chatType = "channel";
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
unreachable();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
const location = query_.geo !== undefined && is("geoPoint", query_.geo) ? constructLocation(query_.geo) : undefined;
|
|
51
|
+
const location = query_.geo !== undefined && Api.is("geoPoint", query_.geo) ? constructLocation(query_.geo) : undefined;
|
|
52
52
|
return {
|
|
53
53
|
id: String(query_.query_id),
|
|
54
54
|
from: user,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_message_reactions.d.ts","sourceRoot":"","sources":["../../src/types/2_message_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_message_reactions.d.ts","sourceRoot":"","sources":["../../src/types/2_message_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,IAAI,EAAE,KAAK,CAAC;IACZ,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,6FAA6F;IAC7F,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,sDAAsD;IACtD,IAAI,EAAE,IAAI,CAAC;IACX,8BAA8B;IAC9B,YAAY,EAAE,QAAQ,EAAE,CAAC;IACzB,6BAA6B;IAC7B,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAkC/I"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { constructReaction } from "./0_reaction.js";
|
|
23
23
|
import { constructChatP } from "./1_chat_p.js";
|
|
24
24
|
import { constructUser } from "./1_user.js";
|
|
@@ -38,7 +38,7 @@ export async function constructMessageReactions(update, getEntity) {
|
|
|
38
38
|
if (!entity) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
if (is("user", entity)) {
|
|
41
|
+
if (Api.is("user", entity)) {
|
|
42
42
|
user = constructUser(entity);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_story_content.d.ts","sourceRoot":"","sources":["../../src/types/2_story_content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_story_content.d.ts","sourceRoot":"","sources":["../../src/types/2_story_content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AAErD,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,qBAAqB;IACrB,WAAW,EAAE,IAAI,CAAC;CACnB;AAED,uBAAuB;AACvB,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,uBAAuB,CAAC;AAE3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,YAAY,GAAG,YAAY,CA0B3E"}
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
23
23
|
import { constructPhoto } from "./1_photo.js";
|
|
24
24
|
import { constructVideo } from "./1_video.js";
|
|
25
25
|
export function constructStoryContent(media) {
|
|
26
|
-
if (is("messageMediaPhoto", media)) {
|
|
26
|
+
if (Api.is("messageMediaPhoto", media)) {
|
|
27
27
|
if (!media.photo) {
|
|
28
28
|
unreachable();
|
|
29
29
|
}
|
|
30
|
-
const photo = constructPhoto(as("photo", media.photo));
|
|
30
|
+
const photo = constructPhoto(Api.as("photo", media.photo));
|
|
31
31
|
return { photo };
|
|
32
32
|
}
|
|
33
|
-
else if (is("messageMediaDocument", media)) {
|
|
33
|
+
else if (Api.is("messageMediaDocument", media)) {
|
|
34
34
|
const document = media.document;
|
|
35
|
-
if (!(is("document", document))) {
|
|
35
|
+
if (!(Api.is("document", document))) {
|
|
36
36
|
unreachable();
|
|
37
37
|
}
|
|
38
|
-
const video = document.attributes.find((v) => is("documentAttributeVideo", v));
|
|
38
|
+
const video = document.attributes.find((v) => Api.is("documentAttributeVideo", v));
|
|
39
39
|
if (!video) {
|
|
40
40
|
unreachable();
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_story_interactive_area.d.ts","sourceRoot":"","sources":["../../src/types/2_story_interactive_area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"2_story_interactive_area.d.ts","sourceRoot":"","sources":["../../src/types/2_story_interactive_area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AAErD,gBAAgB;AAChB,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,mCAAmC;IAClD,QAAQ,EAAE,4BAA4B,CAAC;CACxC;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA6B,SAAQ,mCAAmC;IACvF,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,yBAA0B,SAAQ,mCAAmC;IACpF,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA6B,SAAQ,mCAAmC;IACvF,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,gBAAgB;AAChB,MAAM,WAAW,2BAA4B,SAAQ,mCAAmC;IACtF,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,kCAAkC;AAClC,MAAM,MAAM,oBAAoB,GAC5B,4BAA4B,GAC5B,yBAAyB,GACzB,4BAA4B,GAC5B,2BAA2B,CAAC;AAWhC,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,GAAG,CAAC,SAAS,GAAG,oBAAoB,CA+BvF;AAKD,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CA8BhI"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
|
-
import {
|
|
21
|
+
import { Api } from "../2_tl.js";
|
|
22
22
|
import { constructLocation } from "./0_location.js";
|
|
23
23
|
import { constructReaction, reactionToTlObject } from "./0_reaction.js";
|
|
24
24
|
import { constructVenue } from "./1_venue.js";
|
|
@@ -33,18 +33,18 @@ function constructStoryInteractiveAreaPosition(position) {
|
|
|
33
33
|
}
|
|
34
34
|
export function constructStoryInteractiveArea(area) {
|
|
35
35
|
const position = constructStoryInteractiveAreaPosition(area.coordinates);
|
|
36
|
-
if (is("mediaAreaGeoPoint", area)) {
|
|
37
|
-
if (is("geoPointEmpty", area.geo)) {
|
|
36
|
+
if (Api.is("mediaAreaGeoPoint", area)) {
|
|
37
|
+
if (Api.is("geoPointEmpty", area.geo)) {
|
|
38
38
|
unreachable(); // will this ever be empty?
|
|
39
39
|
}
|
|
40
40
|
const location = constructLocation(area.geo);
|
|
41
41
|
return { position, location };
|
|
42
42
|
}
|
|
43
|
-
else if (is("mediaAreaVenue", area)) {
|
|
43
|
+
else if (Api.is("mediaAreaVenue", area)) {
|
|
44
44
|
const venue = constructVenue(area);
|
|
45
45
|
return { position, venue };
|
|
46
46
|
}
|
|
47
|
-
else if (is("mediaAreaSuggestedReaction", area)) {
|
|
47
|
+
else if (Api.is("mediaAreaSuggestedReaction", area)) {
|
|
48
48
|
const reaction = constructReaction(area.reaction);
|
|
49
49
|
return {
|
|
50
50
|
position,
|
|
@@ -54,11 +54,11 @@ export function constructStoryInteractiveArea(area) {
|
|
|
54
54
|
dark: area.dark ? true : false,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
else if (is("mediaAreaChannelPost", area)) {
|
|
57
|
+
else if (Api.is("mediaAreaChannelPost", area)) {
|
|
58
58
|
return {
|
|
59
59
|
position,
|
|
60
60
|
messageReference: {
|
|
61
|
-
chatId: peerToChatId(area),
|
|
61
|
+
chatId: Api.peerToChatId(area),
|
|
62
62
|
messageId: area.msg_id,
|
|
63
63
|
},
|
|
64
64
|
};
|
|
@@ -94,8 +94,8 @@ export async function storyInteractiveAreaToTlObject(area, getEntity) {
|
|
|
94
94
|
return { _: "mediaAreaSuggestedReaction", coordinates, reaction, dark: area.dark ? true : undefined, flipped: area.flipped ? true : undefined };
|
|
95
95
|
}
|
|
96
96
|
else if ("messageReference" in area) {
|
|
97
|
-
const entity = await getEntity(chatIdToPeer(area.messageReference.chatId));
|
|
98
|
-
if (!(is("channel", entity))) {
|
|
97
|
+
const entity = await getEntity(Api.chatIdToPeer(area.messageReference.chatId));
|
|
98
|
+
if (!(Api.is("channel", entity))) {
|
|
99
99
|
unreachable();
|
|
100
100
|
}
|
|
101
101
|
const channel = { _: "inputChannel", channel_id: entity.id, access_hash: entity.access_hash ?? 0n };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_chat_member_updated.d.ts","sourceRoot":"","sources":["../../src/types/3_chat_member_updated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"3_chat_member_updated.d.ts","sourceRoot":"","sources":["../../src/types/3_chat_member_updated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,IAAI,EAAE,KAAK,CAAC;IACZ,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAC;IACX,uEAAuE;IACvE,IAAI,EAAE,IAAI,CAAC;IACX,yCAAyC;IACzC,aAAa,EAAE,UAAU,CAAC;IAC1B,yCAAyC;IACzC,aAAa,EAAE,UAAU,CAAC;IAC1B,oCAAoC;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAsB,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,GAAG,GAAG,CAAC,qBAAqB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA0BtK"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { constructChatP } from "./1_chat_p.js";
|
|
24
24
|
import { constructUser } from "./1_user.js";
|
|
25
25
|
import { constructChatMember } from "./2_chat_member.js";
|
|
@@ -40,7 +40,7 @@ export async function constructChatMemberUpdated(update, getEntity) {
|
|
|
40
40
|
const oldChatMember = await constructChatMember(update.prev_participant ?? ({ _: "channelParticipantLeft", peer: userPeer }), getEntity);
|
|
41
41
|
const newChatMember = await constructChatMember(update.new_participant ?? ({ _: "channelParticipantLeft", peer: userPeer }), getEntity);
|
|
42
42
|
const viaSharedFolder = "via_chatlist" in update ? update.via_chatlist ? true : update.invite ? false : undefined : undefined;
|
|
43
|
-
const inviteLink = (update.invite && is("chatInviteExported", update.invite)) ? await constructInviteLink(update.invite, getEntity) : undefined;
|
|
43
|
+
const inviteLink = (update.invite && Api.is("chatInviteExported", update.invite)) ? await constructInviteLink(update.invite, getEntity) : undefined;
|
|
44
44
|
return cleanObject({
|
|
45
45
|
chat,
|
|
46
46
|
from,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_gift.d.ts","sourceRoot":"","sources":["../../src/types/3_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"3_gift.d.ts","sourceRoot":"","sources":["../../src/types/3_gift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAqB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAkC,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvG;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,yDAAyD;IACzD,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,qBAAqB;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,UAAU,EAAE,qBAAqB,EAAE,CAAC;CACrC;AAED,cAAc;AACd,MAAM,MAAM,IAAI,GAAG,eAAe,GAAG,YAAY,CAAC;AAElD,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAMtD;AACD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,cAAc,GAAG,YAAY,CAkB5E;AACD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAqCjE"}
|
package/esm/types/3_gift.js
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
|
|
24
24
|
import { constructSticker2 } from "./1_sticker.js";
|
|
25
25
|
import { constructGiftUpgradedComponent } from "./2_gift_upgraded_component.js";
|
|
26
26
|
export function constructGift(gift) {
|
|
27
|
-
if (is("starGiftUnique", gift)) {
|
|
27
|
+
if (Api.is("starGiftUnique", gift)) {
|
|
28
28
|
return constructGiftUpgraded(gift);
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
@@ -51,7 +51,7 @@ export function constructGiftUpgraded(gift) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
export function constructGiftNonUpgraded(gift) {
|
|
54
|
-
if (!is("document", gift.sticker)) {
|
|
54
|
+
if (!Api.is("document", gift.sticker)) {
|
|
55
55
|
unreachable();
|
|
56
56
|
}
|
|
57
57
|
const id = String(gift.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_join_request.d.ts","sourceRoot":"","sources":["../../src/types/3_join_request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"3_join_request.d.ts","sourceRoot":"","sources":["../../src/types/3_join_request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,IAAI,EAAE,KAAK,CAAC;IACZ,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,4DAA4D;IAC5D,IAAI,EAAE,IAAI,CAAC;IACX,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmBlI"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
22
|
-
import {
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
23
|
import { constructChatP } from "./1_chat_p.js";
|
|
24
24
|
import { constructUser } from "./1_user.js";
|
|
25
25
|
import { constructInviteLink } from "./2_invite_link.js";
|
|
@@ -34,7 +34,7 @@ export async function constructJoinRequest(update, getEntity) {
|
|
|
34
34
|
unreachable();
|
|
35
35
|
}
|
|
36
36
|
const user = constructUser(user_);
|
|
37
|
-
const inviteLink = update.invite && is("chatInviteExported", update.invite) ? await constructInviteLink(update.invite, getEntity) : undefined;
|
|
37
|
+
const inviteLink = update.invite && Api.is("chatInviteExported", update.invite) ? await constructInviteLink(update.invite, getEntity) : undefined;
|
|
38
38
|
return cleanObject({
|
|
39
39
|
chat,
|
|
40
40
|
user,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_reply_markup.d.ts","sourceRoot":"","sources":["../../src/types/3_reply_markup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"3_reply_markup.d.ts","sourceRoot":"","sources":["../../src/types/3_reply_markup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAA2B,cAAc,EAA4B,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAiC,oBAAoB,EAAkC,MAAM,+BAA+B,CAAC;AAIpI,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,qBAAqB;IACrB,cAAc,EAAE,oBAAoB,EAAE,EAAE,CAAC;CAC1C;AA4BD,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,QAAQ,EAAE,cAAc,EAAE,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkCD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,EAAE,IAAI,CAAC;IACrB,2JAA2J;IAC3J,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB,6DAA6D;IAC7D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2JAA2J;IAC3J,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAmBD,gCAAgC;AAChC,MAAM,MAAM,WAAW,GAAG,yBAAyB,GAAG,mBAAmB,GAAG,yBAAyB,GAAG,qBAAqB,CAAC;AAE9H,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,WAAW,GAAG,WAAW,CAY9E;AAED,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAYlI"}
|