@mtkruto/node 0.1.118 → 0.1.121
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 +3 -3
- package/esm/0_deps.js +3 -3
- package/esm/2_tl.d.ts +3 -3
- package/esm/2_tl.js +3 -3
- package/esm/3_errors.d.ts +509 -509
- package/esm/3_errors.js +509 -509
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/4_errors.d.ts +7 -7
- package/esm/4_errors.js +6 -6
- package/esm/_dnt.shims.js +0 -1
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_password.js +4 -4
- package/esm/client/0_utilities.d.ts +3 -3
- package/esm/client/0_utilities.js +1 -2
- package/esm/client/2_client_plain.js +20 -20
- package/esm/client/3_types.d.ts +4 -0
- package/esm/client/4_composer.d.ts +5 -1
- package/esm/client/4_composer.js +37 -13
- package/esm/client/5_client.d.ts +24 -7
- package/esm/client/5_client.js +381 -258
- package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_strict_equals.js +1 -1
- package/esm/storage/0_storage.d.ts +5 -5
- package/esm/tl/1_tl_object.d.ts +4 -0
- package/esm/tl/1_tl_object.js +13 -4
- package/esm/tl/2_types.d.ts +11384 -6448
- package/esm/tl/2_types.js +16321 -10139
- package/esm/tl/3_functions.d.ts +6773 -2401
- package/esm/tl/3_functions.js +9440 -3368
- package/esm/tl/3_utilities.d.ts +2 -2
- package/esm/tl/3_utilities.js +4 -4
- package/esm/tl/6_message.d.ts +1 -1
- package/esm/tl/6_message.js +1 -1
- package/esm/types/0__file_id.js +1 -2
- package/esm/types/0_audio.js +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +3 -3
- package/esm/types/0_chat_administrator_rights.js +20 -20
- package/esm/types/0_chat_photo.js +8 -8
- package/esm/types/0_contact.js +4 -4
- package/esm/types/0_force_reply.d.ts +1 -1
- package/esm/types/0_location.js +4 -4
- package/esm/types/0_mask_position.d.ts +2 -2
- package/esm/types/0_message_entity.d.ts +3 -3
- package/esm/types/0_message_entity.js +8 -8
- package/esm/types/0_poll_option.d.ts +2 -2
- package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
- package/esm/types/0_restriction_reason.d.ts +2 -2
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_venue.js +3 -3
- package/esm/types/0_voice.js +1 -1
- package/esm/types/1_animation.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts +1 -2
- package/esm/types/1_bot_command_scope.js +1 -1
- package/esm/types/1_chat.js +9 -9
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_input_invoice_message_content.d.ts +1 -1
- package/esm/types/1_keyboard_button.d.ts +3 -3
- package/esm/types/1_keyboard_button.js +35 -35
- package/esm/types/1_photo.js +1 -1
- package/esm/types/1_poll.js +6 -6
- package/esm/types/1_sticker.js +3 -3
- package/esm/types/1_user.js +6 -6
- package/esm/types/1_video.js +1 -1
- package/esm/types/2_game.js +3 -3
- package/esm/types/2_inline_keyboard_button.d.ts +3 -3
- package/esm/types/2_inline_keyboard_button.js +9 -9
- package/esm/types/2_inline_query.js +8 -8
- package/esm/types/2_reply_keyboard_markup.d.ts +1 -1
- package/esm/types/2_reply_keyboard_markup.js +2 -2
- package/esm/types/3_inline_keyboard_markup.d.ts +1 -1
- package/esm/types/3_message.d.ts +4 -4
- package/esm/types/3_message.js +64 -64
- package/esm/types/4_callback_query.js +6 -6
- package/esm/types/4_reply_markup.d.ts +1 -1
- package/esm/types/5_inline_query_result.d.ts +1 -2
- package/esm/types/5_inline_query_result.js +30 -30
- package/package.json +13 -12
- package/script/0_deps.d.ts +3 -3
- package/script/0_deps.js +3 -3
- package/script/2_tl.d.ts +3 -3
- package/script/2_tl.js +5 -15
- package/script/3_errors.d.ts +509 -509
- package/script/3_errors.js +509 -509
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/4_errors.d.ts +7 -7
- package/script/4_errors.js +6 -6
- package/script/_dnt.shims.js +0 -1
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_password.js +4 -4
- package/script/client/0_utilities.d.ts +3 -3
- package/script/client/0_utilities.js +1 -2
- package/script/client/2_client_plain.js +20 -20
- package/script/client/3_types.d.ts +4 -0
- package/script/client/4_composer.d.ts +5 -1
- package/script/client/4_composer.js +37 -13
- package/script/client/5_client.d.ts +24 -7
- package/script/client/5_client.js +380 -257
- package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_diff.js +1 -1
- package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_strict_equals.js +1 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +1 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +3 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +1 -1
- package/script/storage/0_storage.d.ts +5 -5
- package/script/storage/0_utilities.js +1 -1
- package/script/tl/1_tl_object.d.ts +4 -0
- package/script/tl/1_tl_object.js +14 -5
- package/script/tl/2_types.d.ts +11384 -6448
- package/script/tl/2_types.js +18030 -11825
- package/script/tl/3_functions.d.ts +6773 -2401
- package/script/tl/3_functions.js +10051 -3994
- package/script/tl/3_utilities.d.ts +2 -2
- package/script/tl/3_utilities.js +7 -30
- package/script/tl/6_message.d.ts +1 -1
- package/script/tl/6_message.js +4 -4
- package/script/types/0__file_id.js +4 -4
- package/script/types/0_audio.js +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +3 -3
- package/script/types/0_chat_administrator_rights.js +20 -20
- package/script/types/0_chat_photo.js +8 -8
- package/script/types/0_contact.js +4 -4
- package/script/types/0_force_reply.d.ts +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_mask_position.d.ts +2 -2
- package/script/types/0_message_entity.d.ts +3 -3
- package/script/types/0_message_entity.js +8 -8
- package/script/types/0_poll_option.d.ts +2 -2
- package/script/types/0_reply_keyboard_remove.d.ts +1 -1
- package/script/types/0_restriction_reason.d.ts +2 -2
- package/script/types/0_thumbnail.js +3 -3
- package/script/types/0_venue.js +3 -3
- package/script/types/0_voice.js +1 -1
- package/script/types/1_animation.js +2 -2
- package/script/types/1_bot_command_scope.d.ts +1 -2
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat.js +9 -9
- package/script/types/1_document.js +2 -2
- package/script/types/1_input_invoice_message_content.d.ts +1 -1
- package/script/types/1_keyboard_button.d.ts +3 -3
- package/script/types/1_keyboard_button.js +35 -35
- package/script/types/1_photo.js +1 -1
- package/script/types/1_poll.js +6 -6
- package/script/types/1_sticker.js +3 -3
- package/script/types/1_user.js +6 -6
- package/script/types/1_video.js +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +3 -3
- package/script/types/2_inline_keyboard_button.js +9 -9
- package/script/types/2_inline_query.js +8 -8
- package/script/types/2_reply_keyboard_markup.d.ts +1 -1
- package/script/types/2_reply_keyboard_markup.js +2 -2
- package/script/types/3_inline_keyboard_markup.d.ts +1 -1
- package/script/types/3_message.d.ts +4 -4
- package/script/types/3_message.js +64 -64
- package/script/types/4_callback_query.js +6 -6
- package/script/types/4_reply_markup.d.ts +1 -1
- package/script/types/5_inline_query_result.d.ts +1 -2
- package/script/types/5_inline_query_result.js +30 -30
- package/esm/_dnt.test_shims.d.ts +0 -10
- package/esm/client/0_password_test.d.ts +0 -1
- package/esm/client/0_utilities_test.d.ts +0 -1
- package/esm/storage/0_utilities_test.d.ts +0 -1
- package/esm/tl/0_tl_raw_reader_test.d.ts +0 -1
- package/esm/tl/0_tl_raw_writer_test.d.ts +0 -1
- package/esm/tl/1_tl_object_test.d.ts +0 -1
- package/esm/tl/2_types_test.d.ts +0 -1
- package/esm/tl/3_deserialize_test.d.ts +0 -1
- package/esm/tl/3_functions_test.d.ts +0 -1
- package/esm/tl/6_message_test.d.ts +0 -1
- package/esm/utilities/0_base64_test.d.ts +0 -1
- package/esm/utilities/0_bigint_test.d.ts +0 -1
- package/esm/utilities/0_buffer_test.d.ts +0 -1
- package/esm/utilities/0_rle_test.d.ts +0 -1
- package/script/_dnt.test_shims.d.ts +0 -10
- package/script/client/0_password_test.d.ts +0 -1
- package/script/client/0_utilities_test.d.ts +0 -1
- package/script/storage/0_utilities_test.d.ts +0 -1
- package/script/tl/0_tl_raw_reader_test.d.ts +0 -1
- package/script/tl/0_tl_raw_writer_test.d.ts +0 -1
- package/script/tl/1_tl_object_test.d.ts +0 -1
- package/script/tl/2_types_test.d.ts +0 -1
- package/script/tl/3_deserialize_test.d.ts +0 -1
- package/script/tl/3_functions_test.d.ts +0 -1
- package/script/tl/6_message_test.d.ts +0 -1
- package/script/utilities/0_base64_test.d.ts +0 -1
- package/script/utilities/0_bigint_test.d.ts +0 -1
- package/script/utilities/0_buffer_test.d.ts +0 -1
- package/script/utilities/0_rle_test.d.ts +0 -1
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_diff.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_diff.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_almost_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_array_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_array_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_exists.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_exists.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_false.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_false.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_is_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_is_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_object_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_object_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_rejects.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_rejects.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_string_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_string_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_throws.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_throws.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/fail.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/fail.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unimplemented.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unimplemented.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unreachable.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unreachable.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/base64.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/base64.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/fmt/colors.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/fmt/colors.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/assert_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/assert_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize_string.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_interface.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_interface.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_os.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_os.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_namespaced_path.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/basename.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/basename.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/common.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/common.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/dirname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/dirname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/extname.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/extname.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/format.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/from_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/glob_to_regexp.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_absolute.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join_globs.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join_globs.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize_glob.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/parse.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/parse.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/relative.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/relative.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/resolve.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/resolve.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/separator.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/separator.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_file_url.js +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_namespaced_path.js +0 -0
- /package/esm/tl/{5_rpc_result.d.ts → 4_rpc_result.d.ts} +0 -0
- /package/esm/tl/{5_rpc_result.js → 4_rpc_result.js} +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_constants.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_diff.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_almost_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_array_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_array_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_exists.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_exists.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_false.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_false.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_greater_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_is_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_is_error.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_less_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_match.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_match.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_object_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_object_match.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_rejects.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_rejects.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_string_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_string_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_throws.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assert_throws.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/equal.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/fail.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/fail.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unimplemented.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unimplemented.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unreachable.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/assert/unreachable.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/base64.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/encoding/base64.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/fmt/colors.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/fmt/colors.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/assert_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/assert_path.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/common.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/constants.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/format.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/glob_to_reg_exp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/glob_to_reg_exp.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize_string.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/normalize_string.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/strip_trailing_separators.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_common/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_interface.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_interface.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_os.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/_os.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/common.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/format.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/common.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/format.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/posix/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/to_namespaced_path.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/basename.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/basename.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/common.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/common.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/dirname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/dirname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/extname.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/extname.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/format.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/from_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/from_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/glob_to_regexp.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/glob_to_regexp.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_absolute.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_absolute.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/is_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join_globs.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/join_globs.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize_glob.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/normalize_glob.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/parse.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/parse.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/relative.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/relative.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/resolve.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/resolve.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/separator.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/separator.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_file_url.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_file_url.js +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_namespaced_path.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.207.0 → std@0.208.0}/path/windows/to_namespaced_path.js +0 -0
- /package/script/tl/{5_rpc_result.d.ts → 4_rpc_result.d.ts} +0 -0
- /package/script/tl/{5_rpc_result.js → 4_rpc_result.js} +0 -0
package/esm/client/5_client.js
CHANGED
|
@@ -9,10 +9,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _Client_instances, _a, _Client_auth, _Client_sessionId, _Client_state, _Client_promises, _Client_toAcknowledge, _Client_updateState, _Client_publicKeys, _Client_autoStart, _Client_ignoreOutgoing, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_storageInited, _Client_setAuth, _Client_authKeyWasCreated, _Client_connectMutex, _Client_assertUser, _Client_assertBot, _Client_fetchState, _Client_connectionInited, _Client_initConnection, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_selfId, _Client_getSelfId, _Client_receiveLoop, _Client_pingInterval, _Client_pingLoop, _Client_pingLoopStarted, _Client_autoStarted, _Client_lastMsgId, _Client_invoke, _Client_handleInvokeError, _Client_processChats, _Client_processUsers, _Client_handleUpdateQueue, _Client_processUpdatesQueue, _Client_checkChannelGap, _Client_processUpdates, _Client_setUpdateStateDate, _Client_getLocalState, _Client_recoverUpdateGap, _Client_recoverChannelUpdateGap, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_updatesToMessages, _Client_resolveSendAs, _Client_parseText, _Client_getMessagesInner, _Client_downloadInner, _Client_lastGetMe, _Client_getMe, _Client_handleUpdate, _Client_usernameResolver, _Client_constructReplyMarkup, _Client_assertMsgHas, _Client_handle, _Client_setMyInfo, _Client_getMyInfo;
|
|
12
|
+
var _Client_instances, _a, _Client_auth, _Client_sessionId, _Client_state, _Client_promises, _Client_toAcknowledge, _Client_updateState, _Client_publicKeys, _Client_autoStart, _Client_ignoreOutgoing, _Client_prefixes, _Client_namespaceProxies, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_storageInited, _Client_setAuth, _Client_authKeyWasCreated, _Client_connectMutex, _Client_assertUser, _Client_assertBot, _Client_fetchState, _Client_connectionInited, _Client_initConnection, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_selfId, _Client_getSelfId, _Client_receiveLoop, _Client_pingInterval, _Client_pingLoop, _Client_pingLoopStarted, _Client_autoStarted, _Client_lastMsgId, _Client_invoke, _Client_handleInvokeError, _Client_processChats, _Client_processUsers, _Client_handleUpdateQueue, _Client_processUpdatesQueue, _Client_checkChannelGap, _Client_processUpdates, _Client_setUpdateStateDate, _Client_setUpdatePts, _Client_getLocalState, _Client_recoverUpdateGap, _Client_recoverChannelUpdateGap, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_updatesToMessages, _Client_resolveSendAs, _Client_parseText, _Client_getMessagesInner, _Client_downloadInner, _Client_lastGetMe, _Client_getMe, _Client_handleUpdate, _Client_usernameResolver, _Client_constructReplyMarkup, _Client_assertMsgHas, _Client_handle, _Client_setMyInfo, _Client_getMyInfo;
|
|
13
13
|
import { debug, gunzip, Mutex } from "../0_deps.js";
|
|
14
14
|
import { bigIntFromBuffer, cleanObject, drop, getRandomBigInt, getRandomId, mod, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
|
|
15
|
-
import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
|
|
15
|
+
import { as, functions, getChannelChatId, Message_, MessageContainer, name, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
|
|
16
16
|
import { StorageMemory } from "../3_storage.js";
|
|
17
17
|
import { botCommandScopeToTlObject, constructCallbackQuery, constructInlineQuery, constructMessage, constructUser, FileID, FileType, inlineQueryResultToTlObject, messageEntityToTlObject, replyMarkupToTlObject, ThumbnailSource } from "../3_types.js";
|
|
18
18
|
import { ACK_THRESHOLD, APP_VERSION, CHANNEL_DIFFERENCE_LIMIT_BOT, CHANNEL_DIFFERENCE_LIMIT_USER, DEVICE_MODEL, LANG_CODE, LANG_PACK, LAYER, MAX_CHANNEL_ID, MAX_CHAT_ID, STICKER_SET_NAME_TTL, SYSTEM_LANG_CODE, SYSTEM_VERSION, USERNAME_TTL, ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
@@ -34,6 +34,7 @@ const getEntity = Symbol();
|
|
|
34
34
|
const getStickerSetName = Symbol();
|
|
35
35
|
export const handleMigrationError = Symbol();
|
|
36
36
|
const getMessageWithReply = Symbol();
|
|
37
|
+
const functionNamespaces = Object.entries(functions).filter(([, v]) => !(v instanceof Function)).map(([k]) => k);
|
|
37
38
|
export function skipInvoke() {
|
|
38
39
|
return (_ctx, next) => next();
|
|
39
40
|
}
|
|
@@ -120,6 +121,63 @@ export class Client extends ClientAbstract {
|
|
|
120
121
|
_Client_publicKeys.set(this, void 0);
|
|
121
122
|
_Client_autoStart.set(this, void 0);
|
|
122
123
|
_Client_ignoreOutgoing.set(this, void 0);
|
|
124
|
+
_Client_prefixes.set(this, void 0);
|
|
125
|
+
_Client_namespaceProxies.set(this, (() => {
|
|
126
|
+
// deno-lint-ignore no-explicit-any
|
|
127
|
+
const proxies = {};
|
|
128
|
+
for (const name of functionNamespaces) {
|
|
129
|
+
const ns = functions[name];
|
|
130
|
+
proxies[name] = new Proxy({}, {
|
|
131
|
+
get: (_, key) => {
|
|
132
|
+
if (key in ns) {
|
|
133
|
+
// deno-lint-ignore no-explicit-any
|
|
134
|
+
const func = ns[key];
|
|
135
|
+
if (func instanceof Function) {
|
|
136
|
+
// deno-lint-ignore no-explicit-any
|
|
137
|
+
return (params) => {
|
|
138
|
+
// deno-lint-ignore ban-ts-comment
|
|
139
|
+
// @ts-ignore
|
|
140
|
+
return this.invoke(new func(params));
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
UNREACHABLE();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
set() {
|
|
149
|
+
return true;
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return proxies;
|
|
154
|
+
})());
|
|
155
|
+
Object.defineProperty(this, "api", {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
configurable: true,
|
|
158
|
+
writable: true,
|
|
159
|
+
value: new Proxy({}, {
|
|
160
|
+
get: (_, key) => {
|
|
161
|
+
if (key in functions) {
|
|
162
|
+
const func = functions[key];
|
|
163
|
+
if (func instanceof Function) {
|
|
164
|
+
// deno-lint-ignore no-explicit-any
|
|
165
|
+
return (params) => {
|
|
166
|
+
// deno-lint-ignore ban-ts-comment
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
return this.invoke(new func(params));
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return __classPrivateFieldGet(this, _Client_namespaceProxies, "f")[key];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
set() {
|
|
177
|
+
return true;
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
});
|
|
123
181
|
_Client_constructContext.set(this, async (update) => {
|
|
124
182
|
const msg = update.message ?? update.editedMessage ?? update.callbackQuery?.message;
|
|
125
183
|
const mustGetMsg = () => {
|
|
@@ -282,7 +340,7 @@ export class Client extends ClientAbstract {
|
|
|
282
340
|
_Client_lastGetMe.set(this, null);
|
|
283
341
|
_Client_usernameResolver.set(this, async (v) => {
|
|
284
342
|
const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
|
|
285
|
-
return new types.InputUser(
|
|
343
|
+
return new types.InputUser(inputPeer);
|
|
286
344
|
});
|
|
287
345
|
//#region Composer
|
|
288
346
|
_Client_handle.set(this, skip);
|
|
@@ -297,6 +355,7 @@ export class Client extends ClientAbstract {
|
|
|
297
355
|
__classPrivateFieldSet(this, _Client_publicKeys, params?.publicKeys, "f");
|
|
298
356
|
__classPrivateFieldSet(this, _Client_autoStart, params?.autoStart ?? true, "f");
|
|
299
357
|
__classPrivateFieldSet(this, _Client_ignoreOutgoing, params?.ignoreOutgoing ?? null, "f");
|
|
358
|
+
__classPrivateFieldSet(this, _Client_prefixes, params?.prefixes, "f");
|
|
300
359
|
if (params?.defaultHandlers ?? true) {
|
|
301
360
|
this.on("connectionState", ({ connectionState }, next) => {
|
|
302
361
|
drop((async () => {
|
|
@@ -406,7 +465,7 @@ export class Client extends ClientAbstract {
|
|
|
406
465
|
release();
|
|
407
466
|
}
|
|
408
467
|
}
|
|
409
|
-
async [(_Client_auth = new WeakMap(), _Client_sessionId = new WeakMap(), _Client_state = new WeakMap(), _Client_promises = new WeakMap(), _Client_toAcknowledge = new WeakMap(), _Client_updateState = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_autoStart = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_authKeyWasCreated = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_selfId = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_autoStarted = new WeakMap(), _Client_lastMsgId = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_handleUpdateQueue = new WeakMap(), _Client_processUpdatesQueue = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_usernameResolver = new WeakMap(), _Client_handle = new WeakMap(), _Client_instances = new WeakSet(), _Client_propagateConnectionState = function _Client_propagateConnectionState(connectionState) {
|
|
468
|
+
async [(_Client_auth = new WeakMap(), _Client_sessionId = new WeakMap(), _Client_state = new WeakMap(), _Client_promises = new WeakMap(), _Client_toAcknowledge = new WeakMap(), _Client_updateState = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_autoStart = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_prefixes = new WeakMap(), _Client_namespaceProxies = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_authKeyWasCreated = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_selfId = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_autoStarted = new WeakMap(), _Client_lastMsgId = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_handleUpdateQueue = new WeakMap(), _Client_processUpdatesQueue = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_usernameResolver = new WeakMap(), _Client_handle = new WeakMap(), _Client_instances = new WeakSet(), _Client_propagateConnectionState = function _Client_propagateConnectionState(connectionState) {
|
|
410
469
|
__classPrivateFieldGet(this, _Client_handleUpdateQueue, "f").add(async () => {
|
|
411
470
|
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, await __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { connectionState }), resolve);
|
|
412
471
|
});
|
|
@@ -423,7 +482,7 @@ export class Client extends ClientAbstract {
|
|
|
423
482
|
throw new Error(`${source}: not a bot client`);
|
|
424
483
|
}
|
|
425
484
|
}, _Client_fetchState = async function _Client_fetchState(source) {
|
|
426
|
-
const state = await this.invoke(new functions.
|
|
485
|
+
const state = await this.invoke(new functions.updates.getState());
|
|
427
486
|
__classPrivateFieldSet(this, _Client_updateState, state, "f");
|
|
428
487
|
d("state fetched [%s]", source);
|
|
429
488
|
}, handleMigrationError)](err) {
|
|
@@ -471,7 +530,7 @@ export class Client extends ClientAbstract {
|
|
|
471
530
|
params = { phone: () => mustPrompt("Phone number:"), code: () => mustPrompt("Verification code:"), password: () => mustPrompt("Password:") };
|
|
472
531
|
}
|
|
473
532
|
}
|
|
474
|
-
dAuth("authorizing with %s", typeof params === "string" ? "bot token" : params instanceof types.
|
|
533
|
+
dAuth("authorizing with %s", typeof params === "string" ? "bot token" : params instanceof types.auth.ExportedAuthorization ? "exported authorization" : "AuthorizeUserParams");
|
|
475
534
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initConnection).call(this);
|
|
476
535
|
try {
|
|
477
536
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_fetchState).call(this, "authorize");
|
|
@@ -487,8 +546,8 @@ export class Client extends ClientAbstract {
|
|
|
487
546
|
if (typeof params === "string") {
|
|
488
547
|
while (true) {
|
|
489
548
|
try {
|
|
490
|
-
const auth = await this.invoke(new functions.
|
|
491
|
-
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.
|
|
549
|
+
const auth = await this.invoke(new functions.auth.importBotAuthorization({ api_id: this.apiId, api_hash: this.apiHash, bot_auth_token: params, flags: 0 }));
|
|
550
|
+
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.auth.Authorization).user.id), "f");
|
|
492
551
|
await this.storage.setAccountType("bot");
|
|
493
552
|
break;
|
|
494
553
|
}
|
|
@@ -508,8 +567,8 @@ export class Client extends ClientAbstract {
|
|
|
508
567
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_fetchState).call(this, "authorize");
|
|
509
568
|
return;
|
|
510
569
|
}
|
|
511
|
-
if (params instanceof types.
|
|
512
|
-
await this.invoke(new functions.
|
|
570
|
+
if (params instanceof types.auth.ExportedAuthorization) {
|
|
571
|
+
await this.invoke(new functions.auth.importAuthorization({ id: params.id, bytes: params.bytes }));
|
|
513
572
|
dAuth("authorization imported");
|
|
514
573
|
return;
|
|
515
574
|
}
|
|
@@ -520,12 +579,12 @@ export class Client extends ClientAbstract {
|
|
|
520
579
|
while (true) {
|
|
521
580
|
try {
|
|
522
581
|
phone = typeof params.phone === "string" ? params.phone : await params.phone();
|
|
523
|
-
const sendCode = () => this.invoke(new functions.
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
582
|
+
const sendCode = () => this.invoke(new functions.auth.sendCode({
|
|
583
|
+
phone_number: phone,
|
|
584
|
+
api_id: this.apiId,
|
|
585
|
+
api_hash: this.apiHash,
|
|
527
586
|
settings: new types.CodeSettings(),
|
|
528
|
-
})).then((v) => v[as](types.
|
|
587
|
+
})).then((v) => v[as](types.auth.SentCode));
|
|
529
588
|
try {
|
|
530
589
|
sentCode = await sendCode();
|
|
531
590
|
}
|
|
@@ -555,12 +614,12 @@ export class Client extends ClientAbstract {
|
|
|
555
614
|
code: while (true) {
|
|
556
615
|
const code = typeof params.code === "string" ? params.code : await params.code();
|
|
557
616
|
try {
|
|
558
|
-
const auth = await this.invoke(new functions.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
617
|
+
const auth = await this.invoke(new functions.auth.signIn({
|
|
618
|
+
phone_number: phone,
|
|
619
|
+
phone_code: code,
|
|
620
|
+
phone_code_hash: sentCode.phone_code_hash,
|
|
562
621
|
}));
|
|
563
|
-
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.
|
|
622
|
+
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.auth.Authorization).user.id), "f");
|
|
564
623
|
await this.storage.setAccountType("user");
|
|
565
624
|
dAuth("authorized as user");
|
|
566
625
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, true);
|
|
@@ -568,7 +627,7 @@ export class Client extends ClientAbstract {
|
|
|
568
627
|
return;
|
|
569
628
|
}
|
|
570
629
|
catch (err_) {
|
|
571
|
-
if (err_ instanceof types.
|
|
630
|
+
if (err_ instanceof types.Rpc_error && err_.error_message == "PHONE_CODE_INVALID") {
|
|
572
631
|
continue code;
|
|
573
632
|
}
|
|
574
633
|
else {
|
|
@@ -581,20 +640,20 @@ export class Client extends ClientAbstract {
|
|
|
581
640
|
throw err;
|
|
582
641
|
}
|
|
583
642
|
password: while (true) {
|
|
584
|
-
const ap = await this.invoke(new functions.
|
|
585
|
-
if (!(ap.
|
|
586
|
-
throw new Error(`Handling ${ap.
|
|
643
|
+
const ap = await this.invoke(new functions.account.getPassword());
|
|
644
|
+
if (!(ap.current_algo instanceof types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {
|
|
645
|
+
throw new Error(`Handling ${ap.current_algo?.[name]} not implemented`);
|
|
587
646
|
}
|
|
588
647
|
try {
|
|
589
648
|
const password = typeof params.password === "string" ? params.password : await params.password(ap.hint ?? null);
|
|
590
649
|
const input = await checkPassword(password, ap);
|
|
591
|
-
const auth = await this.invoke(new functions.
|
|
592
|
-
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.
|
|
650
|
+
const auth = await this.invoke(new functions.auth.checkPassword({ password: input }));
|
|
651
|
+
__classPrivateFieldSet(this, _Client_selfId, Number(auth[as](types.auth.Authorization).user.id), "f");
|
|
593
652
|
await this.storage.setAccountType("user");
|
|
594
653
|
dAuth("authorized as user");
|
|
595
654
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, true);
|
|
596
655
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_fetchState).call(this, "authorize");
|
|
597
|
-
|
|
656
|
+
return;
|
|
598
657
|
}
|
|
599
658
|
catch (err) {
|
|
600
659
|
if (err instanceof PasswordHashInvalid) {
|
|
@@ -651,36 +710,36 @@ export class Client extends ClientAbstract {
|
|
|
651
710
|
}
|
|
652
711
|
}
|
|
653
712
|
async getUserAccessHash(userId) {
|
|
654
|
-
const users = await this.invoke(new functions.
|
|
655
|
-
return users[0]?.[as](types.User).
|
|
713
|
+
const users = await this.invoke(new functions.users.getUsers({ id: [new types.InputUser({ user_id: userId, access_hash: 0n })] }));
|
|
714
|
+
return users[0]?.[as](types.User).access_hash ?? 0n;
|
|
656
715
|
}
|
|
657
716
|
async getInputPeer(id) {
|
|
658
717
|
const inputPeer = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getInputPeerInner).call(this, id);
|
|
659
|
-
if ((inputPeer instanceof types.InputPeerUser || inputPeer instanceof types.InputPeerChannel && inputPeer.
|
|
660
|
-
if ("
|
|
661
|
-
inputPeer.
|
|
718
|
+
if ((inputPeer instanceof types.InputPeerUser || inputPeer instanceof types.InputPeerChannel && inputPeer.access_hash == 0n) && await this.storage.getAccountType() == "bot") {
|
|
719
|
+
if ("channel_id" in inputPeer) {
|
|
720
|
+
inputPeer.access_hash = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getChannelAccessHash).call(this, inputPeer.channel_id);
|
|
662
721
|
}
|
|
663
722
|
else {
|
|
664
|
-
inputPeer.
|
|
665
|
-
await this.storage.setUserAccessHash(inputPeer.
|
|
723
|
+
inputPeer.access_hash = await this.getUserAccessHash(inputPeer.user_id);
|
|
724
|
+
await this.storage.setUserAccessHash(inputPeer.user_id, inputPeer.access_hash);
|
|
666
725
|
}
|
|
667
726
|
}
|
|
668
727
|
return inputPeer;
|
|
669
728
|
}
|
|
670
729
|
[(_Client_initConnection = async function _Client_initConnection() {
|
|
671
730
|
if (!__classPrivateFieldGet(this, _Client_connectionInited, "f")) {
|
|
672
|
-
await this.invoke(new functions.
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
query: new functions.
|
|
731
|
+
await this.invoke(new functions.initConnection({
|
|
732
|
+
api_id: this.apiId,
|
|
733
|
+
app_version: this.appVersion,
|
|
734
|
+
device_model: this.deviceModel,
|
|
735
|
+
lang_code: this.langCode,
|
|
736
|
+
lang_pack: this.langPack,
|
|
737
|
+
query: new functions.invokeWithLayer({
|
|
679
738
|
layer: LAYER,
|
|
680
|
-
query: new functions.
|
|
739
|
+
query: new functions.help.getConfig(),
|
|
681
740
|
}),
|
|
682
|
-
|
|
683
|
-
|
|
741
|
+
system_lang_code: this.systemLangCode,
|
|
742
|
+
system_version: this.systemVersion,
|
|
684
743
|
}));
|
|
685
744
|
__classPrivateFieldSet(this, _Client_connectionInited, true, "f");
|
|
686
745
|
d("connection inited");
|
|
@@ -702,7 +761,7 @@ export class Client extends ClientAbstract {
|
|
|
702
761
|
while (this.connected) {
|
|
703
762
|
try {
|
|
704
763
|
if (__classPrivateFieldGet(this, _Client_toAcknowledge, "f").size >= ACK_THRESHOLD) {
|
|
705
|
-
await this.send(new types.
|
|
764
|
+
await this.send(new types.Msgs_ack({ msg_ids: [...__classPrivateFieldGet(this, _Client_toAcknowledge, "f")] }));
|
|
706
765
|
__classPrivateFieldGet(this, _Client_toAcknowledge, "f").clear();
|
|
707
766
|
}
|
|
708
767
|
const buffer = await this.transport.transport.receive();
|
|
@@ -718,33 +777,33 @@ export class Client extends ClientAbstract {
|
|
|
718
777
|
const messages = decrypted instanceof MessageContainer ? decrypted.messages : [decrypted];
|
|
719
778
|
for (const message of messages) {
|
|
720
779
|
let body = message.body;
|
|
721
|
-
if (body instanceof types.
|
|
722
|
-
body = new TLReader(gunzip(body.
|
|
780
|
+
if (body instanceof types.Gzip_packed) {
|
|
781
|
+
body = new TLReader(gunzip(body.packed_data)).readObject();
|
|
723
782
|
}
|
|
724
|
-
dRecv("received %s", body.constructor.name);
|
|
725
|
-
if (body instanceof types.
|
|
783
|
+
dRecv("received %s", (typeof body === "object" && name in body) ? body[name] : body.constructor.name);
|
|
784
|
+
if (body instanceof types._Updates || body instanceof types._Update) {
|
|
726
785
|
__classPrivateFieldGet(this, _Client_processUpdatesQueue, "f").add(() => __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, body, true));
|
|
727
786
|
}
|
|
728
|
-
else if (body instanceof types.
|
|
729
|
-
__classPrivateFieldGet(this, _Client_state, "f").salt = body.
|
|
787
|
+
else if (body instanceof types.New_session_created) {
|
|
788
|
+
__classPrivateFieldGet(this, _Client_state, "f").salt = body.server_salt;
|
|
730
789
|
await this.storage.setServerSalt(__classPrivateFieldGet(this, _Client_state, "f").salt);
|
|
731
790
|
}
|
|
732
791
|
else if (message.body instanceof RPCResult) {
|
|
733
792
|
let result = message.body.result;
|
|
734
|
-
if (result instanceof types.
|
|
735
|
-
result = new TLReader(gunzip(result.
|
|
793
|
+
if (result instanceof types.Gzip_packed) {
|
|
794
|
+
result = new TLReader(gunzip(result.packed_data)).readObject();
|
|
736
795
|
}
|
|
737
|
-
if (result instanceof types.
|
|
738
|
-
dRecv("RPCResult: %d %s", result.
|
|
796
|
+
if (result instanceof types.Rpc_error) {
|
|
797
|
+
dRecv("RPCResult: %d %s", result.error_code, result.error_message);
|
|
739
798
|
}
|
|
740
799
|
else {
|
|
741
|
-
dRecv("RPCResult: %s", result.constructor.name);
|
|
800
|
+
dRecv("RPCResult: %s", (typeof result === "object" && name in result) ? result[name] : result.constructor.name);
|
|
742
801
|
}
|
|
743
802
|
const messageId = message.body.messageId;
|
|
744
803
|
const resolvePromise = () => {
|
|
745
804
|
const promise = __classPrivateFieldGet(this, _Client_promises, "f").get(messageId);
|
|
746
805
|
if (promise) {
|
|
747
|
-
if (result instanceof types.
|
|
806
|
+
if (result instanceof types.Rpc_error) {
|
|
748
807
|
promise.reject(upgradeInstance(result));
|
|
749
808
|
}
|
|
750
809
|
else {
|
|
@@ -753,7 +812,7 @@ export class Client extends ClientAbstract {
|
|
|
753
812
|
__classPrivateFieldGet(this, _Client_promises, "f").delete(messageId);
|
|
754
813
|
}
|
|
755
814
|
};
|
|
756
|
-
if (result instanceof types.
|
|
815
|
+
if (result instanceof types._Updates || result instanceof types._Update) {
|
|
757
816
|
__classPrivateFieldGet(this, _Client_processUpdatesQueue, "f").add(async () => {
|
|
758
817
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, result, true);
|
|
759
818
|
resolvePromise();
|
|
@@ -765,20 +824,20 @@ export class Client extends ClientAbstract {
|
|
|
765
824
|
}
|
|
766
825
|
}
|
|
767
826
|
else if (message.body instanceof types.Pong) {
|
|
768
|
-
const promise = __classPrivateFieldGet(this, _Client_promises, "f").get(message.body.
|
|
827
|
+
const promise = __classPrivateFieldGet(this, _Client_promises, "f").get(message.body.msg_id);
|
|
769
828
|
if (promise) {
|
|
770
829
|
promise.resolve(message.body);
|
|
771
|
-
__classPrivateFieldGet(this, _Client_promises, "f").delete(message.body.
|
|
830
|
+
__classPrivateFieldGet(this, _Client_promises, "f").delete(message.body.msg_id);
|
|
772
831
|
}
|
|
773
832
|
}
|
|
774
|
-
else if (message.body instanceof types.
|
|
833
|
+
else if (message.body instanceof types.Bad_server_salt) {
|
|
775
834
|
d("server salt reassigned");
|
|
776
|
-
__classPrivateFieldGet(this, _Client_state, "f").salt = message.body.
|
|
835
|
+
__classPrivateFieldGet(this, _Client_state, "f").salt = message.body.new_server_salt;
|
|
777
836
|
await this.storage.setServerSalt(__classPrivateFieldGet(this, _Client_state, "f").salt);
|
|
778
|
-
const promise = __classPrivateFieldGet(this, _Client_promises, "f").get(message.body.
|
|
837
|
+
const promise = __classPrivateFieldGet(this, _Client_promises, "f").get(message.body.bad_msg_id);
|
|
779
838
|
if (promise) {
|
|
780
839
|
promise.resolve(message.body);
|
|
781
|
-
__classPrivateFieldGet(this, _Client_promises, "f").delete(message.body.
|
|
840
|
+
__classPrivateFieldGet(this, _Client_promises, "f").delete(message.body.bad_msg_id);
|
|
782
841
|
}
|
|
783
842
|
}
|
|
784
843
|
__classPrivateFieldGet(this, _Client_toAcknowledge, "f").add(message.id);
|
|
@@ -809,7 +868,7 @@ export class Client extends ClientAbstract {
|
|
|
809
868
|
while (this.connected) {
|
|
810
869
|
await new Promise((r) => setTimeout(r, __classPrivateFieldGet(this, _Client_pingInterval, "f")));
|
|
811
870
|
try {
|
|
812
|
-
await this.invoke(new functions.
|
|
871
|
+
await this.invoke(new functions.ping_delay_disconnect({ ping_id: getRandomBigInt(8, true, false), disconnect_delay: __classPrivateFieldGet(this, _Client_pingInterval, "f") + 15 }));
|
|
813
872
|
}
|
|
814
873
|
catch (err) {
|
|
815
874
|
d("ping loop error: %o", err);
|
|
@@ -831,18 +890,18 @@ export class Client extends ClientAbstract {
|
|
|
831
890
|
while (true) {
|
|
832
891
|
try {
|
|
833
892
|
let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
|
|
834
|
-
if (!(function_ instanceof functions.
|
|
893
|
+
if (!(function_ instanceof functions.ping) && !(function_ instanceof types.Msgs_ack)) {
|
|
835
894
|
seqNo++;
|
|
836
895
|
__classPrivateFieldGet(this, _Client_state, "f").seqNo++;
|
|
837
896
|
}
|
|
838
897
|
const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, getMessageId(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
|
|
839
898
|
const message = new Message_(messageId, seqNo, function_);
|
|
840
899
|
await this.transport.transport.send(await encryptMessage(message, __classPrivateFieldGet(this, _Client_auth, "f").key, __classPrivateFieldGet(this, _Client_auth, "f").id, __classPrivateFieldGet(this, _Client_state, "f").salt, __classPrivateFieldGet(this, _Client_sessionId, "f")));
|
|
841
|
-
d("invoked %s", function_
|
|
900
|
+
d("invoked %s", function_[name]);
|
|
842
901
|
if (noWait) {
|
|
843
902
|
__classPrivateFieldGet(this, _Client_promises, "f").set(message.id, {
|
|
844
903
|
resolve: (result) => {
|
|
845
|
-
if (result instanceof types.
|
|
904
|
+
if (result instanceof types.Bad_server_salt) {
|
|
846
905
|
drop(this.invoke(function_, true));
|
|
847
906
|
}
|
|
848
907
|
},
|
|
@@ -862,7 +921,7 @@ export class Client extends ClientAbstract {
|
|
|
862
921
|
}
|
|
863
922
|
throw err;
|
|
864
923
|
}
|
|
865
|
-
if (result instanceof types.
|
|
924
|
+
if (result instanceof types.Bad_server_salt) {
|
|
866
925
|
return await this.invoke(function_);
|
|
867
926
|
}
|
|
868
927
|
else {
|
|
@@ -884,9 +943,9 @@ export class Client extends ClientAbstract {
|
|
|
884
943
|
}
|
|
885
944
|
}, _Client_processChats = async function _Client_processChats(chats) {
|
|
886
945
|
for (const chat of chats) {
|
|
887
|
-
if (chat instanceof types.Channel && chat.
|
|
946
|
+
if (chat instanceof types.Channel && chat.access_hash) {
|
|
888
947
|
await this.storage.setEntity(chat);
|
|
889
|
-
await this.storage.setChannelAccessHash(chat.id, chat.
|
|
948
|
+
await this.storage.setChannelAccessHash(chat.id, chat.access_hash);
|
|
890
949
|
if (chat.username) {
|
|
891
950
|
await this.storage.updateUsernames("channel", chat.id, [chat.username]);
|
|
892
951
|
}
|
|
@@ -900,9 +959,9 @@ export class Client extends ClientAbstract {
|
|
|
900
959
|
}
|
|
901
960
|
}, _Client_processUsers = async function _Client_processUsers(users) {
|
|
902
961
|
for (const user of users) {
|
|
903
|
-
if (user instanceof types.User && user.
|
|
962
|
+
if (user instanceof types.User && user.access_hash) {
|
|
904
963
|
await this.storage.setEntity(user);
|
|
905
|
-
await this.storage.setUserAccessHash(user.id, user.
|
|
964
|
+
await this.storage.setUserAccessHash(user.id, user.access_hash);
|
|
906
965
|
if (user.username) {
|
|
907
966
|
await this.storage.updateUsernames("user", user.id, [user.username]);
|
|
908
967
|
}
|
|
@@ -930,6 +989,34 @@ export class Client extends ClientAbstract {
|
|
|
930
989
|
let updates;
|
|
931
990
|
if (updates_ instanceof types.UpdatesCombined || updates_ instanceof types.Updates) {
|
|
932
991
|
updates = updates_.updates;
|
|
992
|
+
const seq = updates_.seq;
|
|
993
|
+
const seqStart = "seq_start" in updates_ ? updates_.seq_start : updates_.seq;
|
|
994
|
+
if (checkGap) {
|
|
995
|
+
if (seqStart == 0) {
|
|
996
|
+
checkGap = false;
|
|
997
|
+
d("seqStart=0");
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
const localState = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
1001
|
+
const localSeq = localState.seq;
|
|
1002
|
+
if (localSeq + 1 == seqStart) {
|
|
1003
|
+
// The updates can be applied.
|
|
1004
|
+
localState.seq = seq;
|
|
1005
|
+
localState.date = updates_.date;
|
|
1006
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setUpdateStateDate).call(this, updates_.date);
|
|
1007
|
+
await this.storage.setState(localState);
|
|
1008
|
+
}
|
|
1009
|
+
else if (localSeq + 1 > seqStart) {
|
|
1010
|
+
// The updates were already applied, and must be ignored.
|
|
1011
|
+
d("localSeq + 1 > seqStart");
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
else if (localSeq + 1 < seqStart) {
|
|
1015
|
+
// There's an updates gap that must be filled.
|
|
1016
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_recoverUpdateGap).call(this, "localSeq + 1 < seqStart");
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
933
1020
|
}
|
|
934
1021
|
else if (updates_ instanceof types.UpdateShort) {
|
|
935
1022
|
updates = [updates_.update];
|
|
@@ -943,7 +1030,7 @@ export class Client extends ClientAbstract {
|
|
|
943
1030
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_recoverUpdateGap).call(this, "updatesTooLong");
|
|
944
1031
|
return;
|
|
945
1032
|
}
|
|
946
|
-
else if (updates_ instanceof types.
|
|
1033
|
+
else if (updates_ instanceof types._Update) {
|
|
947
1034
|
updates = [updates_];
|
|
948
1035
|
}
|
|
949
1036
|
else {
|
|
@@ -962,11 +1049,11 @@ export class Client extends ClientAbstract {
|
|
|
962
1049
|
continue;
|
|
963
1050
|
}
|
|
964
1051
|
if (checkGap) {
|
|
965
|
-
await this.checkGap(update.pts, update.
|
|
1052
|
+
await this.checkGap(update.pts, update.pts_count);
|
|
966
1053
|
}
|
|
967
1054
|
localState ??= await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
968
1055
|
originalPts ??= localState.pts;
|
|
969
|
-
if (localState.pts + update.
|
|
1056
|
+
if (localState.pts + update.pts_count > update.pts) {
|
|
970
1057
|
updates = updates.filter((v) => v != update);
|
|
971
1058
|
}
|
|
972
1059
|
else {
|
|
@@ -977,8 +1064,8 @@ export class Client extends ClientAbstract {
|
|
|
977
1064
|
if (update.pts == 0) {
|
|
978
1065
|
continue;
|
|
979
1066
|
}
|
|
980
|
-
const ptsCount = update.
|
|
981
|
-
const channelId = update instanceof types.UpdateNewChannelMessage || update instanceof types.UpdateEditChannelMessage ? update.message.
|
|
1067
|
+
const ptsCount = update.pts_count;
|
|
1068
|
+
const channelId = update instanceof types.UpdateNewChannelMessage || update instanceof types.UpdateEditChannelMessage ? update.message.peer_id[as](types.PeerChannel).channel_id : update.channel_id;
|
|
982
1069
|
if (checkGap) {
|
|
983
1070
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_checkChannelGap).call(this, channelId, update.pts, ptsCount);
|
|
984
1071
|
}
|
|
@@ -1013,12 +1100,12 @@ export class Client extends ClientAbstract {
|
|
|
1013
1100
|
}
|
|
1014
1101
|
else if (update instanceof types.UpdateChannelTooLong) {
|
|
1015
1102
|
if (update.pts != undefined) {
|
|
1016
|
-
await this.storage.setChannelPts(update.
|
|
1103
|
+
await this.storage.setChannelPts(update.channel_id, update.pts);
|
|
1017
1104
|
}
|
|
1018
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_recoverChannelUpdateGap).call(this, update.
|
|
1105
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_recoverChannelUpdateGap).call(this, update.channel_id, "updateChannelTooLong");
|
|
1019
1106
|
}
|
|
1020
1107
|
else if (update instanceof types.UpdateUserName) {
|
|
1021
|
-
await this.storage.updateUsernames("user", update.
|
|
1108
|
+
await this.storage.updateUsernames("user", update.user_id, update.usernames.map((v) => v.username));
|
|
1022
1109
|
}
|
|
1023
1110
|
else if (update instanceof types.UpdatePtsChanged) {
|
|
1024
1111
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_fetchState).call(this, "updatePtsChanged");
|
|
@@ -1029,8 +1116,23 @@ export class Client extends ClientAbstract {
|
|
|
1029
1116
|
UNREACHABLE();
|
|
1030
1117
|
}
|
|
1031
1118
|
}
|
|
1119
|
+
if (isPtsUpdate(update)) {
|
|
1120
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setUpdatePts).call(this, update.pts);
|
|
1121
|
+
}
|
|
1122
|
+
else if (isChannelPtsUpdate(update)) {
|
|
1123
|
+
let channelId = null;
|
|
1124
|
+
if ("channel_id" in update) {
|
|
1125
|
+
channelId = update.channel_id;
|
|
1126
|
+
}
|
|
1127
|
+
else if ("peer_id" in update.message && update.message.peer_id !== undefined && "channel_id" in update.message.peer_id) {
|
|
1128
|
+
channelId = update.message.peer_id.channel_id;
|
|
1129
|
+
}
|
|
1130
|
+
if (channelId != null) {
|
|
1131
|
+
await this.storage.setChannelPts(channelId, update.pts);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1032
1134
|
/// If there were any Update, they will be passed to the update handling queue.
|
|
1033
|
-
if (update instanceof types.
|
|
1135
|
+
if (update instanceof types._Update) {
|
|
1034
1136
|
updatesToHandle.push(update);
|
|
1035
1137
|
}
|
|
1036
1138
|
}
|
|
@@ -1043,6 +1145,10 @@ export class Client extends ClientAbstract {
|
|
|
1043
1145
|
const localState = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
1044
1146
|
localState.date = date;
|
|
1045
1147
|
await this.storage.setState(localState);
|
|
1148
|
+
}, _Client_setUpdatePts = async function _Client_setUpdatePts(pts) {
|
|
1149
|
+
const localState = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
1150
|
+
localState.pts = pts;
|
|
1151
|
+
await this.storage.setState(localState);
|
|
1046
1152
|
}, _Client_getLocalState = async function _Client_getLocalState() {
|
|
1047
1153
|
let localState = await this.storage.getState();
|
|
1048
1154
|
if (!localState) {
|
|
@@ -1068,34 +1174,34 @@ export class Client extends ClientAbstract {
|
|
|
1068
1174
|
try {
|
|
1069
1175
|
let state = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
1070
1176
|
while (true) {
|
|
1071
|
-
const difference = await this.invoke(new functions.
|
|
1072
|
-
if (difference instanceof types.
|
|
1177
|
+
const difference = await this.invoke(new functions.updates.getDifference({ pts: state.pts, date: state.date, qts: state.qts ?? 0 }));
|
|
1178
|
+
if (difference instanceof types.updates.Difference || difference instanceof types.updates.DifferenceSlice) {
|
|
1073
1179
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processChats).call(this, difference.chats);
|
|
1074
1180
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUsers).call(this, difference.users);
|
|
1075
|
-
for (const message of difference.
|
|
1076
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewMessage({ message, pts: 0,
|
|
1181
|
+
for (const message of difference.new_messages) {
|
|
1182
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewMessage({ message, pts: 0, pts_count: 0 }), false);
|
|
1077
1183
|
}
|
|
1078
|
-
for (const update of difference.
|
|
1184
|
+
for (const update of difference.other_updates) {
|
|
1079
1185
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, update, false);
|
|
1080
1186
|
}
|
|
1081
|
-
if (difference instanceof types.
|
|
1187
|
+
if (difference instanceof types.updates.Difference) {
|
|
1082
1188
|
await this.storage.setState(difference.state);
|
|
1083
1189
|
dGap("recovered from update gap");
|
|
1084
1190
|
break;
|
|
1085
1191
|
}
|
|
1086
|
-
else if (difference instanceof types.
|
|
1087
|
-
state = difference.
|
|
1192
|
+
else if (difference instanceof types.updates.DifferenceSlice) {
|
|
1193
|
+
state = difference.intermediate_state;
|
|
1088
1194
|
}
|
|
1089
1195
|
else {
|
|
1090
1196
|
UNREACHABLE();
|
|
1091
1197
|
}
|
|
1092
1198
|
}
|
|
1093
|
-
else if (difference instanceof types.
|
|
1199
|
+
else if (difference instanceof types.updates.DifferenceTooLong) {
|
|
1094
1200
|
await this.storage.deleteMessages();
|
|
1095
1201
|
state.pts = difference.pts;
|
|
1096
1202
|
dGap("received differenceTooLong");
|
|
1097
1203
|
}
|
|
1098
|
-
else if (difference instanceof types.
|
|
1204
|
+
else if (difference instanceof types.updates.DifferenceEmpty) {
|
|
1099
1205
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setUpdateStateDate).call(this, difference.date);
|
|
1100
1206
|
dGap("there was no update gap");
|
|
1101
1207
|
break;
|
|
@@ -1113,33 +1219,33 @@ export class Client extends ClientAbstract {
|
|
|
1113
1219
|
const pts_ = await this.storage.getChannelPts(channelId);
|
|
1114
1220
|
let pts = pts_ == null ? 1 : pts_;
|
|
1115
1221
|
while (true) {
|
|
1116
|
-
const {
|
|
1117
|
-
const difference = await this.invoke(new functions.
|
|
1222
|
+
const { access_hash } = await this.getInputPeer(ZERO_CHANNEL_ID + -Number(channelId)).then((v) => v[as](types.InputPeerChannel));
|
|
1223
|
+
const difference = await this.invoke(new functions.updates.getChannelDifference({
|
|
1118
1224
|
pts,
|
|
1119
|
-
channel: new types.InputChannel({ channelId,
|
|
1225
|
+
channel: new types.InputChannel({ channel_id: channelId, access_hash }),
|
|
1120
1226
|
filter: new types.ChannelMessagesFilterEmpty(),
|
|
1121
1227
|
limit: await this.storage.getAccountType() == "user" ? CHANNEL_DIFFERENCE_LIMIT_USER : CHANNEL_DIFFERENCE_LIMIT_BOT,
|
|
1122
1228
|
}));
|
|
1123
|
-
if (difference instanceof types.
|
|
1229
|
+
if (difference instanceof types.updates.ChannelDifference) {
|
|
1124
1230
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processChats).call(this, difference.chats);
|
|
1125
1231
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUsers).call(this, difference.users);
|
|
1126
|
-
for (const message of difference.
|
|
1127
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewChannelMessage({ message, pts: 0,
|
|
1232
|
+
for (const message of difference.new_messages) {
|
|
1233
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewChannelMessage({ message, pts: 0, pts_count: 0 }), false);
|
|
1128
1234
|
}
|
|
1129
|
-
for (const update of difference.
|
|
1235
|
+
for (const update of difference.other_updates) {
|
|
1130
1236
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, update, false);
|
|
1131
1237
|
}
|
|
1132
1238
|
await this.storage.setChannelPts(channelId, difference.pts);
|
|
1133
1239
|
dGapC("recovered from update gap [%o, %s]", channelId, source);
|
|
1134
1240
|
break;
|
|
1135
1241
|
}
|
|
1136
|
-
else if (difference instanceof types.
|
|
1242
|
+
else if (difference instanceof types.updates.ChannelDifferenceTooLong) {
|
|
1137
1243
|
// invalidate messages
|
|
1138
1244
|
dGapC("received channelDifferenceTooLong");
|
|
1139
1245
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processChats).call(this, difference.chats);
|
|
1140
1246
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUsers).call(this, difference.users);
|
|
1141
1247
|
for (const message of difference.messages) {
|
|
1142
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewChannelMessage({ message, pts: 0,
|
|
1248
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUpdates).call(this, new types.UpdateNewChannelMessage({ message, pts: 0, pts_count: 0 }), false);
|
|
1143
1249
|
}
|
|
1144
1250
|
const pts_ = difference.dialog[as](types.Dialog).pts;
|
|
1145
1251
|
if (pts_ != undefined) {
|
|
@@ -1150,14 +1256,14 @@ export class Client extends ClientAbstract {
|
|
|
1150
1256
|
}
|
|
1151
1257
|
dGapC("processed channelDifferenceTooLong");
|
|
1152
1258
|
}
|
|
1153
|
-
else if (difference instanceof types.
|
|
1259
|
+
else if (difference instanceof types.updates.ChannelDifferenceEmpty) {
|
|
1154
1260
|
dGapC("there was no update gap");
|
|
1155
1261
|
break;
|
|
1156
1262
|
}
|
|
1157
1263
|
}
|
|
1158
1264
|
}, _Client_getChannelAccessHash = async function _Client_getChannelAccessHash(channelId) {
|
|
1159
|
-
const channels = await this.invoke(new functions.
|
|
1160
|
-
return channels.chats[0][as](types.Channel).
|
|
1265
|
+
const channels = await this.invoke(new functions.channels.getChannels({ id: [new types.InputChannel({ channel_id: channelId, access_hash: 0n })] }));
|
|
1266
|
+
return channels.chats[0][as](types.Channel).access_hash ?? 0n;
|
|
1161
1267
|
}, _Client_getInputPeerInner = async function _Client_getInputPeerInner(id) {
|
|
1162
1268
|
if (typeof id === "string") {
|
|
1163
1269
|
id = getUsername(id);
|
|
@@ -1174,14 +1280,14 @@ export class Client extends ClientAbstract {
|
|
|
1174
1280
|
}
|
|
1175
1281
|
}
|
|
1176
1282
|
else {
|
|
1177
|
-
const resolved = await this.invoke(new functions.
|
|
1283
|
+
const resolved = await this.invoke(new functions.contacts.resolveUsername({ username: id }));
|
|
1178
1284
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processChats).call(this, resolved.chats);
|
|
1179
1285
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUsers).call(this, resolved.users);
|
|
1180
1286
|
if (resolved.peer instanceof types.PeerUser) {
|
|
1181
|
-
userId = resolved.peer.
|
|
1287
|
+
userId = resolved.peer.user_id;
|
|
1182
1288
|
}
|
|
1183
1289
|
else if (resolved.peer instanceof types.PeerChannel) {
|
|
1184
|
-
channelId = resolved.peer.
|
|
1290
|
+
channelId = resolved.peer.channel_id;
|
|
1185
1291
|
}
|
|
1186
1292
|
else {
|
|
1187
1293
|
UNREACHABLE();
|
|
@@ -1189,11 +1295,11 @@ export class Client extends ClientAbstract {
|
|
|
1189
1295
|
}
|
|
1190
1296
|
if (userId) {
|
|
1191
1297
|
const accessHash = await this.storage.getUserAccessHash(userId);
|
|
1192
|
-
return new types.InputPeerUser({ userId,
|
|
1298
|
+
return new types.InputPeerUser({ user_id: userId, access_hash: accessHash ?? 0n });
|
|
1193
1299
|
}
|
|
1194
1300
|
else if (channelId) {
|
|
1195
1301
|
const accessHash = await this.storage.getChannelAccessHash(channelId);
|
|
1196
|
-
return new types.InputPeerChannel({ channelId,
|
|
1302
|
+
return new types.InputPeerChannel({ channel_id: channelId, access_hash: accessHash ?? 0n });
|
|
1197
1303
|
}
|
|
1198
1304
|
else {
|
|
1199
1305
|
UNREACHABLE();
|
|
@@ -1202,70 +1308,70 @@ export class Client extends ClientAbstract {
|
|
|
1202
1308
|
else if (id > 0) {
|
|
1203
1309
|
const id_ = BigInt(id);
|
|
1204
1310
|
const accessHash = await this.storage.getUserAccessHash(id_);
|
|
1205
|
-
return new types.InputPeerUser({
|
|
1311
|
+
return new types.InputPeerUser({ user_id: id_, access_hash: accessHash ?? 0n });
|
|
1206
1312
|
}
|
|
1207
1313
|
else if (-MAX_CHAT_ID <= id) {
|
|
1208
|
-
return new types.InputPeerChat({
|
|
1314
|
+
return new types.InputPeerChat({ chat_id: BigInt(Math.abs(id)) });
|
|
1209
1315
|
}
|
|
1210
1316
|
else if (ZERO_CHANNEL_ID - MAX_CHANNEL_ID <= id && id != ZERO_CHANNEL_ID) {
|
|
1211
1317
|
const id_ = BigInt(Math.abs(id - ZERO_CHANNEL_ID));
|
|
1212
1318
|
const accessHash = await this.storage.getChannelAccessHash(id_);
|
|
1213
|
-
return new types.InputPeerChannel({
|
|
1319
|
+
return new types.InputPeerChannel({ channel_id: id_, access_hash: accessHash ?? 0n });
|
|
1214
1320
|
}
|
|
1215
1321
|
else {
|
|
1216
1322
|
throw new Error("ID format unknown or not implemented");
|
|
1217
1323
|
}
|
|
1218
1324
|
}, getEntity)](peer) {
|
|
1219
1325
|
const type = peer instanceof types.PeerUser ? "user" : peer instanceof types.PeerChat ? "chat" : peer instanceof types.PeerChannel ? "channel" : UNREACHABLE();
|
|
1220
|
-
const id = peer instanceof types.PeerUser ? peer.
|
|
1326
|
+
const id = peer instanceof types.PeerUser ? peer.user_id : peer instanceof types.PeerChat ? peer.chat_id : peer instanceof types.PeerChannel ? peer.channel_id : UNREACHABLE();
|
|
1221
1327
|
return this.storage.getEntity(type, id);
|
|
1222
1328
|
}
|
|
1223
1329
|
async processResult(result) {
|
|
1224
|
-
if (result instanceof types.
|
|
1225
|
-
result instanceof types.
|
|
1226
|
-
result instanceof types.
|
|
1227
|
-
result instanceof types.
|
|
1228
|
-
result instanceof types.
|
|
1229
|
-
result instanceof types.
|
|
1230
|
-
result instanceof types.
|
|
1231
|
-
result instanceof types.
|
|
1232
|
-
result instanceof types.
|
|
1233
|
-
result instanceof types.
|
|
1234
|
-
result instanceof types.
|
|
1235
|
-
result instanceof types.
|
|
1236
|
-
result instanceof types.
|
|
1237
|
-
result instanceof types.
|
|
1238
|
-
result instanceof types.
|
|
1239
|
-
result instanceof types.
|
|
1240
|
-
result instanceof types.
|
|
1241
|
-
result instanceof types.
|
|
1242
|
-
result instanceof types.
|
|
1243
|
-
result instanceof types.
|
|
1244
|
-
result instanceof types.
|
|
1245
|
-
result instanceof types.
|
|
1246
|
-
result instanceof types.
|
|
1247
|
-
result instanceof types.
|
|
1248
|
-
result instanceof types.
|
|
1249
|
-
result instanceof types.
|
|
1250
|
-
result instanceof types.
|
|
1251
|
-
result instanceof types.
|
|
1252
|
-
result instanceof types.
|
|
1253
|
-
result instanceof types.
|
|
1254
|
-
result instanceof types.
|
|
1255
|
-
result instanceof types.
|
|
1256
|
-
result instanceof types.
|
|
1257
|
-
result instanceof types.
|
|
1258
|
-
result instanceof types.
|
|
1259
|
-
result instanceof types.
|
|
1330
|
+
if (result instanceof types.messages.Dialogs ||
|
|
1331
|
+
result instanceof types.messages.DialogsSlice ||
|
|
1332
|
+
result instanceof types.messages.Messages ||
|
|
1333
|
+
result instanceof types.messages.MessagesSlice ||
|
|
1334
|
+
result instanceof types.messages.ChannelMessages ||
|
|
1335
|
+
result instanceof types.messages.ChatFull ||
|
|
1336
|
+
result instanceof types.contacts.Found ||
|
|
1337
|
+
result instanceof types.account.PrivacyRules ||
|
|
1338
|
+
result instanceof types.contacts.ResolvedPeer ||
|
|
1339
|
+
result instanceof types.channels.ChannelParticipants ||
|
|
1340
|
+
result instanceof types.channels.ChannelParticipant ||
|
|
1341
|
+
result instanceof types.messages.PeerDialogs ||
|
|
1342
|
+
result instanceof types.contacts.TopPeers ||
|
|
1343
|
+
result instanceof types.channels.AdminLogResults ||
|
|
1344
|
+
result instanceof types.help.RecentMeUrls ||
|
|
1345
|
+
result instanceof types.messages.InactiveChats ||
|
|
1346
|
+
result instanceof types.help.PromoData ||
|
|
1347
|
+
result instanceof types.messages.MessageViews ||
|
|
1348
|
+
result instanceof types.messages.DiscussionMessage ||
|
|
1349
|
+
result instanceof types.phone.GroupCall ||
|
|
1350
|
+
result instanceof types.phone.GroupParticipants ||
|
|
1351
|
+
result instanceof types.phone.JoinAsPeers ||
|
|
1352
|
+
result instanceof types.messages.SponsoredMessages ||
|
|
1353
|
+
result instanceof types.messages.SearchResultsCalendar ||
|
|
1354
|
+
result instanceof types.channels.SendAsPeers ||
|
|
1355
|
+
result instanceof types.users.UserFull ||
|
|
1356
|
+
result instanceof types.messages.PeerSettings ||
|
|
1357
|
+
result instanceof types.messages.MessageReactionsList ||
|
|
1358
|
+
result instanceof types.messages.ForumTopics ||
|
|
1359
|
+
result instanceof types.account.AutoSaveSettings ||
|
|
1360
|
+
result instanceof types.chatlists.ExportedInvites ||
|
|
1361
|
+
result instanceof types.chatlists.ChatlistInviteAlready ||
|
|
1362
|
+
result instanceof types.chatlists.ChatlistInvite ||
|
|
1363
|
+
result instanceof types.chatlists.ChatlistUpdates ||
|
|
1364
|
+
result instanceof types.messages.Chats ||
|
|
1365
|
+
result instanceof types.messages.ChatsSlice) {
|
|
1260
1366
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processChats).call(this, result.chats);
|
|
1261
1367
|
if ("users" in result) {
|
|
1262
1368
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_processUsers).call(this, result.users);
|
|
1263
1369
|
}
|
|
1264
1370
|
}
|
|
1265
|
-
if (result instanceof types.
|
|
1371
|
+
if (result instanceof types.messages.Messages) {
|
|
1266
1372
|
for (const message of result.messages) {
|
|
1267
1373
|
if (message instanceof types.Message || message instanceof types.MessageService) {
|
|
1268
|
-
await this.storage.setMessage(peerToChatId(message.
|
|
1374
|
+
await this.storage.setMessage(peerToChatId(message.peer_id), message.id, message);
|
|
1269
1375
|
}
|
|
1270
1376
|
}
|
|
1271
1377
|
}
|
|
@@ -1289,20 +1395,20 @@ export class Client extends ClientAbstract {
|
|
|
1289
1395
|
const replyToMsgId = params?.replyToMessageId;
|
|
1290
1396
|
const topMsgId = params?.messageThreadId;
|
|
1291
1397
|
const sendAs = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_resolveSendAs).call(this, params);
|
|
1292
|
-
const result = await this.invoke(new functions.
|
|
1398
|
+
const result = await this.invoke(new functions.messages.sendMessage({
|
|
1293
1399
|
peer,
|
|
1294
|
-
randomId,
|
|
1400
|
+
random_id: randomId,
|
|
1295
1401
|
message,
|
|
1296
|
-
noWebpage,
|
|
1402
|
+
no_webpage: noWebpage,
|
|
1297
1403
|
silent,
|
|
1298
1404
|
noforwards,
|
|
1299
|
-
|
|
1300
|
-
sendAs,
|
|
1405
|
+
reply_to: replyToMsgId !== undefined ? new types.InputReplyToMessage({ reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId }) : undefined,
|
|
1406
|
+
send_as: sendAs,
|
|
1301
1407
|
entities,
|
|
1302
|
-
replyMarkup,
|
|
1408
|
+
reply_markup: replyMarkup,
|
|
1303
1409
|
}));
|
|
1304
1410
|
const message_ = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
1305
|
-
return __classPrivateFieldGet(
|
|
1411
|
+
return __classPrivateFieldGet(_a, _a, "m", _Client_assertMsgHas).call(_a, message_, "text");
|
|
1306
1412
|
}
|
|
1307
1413
|
/**
|
|
1308
1414
|
* Edit a message's text.
|
|
@@ -1315,16 +1421,16 @@ export class Client extends ClientAbstract {
|
|
|
1315
1421
|
*/
|
|
1316
1422
|
async editMessageText(chatId, messageId, text, params) {
|
|
1317
1423
|
const [message, entities] = __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).call(this, text, params);
|
|
1318
|
-
const result = await this.invoke(new functions.
|
|
1424
|
+
const result = await this.invoke(new functions.messages.editMessage({
|
|
1319
1425
|
id: messageId,
|
|
1320
1426
|
peer: await this.getInputPeer(chatId),
|
|
1321
1427
|
entities,
|
|
1322
1428
|
message,
|
|
1323
|
-
|
|
1324
|
-
|
|
1429
|
+
no_webpage: params?.disableWebPagePreview ? true : undefined,
|
|
1430
|
+
reply_markup: await __classPrivateFieldGet(this, _Client_instances, "m", _Client_constructReplyMarkup).call(this, params),
|
|
1325
1431
|
}));
|
|
1326
1432
|
const message_ = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
1327
|
-
return __classPrivateFieldGet(
|
|
1433
|
+
return __classPrivateFieldGet(_a, _a, "m", _Client_assertMsgHas).call(_a, message_, "text");
|
|
1328
1434
|
}
|
|
1329
1435
|
/**
|
|
1330
1436
|
* Retrieve multiple messages.
|
|
@@ -1405,15 +1511,15 @@ export class Client extends ClientAbstract {
|
|
|
1405
1511
|
}
|
|
1406
1512
|
if (shouldFetch) {
|
|
1407
1513
|
if (peer instanceof types.InputPeerChannel) {
|
|
1408
|
-
messages_ = await this.invoke(new functions.
|
|
1409
|
-
channel: new types.InputChannel({
|
|
1514
|
+
messages_ = await this.invoke(new functions.channels.getMessages({
|
|
1515
|
+
channel: new types.InputChannel({ channel_id: peer.channel_id, access_hash: peer.access_hash }),
|
|
1410
1516
|
id: messageIds.map((v) => new types.InputMessageID({ id: v })),
|
|
1411
|
-
})).then((v) => v[as](types.
|
|
1517
|
+
})).then((v) => v[as](types.messages.ChannelMessages).messages);
|
|
1412
1518
|
}
|
|
1413
1519
|
else {
|
|
1414
|
-
messages_ = await this.invoke(new functions.
|
|
1520
|
+
messages_ = await this.invoke(new functions.messages.getMessages({
|
|
1415
1521
|
id: messageIds.map((v) => new types.InputMessageID({ id: v })),
|
|
1416
|
-
})).then((v) => v[as](types.
|
|
1522
|
+
})).then((v) => v[as](types.messages.Messages).messages);
|
|
1417
1523
|
}
|
|
1418
1524
|
}
|
|
1419
1525
|
const messages = new Array();
|
|
@@ -1422,7 +1528,7 @@ export class Client extends ClientAbstract {
|
|
|
1422
1528
|
continue;
|
|
1423
1529
|
}
|
|
1424
1530
|
const message = await constructMessage(message_, this[getEntity].bind(this), null, this[getStickerSetName].bind(this));
|
|
1425
|
-
const isReplyToMessage = message_ instanceof types.Message && message_.
|
|
1531
|
+
const isReplyToMessage = message_ instanceof types.Message && message_.reply_to instanceof types.MessageReplyHeader;
|
|
1426
1532
|
messages.push({ message, isReplyToMessage });
|
|
1427
1533
|
}
|
|
1428
1534
|
return messages;
|
|
@@ -1463,7 +1569,7 @@ export class Client extends ClientAbstract {
|
|
|
1463
1569
|
case FileType.ChatPhoto: {
|
|
1464
1570
|
const big = fileId_.params.thumbnailSource == ThumbnailSource.ChatPhotoBig;
|
|
1465
1571
|
const peer = await this.getInputPeer(fileId_.params.chatId);
|
|
1466
|
-
const location = new types.InputPeerPhotoFileLocation({ big: big ? true : undefined, peer,
|
|
1572
|
+
const location = new types.InputPeerPhotoFileLocation({ big: big ? true : undefined, peer, photo_id: fileId_.params.mediaId });
|
|
1467
1573
|
return __classPrivateFieldGet(this, _Client_instances, "m", _Client_downloadInner).call(this, location, fileId_.dcId, params);
|
|
1468
1574
|
}
|
|
1469
1575
|
case FileType.Photo: {
|
|
@@ -1472,9 +1578,9 @@ export class Client extends ClientAbstract {
|
|
|
1472
1578
|
}
|
|
1473
1579
|
const location = new types.InputPhotoFileLocation({
|
|
1474
1580
|
id: fileId_.params.mediaId,
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1581
|
+
access_hash: fileId_.params.accessHash,
|
|
1582
|
+
file_reference: fileId_.params.fileReference,
|
|
1583
|
+
thumb_size: fileId_.params.thumbnailSize,
|
|
1478
1584
|
});
|
|
1479
1585
|
return __classPrivateFieldGet(this, _Client_instances, "m", _Client_downloadInner).call(this, location, fileId_.dcId, params);
|
|
1480
1586
|
}
|
|
@@ -1487,8 +1593,8 @@ export class Client extends ClientAbstract {
|
|
|
1487
1593
|
if (mod(chunkSize, 1024) != 0) {
|
|
1488
1594
|
throw new Error("chunkSize must be divisible by 1024");
|
|
1489
1595
|
}
|
|
1490
|
-
const exportedAuth = await this.invoke(new functions.
|
|
1491
|
-
const client = new
|
|
1596
|
+
const exportedAuth = await this.invoke(new functions.auth.exportAuthorization({ dc_id: dcId }));
|
|
1597
|
+
const client = new _a(new StorageMemory(), this.apiId, this.apiHash, {
|
|
1492
1598
|
transportProvider: this.transportProvider,
|
|
1493
1599
|
appVersion: this.appVersion,
|
|
1494
1600
|
deviceModel: this.deviceModel,
|
|
@@ -1508,8 +1614,8 @@ export class Client extends ClientAbstract {
|
|
|
1508
1614
|
const limit = chunkSize;
|
|
1509
1615
|
let offset = 0n;
|
|
1510
1616
|
while (true) {
|
|
1511
|
-
const file = await (client ?? this).invoke(new functions.
|
|
1512
|
-
if (file instanceof types.
|
|
1617
|
+
const file = await (client ?? this).invoke(new functions.upload.getFile({ location, offset, limit }));
|
|
1618
|
+
if (file instanceof types.upload.File) {
|
|
1513
1619
|
yield file.bytes;
|
|
1514
1620
|
if (file.bytes.length < limit) {
|
|
1515
1621
|
break;
|
|
@@ -1523,14 +1629,14 @@ export class Client extends ClientAbstract {
|
|
|
1523
1629
|
}
|
|
1524
1630
|
}
|
|
1525
1631
|
}, getStickerSetName)](inputStickerSet, hash = 0) {
|
|
1526
|
-
const maybeStickerSetName = await this.storage.getStickerSetName(inputStickerSet.id, inputStickerSet.
|
|
1632
|
+
const maybeStickerSetName = await this.storage.getStickerSetName(inputStickerSet.id, inputStickerSet.access_hash);
|
|
1527
1633
|
if (maybeStickerSetName != null && Date.now() - maybeStickerSetName[1].getTime() < STICKER_SET_NAME_TTL) {
|
|
1528
1634
|
return maybeStickerSetName[0];
|
|
1529
1635
|
}
|
|
1530
1636
|
else {
|
|
1531
|
-
const stickerSet = await this.invoke(new functions.
|
|
1532
|
-
const name = stickerSet[as](types.
|
|
1533
|
-
await this.storage.updateStickerSetName(inputStickerSet.id, inputStickerSet.
|
|
1637
|
+
const stickerSet = await this.invoke(new functions.messages.getStickerSet({ stickerset: inputStickerSet, hash }));
|
|
1638
|
+
const name = stickerSet[as](types.messages.StickerSet).set.short_name;
|
|
1639
|
+
await this.storage.updateStickerSetName(inputStickerSet.id, inputStickerSet.access_hash, name);
|
|
1534
1640
|
return name;
|
|
1535
1641
|
}
|
|
1536
1642
|
}
|
|
@@ -1544,17 +1650,17 @@ export class Client extends ClientAbstract {
|
|
|
1544
1650
|
* @returns The forwarded messages.
|
|
1545
1651
|
*/
|
|
1546
1652
|
async forwardMessages(from, to, messageIds, params) {
|
|
1547
|
-
const result = await this.invoke(new functions.
|
|
1548
|
-
|
|
1549
|
-
|
|
1653
|
+
const result = await this.invoke(new functions.messages.forwardMessages({
|
|
1654
|
+
from_peer: await this.getInputPeer(from),
|
|
1655
|
+
to_peer: await this.getInputPeer(to),
|
|
1550
1656
|
id: messageIds,
|
|
1551
|
-
|
|
1657
|
+
random_id: messageIds.map(() => getRandomId()),
|
|
1552
1658
|
silent: params?.disableNotification || undefined,
|
|
1553
|
-
|
|
1659
|
+
top_msg_id: params?.messageThreadId,
|
|
1554
1660
|
noforwards: params?.disableNotification || undefined,
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1661
|
+
send_as: params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined,
|
|
1662
|
+
drop_author: params?.dropSenderName || undefined,
|
|
1663
|
+
drop_media_captions: params?.dropCaption || undefined,
|
|
1558
1664
|
}));
|
|
1559
1665
|
return await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, to, result);
|
|
1560
1666
|
}
|
|
@@ -1576,7 +1682,7 @@ export class Client extends ClientAbstract {
|
|
|
1576
1682
|
* @method
|
|
1577
1683
|
*/
|
|
1578
1684
|
async getMe() {
|
|
1579
|
-
const users = await this.invoke(new functions.
|
|
1685
|
+
const users = await this.invoke(new functions.users.getUsers({ id: [new types.InputUserSelf()] }));
|
|
1580
1686
|
if (users.length < 1) {
|
|
1581
1687
|
UNREACHABLE();
|
|
1582
1688
|
}
|
|
@@ -1592,9 +1698,9 @@ export class Client extends ClientAbstract {
|
|
|
1592
1698
|
*/
|
|
1593
1699
|
async answerCallbackQuery(id, params) {
|
|
1594
1700
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "answerCallbackQuery");
|
|
1595
|
-
await this.invoke(new functions.
|
|
1596
|
-
|
|
1597
|
-
|
|
1701
|
+
await this.invoke(new functions.messages.setBotCallbackAnswer({
|
|
1702
|
+
query_id: BigInt(id),
|
|
1703
|
+
cache_time: params?.cacheTime ?? 0,
|
|
1598
1704
|
message: params?.text,
|
|
1599
1705
|
alert: params?.alert ? true : undefined,
|
|
1600
1706
|
}));
|
|
@@ -1627,31 +1733,31 @@ export class Client extends ClientAbstract {
|
|
|
1627
1733
|
answers,
|
|
1628
1734
|
question,
|
|
1629
1735
|
closed: params?.isClosed ? true : undefined,
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1736
|
+
close_date: params?.closeDate ? Math.floor(params.closeDate.getTime() / 1000) : undefined,
|
|
1737
|
+
close_period: params?.openPeriod ? params.openPeriod : undefined,
|
|
1738
|
+
multiple_choice: params?.allowMultipleAnswers ? true : undefined,
|
|
1739
|
+
public_voters: params?.isAnonymous === false ? true : undefined,
|
|
1634
1740
|
quiz: params?.type == "quiz" ? true : undefined,
|
|
1635
1741
|
});
|
|
1636
1742
|
const media = new types.InputMediaPoll({
|
|
1637
1743
|
poll,
|
|
1638
|
-
|
|
1744
|
+
correct_answers: params?.correctOptionIndex ? [new Uint8Array([params.correctOptionIndex])] : undefined,
|
|
1639
1745
|
solution,
|
|
1640
|
-
solutionEntities,
|
|
1746
|
+
solution_entities: solutionEntities,
|
|
1641
1747
|
});
|
|
1642
|
-
const result = await this.invoke(new functions.
|
|
1748
|
+
const result = await this.invoke(new functions.messages.sendMedia({
|
|
1643
1749
|
peer,
|
|
1644
|
-
randomId,
|
|
1750
|
+
random_id: randomId,
|
|
1645
1751
|
silent,
|
|
1646
1752
|
noforwards,
|
|
1647
|
-
replyMarkup,
|
|
1648
|
-
|
|
1649
|
-
sendAs,
|
|
1753
|
+
reply_markup: replyMarkup,
|
|
1754
|
+
reply_to: replyToMsgId !== undefined ? new types.InputReplyToMessage({ reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId }) : undefined,
|
|
1755
|
+
send_as: sendAs,
|
|
1650
1756
|
media,
|
|
1651
1757
|
message: "",
|
|
1652
1758
|
}));
|
|
1653
1759
|
const message = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
1654
|
-
return __classPrivateFieldGet(
|
|
1760
|
+
return __classPrivateFieldGet(_a, _a, "m", _Client_assertMsgHas).call(_a, message, "poll");
|
|
1655
1761
|
}
|
|
1656
1762
|
/**
|
|
1657
1763
|
* Send a chat action.
|
|
@@ -1700,7 +1806,7 @@ export class Client extends ClientAbstract {
|
|
|
1700
1806
|
default:
|
|
1701
1807
|
throw new Error("Invalid chat action: " + action);
|
|
1702
1808
|
}
|
|
1703
|
-
await this.invoke(new functions.
|
|
1809
|
+
await this.invoke(new functions.messages.setTyping({ peer: await this.getInputPeer(chatId), action: action_, top_msg_id: params?.messageThreadId }));
|
|
1704
1810
|
}
|
|
1705
1811
|
/**
|
|
1706
1812
|
* Upload a file.
|
|
@@ -1718,7 +1824,7 @@ export class Client extends ClientAbstract {
|
|
|
1718
1824
|
dUpload("uploading " + (isBig ? "big " : "") + "file of size " + contents.length + " with chunk size of " + chunkSize);
|
|
1719
1825
|
const fileId = getRandomId();
|
|
1720
1826
|
const name = params?.fileName ?? fileId.toString();
|
|
1721
|
-
const client = new
|
|
1827
|
+
const client = new _a(this.storage, this.apiId, this.apiHash, {
|
|
1722
1828
|
transportProvider: this.transportProvider,
|
|
1723
1829
|
appVersion: this.appVersion,
|
|
1724
1830
|
deviceModel: this.deviceModel,
|
|
@@ -1746,10 +1852,10 @@ export class Client extends ClientAbstract {
|
|
|
1746
1852
|
continue main;
|
|
1747
1853
|
}
|
|
1748
1854
|
if (isBig) {
|
|
1749
|
-
await client.invoke(new functions.
|
|
1855
|
+
await client.invoke(new functions.upload.saveBigFilePart({ file_id: fileId, file_part: part, bytes, file_total_parts: partCount }));
|
|
1750
1856
|
}
|
|
1751
1857
|
else {
|
|
1752
|
-
await client.invoke(new functions.
|
|
1858
|
+
await client.invoke(new functions.upload.saveFilePart({ file_id: fileId, bytes, file_part: part }));
|
|
1753
1859
|
}
|
|
1754
1860
|
dUpload((part + 1) + " out of " + partCount + " chunks have been uploaded so far");
|
|
1755
1861
|
break chunk;
|
|
@@ -1790,7 +1896,7 @@ export class Client extends ClientAbstract {
|
|
|
1790
1896
|
return new types.InputFileBig({ id: fileId, parts: contents.length / chunkSize, name });
|
|
1791
1897
|
}
|
|
1792
1898
|
else {
|
|
1793
|
-
return new types.InputFile({ id: fileId, name, parts: part,
|
|
1899
|
+
return new types.InputFile({ id: fileId, name, parts: part, md5_checksum: "" });
|
|
1794
1900
|
}
|
|
1795
1901
|
}
|
|
1796
1902
|
/**
|
|
@@ -1800,9 +1906,9 @@ export class Client extends ClientAbstract {
|
|
|
1800
1906
|
* @param commands The commands to set.
|
|
1801
1907
|
*/
|
|
1802
1908
|
async setMyCommands(commands, params) {
|
|
1803
|
-
await this.invoke(new functions.
|
|
1909
|
+
await this.invoke(new functions.bots.setBotCommands({
|
|
1804
1910
|
commands: commands.map((v) => new types.BotCommand(v)),
|
|
1805
|
-
|
|
1911
|
+
lang_code: params?.languageCode ?? "",
|
|
1806
1912
|
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1807
1913
|
}));
|
|
1808
1914
|
}
|
|
@@ -1810,8 +1916,8 @@ export class Client extends ClientAbstract {
|
|
|
1810
1916
|
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1811
1917
|
*/
|
|
1812
1918
|
async getMyCommands(params) {
|
|
1813
|
-
const commands_ = await this.invoke(new functions.
|
|
1814
|
-
|
|
1919
|
+
const commands_ = await this.invoke(new functions.bots.getBotCommands({
|
|
1920
|
+
lang_code: params?.languageCode ?? "",
|
|
1815
1921
|
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1816
1922
|
}));
|
|
1817
1923
|
return commands_.map((v) => ({ command: v.command, description: v.description }));
|
|
@@ -1824,15 +1930,15 @@ export class Client extends ClientAbstract {
|
|
|
1824
1930
|
* @param results The results to answer with.
|
|
1825
1931
|
*/
|
|
1826
1932
|
async answerInlineQuery(id, results, params) {
|
|
1827
|
-
await this.invoke(new functions.
|
|
1828
|
-
|
|
1933
|
+
await this.invoke(new functions.messages.setInlineBotResults({
|
|
1934
|
+
query_id: BigInt(id),
|
|
1829
1935
|
results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).bind(this), __classPrivateFieldGet(this, _Client_usernameResolver, "f").bind(this)))),
|
|
1830
|
-
|
|
1936
|
+
cache_time: params?.cacheTime ?? 300,
|
|
1831
1937
|
private: params?.isPersonal ? true : undefined,
|
|
1832
|
-
|
|
1833
|
-
|
|
1938
|
+
switch_webview: params?.button && params.button.webApp ? new types.InlineBotWebView({ text: params.button.text, url: params.button.webApp.url }) : undefined,
|
|
1939
|
+
switch_pm: params?.button && params.button.startParameter ? new types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
|
|
1834
1940
|
gallery: params?.isGallery ? true : undefined,
|
|
1835
|
-
|
|
1941
|
+
next_offset: params?.nextOffset,
|
|
1836
1942
|
}));
|
|
1837
1943
|
}
|
|
1838
1944
|
use(...middleware) {
|
|
@@ -1879,20 +1985,37 @@ export class Client extends ClientAbstract {
|
|
|
1879
1985
|
}, ...middleawre);
|
|
1880
1986
|
}
|
|
1881
1987
|
command(commands, ...middleawre) {
|
|
1882
|
-
const
|
|
1988
|
+
const commands__ = typeof commands === "object" && "names" in commands ? commands.names : commands;
|
|
1989
|
+
const commands_ = Array.isArray(commands__) ? commands__ : [commands__];
|
|
1990
|
+
const prefixes_ = typeof commands === "object" && "prefixes" in commands ? commands.prefixes : (__classPrivateFieldGet(this, _Client_prefixes, "f") ?? []);
|
|
1991
|
+
const prefixes = Array.isArray(prefixes_) ? prefixes_ : [prefixes_];
|
|
1992
|
+
for (const left of prefixes) {
|
|
1993
|
+
for (const right of prefixes) {
|
|
1994
|
+
if (left == right) {
|
|
1995
|
+
continue;
|
|
1996
|
+
}
|
|
1997
|
+
if (left.startsWith(right) || right.startsWith(left)) {
|
|
1998
|
+
throw new Error("Intersecting prefixes");
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
1883
2002
|
return this.on(["message", "text"]).filter((ctx) => {
|
|
1884
|
-
const
|
|
1885
|
-
if (
|
|
2003
|
+
const prefixes_ = prefixes.length == 0 ? [!ctx.me?.isBot ? "\\" : "/"] : prefixes;
|
|
2004
|
+
if (prefixes_.length == 0) {
|
|
2005
|
+
return false;
|
|
2006
|
+
}
|
|
2007
|
+
const cmd = ctx.message.text.split(/\s/, 1)[0];
|
|
2008
|
+
const prefix = prefixes_.find((v) => cmd.startsWith(v));
|
|
2009
|
+
if (prefix === undefined) {
|
|
1886
2010
|
return false;
|
|
1887
2011
|
}
|
|
1888
|
-
const cmd = ctx.message.text.slice(botCommand.offset, botCommand.offset + botCommand.length);
|
|
1889
2012
|
if (cmd.includes("@")) {
|
|
1890
|
-
const username = cmd.split("@")[1];
|
|
2013
|
+
const username = cmd.split("@", 2)[1];
|
|
1891
2014
|
if (username.toLowerCase() !== ctx.me.username?.toLowerCase()) {
|
|
1892
2015
|
return false;
|
|
1893
2016
|
}
|
|
1894
2017
|
}
|
|
1895
|
-
const command_ = cmd.split("@")[0].split(
|
|
2018
|
+
const command_ = cmd.split("@", 1)[0].split(prefix, 2)[1].toLowerCase();
|
|
1896
2019
|
for (const command of commands_) {
|
|
1897
2020
|
if (typeof command === "string" && (command.toLowerCase() == command_)) {
|
|
1898
2021
|
return true;
|
|
@@ -1911,7 +2034,7 @@ export class Client extends ClientAbstract {
|
|
|
1911
2034
|
*/
|
|
1912
2035
|
async setMyDescription({ description, languageCode }) {
|
|
1913
2036
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "setMyDescription");
|
|
1914
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { description,
|
|
2037
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { description, lang_code: languageCode ?? "" });
|
|
1915
2038
|
}
|
|
1916
2039
|
/**
|
|
1917
2040
|
* Set the bot's name in the given language. Bot-only.
|
|
@@ -1920,7 +2043,7 @@ export class Client extends ClientAbstract {
|
|
|
1920
2043
|
*/
|
|
1921
2044
|
async setMyName({ name, languageCode }) {
|
|
1922
2045
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "setMyName");
|
|
1923
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { name,
|
|
2046
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { name, lang_code: languageCode ?? "" });
|
|
1924
2047
|
}
|
|
1925
2048
|
/**
|
|
1926
2049
|
* Set the bot's short description in the given language. Bot-only.
|
|
@@ -1929,7 +2052,7 @@ export class Client extends ClientAbstract {
|
|
|
1929
2052
|
*/
|
|
1930
2053
|
async setMyShortDescription({ shortDescription: about, languageCode }) {
|
|
1931
2054
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "setMyShortDescription");
|
|
1932
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { about,
|
|
2055
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_setMyInfo).call(this, { about, lang_code: languageCode ?? "" });
|
|
1933
2056
|
}
|
|
1934
2057
|
/**
|
|
1935
2058
|
* Get the bot's description in the given language. Bot-only.
|
|
@@ -1968,10 +2091,10 @@ export class Client extends ClientAbstract {
|
|
|
1968
2091
|
async deleteMessages(chatId, messageIds, params) {
|
|
1969
2092
|
const peer = await this.getInputPeer(chatId);
|
|
1970
2093
|
if (peer instanceof types.InputPeerChannel) {
|
|
1971
|
-
await this.invoke(new functions.
|
|
2094
|
+
await this.invoke(new functions.channels.deleteMessages({ channel: new types.InputChannel(peer), id: messageIds }));
|
|
1972
2095
|
}
|
|
1973
2096
|
else {
|
|
1974
|
-
await this.invoke(new functions.
|
|
2097
|
+
await this.invoke(new functions.messages.deleteMessages({ id: messageIds, revoke: params?.onlyForMe ? undefined : true }));
|
|
1975
2098
|
}
|
|
1976
2099
|
}
|
|
1977
2100
|
/**
|
|
@@ -2012,8 +2135,8 @@ export class Client extends ClientAbstract {
|
|
|
2012
2135
|
media = new types.InputMediaPhoto({
|
|
2013
2136
|
id: new types.InputPhoto({
|
|
2014
2137
|
id: fileId.params.mediaId,
|
|
2015
|
-
|
|
2016
|
-
|
|
2138
|
+
access_hash: fileId.params.accessHash,
|
|
2139
|
+
file_reference: fileId.params.fileReference,
|
|
2017
2140
|
}),
|
|
2018
2141
|
spoiler,
|
|
2019
2142
|
});
|
|
@@ -2041,20 +2164,20 @@ export class Client extends ClientAbstract {
|
|
|
2041
2164
|
const parseResult = caption_ !== undefined ? __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).call(this, caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
|
|
2042
2165
|
const caption = parseResult === undefined ? undefined : parseResult[0];
|
|
2043
2166
|
const captionEntities = parseResult === undefined ? undefined : parseResult[1];
|
|
2044
|
-
const result = await this.invoke(new functions.
|
|
2167
|
+
const result = await this.invoke(new functions.messages.sendMedia({
|
|
2045
2168
|
peer,
|
|
2046
|
-
randomId,
|
|
2169
|
+
random_id: randomId,
|
|
2047
2170
|
silent,
|
|
2048
2171
|
noforwards,
|
|
2049
|
-
replyMarkup,
|
|
2050
|
-
|
|
2051
|
-
sendAs,
|
|
2172
|
+
reply_markup: replyMarkup,
|
|
2173
|
+
reply_to: replyToMsgId !== undefined ? new types.InputReplyToMessage({ reply_to_msg_id: replyToMsgId, top_msg_id: topMsgId }) : undefined,
|
|
2174
|
+
send_as: sendAs,
|
|
2052
2175
|
media,
|
|
2053
2176
|
message: caption ?? "",
|
|
2054
2177
|
entities: captionEntities,
|
|
2055
2178
|
}));
|
|
2056
2179
|
const message = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
2057
|
-
return __classPrivateFieldGet(
|
|
2180
|
+
return __classPrivateFieldGet(_a, _a, "m", _Client_assertMsgHas).call(_a, message, "photo");
|
|
2058
2181
|
}
|
|
2059
2182
|
}
|
|
2060
2183
|
_a = Client, _Client_getMe = async function _Client_getMe() {
|
|
@@ -2074,21 +2197,21 @@ async function _Client_handleUpdate(update) {
|
|
|
2074
2197
|
message: new types.Message({
|
|
2075
2198
|
out: update.out,
|
|
2076
2199
|
mentioned: update.mentioned,
|
|
2077
|
-
|
|
2200
|
+
media_unread: update.media_unread,
|
|
2078
2201
|
silent: update.silent,
|
|
2079
2202
|
id: update.id,
|
|
2080
|
-
|
|
2081
|
-
|
|
2203
|
+
from_id: update.out ? new types.PeerUser({ user_id: await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getSelfId).call(this).then(BigInt) }) : new types.PeerUser({ user_id: update.user_id }),
|
|
2204
|
+
peer_id: new types.PeerChat({ chat_id: update.user_id }),
|
|
2082
2205
|
message: update.message,
|
|
2083
2206
|
date: update.date,
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2207
|
+
fwd_from: update.fwd_from,
|
|
2208
|
+
via_bot_id: update.via_bot_id,
|
|
2209
|
+
reply_to: update.reply_to,
|
|
2087
2210
|
entities: update.entities,
|
|
2088
|
-
|
|
2211
|
+
ttl_period: update.ttl_period,
|
|
2089
2212
|
}),
|
|
2090
2213
|
pts: update.pts,
|
|
2091
|
-
|
|
2214
|
+
pts_count: update.pts_count,
|
|
2092
2215
|
});
|
|
2093
2216
|
}
|
|
2094
2217
|
else if (update instanceof types.UpdateShortChatMessage) {
|
|
@@ -2096,26 +2219,26 @@ async function _Client_handleUpdate(update) {
|
|
|
2096
2219
|
message: new types.Message({
|
|
2097
2220
|
out: update.out,
|
|
2098
2221
|
mentioned: update.mentioned,
|
|
2099
|
-
|
|
2222
|
+
media_unread: update.media_unread,
|
|
2100
2223
|
silent: update.silent,
|
|
2101
2224
|
id: update.id,
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2225
|
+
from_id: new types.PeerUser({ user_id: update.from_id }),
|
|
2226
|
+
peer_id: new types.PeerChat({ chat_id: update.chat_id }),
|
|
2227
|
+
fwd_from: update.fwd_from,
|
|
2228
|
+
via_bot_id: update.via_bot_id,
|
|
2229
|
+
reply_to: update.reply_to,
|
|
2107
2230
|
date: update.date,
|
|
2108
2231
|
message: update.message,
|
|
2109
2232
|
entities: update.entities,
|
|
2110
|
-
|
|
2233
|
+
ttl_period: update.ttl_period,
|
|
2111
2234
|
}),
|
|
2112
2235
|
pts: update.pts,
|
|
2113
|
-
|
|
2236
|
+
pts_count: update.pts_count,
|
|
2114
2237
|
});
|
|
2115
2238
|
}
|
|
2116
2239
|
if (update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewChannelMessage || update instanceof types.UpdateNewChannelMessage) {
|
|
2117
2240
|
if (update.message instanceof types.Message || update.message instanceof types.MessageService) {
|
|
2118
|
-
await this.storage.setMessage(peerToChatId(update.message.
|
|
2241
|
+
await this.storage.setMessage(peerToChatId(update.message.peer_id), update.message.id, update.message);
|
|
2119
2242
|
}
|
|
2120
2243
|
}
|
|
2121
2244
|
if (update instanceof types.UpdateNewMessage ||
|
|
@@ -2152,7 +2275,7 @@ async function _Client_handleUpdate(update) {
|
|
|
2152
2275
|
}
|
|
2153
2276
|
}
|
|
2154
2277
|
else if (update instanceof types.UpdateDeleteChannelMessages) {
|
|
2155
|
-
const chatId = getChannelChatId(update.
|
|
2278
|
+
const chatId = getChannelChatId(update.channel_id);
|
|
2156
2279
|
const deletedMessages = new Array();
|
|
2157
2280
|
for (const messageId of update.messages) {
|
|
2158
2281
|
const message = await this.storage.getMessage(chatId, messageId);
|
|
@@ -2184,7 +2307,7 @@ async function _Client_handleUpdate(update) {
|
|
|
2184
2307
|
}, _Client_setMyInfo =
|
|
2185
2308
|
//#endregion
|
|
2186
2309
|
async function _Client_setMyInfo(info) {
|
|
2187
|
-
await this.invoke(new functions.
|
|
2310
|
+
await this.invoke(new functions.bots.setBotInfo({ bot: new types.InputUserSelf(), ...info }));
|
|
2188
2311
|
}, _Client_getMyInfo = function _Client_getMyInfo(languageCode) {
|
|
2189
|
-
return this.invoke(new functions.
|
|
2312
|
+
return this.invoke(new functions.bots.getBotInfo({ bot: new types.InputUserSelf(), lang_code: languageCode ?? "" }));
|
|
2190
2313
|
};
|