@mtkruto/node 0.0.997 → 0.0.999
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +2 -2
- package/esm/0_deps.js +2 -2
- package/esm/3_types.d.ts +39 -3
- package/esm/3_types.js +39 -3
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/0_html.js +1 -1
- package/esm/client/3_types.d.ts +3 -6
- package/esm/client/3_types.js +1 -1
- package/esm/client/4_client.d.ts +20 -5
- package/esm/client/4_client.js +56 -40
- package/esm/connection/1_connection_web_socket.js +2 -1
- package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.js +14 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +14 -0
- package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
- package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
- package/esm/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_less.js +14 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
- package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +14 -0
- package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
- package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
- package/{script/deps/deno.land/std@0.200.0 → esm/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
- package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +8 -1
- package/esm/tl/3_tl_reader.d.ts +1 -1
- package/esm/tl/3_tl_reader.js +6 -0
- package/esm/tl/4_tl_writer.js +8 -0
- package/esm/tl/6_message.js +3 -0
- package/esm/types/0_bot_command.d.ts +4 -0
- package/esm/types/0_chat_action.d.ts +1 -1
- package/esm/types/0_chat_id.d.ts +4 -0
- package/esm/types/0_chat_id.js +1 -0
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_input_contact_message_content.d.ts +6 -0
- package/esm/types/0_input_contact_message_content.js +1 -0
- package/esm/types/0_input_location_message_content.d.ts +8 -0
- package/esm/types/0_input_location_message_content.js +1 -0
- package/esm/types/0_input_venue_message_content.d.ts +10 -0
- package/esm/types/0_input_venue_message_content.js +1 -0
- package/esm/types/0_labeled_price.d.ts +4 -0
- package/esm/types/0_labeled_price.js +1 -0
- package/esm/types/0_message_entity.d.ts +10 -10
- package/esm/types/0_message_entity.js +12 -12
- package/esm/types/0_parse_mode.d.ts +1 -0
- package/esm/types/0_parse_mode.js +1 -0
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/esm/types/1__getters.js +1 -0
- package/esm/types/1_bot_command_scope.d.ts +32 -0
- package/esm/types/1_bot_command_scope.js +27 -0
- package/esm/types/1_chat.d.ts +5 -10
- package/esm/types/1_chat.js +4 -11
- package/esm/types/1_inline_query_result_button.d.ts +6 -0
- package/esm/types/1_inline_query_result_button.js +1 -0
- package/esm/types/1_input_invoice_message_content.d.ts +23 -0
- package/esm/types/1_input_invoice_message_content.js +1 -0
- package/esm/types/1_input_text_message_content.d.ts +8 -0
- package/esm/types/1_input_text_message_content.js +1 -0
- package/esm/types/1_photo.js +1 -1
- package/esm/types/1_sticker.d.ts +2 -2
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/{1_inline_keyboard_button.d.ts → 2_inline_keyboard_button.d.ts} +2 -2
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_input_message_content.d.ts +6 -0
- package/esm/types/2_input_message_content.js +1 -0
- package/{script/types/2_inline_keyboard_markup.d.ts → esm/types/3_inline_keyboard_markup.d.ts} +3 -2
- package/esm/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +1 -1
- package/esm/types/3_message.d.ts +2 -2
- package/esm/types/3_message.js +5 -5
- package/esm/types/4_callback_query.d.ts +1 -1
- package/esm/types/4_inline_query_result_article.d.ts +15 -0
- package/esm/types/4_inline_query_result_article.js +1 -0
- package/esm/types/4_inline_query_result_audio.d.ts +17 -0
- package/esm/types/4_inline_query_result_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/esm/types/4_inline_query_result_cached_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_document.js +1 -0
- package/esm/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_photo.js +1 -0
- package/esm/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/esm/types/4_inline_query_result_cached_sticker.js +1 -0
- package/esm/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_video.js +1 -0
- package/esm/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_voice.js +1 -0
- package/esm/types/4_inline_query_result_contact.d.ts +15 -0
- package/esm/types/4_inline_query_result_contact.js +1 -0
- package/esm/types/4_inline_query_result_document.d.ts +18 -0
- package/esm/types/4_inline_query_result_document.js +1 -0
- package/esm/types/4_inline_query_result_game.d.ts +7 -0
- package/esm/types/4_inline_query_result_game.js +1 -0
- package/esm/types/4_inline_query_result_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_gif.js +1 -0
- package/esm/types/4_inline_query_result_location.d.ts +18 -0
- package/esm/types/4_inline_query_result_location.js +1 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_photo.d.ts +19 -0
- package/esm/types/4_inline_query_result_photo.js +1 -0
- package/esm/types/4_inline_query_result_venue.d.ts +19 -0
- package/esm/types/4_inline_query_result_venue.js +1 -0
- package/esm/types/4_inline_query_result_video.d.ts +21 -0
- package/esm/types/4_inline_query_result_video.js +1 -0
- package/esm/types/4_inline_query_result_voice.d.ts +16 -0
- package/esm/types/4_inline_query_result_voice.js +1 -0
- package/esm/types/4_reply_markup.d.ts +7 -0
- package/esm/types/4_reply_markup.js +22 -0
- package/esm/types/5_inline_query_result.d.ts +29 -0
- package/esm/types/5_inline_query_result.js +256 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +2 -2
- package/script/0_deps.js +2 -2
- package/script/3_types.d.ts +39 -3
- package/script/3_types.js +39 -3
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/0_html.js +1 -1
- package/script/client/3_types.d.ts +3 -6
- package/script/client/3_types.js +3 -0
- package/script/client/4_client.d.ts +20 -5
- package/script/client/4_client.js +55 -39
- package/script/connection/1_connection_web_socket.js +2 -1
- package/script/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_greater.js +18 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +18 -0
- package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
- package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
- package/script/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_less.js +18 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
- package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +18 -0
- package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
- package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
- package/{esm/deps/deno.land/std@0.200.0 → script/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
- package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +10 -3
- package/script/tl/3_tl_reader.d.ts +1 -1
- package/script/tl/3_tl_reader.js +6 -0
- package/script/tl/4_tl_writer.js +8 -0
- package/script/tl/6_message.js +3 -0
- package/script/types/0_bot_command.d.ts +4 -0
- package/script/types/0_chat_action.d.ts +1 -1
- package/script/types/0_chat_id.d.ts +4 -0
- package/script/types/0_chat_id.js +2 -0
- package/script/types/0_chat_photo.js +7 -7
- package/script/types/0_input_contact_message_content.d.ts +6 -0
- package/script/types/0_input_contact_message_content.js +2 -0
- package/script/types/0_input_location_message_content.d.ts +8 -0
- package/script/types/0_input_location_message_content.js +2 -0
- package/script/types/0_input_venue_message_content.d.ts +10 -0
- package/script/types/0_input_venue_message_content.js +2 -0
- package/script/types/0_labeled_price.d.ts +4 -0
- package/script/types/0_labeled_price.js +2 -0
- package/script/types/0_message_entity.d.ts +10 -10
- package/script/types/0_message_entity.js +12 -12
- package/script/types/0_parse_mode.d.ts +1 -0
- package/script/types/0_parse_mode.js +2 -0
- package/script/types/0_thumbnail.js +5 -5
- package/script/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/script/types/1__getters.js +2 -0
- package/script/types/1_bot_command_scope.d.ts +32 -0
- package/script/types/1_bot_command_scope.js +31 -0
- package/script/types/1_chat.d.ts +5 -10
- package/script/types/1_chat.js +5 -12
- package/script/types/1_inline_query_result_button.d.ts +6 -0
- package/script/types/1_inline_query_result_button.js +2 -0
- package/script/types/1_input_invoice_message_content.d.ts +23 -0
- package/script/types/1_input_invoice_message_content.js +2 -0
- package/script/types/1_input_text_message_content.d.ts +8 -0
- package/script/types/1_input_text_message_content.js +2 -0
- package/script/types/1_photo.js +5 -5
- package/script/types/1_sticker.d.ts +2 -2
- package/script/types/1_sticker.js +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/{1_inline_keyboard_button.d.ts → 2_inline_keyboard_button.d.ts} +2 -2
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_input_message_content.d.ts +6 -0
- package/script/types/2_input_message_content.js +2 -0
- package/{esm/types/2_inline_keyboard_markup.d.ts → script/types/3_inline_keyboard_markup.d.ts} +3 -2
- package/script/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +3 -3
- package/script/types/3_message.d.ts +2 -2
- package/script/types/3_message.js +14 -14
- package/script/types/4_callback_query.d.ts +1 -1
- package/script/types/4_inline_query_result_article.d.ts +15 -0
- package/script/types/4_inline_query_result_article.js +2 -0
- package/script/types/4_inline_query_result_audio.d.ts +17 -0
- package/script/types/4_inline_query_result_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/script/types/4_inline_query_result_cached_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_document.js +2 -0
- package/script/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_photo.js +2 -0
- package/script/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/script/types/4_inline_query_result_cached_sticker.js +2 -0
- package/script/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_video.js +2 -0
- package/script/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_voice.js +2 -0
- package/script/types/4_inline_query_result_contact.d.ts +15 -0
- package/script/types/4_inline_query_result_contact.js +2 -0
- package/script/types/4_inline_query_result_document.d.ts +18 -0
- package/script/types/4_inline_query_result_document.js +2 -0
- package/script/types/4_inline_query_result_game.d.ts +7 -0
- package/script/types/4_inline_query_result_game.js +2 -0
- package/script/types/4_inline_query_result_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_gif.js +2 -0
- package/script/types/4_inline_query_result_location.d.ts +18 -0
- package/script/types/4_inline_query_result_location.js +2 -0
- package/script/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_photo.d.ts +19 -0
- package/script/types/4_inline_query_result_photo.js +2 -0
- package/script/types/4_inline_query_result_venue.d.ts +19 -0
- package/script/types/4_inline_query_result_venue.js +2 -0
- package/script/types/4_inline_query_result_video.d.ts +21 -0
- package/script/types/4_inline_query_result_video.js +2 -0
- package/script/types/4_inline_query_result_voice.d.ts +16 -0
- package/script/types/4_inline_query_result_voice.js +2 -0
- package/script/types/4_reply_markup.d.ts +7 -0
- package/script/types/4_reply_markup.js +26 -0
- package/script/types/5_inline_query_result.d.ts +29 -0
- package/script/types/5_inline_query_result.js +260 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
- /package/esm/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/esm/types/{!0_file_id.js → 0__file_id.js} +0 -0
- /package/esm/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/esm/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
- /package/script/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/script/types/{!0_file_id.js → 0__file_id.js} +0 -0
- /package/script/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/script/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
package/esm/0_deps.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./deps/deno.land/std@0.
|
|
1
|
+
export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
|
|
2
2
|
export { ctr256Decrypt, ctr256Encrypt, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.1.3/mod.js";
|
|
3
3
|
export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
|
|
4
4
|
export { Mutex, type MutexInterface } from "async-mutex";
|
|
5
5
|
export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
|
|
6
6
|
import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
|
|
7
7
|
export declare const debug: typeof debug_;
|
|
8
|
-
export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.
|
|
8
|
+
export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
|
package/esm/0_deps.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./deps/deno.land/std@0.
|
|
1
|
+
export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
|
|
2
2
|
export { ctr256Decrypt, ctr256Encrypt, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.1.3/mod.js";
|
|
3
3
|
export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
|
|
4
4
|
export { Mutex } from "async-mutex";
|
|
5
5
|
export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
|
|
6
6
|
import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
|
|
7
7
|
export const debug = (v) => debug_(v);
|
|
8
|
-
export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.
|
|
8
|
+
export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
|
package/esm/3_types.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
export * from "./types/!0_file_id.js";
|
|
2
1
|
export * from "./types/0_audio.js";
|
|
2
|
+
export * from "./types/0_bot_command.js";
|
|
3
3
|
export * from "./types/0_chat_action.js";
|
|
4
4
|
export * from "./types/0_chat_administrator_rights.js";
|
|
5
|
+
export * from "./types/0_chat_id.js";
|
|
5
6
|
export * from "./types/0_chat_photo.js";
|
|
7
|
+
export * from "./types/0_color.js";
|
|
6
8
|
export * from "./types/0_contact.js";
|
|
7
9
|
export * from "./types/0_dice.js";
|
|
10
|
+
export * from "./types/0__file_id.js";
|
|
8
11
|
export * from "./types/0_force_reply.js";
|
|
12
|
+
export * from "./types/0_input_contact_message_content.js";
|
|
13
|
+
export * from "./types/0_input_location_message_content.js";
|
|
14
|
+
export * from "./types/0_input_venue_message_content.js";
|
|
9
15
|
export * from "./types/0_keyboard_button_poll_type.js";
|
|
16
|
+
export * from "./types/0_labeled_price.js";
|
|
10
17
|
export * from "./types/0_location.js";
|
|
11
18
|
export * from "./types/0_login_url.js";
|
|
12
19
|
export * from "./types/0_mask_position.js";
|
|
13
20
|
export * from "./types/0_message_entity.js";
|
|
21
|
+
export * from "./types/0_parse_mode.js";
|
|
14
22
|
export * from "./types/0_poll_option.js";
|
|
15
23
|
export * from "./types/0_reply_keyboard_remove.js";
|
|
16
24
|
export * from "./types/0_thumbnail.js";
|
|
@@ -18,9 +26,13 @@ export * from "./types/0_venue.js";
|
|
|
18
26
|
export * from "./types/0_voice.js";
|
|
19
27
|
export * from "./types/0_web_app_info.js";
|
|
20
28
|
export * from "./types/1_animation.js";
|
|
29
|
+
export * from "./types/1_bot_command_scope.js";
|
|
21
30
|
export * from "./types/1_chat.js";
|
|
22
31
|
export * from "./types/1_document.js";
|
|
23
|
-
export * from "./types/
|
|
32
|
+
export * from "./types/1__getters.js";
|
|
33
|
+
export * from "./types/1_inline_query_result_button.js";
|
|
34
|
+
export * from "./types/1_input_invoice_message_content.js";
|
|
35
|
+
export * from "./types/1_input_text_message_content.js";
|
|
24
36
|
export * from "./types/1_keyboard_button.js";
|
|
25
37
|
export * from "./types/1_photo.js";
|
|
26
38
|
export * from "./types/1_poll.js";
|
|
@@ -29,8 +41,32 @@ export * from "./types/1_user.js";
|
|
|
29
41
|
export * from "./types/1_video_note.js";
|
|
30
42
|
export * from "./types/1_video.js";
|
|
31
43
|
export * from "./types/2_game.js";
|
|
32
|
-
export * from "./types/
|
|
44
|
+
export * from "./types/2_inline_keyboard_button.js";
|
|
33
45
|
export * from "./types/2_inline_query.js";
|
|
46
|
+
export * from "./types/2_input_message_content.js";
|
|
34
47
|
export * from "./types/2_reply_keyboard_markup.js";
|
|
48
|
+
export * from "./types/3_inline_keyboard_markup.js";
|
|
35
49
|
export * from "./types/3_message.js";
|
|
36
50
|
export * from "./types/4_callback_query.js";
|
|
51
|
+
export * from "./types/4_inline_query_result_article.js";
|
|
52
|
+
export * from "./types/4_inline_query_result_audio.js";
|
|
53
|
+
export * from "./types/4_inline_query_result_cached_audio.js";
|
|
54
|
+
export * from "./types/4_inline_query_result_cached_document.js";
|
|
55
|
+
export * from "./types/4_inline_query_result_cached_gif.js";
|
|
56
|
+
export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
|
|
57
|
+
export * from "./types/4_inline_query_result_cached_photo.js";
|
|
58
|
+
export * from "./types/4_inline_query_result_cached_sticker.js";
|
|
59
|
+
export * from "./types/4_inline_query_result_cached_video.js";
|
|
60
|
+
export * from "./types/4_inline_query_result_cached_voice.js";
|
|
61
|
+
export * from "./types/4_inline_query_result_contact.js";
|
|
62
|
+
export * from "./types/4_inline_query_result_document.js";
|
|
63
|
+
export * from "./types/4_inline_query_result_game.js";
|
|
64
|
+
export * from "./types/4_inline_query_result_gif.js";
|
|
65
|
+
export * from "./types/4_inline_query_result_location.js";
|
|
66
|
+
export * from "./types/4_inline_query_result_mpeg4_gif.js";
|
|
67
|
+
export * from "./types/4_inline_query_result_photo.js";
|
|
68
|
+
export * from "./types/4_inline_query_result_venue.js";
|
|
69
|
+
export * from "./types/4_inline_query_result_video.js";
|
|
70
|
+
export * from "./types/4_inline_query_result_voice.js";
|
|
71
|
+
export * from "./types/4_reply_markup.js";
|
|
72
|
+
export * from "./types/5_inline_query_result.js";
|
package/esm/3_types.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
export * from "./types/!0_file_id.js";
|
|
2
1
|
export * from "./types/0_audio.js";
|
|
2
|
+
export * from "./types/0_bot_command.js";
|
|
3
3
|
export * from "./types/0_chat_action.js";
|
|
4
4
|
export * from "./types/0_chat_administrator_rights.js";
|
|
5
|
+
export * from "./types/0_chat_id.js";
|
|
5
6
|
export * from "./types/0_chat_photo.js";
|
|
7
|
+
export * from "./types/0_color.js";
|
|
6
8
|
export * from "./types/0_contact.js";
|
|
7
9
|
export * from "./types/0_dice.js";
|
|
10
|
+
export * from "./types/0__file_id.js";
|
|
8
11
|
export * from "./types/0_force_reply.js";
|
|
12
|
+
export * from "./types/0_input_contact_message_content.js";
|
|
13
|
+
export * from "./types/0_input_location_message_content.js";
|
|
14
|
+
export * from "./types/0_input_venue_message_content.js";
|
|
9
15
|
export * from "./types/0_keyboard_button_poll_type.js";
|
|
16
|
+
export * from "./types/0_labeled_price.js";
|
|
10
17
|
export * from "./types/0_location.js";
|
|
11
18
|
export * from "./types/0_login_url.js";
|
|
12
19
|
export * from "./types/0_mask_position.js";
|
|
13
20
|
export * from "./types/0_message_entity.js";
|
|
21
|
+
export * from "./types/0_parse_mode.js";
|
|
14
22
|
export * from "./types/0_poll_option.js";
|
|
15
23
|
export * from "./types/0_reply_keyboard_remove.js";
|
|
16
24
|
export * from "./types/0_thumbnail.js";
|
|
@@ -18,9 +26,13 @@ export * from "./types/0_venue.js";
|
|
|
18
26
|
export * from "./types/0_voice.js";
|
|
19
27
|
export * from "./types/0_web_app_info.js";
|
|
20
28
|
export * from "./types/1_animation.js";
|
|
29
|
+
export * from "./types/1_bot_command_scope.js";
|
|
21
30
|
export * from "./types/1_chat.js";
|
|
22
31
|
export * from "./types/1_document.js";
|
|
23
|
-
export * from "./types/
|
|
32
|
+
export * from "./types/1__getters.js";
|
|
33
|
+
export * from "./types/1_inline_query_result_button.js";
|
|
34
|
+
export * from "./types/1_input_invoice_message_content.js";
|
|
35
|
+
export * from "./types/1_input_text_message_content.js";
|
|
24
36
|
export * from "./types/1_keyboard_button.js";
|
|
25
37
|
export * from "./types/1_photo.js";
|
|
26
38
|
export * from "./types/1_poll.js";
|
|
@@ -29,8 +41,32 @@ export * from "./types/1_user.js";
|
|
|
29
41
|
export * from "./types/1_video_note.js";
|
|
30
42
|
export * from "./types/1_video.js";
|
|
31
43
|
export * from "./types/2_game.js";
|
|
32
|
-
export * from "./types/
|
|
44
|
+
export * from "./types/2_inline_keyboard_button.js";
|
|
33
45
|
export * from "./types/2_inline_query.js";
|
|
46
|
+
export * from "./types/2_input_message_content.js";
|
|
34
47
|
export * from "./types/2_reply_keyboard_markup.js";
|
|
48
|
+
export * from "./types/3_inline_keyboard_markup.js";
|
|
35
49
|
export * from "./types/3_message.js";
|
|
36
50
|
export * from "./types/4_callback_query.js";
|
|
51
|
+
export * from "./types/4_inline_query_result_article.js";
|
|
52
|
+
export * from "./types/4_inline_query_result_audio.js";
|
|
53
|
+
export * from "./types/4_inline_query_result_cached_audio.js";
|
|
54
|
+
export * from "./types/4_inline_query_result_cached_document.js";
|
|
55
|
+
export * from "./types/4_inline_query_result_cached_gif.js";
|
|
56
|
+
export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
|
|
57
|
+
export * from "./types/4_inline_query_result_cached_photo.js";
|
|
58
|
+
export * from "./types/4_inline_query_result_cached_sticker.js";
|
|
59
|
+
export * from "./types/4_inline_query_result_cached_video.js";
|
|
60
|
+
export * from "./types/4_inline_query_result_cached_voice.js";
|
|
61
|
+
export * from "./types/4_inline_query_result_contact.js";
|
|
62
|
+
export * from "./types/4_inline_query_result_document.js";
|
|
63
|
+
export * from "./types/4_inline_query_result_game.js";
|
|
64
|
+
export * from "./types/4_inline_query_result_gif.js";
|
|
65
|
+
export * from "./types/4_inline_query_result_location.js";
|
|
66
|
+
export * from "./types/4_inline_query_result_mpeg4_gif.js";
|
|
67
|
+
export * from "./types/4_inline_query_result_photo.js";
|
|
68
|
+
export * from "./types/4_inline_query_result_venue.js";
|
|
69
|
+
export * from "./types/4_inline_query_result_video.js";
|
|
70
|
+
export * from "./types/4_inline_query_result_voice.js";
|
|
71
|
+
export * from "./types/4_reply_markup.js";
|
|
72
|
+
export * from "./types/5_inline_query_result.js";
|
package/esm/4_constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 161;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.999";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
54
54
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
55
55
|
export const INITIAL_DC = "2-test";
|
|
56
56
|
export const LAYER = 161;
|
|
57
|
-
export const APP_VERSION = "MTKruto 0.0.
|
|
57
|
+
export const APP_VERSION = "MTKruto 0.0.999";
|
|
58
58
|
// @ts-ignore: lib
|
|
59
59
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
60
60
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/esm/client/0_html.js
CHANGED
|
@@ -27,7 +27,7 @@ export function parseHtml(html) {
|
|
|
27
27
|
if (!url) {
|
|
28
28
|
throw new Error("Missing attribute href");
|
|
29
29
|
}
|
|
30
|
-
queue.push({ type: "
|
|
30
|
+
queue.push({ type: "textLink", offset: text.length, length: 0, url });
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
case "ins":
|
package/esm/client/3_types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
-
import { CallbackQuery, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
|
|
2
|
+
import { CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
|
|
3
3
|
import { With } from "./0_utilities.js";
|
|
4
4
|
import { ClientPlainParams } from "./2_client_plain.js";
|
|
5
|
-
export type ParseMode = "
|
|
5
|
+
export type ParseMode = "HTML" | null;
|
|
6
6
|
export interface ClientParams extends ClientPlainParams {
|
|
7
7
|
/**
|
|
8
8
|
* A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defauls to `ParseMode.None`.
|
|
@@ -52,10 +52,6 @@ export interface AuthorizeUserParams<S = string> {
|
|
|
52
52
|
code: S | (() => MaybePromise<S>);
|
|
53
53
|
password: S | ((hint: string | null) => MaybePromise<S>);
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* A chat identifier as provided by MTKruto or a string starting with a @ that is followed by a username.
|
|
57
|
-
*/
|
|
58
|
-
export type ChatID = number | string;
|
|
59
55
|
export interface SendMessagesParams {
|
|
60
56
|
/**
|
|
61
57
|
* The parse mode to use. If not provided, the default parse mode will be used.
|
|
@@ -217,3 +213,4 @@ export interface Handler<U extends Partial<Update> = Partial<Update>> {
|
|
|
217
213
|
export type FilterUpdate<U extends Update, T extends keyof U, F extends keyof NonNullable<U[T]>> = With<U, T> & Pick<{
|
|
218
214
|
[P in T]-?: With<NonNullable<U[T]>, F>;
|
|
219
215
|
}, T>;
|
|
216
|
+
export declare const skip: Handler;
|
package/esm/client/3_types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const skip = (__, _) => _();
|
package/esm/client/4_client.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { functions, ReadObject, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { ChatAction, Message } from "../3_types.js";
|
|
5
|
+
import { BotCommand, BotCommandScope, ChatAction, ChatID, InlineQueryResult, InlineQueryResultButton, Message } from "../3_types.js";
|
|
6
6
|
import { With } from "./0_utilities.js";
|
|
7
7
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
8
|
-
import { AnswerCallbackQueryParams, AuthorizeUserParams,
|
|
8
|
+
import { AnswerCallbackQueryParams, AuthorizeUserParams, ClientParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, Handler, ParseMode, SendMessagesParams, SendPollParams, Update } from "./3_types.js";
|
|
9
9
|
export declare const getEntity: unique symbol;
|
|
10
10
|
export declare const getStickerSetName: unique symbol;
|
|
11
11
|
export declare const handleMigrationError: unique symbol;
|
|
@@ -36,7 +36,6 @@ export declare class Client extends ClientAbstract {
|
|
|
36
36
|
* @param storage The storage provider to use. Defaults to memory storage.
|
|
37
37
|
* @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
|
|
38
38
|
* @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
|
|
39
|
-
* @param params Other parameters.
|
|
40
39
|
*/
|
|
41
40
|
constructor(storage?: Storage, apiId?: number | null, apiHash?: string | null, params?: ClientParams);
|
|
42
41
|
private propagateConnectionState;
|
|
@@ -193,6 +192,7 @@ export declare class Client extends ClientAbstract {
|
|
|
193
192
|
* @param id ID of the callback query to answer.
|
|
194
193
|
*/
|
|
195
194
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
195
|
+
private usernameResolver;
|
|
196
196
|
private constructReplyMarkup;
|
|
197
197
|
private static assertMsgHas;
|
|
198
198
|
/**
|
|
@@ -211,10 +211,25 @@ export declare class Client extends ClientAbstract {
|
|
|
211
211
|
* @param messageThreadId The thread to send the chat action to.
|
|
212
212
|
*/
|
|
213
213
|
sendChatAction(chatId: ChatID, action_: ChatAction, messageThreadId?: number): Promise<void>;
|
|
214
|
+
setMyCommands(commands: BotCommand[], params?: {
|
|
215
|
+
languageCode?: string;
|
|
216
|
+
scope?: BotCommandScope;
|
|
217
|
+
}): Promise<void>;
|
|
218
|
+
getMyCommands(params?: {
|
|
219
|
+
languageCode?: string;
|
|
220
|
+
scope?: BotCommandScope;
|
|
221
|
+
}): Promise<BotCommand[]>;
|
|
222
|
+
answerInlineQuery(id: string, results: InlineQueryResult[], params?: {
|
|
223
|
+
cacheTime?: number;
|
|
224
|
+
isPersonal?: boolean;
|
|
225
|
+
nextOffset?: string;
|
|
226
|
+
isGallery?: boolean;
|
|
227
|
+
button: InlineQueryResultButton;
|
|
228
|
+
}): Promise<void>;
|
|
214
229
|
private handle;
|
|
215
230
|
use(handler: Handler): void;
|
|
216
231
|
branch(predicate: (upd: Update) => MaybePromise<boolean>, trueHandler: Handler, falseHandler: Handler): void;
|
|
217
|
-
filter<D extends Update>(predicate: (
|
|
218
|
-
filter(predicate: (
|
|
232
|
+
filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
|
|
233
|
+
filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
|
|
219
234
|
on<T extends keyof Update, F extends keyof NonNullable<Update[T]>>(filter: T extends FilterableUpdates ? T | [T, F, ...F[]] : T, handler: Handler<FilterUpdate<Update, T, F>>): void;
|
|
220
235
|
}
|
package/esm/client/4_client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { debug, gunzip, Mutex } from "../0_deps.js";
|
|
|
2
2
|
import { bigIntFromBuffer, drop, getRandomBigInt, getRandomId, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
|
|
3
3
|
import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
|
|
4
4
|
import { StorageMemory } from "../3_storage.js";
|
|
5
|
-
import { constructCallbackQuery, constructInlineQuery, constructMessage, constructUser, FileID, FileType,
|
|
5
|
+
import { botCommandScopeToTlObject, constructCallbackQuery, constructInlineQuery, constructMessage, constructUser, FileID, FileType, inlineQueryResultToTlObject, messageEntityToTlObject, replyMarkupToTlObject, ThumbnailSource } from "../3_types.js";
|
|
6
6
|
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";
|
|
7
7
|
import { isChannelPtsUpdate, isPtsUpdate, resolve } from "./0_utilities.js";
|
|
8
8
|
import { decryptMessage, encryptMessage, getMessageId } from "./0_message.js";
|
|
@@ -10,6 +10,7 @@ import { checkPassword } from "./0_password.js";
|
|
|
10
10
|
import { parseHtml } from "./0_html.js";
|
|
11
11
|
import { ClientPlain } from "./2_client_plain.js";
|
|
12
12
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
13
|
+
import { skip } from "./3_types.js";
|
|
13
14
|
const d = debug("Client");
|
|
14
15
|
const dGap = debug("Client/recoverUpdateGap");
|
|
15
16
|
const dGapC = debug("Client/recoverChannelUpdateGap");
|
|
@@ -27,7 +28,6 @@ export class Client extends ClientAbstract {
|
|
|
27
28
|
* @param storage The storage provider to use. Defaults to memory storage.
|
|
28
29
|
* @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
|
|
29
30
|
* @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
|
|
30
|
-
* @param params Other parameters.
|
|
31
31
|
*/
|
|
32
32
|
constructor(storage = new StorageMemory(), apiId = 0, apiHash = "", params) {
|
|
33
33
|
super(params);
|
|
@@ -212,15 +212,22 @@ export class Client extends ClientAbstract {
|
|
|
212
212
|
writable: true,
|
|
213
213
|
value: new Queue("processUpdates")
|
|
214
214
|
});
|
|
215
|
-
Object.defineProperty(this, "
|
|
215
|
+
Object.defineProperty(this, "usernameResolver", {
|
|
216
216
|
enumerable: true,
|
|
217
217
|
configurable: true,
|
|
218
218
|
writable: true,
|
|
219
|
-
value: (
|
|
220
|
-
|
|
219
|
+
value: async (v) => {
|
|
220
|
+
const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
|
|
221
|
+
return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
|
|
221
222
|
}
|
|
222
223
|
});
|
|
223
|
-
this
|
|
224
|
+
Object.defineProperty(this, "handle", {
|
|
225
|
+
enumerable: true,
|
|
226
|
+
configurable: true,
|
|
227
|
+
writable: true,
|
|
228
|
+
value: skip
|
|
229
|
+
});
|
|
230
|
+
this.parseMode = params?.parseMode ?? null;
|
|
224
231
|
this.appVersion = params?.appVersion ?? APP_VERSION;
|
|
225
232
|
this.deviceModel = params?.deviceModel ?? DEVICE_MODEL;
|
|
226
233
|
this.langCode = params?.langCode ?? LANG_CODE;
|
|
@@ -1221,9 +1228,9 @@ export class Client extends ClientAbstract {
|
|
|
1221
1228
|
const entities_ = params?.entities ?? [];
|
|
1222
1229
|
const parseMode = params?.parseMode ?? this.parseMode;
|
|
1223
1230
|
switch (parseMode) {
|
|
1224
|
-
case
|
|
1231
|
+
case null:
|
|
1225
1232
|
break;
|
|
1226
|
-
case "
|
|
1233
|
+
case "HTML": {
|
|
1227
1234
|
const [newText, entitiesToPush] = parseHtml(text);
|
|
1228
1235
|
text = newText;
|
|
1229
1236
|
for (const entity of entitiesToPush) {
|
|
@@ -1506,29 +1513,10 @@ export class Client extends ClientAbstract {
|
|
|
1506
1513
|
}));
|
|
1507
1514
|
}
|
|
1508
1515
|
async constructReplyMarkup(params) {
|
|
1509
|
-
let replyMarkup = undefined;
|
|
1510
1516
|
if (params?.replyMarkup) {
|
|
1511
1517
|
await this.assertBot("replyMarkup");
|
|
1512
|
-
|
|
1513
|
-
replyMarkup = await inlineKeyboardMarkupToTlObject(params.replyMarkup, async (v) => {
|
|
1514
|
-
const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
|
|
1515
|
-
return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
|
|
1516
|
-
});
|
|
1517
|
-
}
|
|
1518
|
-
else if ("keyboard" in params.replyMarkup) {
|
|
1519
|
-
replyMarkup = replyKeyboardMarkupToTlObject(params.replyMarkup);
|
|
1520
|
-
}
|
|
1521
|
-
else if ("removeKeyboard" in params.replyMarkup) {
|
|
1522
|
-
replyMarkup = replyKeyboardRemoveToTlObject(params.replyMarkup);
|
|
1523
|
-
}
|
|
1524
|
-
else if ("forceReply" in params.replyMarkup) {
|
|
1525
|
-
replyMarkup = forceReplyToTlObject(params.replyMarkup);
|
|
1526
|
-
}
|
|
1527
|
-
else {
|
|
1528
|
-
throw new Error("The replyMarkup parameter has an unexpected type");
|
|
1529
|
-
}
|
|
1518
|
+
return replyMarkupToTlObject(params.replyMarkup, this.usernameResolver.bind(this));
|
|
1530
1519
|
}
|
|
1531
|
-
return replyMarkup;
|
|
1532
1520
|
}
|
|
1533
1521
|
static assertMsgHas(message, key) {
|
|
1534
1522
|
if (!(key in message) || message[key] === undefined) {
|
|
@@ -1598,42 +1586,70 @@ export class Client extends ClientAbstract {
|
|
|
1598
1586
|
async sendChatAction(chatId, action_, messageThreadId) {
|
|
1599
1587
|
let action;
|
|
1600
1588
|
switch (action_) {
|
|
1601
|
-
case "
|
|
1589
|
+
case "type":
|
|
1602
1590
|
action = new types.SendMessageTypingAction();
|
|
1603
1591
|
break;
|
|
1604
|
-
case "
|
|
1592
|
+
case "uploadPhoto":
|
|
1605
1593
|
action = new types.SendMessageUploadPhotoAction({ progress: 0 });
|
|
1606
1594
|
break;
|
|
1607
|
-
case "
|
|
1595
|
+
case "recordVideo":
|
|
1608
1596
|
action = new types.SendMessageRecordVideoAction();
|
|
1609
1597
|
break;
|
|
1610
|
-
case "
|
|
1598
|
+
case "uploadVideo":
|
|
1611
1599
|
action = new types.SendMessageRecordVideoAction();
|
|
1612
1600
|
break;
|
|
1613
|
-
case "
|
|
1601
|
+
case "recordVoice":
|
|
1614
1602
|
action = new types.SendMessageRecordAudioAction();
|
|
1615
1603
|
break;
|
|
1616
|
-
case "
|
|
1604
|
+
case "uploadAudio":
|
|
1617
1605
|
action = new types.SendMessageUploadAudioAction({ progress: 0 });
|
|
1618
1606
|
break;
|
|
1619
|
-
case "
|
|
1607
|
+
case "uploadDocument":
|
|
1620
1608
|
action = new types.SendMessageUploadDocumentAction({ progress: 0 });
|
|
1621
1609
|
break;
|
|
1622
|
-
case "
|
|
1610
|
+
case "chooseSticker":
|
|
1623
1611
|
action = new types.SendMessageChooseStickerAction();
|
|
1624
1612
|
break;
|
|
1625
|
-
case "
|
|
1613
|
+
case "findLocation":
|
|
1626
1614
|
action = new types.SendMessageGeoLocationAction();
|
|
1627
1615
|
break;
|
|
1628
|
-
case "
|
|
1616
|
+
case "recordVideoNote":
|
|
1629
1617
|
action = new types.SendMessageRecordRoundAction();
|
|
1630
1618
|
break;
|
|
1631
|
-
case "
|
|
1619
|
+
case "uploadVideoNote":
|
|
1632
1620
|
action = new types.SendMessageUploadRoundAction({ progress: 0 });
|
|
1633
1621
|
break;
|
|
1622
|
+
default:
|
|
1623
|
+
throw new Error("Invalid chat action: " + action_);
|
|
1634
1624
|
}
|
|
1635
1625
|
await this.invoke(new functions.MessagesSetTyping({ peer: await this.getInputPeer(chatId), action, topMsgId: messageThreadId }));
|
|
1636
1626
|
}
|
|
1627
|
+
async setMyCommands(commands, params) {
|
|
1628
|
+
await this.invoke(new functions.BotsSetBotCommands({
|
|
1629
|
+
commands: commands.map((v) => new types.BotCommand(v)),
|
|
1630
|
+
langCode: params?.languageCode ?? "",
|
|
1631
|
+
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
|
|
1632
|
+
}));
|
|
1633
|
+
}
|
|
1634
|
+
async getMyCommands(params) {
|
|
1635
|
+
const commands_ = await this.invoke(new functions.BotsGetBotCommands({
|
|
1636
|
+
langCode: params?.languageCode ?? "",
|
|
1637
|
+
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
|
|
1638
|
+
}));
|
|
1639
|
+
return commands_.map((v) => ({ command: v.command, description: v.description }));
|
|
1640
|
+
}
|
|
1641
|
+
async answerInlineQuery(id, results, params) {
|
|
1642
|
+
await this.invoke(new functions.MessagesSetInlineBotResults({
|
|
1643
|
+
queryId: BigInt(id),
|
|
1644
|
+
results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, this.parseText.bind(this), this.usernameResolver.bind(this)))),
|
|
1645
|
+
cacheTime: params?.cacheTime ?? 300,
|
|
1646
|
+
private: params?.isPersonal ? true : undefined,
|
|
1647
|
+
switchWebview: params?.button && params.button.webApp ? new types.InlineBotWebView({ text: params.button.text, url: params.button.webApp.url }) : undefined,
|
|
1648
|
+
switchPm: params?.button && params.button.startParameter ? new types.InlineBotSwitchPM({ text: params.button.text, startParam: params.button.startParameter }) : undefined,
|
|
1649
|
+
gallery: params?.isGallery ? true : undefined,
|
|
1650
|
+
nextOffset: params?.nextOffset,
|
|
1651
|
+
}));
|
|
1652
|
+
}
|
|
1637
1653
|
use(handler) {
|
|
1638
1654
|
const handle = this.handle;
|
|
1639
1655
|
this.handle = async (upd, next) => {
|
|
@@ -1657,7 +1673,7 @@ export class Client extends ClientAbstract {
|
|
|
1657
1673
|
});
|
|
1658
1674
|
}
|
|
1659
1675
|
filter(predicate, handler) {
|
|
1660
|
-
this.branch(predicate, handler,
|
|
1676
|
+
this.branch(predicate, handler, skip);
|
|
1661
1677
|
}
|
|
1662
1678
|
on(filter, handler) {
|
|
1663
1679
|
const type = typeof filter === "string" ? filter : filter[0];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
|
2
2
|
import { debug, Mutex } from "../0_deps.js";
|
|
3
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
3
4
|
import { ConnectionUnframed } from "./0_connection.js";
|
|
4
5
|
const d = debug("ConnectionWebSocket");
|
|
5
6
|
export class ConnectionWebSocket extends ConnectionUnframed {
|
|
@@ -75,7 +76,7 @@ export class ConnectionWebSocket extends ConnectionUnframed {
|
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
const release = await mutex.acquire();
|
|
78
|
-
const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob
|
|
79
|
+
const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob || v instanceof Uint8Array ? v : v instanceof ArrayBuffer ? v : UNREACHABLE())).arrayBuffer());
|
|
79
80
|
for (const byte of data) {
|
|
80
81
|
this.buffer.push(byte);
|
|
81
82
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { format } from "./_format.js";
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion that `actual` is greater than `expected`.
|
|
6
|
+
* If not then throw.
|
|
7
|
+
*/
|
|
8
|
+
export function assertGreater(actual, expected, msg) {
|
|
9
|
+
if (actual > expected)
|
|
10
|
+
return;
|
|
11
|
+
const actualString = format(actual);
|
|
12
|
+
const expectedString = format(expected);
|
|
13
|
+
throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { format } from "./_format.js";
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion that `actual` is greater than or equal to `expected`.
|
|
6
|
+
* If not then throw.
|
|
7
|
+
*/
|
|
8
|
+
export function assertGreaterOrEqual(actual, expected, msg) {
|
|
9
|
+
if (actual >= expected)
|
|
10
|
+
return;
|
|
11
|
+
const actualString = format(actual);
|
|
12
|
+
const expectedString = format(expected);
|
|
13
|
+
throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
|
|
14
|
+
}
|
|
@@ -22,11 +22,11 @@ export function assertInstanceOf(actual, expectedType, msg = "") {
|
|
|
22
22
|
else {
|
|
23
23
|
actualTypeStr = typeof actual;
|
|
24
24
|
}
|
|
25
|
-
if (expectedTypeStr
|
|
25
|
+
if (expectedTypeStr === actualTypeStr) {
|
|
26
26
|
msg =
|
|
27
27
|
`Expected object to be an instance of "${expectedTypeStr}"${msgSuffix}`;
|
|
28
28
|
}
|
|
29
|
-
else if (actualTypeStr
|
|
29
|
+
else if (actualTypeStr === "function") {
|
|
30
30
|
msg =
|
|
31
31
|
`Expected object to be an instance of "${expectedTypeStr}" but was not an instanced object${msgSuffix}`;
|
|
32
32
|
}
|
|
@@ -20,7 +20,10 @@ ErrorClass, msgIncludes, msg) {
|
|
|
20
20
|
}
|
|
21
21
|
if (msgIncludes && (!(error instanceof Error) ||
|
|
22
22
|
!stripColor(error.message).includes(stripColor(msgIncludes)))) {
|
|
23
|
-
msg = `Expected error message to include
|
|
23
|
+
msg = `Expected error message to include ${JSON.stringify(msgIncludes)}, but got ${error instanceof Error
|
|
24
|
+
? JSON.stringify(error.message)
|
|
25
|
+
: '"[not an Error]"' // TODO(kt3k): show more useful information
|
|
26
|
+
}${msgSuffix}`;
|
|
24
27
|
throw new AssertionError(msg);
|
|
25
28
|
}
|
|
26
29
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { format } from "./_format.js";
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion that `actual` is less than `expected`.
|
|
6
|
+
* If not then throw.
|
|
7
|
+
*/
|
|
8
|
+
export function assertLess(actual, expected, msg) {
|
|
9
|
+
if (actual < expected)
|
|
10
|
+
return;
|
|
11
|
+
const actualString = format(actual);
|
|
12
|
+
const expectedString = format(expected);
|
|
13
|
+
throw new AssertionError(msg ?? `Expect ${actualString} < ${expectedString}`);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
import { format } from "./_format.js";
|
|
3
|
+
import { AssertionError } from "./assertion_error.js";
|
|
4
|
+
/**
|
|
5
|
+
* Make an assertion that `actual` is less than or equal to `expected`.
|
|
6
|
+
* If not then throw.
|
|
7
|
+
*/
|
|
8
|
+
export function assertLessOrEqual(actual, expected, msg) {
|
|
9
|
+
if (actual <= expected)
|
|
10
|
+
return;
|
|
11
|
+
const actualString = format(actual);
|
|
12
|
+
const expectedString = format(expected);
|
|
13
|
+
throw new AssertionError(msg ?? `Expect ${actualString} <= ${expectedString}`);
|
|
14
|
+
}
|
|
@@ -12,8 +12,12 @@ export * from "./assert_array_includes.js";
|
|
|
12
12
|
export * from "./assert_equals.js";
|
|
13
13
|
export * from "./assert_exists.js";
|
|
14
14
|
export * from "./assert_false.js";
|
|
15
|
+
export * from "./assert_greater_or_equal.js";
|
|
16
|
+
export * from "./assert_greater.js";
|
|
15
17
|
export * from "./assert_instance_of.js";
|
|
16
18
|
export * from "./assert_is_error.js";
|
|
19
|
+
export * from "./assert_less_or_equal.js";
|
|
20
|
+
export * from "./assert_less.js";
|
|
17
21
|
export * from "./assert_match.js";
|
|
18
22
|
export * from "./assert_not_equals.js";
|
|
19
23
|
export * from "./assert_not_instance_of.js";
|