@mtkruto/node 0.1.112 → 0.1.114
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 -2
- package/esm/0_deps.js +3 -2
- package/esm/1_utilities.d.ts +1 -0
- package/esm/1_utilities.js +1 -0
- package/esm/3_types.d.ts +0 -1
- package/esm/3_types.js +0 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/5_client.d.ts +2 -1
- package/esm/5_client.js +2 -1
- package/esm/client/0_utilities.d.ts +6 -0
- package/esm/client/0_utilities.js +53 -0
- package/esm/client/3_types.d.ts +76 -8
- package/esm/client/3_types.js +1 -1
- package/esm/client/4_composer.d.ts +22 -0
- package/esm/client/4_composer.js +81 -0
- package/esm/client/{4_client.d.ts → 5_client.d.ts} +87 -12
- package/esm/client/{4_client.js → 5_client.js} +367 -107
- package/esm/client/6_composer.d.ts +4 -0
- package/esm/client/6_composer.js +3 -0
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
- package/{script/deps/deno.land/std@0.204.0 → esm/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
- package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
- package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.js +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/basename.js +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/common.js +23 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/constants.js +46 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/format.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +9 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +235 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +77 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/relative.js +9 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +15 -0
- package/esm/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/_interface.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/_os.js +18 -0
- package/esm/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/basename.js +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/dirname.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/extname.js +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/format.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/from_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
- package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +65 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/is_glob.js +28 -0
- package/esm/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/join.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/join_globs.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
- package/esm/deps/deno.land/std@0.207.0/path/mod.js +63 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/parse.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/_util.js +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/basename.js +18 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.js +36 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/extname.js +59 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/format.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/mod.js +44 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.js +25 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/parse.js +98 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/relative.js +94 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.js +48 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/separator.js +4 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +22 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +10 -0
- package/esm/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/relative.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/resolve.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/separator.js +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_file_url.js +24 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +14 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/_util.js +15 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/basename.js +30 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/common.js +19 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.js +98 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/extname.js +68 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/format.js +11 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +69 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +27 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.js +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join.js +72 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.js +26 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/mod.js +44 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.js +130 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +16 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/parse.js +159 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/relative.js +121 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.js +143 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/separator.js +4 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +31 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +38 -0
- package/esm/mod.d.ts +1 -1
- package/esm/mod.js +1 -1
- package/esm/tl/0_tl_raw_reader.d.ts +1 -0
- package/esm/tl/0_tl_raw_reader.js +3 -0
- package/esm/tl/3_deserialize.js +7 -2
- package/esm/types/1_chat.d.ts +2 -3
- package/esm/types/1_chat.js +4 -5
- package/esm/types/1_user.d.ts +2 -3
- package/esm/types/1_user.js +2 -3
- package/esm/types/5_inline_query_result.js +7 -0
- package/esm/utilities/0_color.d.ts +3 -0
- package/esm/utilities/0_color.js +55 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +3 -2
- package/script/0_deps.js +18 -5
- package/script/1_utilities.d.ts +1 -0
- package/script/1_utilities.js +1 -0
- package/script/3_types.d.ts +0 -1
- package/script/3_types.js +0 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/5_client.d.ts +2 -1
- package/script/5_client.js +2 -1
- package/script/client/0_utilities.d.ts +6 -0
- package/script/client/0_utilities.js +79 -1
- package/script/client/3_types.d.ts +76 -8
- package/script/client/3_types.js +0 -3
- package/script/client/4_composer.d.ts +22 -0
- package/script/client/4_composer.js +88 -0
- package/script/client/{4_client.d.ts → 5_client.d.ts} +87 -12
- package/script/client/{4_client.js → 5_client.js} +369 -108
- package/script/client/6_composer.d.ts +4 -0
- package/script/client/6_composer.js +7 -0
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
- package/{esm/deps/deno.land/std@0.204.0 → script/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
- package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
- package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.js +11 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/basename.js +46 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/common.js +27 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/constants.js +49 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/dirname.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/format.js +24 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +13 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +239 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +81 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/relative.js +13 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +19 -0
- package/script/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
- package/script/deps/deno.land/std@0.207.0/path/_interface.js +4 -0
- package/script/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/_os.js +44 -0
- package/script/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/basename.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/dirname.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/extname.js +17 -0
- package/script/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/format.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
- package/script/deps/deno.land/std@0.207.0/path/from_file_url.js +28 -0
- package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
- package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +69 -0
- package/script/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/is_glob.js +32 -0
- package/script/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/join.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/join_globs.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
- package/script/deps/deno.land/std@0.207.0/path/mod.js +92 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/normalize_glob.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/parse.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/_util.js +12 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/basename.js +22 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/dirname.js +40 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/extname.js +63 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/format.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +16 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/mod.js +61 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize.js +29 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/parse.js +102 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/relative.js +98 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/resolve.js +75 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/separator.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +26 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +14 -0
- package/script/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.207.0/path/relative.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/resolve.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/separator.js +8 -0
- package/script/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
- package/script/deps/deno.land/std@0.207.0/path/to_file_url.js +28 -0
- package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +18 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/_util.js +21 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/basename.js +34 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/common.js +23 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/dirname.js +102 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/extname.js +72 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/format.js +15 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +73 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +31 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join.js +76 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.js +30 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/mod.js +61 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize.js +134 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +20 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/parse.js +163 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/relative.js +125 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/resolve.js +170 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/separator.js +7 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +35 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
- package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +42 -0
- package/script/mod.d.ts +1 -1
- package/script/mod.js +3 -1
- package/script/tl/0_tl_raw_reader.d.ts +1 -0
- package/script/tl/0_tl_raw_reader.js +3 -0
- package/script/tl/3_deserialize.js +7 -2
- package/script/types/1_chat.d.ts +2 -3
- package/script/types/1_chat.js +4 -5
- package/script/types/1_user.d.ts +2 -3
- package/script/types/1_user.js +1 -2
- package/script/types/5_inline_query_result.js +7 -0
- package/script/utilities/0_color.d.ts +3 -0
- package/script/utilities/0_color.js +60 -0
- package/esm/types/0_color.d.ts +0 -3
- package/esm/types/0_color.js +0 -36
- package/script/types/0_color.d.ts +0 -3
- package/script/types/0_color.js +0 -41
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
|
@@ -9,7 +9,7 @@ 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,
|
|
12
|
+
var _Client_instances, _a, _Client_auth, _Client_sessionId, _Client_state, _Client_promises, _Client_toAcknowledge, _Client_updateState, _Client_publicKeys, _Client_autoStart, _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_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, drop, getRandomBigInt, getRandomId, mod, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
|
|
15
15
|
import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
|
|
@@ -20,10 +20,10 @@ import { AuthKeyUnregistered, FloodWait, Migrate, PasswordHashInvalid, PhoneNumb
|
|
|
20
20
|
import { parseHtml } from "./0_html.js";
|
|
21
21
|
import { decryptMessage, encryptMessage, getMessageId } from "./0_message.js";
|
|
22
22
|
import { checkPassword } from "./0_password.js";
|
|
23
|
-
import { isChannelPtsUpdate, isPtsUpdate, resolve } from "./0_utilities.js";
|
|
23
|
+
import { getFileContents, isChannelPtsUpdate, isHttpUrl, isPtsUpdate, resolve } from "./0_utilities.js";
|
|
24
24
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
25
25
|
import { ClientPlain } from "./2_client_plain.js";
|
|
26
|
-
import { skip } from "./
|
|
26
|
+
import { Composer, concat, flatten, skip } from "./4_composer.js";
|
|
27
27
|
const d = debug("Client");
|
|
28
28
|
const dGap = debug("Client/recoverUpdateGap");
|
|
29
29
|
const dGapC = debug("Client/recoverChannelUpdateGap");
|
|
@@ -34,6 +34,9 @@ const getEntity = Symbol();
|
|
|
34
34
|
const getStickerSetName = Symbol();
|
|
35
35
|
export const handleMigrationError = Symbol();
|
|
36
36
|
const getMessageWithReply = Symbol();
|
|
37
|
+
export function skipInvoke() {
|
|
38
|
+
return (_ctx, next) => next();
|
|
39
|
+
}
|
|
37
40
|
export const restartAuth = Symbol();
|
|
38
41
|
export class ConnectionError extends Error {
|
|
39
42
|
}
|
|
@@ -66,7 +69,6 @@ export class Client extends ClientAbstract {
|
|
|
66
69
|
_Client_promises.set(this, new Map());
|
|
67
70
|
_Client_toAcknowledge.set(this, new Set());
|
|
68
71
|
_Client_updateState.set(this, void 0);
|
|
69
|
-
_Client_errorHandler.set(this, void 0);
|
|
70
72
|
Object.defineProperty(this, "storage", {
|
|
71
73
|
enumerable: true,
|
|
72
74
|
configurable: true,
|
|
@@ -117,17 +119,116 @@ export class Client extends ClientAbstract {
|
|
|
117
119
|
});
|
|
118
120
|
_Client_publicKeys.set(this, void 0);
|
|
119
121
|
_Client_autoStart.set(this, void 0);
|
|
122
|
+
_Client_constructContext.set(this, (update) => {
|
|
123
|
+
const msg = update.message ?? update.editedMessage ?? update.callbackQuery?.message;
|
|
124
|
+
const mustGetMsg = () => {
|
|
125
|
+
if (msg !== undefined) {
|
|
126
|
+
return msg;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
UNREACHABLE();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const chat = msg?.chat;
|
|
133
|
+
const from = update.callbackQuery?.from ?? update.inlineQuery?.from ?? update.message?.from ?? update.editedMessage?.from;
|
|
134
|
+
const senderChat = msg?.senderChat;
|
|
135
|
+
const getReplyToMessageId = (quote, effectiveMessage) => {
|
|
136
|
+
const shouldQuote = quote === undefined ? effectiveMessage.chat.type != "private" : quote;
|
|
137
|
+
const replyToMessageId = shouldQuote ? effectiveMessage.id : undefined;
|
|
138
|
+
return replyToMessageId;
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
...update,
|
|
142
|
+
client: this,
|
|
143
|
+
msg,
|
|
144
|
+
chat,
|
|
145
|
+
from,
|
|
146
|
+
senderChat,
|
|
147
|
+
reply: (text, params) => {
|
|
148
|
+
const effectiveMessage = mustGetMsg();
|
|
149
|
+
const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
|
|
150
|
+
return this.sendMessage(effectiveMessage.chat.id, text, { ...params, replyToMessageId });
|
|
151
|
+
},
|
|
152
|
+
replyPoll: (question, options, params) => {
|
|
153
|
+
const effectiveMessage = mustGetMsg();
|
|
154
|
+
const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
|
|
155
|
+
return this.sendPoll(effectiveMessage.chat.id, question, options, { ...params, replyToMessageId });
|
|
156
|
+
},
|
|
157
|
+
replyPhoto: (photo, params) => {
|
|
158
|
+
const effectiveMessage = mustGetMsg();
|
|
159
|
+
const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
|
|
160
|
+
return this.sendPhoto(effectiveMessage.chat.id, photo, { ...params, replyToMessageId });
|
|
161
|
+
},
|
|
162
|
+
delete: () => {
|
|
163
|
+
const effectiveMessage = mustGetMsg();
|
|
164
|
+
return this.deleteMessage(effectiveMessage.chat.id, effectiveMessage.id);
|
|
165
|
+
},
|
|
166
|
+
forward: (to, params) => {
|
|
167
|
+
const effectiveMessage = mustGetMsg();
|
|
168
|
+
return this.forwardMessage(effectiveMessage.chat.id, to, effectiveMessage.id, params);
|
|
169
|
+
},
|
|
170
|
+
answerCallbackQuery: (params) => {
|
|
171
|
+
const { callbackQuery } = update;
|
|
172
|
+
if (callbackQuery === undefined) {
|
|
173
|
+
UNREACHABLE();
|
|
174
|
+
}
|
|
175
|
+
return this.answerCallbackQuery(callbackQuery.id, params);
|
|
176
|
+
},
|
|
177
|
+
answerInlineQuery: (results, params) => {
|
|
178
|
+
const { inlineQuery } = update;
|
|
179
|
+
if (inlineQuery == undefined) {
|
|
180
|
+
UNREACHABLE();
|
|
181
|
+
}
|
|
182
|
+
return this.answerInlineQuery(inlineQuery.id, results, params);
|
|
183
|
+
},
|
|
184
|
+
sendChatAction: (chatAction, params) => {
|
|
185
|
+
const effectiveMessage = mustGetMsg();
|
|
186
|
+
return this.sendChatAction(effectiveMessage.chat.id, chatAction, params);
|
|
187
|
+
},
|
|
188
|
+
editMessageText: (messageId, text, params) => {
|
|
189
|
+
const effectiveMessage = mustGetMsg();
|
|
190
|
+
return this.editMessageText(effectiveMessage.chat.id, messageId, text, params);
|
|
191
|
+
},
|
|
192
|
+
getMessage: (messageId) => {
|
|
193
|
+
const effectiveMessage = mustGetMsg();
|
|
194
|
+
return this.getMessage(effectiveMessage.chat.id, messageId);
|
|
195
|
+
},
|
|
196
|
+
getMessages: (messageIds) => {
|
|
197
|
+
const effectiveMessage = mustGetMsg();
|
|
198
|
+
return this.getMessages(effectiveMessage.chat.id, messageIds);
|
|
199
|
+
},
|
|
200
|
+
forwardMessage: (to, messageId, params) => {
|
|
201
|
+
const effectiveMessage = mustGetMsg();
|
|
202
|
+
return this.forwardMessage(effectiveMessage.chat.id, to, messageId, params);
|
|
203
|
+
},
|
|
204
|
+
forwardMessages: (to, messageIds, params) => {
|
|
205
|
+
const effectiveMessage = mustGetMsg();
|
|
206
|
+
return this.forwardMessages(effectiveMessage.chat.id, to, messageIds, params);
|
|
207
|
+
},
|
|
208
|
+
deleteMessage: (messageId, params) => {
|
|
209
|
+
const effectiveMessage = mustGetMsg();
|
|
210
|
+
return this.deleteMessage(effectiveMessage.chat.id, messageId, params);
|
|
211
|
+
},
|
|
212
|
+
deleteMessages: (messageIds, params) => {
|
|
213
|
+
const effectiveMessage = mustGetMsg();
|
|
214
|
+
return this.deleteMessages(effectiveMessage.chat.id, messageIds, params);
|
|
215
|
+
},
|
|
216
|
+
get toJSON() {
|
|
217
|
+
return () => update;
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
});
|
|
120
221
|
_Client_lastPropagatedConnectionState.set(this, null);
|
|
121
222
|
Object.defineProperty(this, "stateChangeHandler", {
|
|
122
223
|
enumerable: true,
|
|
123
224
|
configurable: true,
|
|
124
225
|
writable: true,
|
|
125
226
|
value: ((connected) => {
|
|
126
|
-
__classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then(
|
|
227
|
+
__classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then((release) => {
|
|
127
228
|
try {
|
|
128
229
|
const connectionState = connected ? "ready" : "notConnected";
|
|
129
230
|
if (this.connected == connected && __classPrivateFieldGet(this, _Client_lastPropagatedConnectionState, "f") != connectionState) {
|
|
130
|
-
|
|
231
|
+
__classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, connectionState);
|
|
131
232
|
__classPrivateFieldSet(this, _Client_lastPropagatedConnectionState, connectionState, "f");
|
|
132
233
|
}
|
|
133
234
|
}
|
|
@@ -143,16 +244,43 @@ export class Client extends ClientAbstract {
|
|
|
143
244
|
_Client_connectionInited.set(this, false);
|
|
144
245
|
_Client_lastPropagatedAuthorizationState.set(this, null);
|
|
145
246
|
_Client_selfId.set(this, null);
|
|
146
|
-
|
|
247
|
+
_Client_pingInterval.set(this, 60 * 1000); // 60 seconds
|
|
147
248
|
_Client_pingLoopStarted.set(this, false);
|
|
148
249
|
_Client_autoStarted.set(this, false);
|
|
149
250
|
_Client_lastMsgId.set(this, 0n);
|
|
251
|
+
_Client_handleInvokeError.set(this, skipInvoke());
|
|
252
|
+
/**
|
|
253
|
+
* Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
|
|
254
|
+
* to be connected.
|
|
255
|
+
*
|
|
256
|
+
* @param function_ The function to invoke.
|
|
257
|
+
*/
|
|
258
|
+
Object.defineProperty(this, "invoke", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
configurable: true,
|
|
261
|
+
writable: true,
|
|
262
|
+
value: Object.assign(__classPrivateFieldGet(this, _Client_instances, "m", _Client_invoke), {
|
|
263
|
+
use: (handler) => {
|
|
264
|
+
const handle = __classPrivateFieldGet(this, _Client_handleInvokeError, "f");
|
|
265
|
+
__classPrivateFieldSet(this, _Client_handleInvokeError, async (ctx, next) => {
|
|
266
|
+
let result = null;
|
|
267
|
+
return await handle(ctx, async () => {
|
|
268
|
+
if (result != null)
|
|
269
|
+
return result;
|
|
270
|
+
result = await handler(ctx, next);
|
|
271
|
+
return result;
|
|
272
|
+
});
|
|
273
|
+
}, "f");
|
|
274
|
+
},
|
|
275
|
+
})
|
|
276
|
+
});
|
|
150
277
|
_Client_handleUpdateQueue.set(this, new Queue("handleUpdate"));
|
|
151
278
|
_Client_processUpdatesQueue.set(this, new Queue("processUpdates"));
|
|
152
279
|
_Client_usernameResolver.set(this, async (v) => {
|
|
153
280
|
const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
|
|
154
281
|
return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
|
|
155
282
|
});
|
|
283
|
+
//#region Composer
|
|
156
284
|
_Client_handle.set(this, skip);
|
|
157
285
|
this.storage = storage ?? new StorageMemory();
|
|
158
286
|
this.parseMode = params?.parseMode ?? null;
|
|
@@ -164,7 +292,41 @@ export class Client extends ClientAbstract {
|
|
|
164
292
|
this.systemVersion = params?.systemVersion ?? SYSTEM_VERSION;
|
|
165
293
|
__classPrivateFieldSet(this, _Client_publicKeys, params?.publicKeys, "f");
|
|
166
294
|
__classPrivateFieldSet(this, _Client_autoStart, params?.autoStart ?? true, "f");
|
|
167
|
-
|
|
295
|
+
if (params?.defaultHandlers ?? true) {
|
|
296
|
+
this.on("connectionState", ({ connectionState }, next) => {
|
|
297
|
+
drop((async () => {
|
|
298
|
+
if (connectionState == "notConnected") {
|
|
299
|
+
let delay = 5;
|
|
300
|
+
while (!this.connected) {
|
|
301
|
+
d("reconnecting");
|
|
302
|
+
try {
|
|
303
|
+
await this.connect();
|
|
304
|
+
d("reconnected");
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
catch (err) {
|
|
308
|
+
d("failed to reconnect, retrying in %d: %o", delay, err);
|
|
309
|
+
}
|
|
310
|
+
await new Promise((r) => setTimeout(r, delay * 1000));
|
|
311
|
+
if (delay < 15) {
|
|
312
|
+
delay += 5;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
})());
|
|
317
|
+
return next();
|
|
318
|
+
});
|
|
319
|
+
this.invoke.use(async ({ error }, next) => {
|
|
320
|
+
if (error instanceof FloodWait && error.seconds <= 10) {
|
|
321
|
+
d("sleeping for %d because of: %o", error.seconds, error);
|
|
322
|
+
await new Promise((r) => setTimeout(r, 1000 * error.seconds));
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
return next();
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
168
330
|
}
|
|
169
331
|
/**
|
|
170
332
|
* Sets the DC and resets the auth key stored in the session provider
|
|
@@ -231,14 +393,17 @@ export class Client extends ClientAbstract {
|
|
|
231
393
|
}
|
|
232
394
|
d("encrypted client connected");
|
|
233
395
|
drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_receiveLoop).call(this));
|
|
396
|
+
if (__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
|
|
397
|
+
drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
|
|
398
|
+
}
|
|
234
399
|
}
|
|
235
400
|
finally {
|
|
236
401
|
release();
|
|
237
402
|
}
|
|
238
403
|
}
|
|
239
|
-
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(),
|
|
404
|
+
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_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_usernameResolver = new WeakMap(), _Client_handle = new WeakMap(), _Client_instances = new WeakSet(), _Client_propagateConnectionState = function _Client_propagateConnectionState(connectionState) {
|
|
240
405
|
__classPrivateFieldGet(this, _Client_handleUpdateQueue, "f").add(async () => {
|
|
241
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { connectionState }, resolve);
|
|
406
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { connectionState }), resolve);
|
|
242
407
|
});
|
|
243
408
|
}, _Client_setAuth = async function _Client_setAuth(key) {
|
|
244
409
|
const hash = await sha1(key);
|
|
@@ -468,70 +633,6 @@ export class Client extends ClientAbstract {
|
|
|
468
633
|
}
|
|
469
634
|
await this.authorize(params);
|
|
470
635
|
}
|
|
471
|
-
async invoke(function_, noWait) {
|
|
472
|
-
if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
|
|
473
|
-
if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
|
|
474
|
-
await this.start();
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
throw new ConnectionError("Not connected");
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
|
|
481
|
-
UNREACHABLE();
|
|
482
|
-
}
|
|
483
|
-
let n = 1;
|
|
484
|
-
while (true) {
|
|
485
|
-
try {
|
|
486
|
-
let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
|
|
487
|
-
if (!(function_ instanceof functions.Ping) && !(function_ instanceof types.MsgsAck)) {
|
|
488
|
-
seqNo++;
|
|
489
|
-
__classPrivateFieldGet(this, _Client_state, "f").seqNo++;
|
|
490
|
-
}
|
|
491
|
-
const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, getMessageId(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
|
|
492
|
-
const message = new Message_(messageId, seqNo, function_);
|
|
493
|
-
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")));
|
|
494
|
-
__classPrivateFieldSet(this, _Client_lastOutgoing, new Date(), "f");
|
|
495
|
-
d("invoked %s", function_.constructor.name);
|
|
496
|
-
if (noWait) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
let result;
|
|
500
|
-
try {
|
|
501
|
-
result = await new Promise((resolve, reject) => {
|
|
502
|
-
__classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
catch (err) {
|
|
506
|
-
if (err instanceof AuthKeyUnregistered) {
|
|
507
|
-
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
|
|
508
|
-
}
|
|
509
|
-
throw err;
|
|
510
|
-
}
|
|
511
|
-
if (result instanceof types.BadServerSalt) {
|
|
512
|
-
return await this.invoke(function_);
|
|
513
|
-
}
|
|
514
|
-
else {
|
|
515
|
-
if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
|
|
516
|
-
drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
|
|
517
|
-
__classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
|
|
518
|
-
}
|
|
519
|
-
return result;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
catch (err) {
|
|
523
|
-
if (__classPrivateFieldGet(this, _Client_errorHandler, "f") === undefined) {
|
|
524
|
-
throw err;
|
|
525
|
-
}
|
|
526
|
-
if (__classPrivateFieldGet(this, _Client_errorHandler, "f") !== undefined && await __classPrivateFieldGet(this, _Client_errorHandler, "f").call(this, err, function_, n++)) {
|
|
527
|
-
continue;
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
throw err;
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
636
|
/**
|
|
536
637
|
* Alias for `invoke` with its second parameter being `true`.
|
|
537
638
|
*/
|
|
@@ -586,7 +687,7 @@ export class Client extends ClientAbstract {
|
|
|
586
687
|
}
|
|
587
688
|
}, _Client_propagateAuthorizationState = async function _Client_propagateAuthorizationState(authorized) {
|
|
588
689
|
if (__classPrivateFieldGet(this, _Client_lastPropagatedAuthorizationState, "f") != authorized) {
|
|
589
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { authorizationState: { authorized } }, resolve);
|
|
690
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { authorizationState: { authorized } }), resolve);
|
|
590
691
|
__classPrivateFieldSet(this, _Client_lastPropagatedAuthorizationState, authorized, "f");
|
|
591
692
|
}
|
|
592
693
|
}, _Client_getSelfId = async function _Client_getSelfId() {
|
|
@@ -706,17 +807,81 @@ export class Client extends ClientAbstract {
|
|
|
706
807
|
}
|
|
707
808
|
}, _Client_pingLoop = async function _Client_pingLoop() {
|
|
708
809
|
while (this.connected) {
|
|
709
|
-
await new Promise((r) => setTimeout(r,
|
|
710
|
-
if (!__classPrivateFieldGet(this, _Client_lastOutgoing, "f") || (Date.now() - __classPrivateFieldGet(this, _Client_lastOutgoing, "f").getTime() < 60 * 1000)) {
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
810
|
+
await new Promise((r) => setTimeout(r, __classPrivateFieldGet(this, _Client_pingInterval, "f")));
|
|
713
811
|
try {
|
|
714
|
-
await this.invoke(new functions.
|
|
812
|
+
await this.invoke(new functions.PingDelayDisconnect({ pingId: getRandomBigInt(8, true, false), disconnectDelay: __classPrivateFieldGet(this, _Client_pingInterval, "f") + 15 }));
|
|
715
813
|
}
|
|
716
814
|
catch (err) {
|
|
717
815
|
d("ping loop error: %o", err);
|
|
718
816
|
}
|
|
719
817
|
}
|
|
818
|
+
}, _Client_invoke = async function _Client_invoke(function_, noWait) {
|
|
819
|
+
if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
|
|
820
|
+
if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
|
|
821
|
+
await this.start();
|
|
822
|
+
}
|
|
823
|
+
else {
|
|
824
|
+
throw new ConnectionError("Not connected");
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
|
|
828
|
+
UNREACHABLE();
|
|
829
|
+
}
|
|
830
|
+
let n = 1;
|
|
831
|
+
while (true) {
|
|
832
|
+
try {
|
|
833
|
+
let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
|
|
834
|
+
if (!(function_ instanceof functions.Ping) && !(function_ instanceof types.MsgsAck)) {
|
|
835
|
+
seqNo++;
|
|
836
|
+
__classPrivateFieldGet(this, _Client_state, "f").seqNo++;
|
|
837
|
+
}
|
|
838
|
+
const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, getMessageId(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
|
|
839
|
+
const message = new Message_(messageId, seqNo, function_);
|
|
840
|
+
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_.constructor.name);
|
|
842
|
+
if (noWait) {
|
|
843
|
+
__classPrivateFieldGet(this, _Client_promises, "f").set(message.id, {
|
|
844
|
+
resolve: (result) => {
|
|
845
|
+
if (result instanceof types.BadServerSalt) {
|
|
846
|
+
drop(this.invoke(function_, true));
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
reject: () => { },
|
|
850
|
+
});
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
let result;
|
|
854
|
+
try {
|
|
855
|
+
result = await new Promise((resolve, reject) => {
|
|
856
|
+
__classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
catch (err) {
|
|
860
|
+
if (err instanceof AuthKeyUnregistered) {
|
|
861
|
+
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
|
|
862
|
+
}
|
|
863
|
+
throw err;
|
|
864
|
+
}
|
|
865
|
+
if (result instanceof types.BadServerSalt) {
|
|
866
|
+
return await this.invoke(function_);
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
|
|
870
|
+
drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
|
|
871
|
+
__classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
|
|
872
|
+
}
|
|
873
|
+
return result;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
catch (err) {
|
|
877
|
+
if (await __classPrivateFieldGet(this, _Client_handleInvokeError, "f").call(this, Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
throw err;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
720
885
|
}, _Client_processChats = async function _Client_processChats(chats) {
|
|
721
886
|
for (const chat of chats) {
|
|
722
887
|
if (chat instanceof types.Channel && chat.accessHash) {
|
|
@@ -908,7 +1073,7 @@ export class Client extends ClientAbstract {
|
|
|
908
1073
|
return localState;
|
|
909
1074
|
}, _Client_recoverUpdateGap = async function _Client_recoverUpdateGap(source) {
|
|
910
1075
|
dGap("recovering from update gap [%s]", source);
|
|
911
|
-
|
|
1076
|
+
__classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, "updating");
|
|
912
1077
|
try {
|
|
913
1078
|
let state = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
|
|
914
1079
|
while (true) {
|
|
@@ -1685,20 +1850,15 @@ export class Client extends ClientAbstract {
|
|
|
1685
1850
|
nextOffset: params?.nextOffset,
|
|
1686
1851
|
}));
|
|
1687
1852
|
}
|
|
1688
|
-
use(
|
|
1689
|
-
const
|
|
1690
|
-
__classPrivateFieldSet(this, _Client_handle,
|
|
1691
|
-
|
|
1692
|
-
await handle(upd, async () => {
|
|
1693
|
-
if (called)
|
|
1694
|
-
return;
|
|
1695
|
-
called = true;
|
|
1696
|
-
await handler(upd, next);
|
|
1697
|
-
});
|
|
1698
|
-
}, "f");
|
|
1853
|
+
use(...middleware) {
|
|
1854
|
+
const composer = new Composer(...middleware);
|
|
1855
|
+
__classPrivateFieldSet(this, _Client_handle, concat(__classPrivateFieldGet(this, _Client_handle, "f"), flatten(composer)), "f");
|
|
1856
|
+
return composer;
|
|
1699
1857
|
}
|
|
1700
|
-
branch(predicate,
|
|
1701
|
-
|
|
1858
|
+
branch(predicate, trueHandler_, falseHandler_) {
|
|
1859
|
+
const trueHandler = flatten(trueHandler_);
|
|
1860
|
+
const falseHandler = flatten(falseHandler_);
|
|
1861
|
+
return this.use(async (upd, next) => {
|
|
1702
1862
|
if (await predicate(upd)) {
|
|
1703
1863
|
await trueHandler(upd, next);
|
|
1704
1864
|
}
|
|
@@ -1707,19 +1867,19 @@ export class Client extends ClientAbstract {
|
|
|
1707
1867
|
}
|
|
1708
1868
|
});
|
|
1709
1869
|
}
|
|
1710
|
-
filter(predicate,
|
|
1711
|
-
this.branch(predicate,
|
|
1870
|
+
filter(predicate, ...middleware) {
|
|
1871
|
+
return this.branch(predicate, middleware.length == 0 ? skip : middleware.map(flatten).reduce(concat), skip);
|
|
1712
1872
|
}
|
|
1713
|
-
on(filter,
|
|
1873
|
+
on(filter, ...middleawre) {
|
|
1714
1874
|
const type = typeof filter === "string" ? filter : filter[0];
|
|
1715
1875
|
const keys = Array.isArray(filter) ? filter.slice(1) : [];
|
|
1716
|
-
this.filter((
|
|
1717
|
-
if (type in
|
|
1876
|
+
return this.filter((ctx) => {
|
|
1877
|
+
if (type in ctx) {
|
|
1718
1878
|
if (keys.length > 0) {
|
|
1719
1879
|
for (const key of keys) {
|
|
1720
1880
|
// deno-lint-ignore ban-ts-comment
|
|
1721
1881
|
// @ts-ignore
|
|
1722
|
-
if (!(key in
|
|
1882
|
+
if (!(key in ctx[type])) {
|
|
1723
1883
|
return false;
|
|
1724
1884
|
}
|
|
1725
1885
|
}
|
|
@@ -1729,7 +1889,7 @@ export class Client extends ClientAbstract {
|
|
|
1729
1889
|
else {
|
|
1730
1890
|
return false;
|
|
1731
1891
|
}
|
|
1732
|
-
},
|
|
1892
|
+
}, ...middleawre);
|
|
1733
1893
|
}
|
|
1734
1894
|
/**
|
|
1735
1895
|
* Set the bot's description in the given language. Bot-only.
|
|
@@ -1785,6 +1945,104 @@ export class Client extends ClientAbstract {
|
|
|
1785
1945
|
await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "getMyShortDescription");
|
|
1786
1946
|
return await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getMyInfo).call(this, params?.languageCode).then((v) => v.about);
|
|
1787
1947
|
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Delete multiple messages.
|
|
1950
|
+
*
|
|
1951
|
+
* @method
|
|
1952
|
+
* @param chatId The chat that contains the messages.
|
|
1953
|
+
* @param messageIds The identifier of the messages to delete.
|
|
1954
|
+
*/
|
|
1955
|
+
async deleteMessages(chatId, messageIds, params) {
|
|
1956
|
+
const peer = await this.getInputPeer(chatId);
|
|
1957
|
+
if (peer instanceof types.InputPeerChannel) {
|
|
1958
|
+
await this.invoke(new functions.ChannelsDeleteMessages({ channel: new types.InputChannel(peer), id: messageIds }));
|
|
1959
|
+
}
|
|
1960
|
+
else {
|
|
1961
|
+
await this.invoke(new functions.MessagesDeleteMessages({ id: messageIds, revoke: params?.onlyForMe ? undefined : true }));
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Delete a single message.
|
|
1966
|
+
*
|
|
1967
|
+
* @method
|
|
1968
|
+
* @param chatId The chat that contains the message.
|
|
1969
|
+
* @param messageId The identifier of the message to delete.
|
|
1970
|
+
*/
|
|
1971
|
+
async deleteMessage(chatId, messageId, params) {
|
|
1972
|
+
await this.deleteMessages(chatId, [messageId], params);
|
|
1973
|
+
}
|
|
1974
|
+
/**
|
|
1975
|
+
* Send a photo.
|
|
1976
|
+
*
|
|
1977
|
+
* @method
|
|
1978
|
+
* @param chatId The chat to send the photo to.
|
|
1979
|
+
* @param photo The photo to send.
|
|
1980
|
+
*/
|
|
1981
|
+
async sendPhoto(chatId, photo, params) {
|
|
1982
|
+
let media = null;
|
|
1983
|
+
const spoiler = params?.hasSpoiler ? true : undefined;
|
|
1984
|
+
if (typeof photo === "string") {
|
|
1985
|
+
let fileId = null;
|
|
1986
|
+
try {
|
|
1987
|
+
fileId = FileID.decode(photo);
|
|
1988
|
+
}
|
|
1989
|
+
catch (err) {
|
|
1990
|
+
d("fileId: %o", err);
|
|
1991
|
+
}
|
|
1992
|
+
if (fileId != null) {
|
|
1993
|
+
if (fileId.fileType != FileType.Photo) {
|
|
1994
|
+
UNREACHABLE();
|
|
1995
|
+
}
|
|
1996
|
+
if (fileId.params.mediaId == undefined || fileId.params.accessHash == undefined || fileId.params.fileReference == undefined) {
|
|
1997
|
+
UNREACHABLE();
|
|
1998
|
+
}
|
|
1999
|
+
media = new types.InputMediaPhoto({
|
|
2000
|
+
id: new types.InputPhoto({
|
|
2001
|
+
id: fileId.params.mediaId,
|
|
2002
|
+
accessHash: fileId.params.accessHash,
|
|
2003
|
+
fileReference: fileId.params.fileReference,
|
|
2004
|
+
}),
|
|
2005
|
+
spoiler,
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
if (media == null) {
|
|
2010
|
+
if (typeof photo === "string" && isHttpUrl(photo)) {
|
|
2011
|
+
media = new types.InputMediaPhotoExternal({ url: photo, spoiler });
|
|
2012
|
+
}
|
|
2013
|
+
else {
|
|
2014
|
+
const [contents, fileName] = await getFileContents(photo);
|
|
2015
|
+
const file = await this.upload(contents, { fileName, chunkSize: params?.chunkSize, signal: params?.signal });
|
|
2016
|
+
media = new types.InputMediaUploadedPhoto({ file, spoiler });
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
const peer = await this.getInputPeer(chatId);
|
|
2020
|
+
const randomId = getRandomId();
|
|
2021
|
+
const silent = params?.disableNotification ? true : undefined;
|
|
2022
|
+
const noforwards = params?.protectContent ? true : undefined;
|
|
2023
|
+
const replyToMsgId = params?.replyToMessageId;
|
|
2024
|
+
const topMsgId = params?.messageThreadId;
|
|
2025
|
+
const sendAs = params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
|
|
2026
|
+
const replyMarkup = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_constructReplyMarkup).call(this, params);
|
|
2027
|
+
const caption_ = params?.caption;
|
|
2028
|
+
const parseResult = caption_ !== undefined ? __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).call(this, caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
|
|
2029
|
+
const caption = parseResult === undefined ? undefined : parseResult[0];
|
|
2030
|
+
const captionEntities = parseResult === undefined ? undefined : parseResult[1];
|
|
2031
|
+
const result = await this.invoke(new functions.MessagesSendMedia({
|
|
2032
|
+
peer,
|
|
2033
|
+
randomId,
|
|
2034
|
+
silent,
|
|
2035
|
+
noforwards,
|
|
2036
|
+
replyMarkup,
|
|
2037
|
+
replyTo: replyToMsgId !== undefined ? new types.InputReplyToMessage({ replyToMsgId, topMsgId }) : undefined,
|
|
2038
|
+
sendAs,
|
|
2039
|
+
media,
|
|
2040
|
+
message: caption ?? "",
|
|
2041
|
+
entities: captionEntities,
|
|
2042
|
+
}));
|
|
2043
|
+
const message = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
|
|
2044
|
+
return __classPrivateFieldGet(Client, _a, "m", _Client_assertMsgHas).call(Client, message, "photo");
|
|
2045
|
+
}
|
|
1788
2046
|
}
|
|
1789
2047
|
_a = Client, _Client_handleUpdate =
|
|
1790
2048
|
// TODO: log errors
|
|
@@ -1845,7 +2103,7 @@ async function _Client_handleUpdate(update) {
|
|
|
1845
2103
|
const key = update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewChannelMessage ? "message" : "editedMessage";
|
|
1846
2104
|
if (!(update.message instanceof types.MessageEmpty)) {
|
|
1847
2105
|
const message = await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
|
|
1848
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, resolve);
|
|
2106
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { [key]: message }), resolve);
|
|
1849
2107
|
}
|
|
1850
2108
|
}
|
|
1851
2109
|
if (update instanceof types.UpdateDeleteMessages) {
|
|
@@ -1861,7 +2119,7 @@ async function _Client_handleUpdate(update) {
|
|
|
1861
2119
|
}
|
|
1862
2120
|
}
|
|
1863
2121
|
if (deletedMessages.length > 0) {
|
|
1864
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, resolve);
|
|
2122
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), resolve);
|
|
1865
2123
|
}
|
|
1866
2124
|
}
|
|
1867
2125
|
else if (update instanceof types.UpdateDeleteChannelMessages) {
|
|
@@ -1875,14 +2133,14 @@ async function _Client_handleUpdate(update) {
|
|
|
1875
2133
|
await this.storage.setMessage(chatId, messageId, null);
|
|
1876
2134
|
}
|
|
1877
2135
|
if (deletedMessages.length > 0) {
|
|
1878
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, resolve);
|
|
2136
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), resolve);
|
|
1879
2137
|
}
|
|
1880
2138
|
}
|
|
1881
2139
|
if (update instanceof types.UpdateBotCallbackQuery || update instanceof types.UpdateInlineBotCallbackQuery) {
|
|
1882
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { callbackQuery: await constructCallbackQuery(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }, resolve);
|
|
2140
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { callbackQuery: await constructCallbackQuery(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }), resolve);
|
|
1883
2141
|
}
|
|
1884
2142
|
else if (update instanceof types.UpdateBotInlineQuery) {
|
|
1885
|
-
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { inlineQuery: await constructInlineQuery(update, this[getEntity].bind(this)) }, resolve);
|
|
2143
|
+
await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { inlineQuery: await constructInlineQuery(update, this[getEntity].bind(this)) }), resolve);
|
|
1886
2144
|
}
|
|
1887
2145
|
}, _Client_constructReplyMarkup = async function _Client_constructReplyMarkup(params) {
|
|
1888
2146
|
if (params?.replyMarkup) {
|
|
@@ -1894,7 +2152,9 @@ async function _Client_handleUpdate(update) {
|
|
|
1894
2152
|
UNREACHABLE();
|
|
1895
2153
|
}
|
|
1896
2154
|
return message;
|
|
1897
|
-
}, _Client_setMyInfo =
|
|
2155
|
+
}, _Client_setMyInfo =
|
|
2156
|
+
//#endregion
|
|
2157
|
+
async function _Client_setMyInfo(info) {
|
|
1898
2158
|
await this.invoke(new functions.BotsSetBotInfo({ bot: new types.InputUserSelf(), ...info }));
|
|
1899
2159
|
}, _Client_getMyInfo = function _Client_getMyInfo(languageCode) {
|
|
1900
2160
|
return this.invoke(new functions.BotsGetBotInfo({ bot: new types.InputUserSelf(), langCode: languageCode ?? "" }));
|