@mtkruto/browser 0.6.1 → 0.119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -1
- package/esm/0_deps.d.ts +23 -13
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +25 -15
- package/esm/0_errors.d.ts +9 -2
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +19 -7
- package/esm/1_utilities.d.ts +6 -7
- package/esm/1_utilities.d.ts.map +1 -1
- package/esm/1_utilities.js +6 -7
- package/esm/2_connection.d.ts +1 -1
- package/esm/2_connection.js +1 -1
- package/esm/2_storage.d.ts +1 -1
- package/esm/2_storage.js +1 -1
- package/esm/2_tl.d.ts +7 -10
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +7 -10
- package/esm/3_errors.d.ts +8 -3
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +11 -14
- package/esm/3_transport.d.ts +4 -4
- package/esm/3_transport.js +4 -4
- package/esm/3_types.d.ts +74 -34
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +74 -34
- package/esm/4_constants.d.ts +21 -2
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +4 -4
- package/esm/4_errors.d.ts +4 -4
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +3 -13
- package/esm/4_session.d.ts +24 -0
- package/esm/4_session.d.ts.map +1 -0
- package/esm/4_session.js +23 -0
- package/esm/5_client.d.ts +9 -3
- package/esm/5_client.d.ts.map +1 -1
- package/esm/5_client.js +9 -3
- package/esm/_dnt.polyfills.d.ts +20 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +120 -0
- package/esm/_dnt.shims.d.ts +0 -1
- package/esm/_dnt.shims.d.ts.map +1 -1
- package/esm/client/0_abortable_loop.d.ts +27 -0
- package/esm/client/0_abortable_loop.d.ts.map +1 -0
- package/esm/client/0_abortable_loop.js +56 -0
- package/esm/client/0_client_abstract.d.ts +31 -28
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +21 -90
- package/esm/client/0_html.d.ts +4 -3
- package/esm/client/0_html.d.ts.map +1 -1
- package/esm/client/0_html.js +412 -74
- package/esm/client/0_markdown.d.ts +2 -2
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +39 -19
- package/esm/client/0_params.d.ts +324 -41
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_params.js +1 -1
- package/esm/client/0_password.d.ts +6 -6
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +13 -13
- package/esm/client/0_storage_operations.d.ts +81 -69
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +396 -314
- package/esm/client/0_update_processor.d.ts +26 -0
- package/esm/client/0_update_processor.d.ts.map +1 -0
- package/esm/client/0_update_processor.js +20 -0
- package/esm/client/0_utilities.d.ts +10 -5
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +45 -31
- package/esm/client/0_worker_error.d.ts +26 -0
- package/esm/client/0_worker_error.d.ts.map +1 -0
- package/esm/client/0_worker_error.js +86 -0
- package/esm/client/0_worker_request.d.ts +27 -0
- package/esm/client/0_worker_request.d.ts.map +1 -0
- package/esm/client/0_worker_request.js +20 -0
- package/esm/client/1_client_generic.d.ts +1846 -0
- package/esm/client/1_client_generic.d.ts.map +1 -0
- package/esm/client/1_client_generic.js +24 -0
- package/esm/client/1_client_plain.d.ts +12 -9
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +36 -65
- package/esm/client/1_invoke_middleware.d.ts +32 -0
- package/esm/client/1_invoke_middleware.d.ts.map +1 -0
- package/esm/client/1_invoke_middleware.js +22 -0
- package/esm/client/1_types.d.ts +17 -32
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/1_types.js +1 -1
- package/esm/client/1_worker_response.d.ts +37 -0
- package/esm/client/1_worker_response.d.ts.map +1 -0
- package/esm/client/1_worker_response.js +20 -0
- package/esm/client/2_account_manager.d.ts +43 -5
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +368 -48
- package/esm/client/2_bot_info_manager.d.ts +12 -5
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +41 -39
- package/esm/client/2_business_connection_manager.d.ts +6 -5
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +16 -29
- package/esm/client/2_client_encrypted.d.ts +58 -0
- package/esm/client/2_client_encrypted.d.ts.map +1 -0
- package/esm/client/2_client_encrypted.js +273 -0
- package/esm/client/2_file_manager.d.ts +27 -7
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +365 -327
- package/esm/client/2_network_statistics_manager.d.ts +5 -5
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +40 -27
- package/esm/client/2_payment_manager.d.ts +8 -7
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +13 -26
- package/esm/client/2_reaction_manager.d.ts +6 -5
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +19 -32
- package/esm/client/2_sign_in.d.ts +25 -0
- package/esm/client/2_sign_in.d.ts.map +1 -0
- package/esm/client/2_sign_in.js +114 -0
- package/esm/client/2_translations_manager.d.ts +35 -0
- package/esm/client/2_translations_manager.d.ts.map +1 -0
- package/esm/client/2_translations_manager.js +161 -0
- package/esm/client/2_update_manager.d.ts +11 -8
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +841 -778
- package/esm/client/3_client_encrypted_pool.d.ts +29 -0
- package/esm/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/esm/client/3_client_encrypted_pool.js +47 -0
- package/esm/client/3_filters.d.ts +96 -0
- package/esm/client/3_filters.d.ts.map +1 -0
- package/esm/client/3_filters.js +52 -0
- package/esm/client/3_message_manager.d.ts +30 -35
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +1083 -790
- package/esm/client/3_video_chat_manager.d.ts +11 -10
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +88 -96
- package/esm/client/4_callback_query_manager.d.ts +9 -8
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +25 -36
- package/esm/client/4_chat_list_manager.d.ts +20 -11
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +214 -444
- package/esm/client/4_chat_manager.d.ts +86 -0
- package/esm/client/4_chat_manager.d.ts.map +1 -0
- package/esm/client/4_chat_manager.js +478 -0
- package/esm/client/4_checklist_manager.d.ts +38 -0
- package/esm/client/4_checklist_manager.d.ts.map +1 -0
- package/esm/client/4_checklist_manager.js +68 -0
- package/esm/client/4_context.d.ts +691 -0
- package/esm/client/4_context.d.ts.map +1 -0
- package/esm/client/4_context.js +1406 -0
- package/esm/client/4_forum_manager.d.ts +40 -0
- package/esm/client/4_forum_manager.d.ts.map +1 -0
- package/esm/client/4_forum_manager.js +128 -0
- package/esm/client/4_gift_manager.d.ts +39 -0
- package/esm/client/4_gift_manager.d.ts.map +1 -0
- package/esm/client/4_gift_manager.js +84 -0
- package/esm/client/4_inline_query_manager.d.ts +10 -9
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +25 -37
- package/esm/client/4_link_preview_manager.d.ts +39 -0
- package/esm/client/4_link_preview_manager.d.ts.map +1 -0
- package/esm/client/4_link_preview_manager.js +51 -0
- package/esm/client/4_poll_manager.d.ts +39 -0
- package/esm/client/4_poll_manager.d.ts.map +1 -0
- package/esm/client/4_poll_manager.js +105 -0
- package/esm/client/4_story_manager.d.ts +11 -10
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +52 -64
- package/esm/client/5_composer.d.ts +51 -0
- package/esm/client/5_composer.d.ts.map +1 -0
- package/esm/client/5_composer.js +106 -0
- package/esm/client/6_client.d.ts +1952 -0
- package/esm/client/6_client.d.ts.map +1 -0
- package/esm/client/6_client.js +3409 -0
- package/esm/client/6_client_dispatcher.d.ts +1917 -0
- package/esm/client/6_client_dispatcher.d.ts.map +1 -0
- package/esm/client/6_client_dispatcher.js +2476 -0
- package/esm/client/7_client_worker.d.ts +27 -0
- package/esm/client/7_client_worker.d.ts.map +1 -0
- package/esm/client/7_client_worker.js +76 -0
- package/esm/connection/0_connection.d.ts +9 -8
- package/esm/connection/0_connection.d.ts.map +1 -1
- package/esm/connection/0_connection.js +1 -1
- package/esm/connection/1_connection_tcp.d.ts +4 -5
- package/esm/connection/1_connection_tcp.d.ts.map +1 -1
- package/esm/connection/1_connection_tcp.js +63 -91
- package/esm/connection/1_connection_web_socket.d.ts +3 -3
- package/esm/connection/1_connection_web_socket.d.ts.map +1 -1
- package/esm/connection/1_connection_web_socket.js +79 -98
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.d.ts +18 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.js +63 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.d.ts +3 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.d.ts.map +1 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +293 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +194 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +37 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +19 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +20 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts +2 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.js +6 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +107 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.js +46 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +37 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.js +41 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +44 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.js +57 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/delay.d.ts +45 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/delay.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/delay.js +84 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts +22 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.js +23 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +111 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +154 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/pool.d.ts +33 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/pool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/pool.js +99 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts +155 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.js +147 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts +43 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.js +79 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +2 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +21 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +32 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/equals.d.ts +22 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/equals.js +82 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/starts_with.d.ts +24 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/starts_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.6/starts_with.js +34 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.d.ts +12 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.js +69 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/lru_cache.d.ts +155 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/lru_cache.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/lru_cache.js +188 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/memoize.d.ts +111 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/memoize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/cache/0.2.2/memoize.js +82 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.d.ts +19 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.js +537 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/constants.d.ts +265 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/constants.js +266 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/format.d.ts +70 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.7/format.js +66 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +23 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +51 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.js +113 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +13 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +2 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +82 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +87 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +80 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.js +116 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff.js +276 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.js +182 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts +29 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/format.js +70 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts +25 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/types.js +3 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/_constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/_constants.js +4 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/iterate_reader.js +96 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.3/types.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
- package/esm/deps/jsr.io/@std/streams/1.0.17/to_array_buffer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/streams/1.0.17/to_array_buffer.js +35 -0
- package/esm/mod.d.ts +2 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -2
- package/esm/session/0_session_error.d.ts +24 -0
- package/esm/session/0_session_error.d.ts.map +1 -0
- package/esm/session/0_session_error.js +25 -0
- package/esm/session/0_session_state.d.ts +28 -0
- package/esm/session/0_session_state.d.ts.map +1 -0
- package/esm/session/0_session_state.js +51 -0
- package/esm/session/1_session.d.ts +51 -0
- package/esm/session/1_session.d.ts.map +1 -0
- package/esm/session/1_session.js +124 -0
- package/esm/session/2_session_encrypted.d.ts +41 -0
- package/esm/session/2_session_encrypted.d.ts.map +1 -0
- package/esm/session/2_session_encrypted.js +509 -0
- package/esm/session/2_session_plain.d.ts +25 -0
- package/esm/session/2_session_plain.d.ts.map +1 -0
- package/esm/session/2_session_plain.js +56 -0
- package/esm/storage/0_storage.d.ts +3 -2
- package/esm/storage/0_storage.d.ts.map +1 -1
- package/esm/storage/0_storage.js +1 -1
- package/esm/storage/1_utilities.d.ts +15 -11
- package/esm/storage/1_utilities.d.ts.map +1 -1
- package/esm/storage/1_utilities.js +33 -41
- package/esm/storage/2_storage_indexed_db.d.ts +3 -2
- package/esm/storage/2_storage_indexed_db.d.ts.map +1 -1
- package/esm/storage/2_storage_indexed_db.js +33 -48
- package/esm/storage/2_storage_local_storage.d.ts +3 -2
- package/esm/storage/2_storage_local_storage.d.ts.map +1 -1
- package/esm/storage/2_storage_local_storage.js +10 -20
- package/esm/storage/2_storage_memory.d.ts +4 -3
- package/esm/storage/2_storage_memory.d.ts.map +1 -1
- package/esm/storage/2_storage_memory.js +30 -44
- package/esm/storage/2_storage_session_storage.d.ts +4 -3
- package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
- package/esm/storage/2_storage_session_storage.js +10 -20
- package/esm/tl/0_types.d.ts +25 -0
- package/esm/tl/0_types.d.ts.map +1 -0
- package/esm/tl/0_types.js +20 -0
- package/esm/tl/0_utilities.d.ts +34 -0
- package/esm/tl/0_utilities.d.ts.map +1 -0
- package/esm/tl/0_utilities.js +79 -0
- package/esm/tl/1_mtproto_api.d.ts +371 -0
- package/esm/tl/1_mtproto_api.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.js +416 -0
- package/esm/tl/1_telegram_api.d.ts +19410 -0
- package/esm/tl/1_telegram_api.d.ts.map +1 -0
- package/esm/tl/1_telegram_api.js +22386 -0
- package/esm/tl/1_tl_reader.d.ts +39 -0
- package/esm/tl/1_tl_reader.d.ts.map +1 -0
- package/esm/tl/1_tl_reader.js +220 -0
- package/esm/tl/1_tl_writer.d.ts +37 -0
- package/esm/tl/1_tl_writer.d.ts.map +1 -0
- package/esm/tl/1_tl_writer.js +269 -0
- package/esm/tl/1_utilities.d.ts +9 -14
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +21 -40
- package/esm/tl/2_message.d.ts +36 -0
- package/esm/tl/2_message.d.ts.map +1 -0
- package/esm/tl/2_message.js +73 -0
- package/esm/tl/2_mtproto.d.ts +33 -0
- package/esm/tl/2_mtproto.d.ts.map +1 -0
- package/esm/tl/2_mtproto.js +53 -0
- package/esm/tl/2_telegram.d.ts +49 -0
- package/esm/tl/2_telegram.d.ts.map +1 -0
- package/esm/tl/2_telegram.js +135 -0
- package/esm/transport/0_obfuscation.d.ts +2 -2
- package/esm/transport/0_obfuscation.d.ts.map +1 -1
- package/esm/transport/0_obfuscation.js +10 -9
- package/esm/transport/0_transport.d.ts +4 -6
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/transport/0_transport.js +11 -19
- package/esm/transport/1_transport_abridged.d.ts +2 -4
- package/esm/transport/1_transport_abridged.d.ts.map +1 -1
- package/esm/transport/1_transport_abridged.js +22 -52
- package/esm/transport/1_transport_intermediate.d.ts +2 -4
- package/esm/transport/1_transport_intermediate.d.ts.map +1 -1
- package/esm/transport/1_transport_intermediate.js +16 -48
- package/esm/transport/1_transport_provider.d.ts +35 -0
- package/esm/transport/1_transport_provider.d.ts.map +1 -0
- package/esm/transport/1_transport_provider.js +81 -0
- package/esm/transport/2_transport_provider_tcp.d.ts +25 -0
- package/esm/transport/2_transport_provider_tcp.d.ts.map +1 -0
- package/esm/transport/2_transport_provider_tcp.js +29 -0
- package/esm/transport/2_transport_provider_web_socket.d.ts +24 -0
- package/esm/transport/2_transport_provider_web_socket.d.ts.map +1 -0
- package/esm/transport/2_transport_provider_web_socket.js +43 -0
- package/esm/types/0_authorization_state.d.ts +2 -2
- package/esm/types/0_authorization_state.d.ts.map +1 -1
- package/esm/types/0_authorization_state.js +1 -1
- package/esm/types/0_birthday.d.ts +3 -2
- package/esm/types/0_birthday.d.ts.map +1 -1
- package/esm/types/0_birthday.js +9 -1
- package/esm/types/0_bot_command.d.ts +1 -1
- package/esm/types/0_bot_command.js +1 -1
- package/esm/types/0_bot_token_check_result.d.ts +31 -0
- package/esm/types/0_bot_token_check_result.d.ts.map +1 -0
- package/esm/types/0_bot_token_check_result.js +20 -0
- package/esm/types/0_button_style.d.ts +28 -0
- package/esm/types/0_button_style.d.ts.map +1 -0
- package/esm/types/0_button_style.js +36 -0
- package/esm/types/0_callback_query_answer.d.ts +3 -3
- package/esm/types/0_callback_query_answer.d.ts.map +1 -1
- package/esm/types/0_callback_query_answer.js +2 -2
- package/esm/types/0_callback_query_question.d.ts +1 -1
- package/esm/types/0_callback_query_question.js +3 -3
- package/esm/types/0_chat_action.d.ts +1 -1
- package/esm/types/0_chat_action.js +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +17 -7
- package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.js +31 -16
- package/esm/types/0_chat_folder.d.ts +29 -0
- package/esm/types/0_chat_folder.d.ts.map +1 -0
- package/esm/types/0_chat_folder.js +25 -0
- package/esm/types/0_chat_member_rights.d.ts +3 -3
- package/esm/types/0_chat_member_rights.d.ts.map +1 -1
- package/esm/types/0_chat_member_rights.js +21 -21
- package/esm/types/0_chat_photo.d.ts +2 -2
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +5 -5
- package/esm/types/0_checklist_changed.d.ts +29 -0
- package/esm/types/0_checklist_changed.d.ts.map +1 -0
- package/esm/types/0_checklist_changed.js +25 -0
- package/esm/types/0_code_check_result.d.ts +47 -0
- package/esm/types/0_code_check_result.d.ts.map +1 -0
- package/esm/types/0_code_check_result.js +20 -0
- package/esm/types/0_connection_state.d.ts +1 -1
- package/esm/types/0_connection_state.js +1 -1
- package/esm/types/0_contact.d.ts +2 -2
- package/esm/types/0_contact.d.ts.map +1 -1
- package/esm/types/0_contact.js +1 -1
- package/esm/types/0_dice.d.ts +2 -2
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_dice.js +1 -1
- package/esm/types/0_emoji_status.d.ts +48 -0
- package/esm/types/0_emoji_status.d.ts.map +1 -0
- package/esm/types/0_emoji_status.js +33 -0
- package/esm/types/0_failed_invitation.d.ts +8 -4
- package/esm/types/0_failed_invitation.d.ts.map +1 -1
- package/esm/types/0_failed_invitation.js +3 -3
- package/esm/types/0_file_source.d.ts +2 -2
- package/esm/types/0_file_source.d.ts.map +1 -1
- package/esm/types/0_file_source.js +1 -1
- package/esm/types/0_gift_component_rarity.d.ts +50 -0
- package/esm/types/0_gift_component_rarity.d.ts.map +1 -0
- package/esm/types/0_gift_component_rarity.js +43 -0
- package/esm/types/0_gift_value.d.ts +25 -0
- package/esm/types/0_gift_value.d.ts.map +1 -0
- package/esm/types/0_gift_value.js +20 -0
- package/esm/types/0_giveaway_parameters.d.ts +2 -2
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +5 -6
- package/esm/types/0_id.d.ts +1 -1
- package/esm/types/0_id.js +1 -1
- package/esm/types/0_input_emoji_status.d.ts +36 -0
- package/esm/types/0_input_emoji_status.d.ts.map +1 -0
- package/esm/types/0_input_emoji_status.js +20 -0
- package/esm/types/0_invoice.d.ts +3 -2
- package/esm/types/0_invoice.d.ts.map +1 -1
- package/esm/types/0_invoice.js +1 -1
- package/esm/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/esm/types/0_keyboard_button_poll_type.js +1 -1
- package/esm/types/0_link_preview_media_size.d.ts +22 -0
- package/esm/types/0_link_preview_media_size.d.ts.map +1 -0
- package/esm/types/0_link_preview_media_size.js +20 -0
- package/esm/types/0_live_stream_channel.d.ts +2 -2
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_live_stream_channel.js +1 -1
- package/esm/types/0_location.d.ts +1 -1
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_location.js +6 -6
- package/esm/types/0_login_url.d.ts +1 -1
- package/esm/types/0_login_url.js +1 -1
- package/esm/types/0_mask_position.d.ts +2 -2
- package/esm/types/0_mask_position.d.ts.map +1 -1
- package/esm/types/0_mask_position.js +2 -2
- package/esm/types/0_message_reference.d.ts +1 -1
- package/esm/types/0_message_reference.js +1 -1
- package/esm/types/0_message_search_filter.d.ts +3 -2
- package/esm/types/0_message_search_filter.d.ts.map +1 -1
- package/esm/types/0_message_search_filter.js +1 -1
- package/esm/types/0_mini_app_button_info.d.ts +26 -0
- package/esm/types/0_mini_app_button_info.d.ts.map +1 -0
- package/esm/types/0_mini_app_button_info.js +22 -0
- package/esm/types/0_mini_app_mode.d.ts +22 -0
- package/esm/types/0_mini_app_mode.d.ts.map +1 -0
- package/esm/types/0_mini_app_mode.js +20 -0
- package/esm/types/0_network_statistics_entry.d.ts +1 -1
- package/esm/types/0_network_statistics_entry.js +1 -1
- package/esm/types/0_parse_mode.d.ts +1 -1
- package/esm/types/0_parse_mode.js +1 -1
- package/esm/types/0_password_check_result.d.ts +39 -0
- package/esm/types/0_password_check_result.d.ts.map +1 -0
- package/esm/types/0_password_check_result.js +20 -0
- package/esm/types/0_price_tag.d.ts +1 -1
- package/esm/types/0_price_tag.js +1 -1
- package/esm/types/0_reaction.d.ts +4 -1
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +10 -10
- package/esm/types/0_refunded_payment.d.ts +2 -2
- package/esm/types/0_refunded_payment.d.ts.map +1 -1
- package/esm/types/0_refunded_payment.js +3 -3
- package/esm/types/0_restriction_reason.d.ts +2 -2
- package/esm/types/0_restriction_reason.d.ts.map +1 -1
- package/esm/types/0_restriction_reason.js +1 -1
- package/esm/types/0_self_destruct_option.d.ts +11 -3
- package/esm/types/0_self_destruct_option.d.ts.map +1 -1
- package/esm/types/0_self_destruct_option.js +12 -3
- package/esm/types/0_shipping_address.d.ts +2 -2
- package/esm/types/0_shipping_address.d.ts.map +1 -1
- package/esm/types/0_shipping_address.js +1 -1
- package/esm/types/0_slow_mode_duration.d.ts +23 -0
- package/esm/types/0_slow_mode_duration.d.ts.map +1 -0
- package/esm/types/0_slow_mode_duration.js +28 -0
- package/esm/types/0_story_reference.d.ts +1 -1
- package/esm/types/0_story_reference.js +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts +20 -0
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.js +19 -0
- package/esm/types/0_thumbnail.d.ts +1 -1
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +4 -4
- package/esm/types/0_translation.d.ts +32 -0
- package/esm/types/0_translation.d.ts.map +1 -0
- package/esm/types/0_translation.js +45 -0
- package/esm/types/0_upload_progress.d.ts +29 -0
- package/esm/types/0_upload_progress.d.ts.map +1 -0
- package/esm/types/0_upload_progress.js +20 -0
- package/esm/types/0_user_status.d.ts +66 -0
- package/esm/types/0_user_status.d.ts.map +1 -0
- package/esm/types/0_user_status.js +35 -0
- package/esm/types/0_video_chat.d.ts +8 -4
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +7 -8
- package/esm/types/0_voice.d.ts +2 -2
- package/esm/types/0_voice.d.ts.map +1 -1
- package/esm/types/0_voice.js +1 -1
- package/esm/types/0_voice_transcription.d.ts +31 -0
- package/esm/types/0_voice_transcription.d.ts.map +1 -0
- package/esm/types/0_voice_transcription.js +26 -0
- package/esm/types/0_working_hours_interval.d.ts +27 -0
- package/esm/types/0_working_hours_interval.d.ts.map +1 -0
- package/esm/types/0_working_hours_interval.js +20 -0
- package/esm/types/1_animation.d.ts +2 -2
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_animation.js +3 -3
- package/esm/types/1_audio.d.ts +2 -2
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_audio.js +3 -3
- package/esm/types/1_bot_command_scope.d.ts +3 -3
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +4 -4
- package/esm/types/1_bot_commands.d.ts +30 -0
- package/esm/types/1_bot_commands.d.ts.map +1 -0
- package/esm/types/1_bot_commands.js +20 -0
- package/esm/types/1_chat_p.d.ts +36 -7
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +43 -17
- package/esm/types/1_document.d.ts +2 -2
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_document.js +3 -3
- package/esm/types/1_giveaway.d.ts +3 -3
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_giveaway.js +1 -1
- package/esm/types/1_inline_keyboard_button.d.ts +140 -0
- package/esm/types/1_inline_keyboard_button.d.ts.map +1 -0
- package/esm/types/1_inline_keyboard_button.js +128 -0
- package/esm/types/1_inline_query_result_button.d.ts +3 -3
- package/esm/types/1_inline_query_result_button.d.ts.map +1 -1
- package/esm/types/1_inline_query_result_button.js +1 -1
- package/esm/types/1_input_gift.d.ts +54 -0
- package/esm/types/1_input_gift.d.ts.map +1 -0
- package/esm/types/1_input_gift.js +32 -0
- package/esm/types/1_input_story_content.d.ts +3 -3
- package/esm/types/1_input_story_content.d.ts.map +1 -1
- package/esm/types/1_input_story_content.js +1 -1
- package/esm/types/1_keyboard_button.d.ts +14 -12
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +87 -34
- package/esm/types/1_message_reaction.d.ts +3 -3
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +8 -8
- package/esm/types/1_mini_app_info.d.ts +32 -0
- package/esm/types/1_mini_app_info.d.ts.map +1 -0
- package/esm/types/1_mini_app_info.js +27 -0
- package/esm/types/1_network_statistics.d.ts +2 -2
- package/esm/types/1_network_statistics.d.ts.map +1 -1
- package/esm/types/1_network_statistics.js +1 -1
- package/esm/types/1_order_info.d.ts +8 -3
- package/esm/types/1_order_info.d.ts.map +1 -1
- package/esm/types/1_order_info.js +1 -1
- package/esm/types/1_photo.d.ts +2 -2
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +4 -4
- package/esm/types/1_reaction_count.d.ts +3 -3
- package/esm/types/1_reaction_count.d.ts.map +1 -1
- package/esm/types/1_reaction_count.js +1 -1
- package/esm/types/1_sticker.d.ts +6 -5
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +15 -11
- package/esm/types/1_story_reaction.d.ts +4 -4
- package/esm/types/1_story_reaction.d.ts.map +1 -1
- package/esm/types/1_story_reaction.js +2 -2
- package/esm/types/1_venue.d.ts +2 -2
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_venue.js +3 -3
- package/esm/types/1_video.d.ts +2 -2
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video.js +3 -3
- package/esm/types/1_video_note.d.ts +2 -2
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/1_video_note.js +3 -3
- package/esm/types/1_working_hours.d.ts +31 -0
- package/esm/types/1_working_hours.d.ts.map +1 -0
- package/esm/types/1_working_hours.js +33 -0
- package/esm/types/2_chat.d.ts +14 -17
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +23 -28
- package/esm/types/2_chat_member.d.ts +72 -15
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +40 -28
- package/esm/types/2_inactive_chat.d.ts +3 -3
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.js +4 -5
- package/esm/types/2_message_entity.d.ts +148 -0
- package/esm/types/2_message_entity.d.ts.map +1 -0
- package/esm/types/2_message_entity.js +243 -0
- package/esm/types/2_message_interactions.d.ts +2 -2
- package/esm/types/2_message_interactions.d.ts.map +1 -1
- package/esm/types/2_message_interactions.js +1 -1
- package/esm/types/2_message_reaction_count.d.ts +6 -7
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reaction_count.js +6 -9
- package/esm/types/2_message_reaction_list_item.d.ts +39 -0
- package/esm/types/2_message_reaction_list_item.d.ts.map +1 -0
- package/esm/types/2_message_reaction_list_item.js +50 -0
- package/esm/types/2_poll_answer.d.ts +32 -0
- package/esm/types/2_poll_answer.d.ts.map +1 -0
- package/esm/types/2_poll_answer.js +35 -0
- package/esm/types/2_reply_markup.d.ts +71 -0
- package/esm/types/2_reply_markup.d.ts.map +1 -0
- package/esm/types/2_reply_markup.js +127 -0
- package/esm/types/2_sticker_set.d.ts +51 -0
- package/esm/types/2_sticker_set.d.ts.map +1 -0
- package/esm/types/2_sticker_set.js +91 -0
- package/esm/types/2_story_content.d.ts +3 -3
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +7 -7
- package/esm/types/2_story_interactions.d.ts +3 -3
- package/esm/types/2_story_interactions.d.ts.map +1 -1
- package/esm/types/2_story_interactions.js +1 -1
- package/esm/types/2_story_interactive_area.d.ts +9 -9
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +16 -15
- package/esm/types/2_story_privacy.d.ts +46 -0
- package/esm/types/2_story_privacy.d.ts.map +1 -0
- package/esm/types/2_story_privacy.js +76 -0
- package/esm/types/2_successful_payment.d.ts +11 -3
- package/esm/types/2_successful_payment.d.ts.map +1 -1
- package/esm/types/2_successful_payment.js +3 -3
- package/esm/types/2_user.d.ts +73 -0
- package/esm/types/2_user.d.ts.map +1 -0
- package/esm/types/2_user.js +82 -0
- package/esm/types/3_business_connection.d.ts +37 -0
- package/esm/types/3_business_connection.d.ts.map +1 -0
- package/esm/types/3_business_connection.js +36 -0
- package/esm/types/3_chat_settings.d.ts +47 -0
- package/esm/types/3_chat_settings.d.ts.map +1 -0
- package/esm/types/3_chat_settings.js +51 -0
- package/esm/types/3_checklist_item.d.ts +65 -0
- package/esm/types/3_checklist_item.d.ts.map +1 -0
- package/esm/types/3_checklist_item.js +51 -0
- package/esm/types/3_chosen_inline_result.d.ts +38 -0
- package/esm/types/3_chosen_inline_result.d.ts.map +1 -0
- package/esm/types/3_chosen_inline_result.js +37 -0
- package/esm/types/3_forward_header.d.ts +77 -0
- package/esm/types/3_forward_header.d.ts.map +1 -0
- package/esm/types/3_forward_header.js +73 -0
- package/esm/types/3_game.d.ts +40 -0
- package/esm/types/3_game.d.ts.map +1 -0
- package/esm/types/3_game.js +44 -0
- package/esm/types/3_gift_upgraded_component.d.ts +96 -0
- package/esm/types/3_gift_upgraded_component.d.ts.map +1 -0
- package/esm/types/3_gift_upgraded_component.js +88 -0
- package/esm/types/3_inline_query.d.ts +40 -0
- package/esm/types/3_inline_query.d.ts.map +1 -0
- package/esm/types/3_inline_query.js +60 -0
- package/esm/types/3_input_checklist_item.d.ts +31 -0
- package/esm/types/3_input_checklist_item.d.ts.map +1 -0
- package/esm/types/3_input_checklist_item.js +20 -0
- package/esm/types/3_input_media.d.ts +123 -0
- package/esm/types/3_input_media.d.ts.map +1 -0
- package/esm/types/3_input_media.js +20 -0
- package/esm/types/3_input_poll_option.d.ts +31 -0
- package/esm/types/3_input_poll_option.d.ts.map +1 -0
- package/esm/types/3_input_poll_option.js +20 -0
- package/esm/types/3_invite_link.d.ts +47 -0
- package/esm/types/3_invite_link.d.ts.map +1 -0
- package/esm/types/3_invite_link.js +48 -0
- package/esm/types/3_message_reaction_list.d.ts +32 -0
- package/esm/types/3_message_reaction_list.d.ts.map +1 -0
- package/esm/types/3_message_reaction_list.js +31 -0
- package/esm/types/3_message_reactions.d.ts +42 -0
- package/esm/types/3_message_reactions.d.ts.map +1 -0
- package/esm/types/3_message_reactions.js +54 -0
- package/esm/types/3_poll_option.d.ts +34 -0
- package/esm/types/3_poll_option.d.ts.map +1 -0
- package/esm/types/3_poll_option.js +29 -0
- package/esm/types/3_pre_checkout_query.d.ts +42 -0
- package/esm/types/3_pre_checkout_query.d.ts.map +1 -0
- package/esm/types/3_pre_checkout_query.js +39 -0
- package/esm/types/3_reply_quote.d.ts +32 -0
- package/esm/types/3_reply_quote.d.ts.map +1 -0
- package/esm/types/3_reply_quote.js +30 -0
- package/esm/types/3_story.d.ts +13 -14
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/3_story.js +13 -14
- package/esm/types/4_chat_member_updated.d.ts +43 -0
- package/esm/types/4_chat_member_updated.d.ts.map +1 -0
- package/esm/types/4_chat_member_updated.js +52 -0
- package/esm/types/4_checklist.d.ts +38 -0
- package/esm/types/4_checklist.d.ts.map +1 -0
- package/esm/types/4_checklist.js +31 -0
- package/esm/types/4_gift.d.ts +100 -0
- package/esm/types/4_gift.d.ts.map +1 -0
- package/esm/types/4_gift.js +112 -0
- package/esm/types/4_join_request.d.ts +39 -0
- package/esm/types/4_join_request.d.ts.map +1 -0
- package/esm/types/4_join_request.js +62 -0
- package/esm/types/4_poll.d.ts +55 -0
- package/esm/types/4_poll.d.ts.map +1 -0
- package/esm/types/4_poll.js +43 -0
- package/esm/types/4_reply_to.d.ts +51 -0
- package/esm/types/4_reply_to.d.ts.map +1 -0
- package/esm/types/4_reply_to.js +20 -0
- package/esm/types/5_claimed_gift.d.ts +44 -0
- package/esm/types/5_claimed_gift.d.ts.map +1 -0
- package/esm/types/5_claimed_gift.js +43 -0
- package/esm/types/5_gift_non_upgraded_information.d.ts +47 -0
- package/esm/types/5_gift_non_upgraded_information.d.ts.map +1 -0
- package/esm/types/5_gift_non_upgraded_information.js +69 -0
- package/esm/types/5_gift_upgraded_information.d.ts +41 -0
- package/esm/types/5_gift_upgraded_information.d.ts.map +1 -0
- package/esm/types/5_gift_upgraded_information.js +58 -0
- package/esm/types/5_link_preview.d.ts +186 -0
- package/esm/types/5_link_preview.d.ts.map +1 -0
- package/esm/types/5_link_preview.js +205 -0
- package/esm/types/6_claimed_gifts.d.ts +33 -0
- package/esm/types/6_claimed_gifts.d.ts.map +1 -0
- package/esm/types/6_claimed_gifts.js +43 -0
- package/esm/types/6_message.d.ts +704 -0
- package/esm/types/6_message.d.ts.map +1 -0
- package/esm/types/6_message.js +553 -0
- package/esm/types/6_message_content.d.ts +124 -0
- package/esm/types/6_message_content.d.ts.map +1 -0
- package/esm/types/6_message_content.js +20 -0
- package/esm/types/7_callback_query.d.ts +43 -0
- package/esm/types/7_callback_query.d.ts.map +1 -0
- package/esm/types/7_callback_query.js +59 -0
- package/esm/types/7_chat_list_item.d.ts +43 -0
- package/esm/types/7_chat_list_item.d.ts.map +1 -0
- package/esm/types/7_chat_list_item.js +57 -0
- package/esm/types/7_inline_query_result.d.ts +251 -0
- package/esm/types/7_inline_query_result.d.ts.map +1 -0
- package/esm/types/7_inline_query_result.js +380 -0
- package/esm/types/7_message_list.d.ts +28 -0
- package/esm/types/7_message_list.d.ts.map +1 -0
- package/esm/types/7_message_list.js +20 -0
- package/esm/types/7_saved_chat.d.ts +35 -0
- package/esm/types/7_saved_chat.d.ts.map +1 -0
- package/esm/types/7_saved_chat.js +42 -0
- package/esm/types/7_topic.d.ts +44 -0
- package/esm/types/7_topic.d.ts.map +1 -0
- package/esm/types/7_topic.js +61 -0
- package/esm/types/8_inline_query_answer.d.ts +32 -0
- package/esm/types/8_inline_query_answer.d.ts.map +1 -0
- package/esm/types/8_inline_query_answer.js +28 -0
- package/esm/types/8_saved_chats.d.ts +33 -0
- package/esm/types/8_saved_chats.d.ts.map +1 -0
- package/esm/types/8_saved_chats.js +36 -0
- package/esm/types/8_update.d.ts +583 -0
- package/esm/types/8_update.d.ts.map +1 -0
- package/esm/types/8_update.js +20 -0
- package/esm/types/_file_id.d.ts +64 -51
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +96 -77
- package/esm/types/_getters.d.ts +4 -11
- package/esm/types/_getters.d.ts.map +1 -1
- package/esm/types/_getters.js +1 -1
- package/esm/utilities/0_color.d.ts +1 -1
- package/esm/utilities/0_color.js +1 -1
- package/esm/utilities/0_env.d.ts.map +1 -1
- package/esm/utilities/0_env.js +20 -1
- package/esm/utilities/0_gzip.d.ts +22 -0
- package/esm/utilities/0_gzip.d.ts.map +1 -0
- package/esm/utilities/0_gzip.js +42 -0
- package/esm/utilities/0_hash.d.ts +3 -3
- package/esm/utilities/0_hash.d.ts.map +1 -1
- package/esm/utilities/0_hash.js +1 -1
- package/esm/utilities/0_int.d.ts +71 -0
- package/esm/utilities/0_int.d.ts.map +1 -0
- package/esm/utilities/0_int.js +140 -0
- package/esm/utilities/0_misc.d.ts +29 -0
- package/esm/utilities/0_misc.d.ts.map +1 -0
- package/esm/utilities/0_misc.js +84 -0
- package/esm/utilities/0_mutex.d.ts +1 -1
- package/esm/utilities/0_mutex.js +5 -20
- package/esm/utilities/0_object.d.ts +1 -1
- package/esm/utilities/0_object.js +1 -1
- package/esm/utilities/0_part_stream.d.ts +4 -4
- package/esm/utilities/0_part_stream.d.ts.map +1 -1
- package/esm/utilities/0_part_stream.js +13 -27
- package/esm/utilities/0_rle.d.ts +3 -3
- package/esm/utilities/0_rle.d.ts.map +1 -1
- package/esm/utilities/0_rle.js +2 -2
- package/esm/utilities/0_text.d.ts +22 -0
- package/esm/utilities/0_text.d.ts.map +1 -0
- package/esm/utilities/0_text.js +27 -0
- package/esm/utilities/0_types.d.ts +1 -1
- package/esm/utilities/0_types.js +1 -1
- package/esm/utilities/0_units.d.ts +1 -4
- package/esm/utilities/0_units.d.ts.map +1 -1
- package/esm/utilities/0_units.js +1 -4
- package/esm/utilities/1_auth.d.ts +2 -2
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_auth.js +5 -6
- package/esm/utilities/1_base64.d.ts +3 -3
- package/esm/utilities/1_base64.d.ts.map +1 -1
- package/esm/utilities/1_base64.js +3 -3
- package/esm/utilities/1_crypto.d.ts +30 -0
- package/esm/utilities/1_crypto.d.ts.map +1 -0
- package/esm/utilities/1_crypto.js +79 -0
- package/esm/utilities/1_logger.d.ts +3 -3
- package/esm/utilities/1_logger.d.ts.map +1 -1
- package/esm/utilities/1_logger.js +5 -4
- package/esm/utilities/1_math.d.ts +1 -1
- package/esm/utilities/1_math.js +4 -4
- package/esm/utilities/2_queue.d.ts +2 -2
- package/esm/utilities/2_queue.d.ts.map +1 -1
- package/esm/utilities/2_queue.js +33 -47
- package/package.json +2 -5
- package/script/0_deps.d.ts +23 -13
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +47 -41
- package/script/0_errors.d.ts +9 -2
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +21 -8
- package/script/1_utilities.d.ts +6 -7
- package/script/1_utilities.d.ts.map +1 -1
- package/script/1_utilities.js +6 -7
- package/script/2_connection.d.ts +1 -1
- package/script/2_connection.js +1 -1
- package/script/2_storage.d.ts +1 -1
- package/script/2_storage.js +1 -1
- package/script/2_tl.d.ts +7 -10
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +25 -19
- package/script/3_errors.d.ts +8 -3
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +16 -17
- package/script/3_transport.d.ts +4 -4
- package/script/3_transport.js +4 -4
- package/script/3_types.d.ts +74 -34
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +74 -34
- package/script/4_constants.d.ts +21 -2
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +6 -29
- package/script/4_errors.d.ts +4 -4
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +3 -13
- package/script/4_session.d.ts +24 -0
- package/script/4_session.d.ts.map +1 -0
- package/script/4_session.js +39 -0
- package/script/5_client.d.ts +9 -3
- package/script/5_client.d.ts.map +1 -1
- package/script/5_client.js +9 -3
- package/script/_dnt.polyfills.d.ts +20 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +120 -0
- package/script/_dnt.shims.d.ts +0 -1
- package/script/_dnt.shims.d.ts.map +1 -1
- package/script/client/0_abortable_loop.d.ts +27 -0
- package/script/client/0_abortable_loop.d.ts.map +1 -0
- package/script/client/0_abortable_loop.js +60 -0
- package/script/client/0_client_abstract.d.ts +31 -28
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +23 -115
- package/script/client/0_html.d.ts +4 -3
- package/script/client/0_html.d.ts.map +1 -1
- package/script/client/0_html.js +413 -74
- package/script/client/0_markdown.d.ts +2 -2
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +39 -19
- package/script/client/0_params.d.ts +324 -41
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_params.js +1 -1
- package/script/client/0_password.d.ts +6 -6
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +11 -11
- package/script/client/0_storage_operations.d.ts +81 -69
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +393 -311
- package/script/client/0_update_processor.d.ts +26 -0
- package/script/client/0_update_processor.d.ts.map +1 -0
- package/script/client/0_update_processor.js +21 -0
- package/script/client/0_utilities.d.ts +10 -5
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +47 -32
- package/script/client/0_worker_error.d.ts +26 -0
- package/script/client/0_worker_error.d.ts.map +1 -0
- package/script/client/0_worker_error.js +90 -0
- package/script/client/0_worker_request.d.ts +27 -0
- package/script/client/0_worker_request.d.ts.map +1 -0
- package/script/client/0_worker_request.js +21 -0
- package/script/client/1_client_generic.d.ts +1846 -0
- package/script/client/1_client_generic.d.ts.map +1 -0
- package/script/client/1_client_generic.js +28 -0
- package/script/client/1_client_plain.d.ts +12 -9
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +34 -63
- package/script/client/1_invoke_middleware.d.ts +32 -0
- package/script/client/1_invoke_middleware.d.ts.map +1 -0
- package/script/client/1_invoke_middleware.js +25 -0
- package/script/client/1_types.d.ts +17 -32
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/1_types.js +1 -1
- package/script/client/1_worker_response.d.ts +37 -0
- package/script/client/1_worker_response.d.ts.map +1 -0
- package/script/client/1_worker_response.js +21 -0
- package/script/client/2_account_manager.d.ts +43 -5
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +367 -47
- package/script/client/2_bot_info_manager.d.ts +12 -5
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +41 -39
- package/script/client/2_business_connection_manager.d.ts +6 -5
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +15 -28
- package/script/client/2_client_encrypted.d.ts +58 -0
- package/script/client/2_client_encrypted.d.ts.map +1 -0
- package/script/client/2_client_encrypted.js +277 -0
- package/script/client/2_file_manager.d.ts +27 -7
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +363 -348
- package/script/client/2_network_statistics_manager.d.ts +5 -5
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +40 -27
- package/script/client/2_payment_manager.d.ts +8 -7
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +12 -25
- package/script/client/2_reaction_manager.d.ts +6 -5
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +18 -31
- package/script/client/2_sign_in.d.ts +25 -0
- package/script/client/2_sign_in.d.ts.map +1 -0
- package/script/client/2_sign_in.js +118 -0
- package/script/client/2_translations_manager.d.ts +35 -0
- package/script/client/2_translations_manager.d.ts.map +1 -0
- package/script/client/2_translations_manager.js +165 -0
- package/script/client/2_update_manager.d.ts +11 -8
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +838 -775
- package/script/client/3_client_encrypted_pool.d.ts +29 -0
- package/script/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/script/client/3_client_encrypted_pool.js +51 -0
- package/script/client/3_filters.d.ts +96 -0
- package/script/client/3_filters.d.ts.map +1 -0
- package/script/client/3_filters.js +55 -0
- package/script/client/3_message_manager.d.ts +30 -35
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +1078 -785
- package/script/client/3_video_chat_manager.d.ts +11 -10
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +85 -93
- package/script/client/4_callback_query_manager.d.ts +9 -8
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +24 -35
- package/script/client/4_chat_list_manager.d.ts +20 -11
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +212 -442
- package/script/client/4_chat_manager.d.ts +86 -0
- package/script/client/4_chat_manager.d.ts.map +1 -0
- package/script/client/4_chat_manager.js +482 -0
- package/script/client/4_checklist_manager.d.ts +38 -0
- package/script/client/4_checklist_manager.d.ts.map +1 -0
- package/script/client/4_checklist_manager.js +72 -0
- package/script/client/4_context.d.ts +691 -0
- package/script/client/4_context.d.ts.map +1 -0
- package/script/client/4_context.js +1410 -0
- package/script/client/4_forum_manager.d.ts +40 -0
- package/script/client/4_forum_manager.d.ts.map +1 -0
- package/script/client/4_forum_manager.js +132 -0
- package/script/client/4_gift_manager.d.ts +39 -0
- package/script/client/4_gift_manager.d.ts.map +1 -0
- package/script/client/4_gift_manager.js +88 -0
- package/script/client/4_inline_query_manager.d.ts +10 -9
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +23 -35
- package/script/client/4_link_preview_manager.d.ts +39 -0
- package/script/client/4_link_preview_manager.d.ts.map +1 -0
- package/script/client/4_link_preview_manager.js +55 -0
- package/script/client/4_poll_manager.d.ts +39 -0
- package/script/client/4_poll_manager.d.ts.map +1 -0
- package/script/client/4_poll_manager.js +109 -0
- package/script/client/4_story_manager.d.ts +11 -10
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +51 -63
- package/script/client/5_composer.d.ts +51 -0
- package/script/client/5_composer.d.ts.map +1 -0
- package/script/client/5_composer.js +113 -0
- package/script/client/6_client.d.ts +1952 -0
- package/script/client/6_client.d.ts.map +1 -0
- package/script/client/6_client.js +3414 -0
- package/script/client/6_client_dispatcher.d.ts +1917 -0
- package/script/client/6_client_dispatcher.d.ts.map +1 -0
- package/script/client/6_client_dispatcher.js +2480 -0
- package/script/client/7_client_worker.d.ts +27 -0
- package/script/client/7_client_worker.d.ts.map +1 -0
- package/script/client/7_client_worker.js +80 -0
- package/script/connection/0_connection.d.ts +9 -8
- package/script/connection/0_connection.d.ts.map +1 -1
- package/script/connection/0_connection.js +1 -1
- package/script/connection/1_connection_tcp.d.ts +4 -5
- package/script/connection/1_connection_tcp.d.ts.map +1 -1
- package/script/connection/1_connection_tcp.js +65 -116
- package/script/connection/1_connection_web_socket.d.ts +3 -3
- package/script/connection/1_connection_web_socket.d.ts.map +1 -1
- package/script/connection/1_connection_web_socket.js +79 -98
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.d.ts +18 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/mod.js +71 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.d.ts +3 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.d.ts.map +1 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +295 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +17 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/assert.js +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equal.js +230 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +37 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/equals.js +64 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/false.d.ts +19 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/false.js +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.19/unreachable.js +23 -0
- package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts +2 -0
- package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/_util.js +9 -0
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +107 -0
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.js +49 -0
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +37 -0
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.js +44 -0
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +44 -0
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.js +60 -0
- package/script/deps/jsr.io/@std/async/1.2.0/delay.d.ts +45 -0
- package/script/deps/jsr.io/@std/async/1.2.0/delay.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/delay.js +87 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts +22 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mod.js +39 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +111 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +158 -0
- package/script/deps/jsr.io/@std/async/1.2.0/pool.d.ts +33 -0
- package/script/deps/jsr.io/@std/async/1.2.0/pool.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/pool.js +102 -0
- package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts +155 -0
- package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/retry.js +152 -0
- package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts +43 -0
- package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/1.2.0/tee.js +82 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +3 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +21 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +35 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/equals.d.ts +22 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/equals.js +85 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/starts_with.d.ts +24 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/starts_with.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.6/starts_with.js +37 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.d.ts +12 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/_serialize_arg_list.js +72 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/lru_cache.d.ts +155 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/lru_cache.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/lru_cache.js +192 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/memoize.d.ts +111 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/memoize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/cache/0.2.2/memoize.js +85 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.d.ts +19 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/_date_time_formatter.js +541 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/constants.d.ts +265 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/constants.js +269 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/format.d.ts +70 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/datetime/0.225.7/format.js +69 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +23 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +57 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.js +119 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +16 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +3 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +86 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +39 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +91 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.js +48 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +80 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/build_message.js +121 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff.js +283 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.js +188 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts +29 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/format.js +106 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/os.js +8 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/styles.js +252 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts +25 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.12/types.js +4 -0
- package/script/deps/jsr.io/@std/io/0.225.3/_constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.3/_constants.js +7 -0
- package/script/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.3/iterate_reader.js +100 -0
- package/script/deps/jsr.io/@std/io/0.225.3/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.3/types.js +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +10 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.js +45 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.js +49 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +12 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +11 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +80 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/basename.js +38 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/extname.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/join.js +32 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.js +11 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.js +55 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.js +96 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +24 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +26 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/join.js +48 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +61 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +30 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +31 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.js +20 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.js +50 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.js +85 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +33 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +41 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/join.js +80 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +138 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +37 -0
- package/script/deps/jsr.io/@std/streams/1.0.17/to_array_buffer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/streams/1.0.17/to_array_buffer.js +38 -0
- package/script/mod.d.ts +2 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +19 -10
- package/script/session/0_session_error.d.ts +24 -0
- package/script/session/0_session_error.d.ts.map +1 -0
- package/script/session/0_session_error.js +29 -0
- package/script/session/0_session_state.d.ts +28 -0
- package/script/session/0_session_state.d.ts.map +1 -0
- package/script/session/0_session_state.js +55 -0
- package/script/session/1_session.d.ts +51 -0
- package/script/session/1_session.d.ts.map +1 -0
- package/script/session/1_session.js +128 -0
- package/script/session/2_session_encrypted.d.ts +41 -0
- package/script/session/2_session_encrypted.d.ts.map +1 -0
- package/script/session/2_session_encrypted.js +513 -0
- package/script/session/2_session_plain.d.ts +25 -0
- package/script/session/2_session_plain.d.ts.map +1 -0
- package/script/session/2_session_plain.js +60 -0
- package/script/storage/0_storage.d.ts +3 -2
- package/script/storage/0_storage.d.ts.map +1 -1
- package/script/storage/0_storage.js +1 -1
- package/script/storage/1_utilities.d.ts +15 -11
- package/script/storage/1_utilities.d.ts.map +1 -1
- package/script/storage/1_utilities.js +47 -55
- package/script/storage/2_storage_indexed_db.d.ts +3 -2
- package/script/storage/2_storage_indexed_db.d.ts.map +1 -1
- package/script/storage/2_storage_indexed_db.js +33 -48
- package/script/storage/2_storage_local_storage.d.ts +3 -2
- package/script/storage/2_storage_local_storage.d.ts.map +1 -1
- package/script/storage/2_storage_local_storage.js +10 -20
- package/script/storage/2_storage_memory.d.ts +4 -3
- package/script/storage/2_storage_memory.d.ts.map +1 -1
- package/script/storage/2_storage_memory.js +30 -44
- package/script/storage/2_storage_session_storage.d.ts +4 -3
- package/script/storage/2_storage_session_storage.d.ts.map +1 -1
- package/script/storage/2_storage_session_storage.js +10 -20
- package/script/tl/0_types.d.ts +25 -0
- package/script/tl/0_types.d.ts.map +1 -0
- package/script/tl/0_types.js +21 -0
- package/script/tl/0_utilities.d.ts +34 -0
- package/script/tl/0_utilities.d.ts.map +1 -0
- package/script/tl/0_utilities.js +89 -0
- package/script/tl/1_mtproto_api.d.ts +371 -0
- package/script/tl/1_mtproto_api.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.js +419 -0
- package/script/tl/1_telegram_api.d.ts +19410 -0
- package/script/tl/1_telegram_api.d.ts.map +1 -0
- package/script/tl/1_telegram_api.js +22389 -0
- package/script/tl/1_tl_reader.d.ts +39 -0
- package/script/tl/1_tl_reader.d.ts.map +1 -0
- package/script/tl/1_tl_reader.js +224 -0
- package/script/tl/1_tl_writer.d.ts +37 -0
- package/script/tl/1_tl_writer.d.ts.map +1 -0
- package/script/tl/1_tl_writer.js +273 -0
- package/script/tl/1_utilities.d.ts +9 -14
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +23 -44
- package/script/tl/2_message.d.ts +36 -0
- package/script/tl/2_message.d.ts.map +1 -0
- package/script/tl/2_message.js +80 -0
- package/script/tl/2_mtproto.d.ts +33 -0
- package/script/tl/2_mtproto.d.ts.map +1 -0
- package/script/tl/2_mtproto.js +78 -0
- package/script/tl/2_telegram.d.ts +49 -0
- package/script/tl/2_telegram.d.ts.map +1 -0
- package/script/tl/2_telegram.js +189 -0
- package/script/transport/0_obfuscation.d.ts +2 -2
- package/script/transport/0_obfuscation.d.ts.map +1 -1
- package/script/transport/0_obfuscation.js +9 -8
- package/script/transport/0_transport.d.ts +4 -6
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/transport/0_transport.js +11 -19
- package/script/transport/1_transport_abridged.d.ts +2 -4
- package/script/transport/1_transport_abridged.d.ts.map +1 -1
- package/script/transport/1_transport_abridged.js +21 -51
- package/script/transport/1_transport_intermediate.d.ts +2 -4
- package/script/transport/1_transport_intermediate.d.ts.map +1 -1
- package/script/transport/1_transport_intermediate.js +15 -47
- package/script/transport/1_transport_provider.d.ts +35 -0
- package/script/transport/1_transport_provider.d.ts.map +1 -0
- package/script/transport/1_transport_provider.js +86 -0
- package/script/transport/2_transport_provider_tcp.d.ts +25 -0
- package/script/transport/2_transport_provider_tcp.d.ts.map +1 -0
- package/script/transport/2_transport_provider_tcp.js +32 -0
- package/script/transport/2_transport_provider_web_socket.d.ts +24 -0
- package/script/transport/2_transport_provider_web_socket.d.ts.map +1 -0
- package/script/transport/2_transport_provider_web_socket.js +47 -0
- package/script/types/0_authorization_state.d.ts +2 -2
- package/script/types/0_authorization_state.d.ts.map +1 -1
- package/script/types/0_authorization_state.js +1 -1
- package/script/types/0_birthday.d.ts +3 -2
- package/script/types/0_birthday.d.ts.map +1 -1
- package/script/types/0_birthday.js +10 -1
- package/script/types/0_bot_command.d.ts +1 -1
- package/script/types/0_bot_command.js +1 -1
- package/script/types/0_bot_token_check_result.d.ts +31 -0
- package/script/types/0_bot_token_check_result.d.ts.map +1 -0
- package/script/types/0_bot_token_check_result.js +21 -0
- package/script/types/0_button_style.d.ts +28 -0
- package/script/types/0_button_style.d.ts.map +1 -0
- package/script/types/0_button_style.js +40 -0
- package/script/types/0_callback_query_answer.d.ts +3 -3
- package/script/types/0_callback_query_answer.d.ts.map +1 -1
- package/script/types/0_callback_query_answer.js +2 -2
- package/script/types/0_callback_query_question.d.ts +1 -1
- package/script/types/0_callback_query_question.js +3 -3
- package/script/types/0_chat_action.d.ts +1 -1
- package/script/types/0_chat_action.js +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +17 -7
- package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.js +31 -16
- package/script/types/0_chat_folder.d.ts +29 -0
- package/script/types/0_chat_folder.d.ts.map +1 -0
- package/script/types/0_chat_folder.js +28 -0
- package/script/types/0_chat_member_rights.d.ts +3 -3
- package/script/types/0_chat_member_rights.d.ts.map +1 -1
- package/script/types/0_chat_member_rights.js +20 -20
- package/script/types/0_chat_photo.d.ts +2 -2
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +4 -4
- package/script/types/0_checklist_changed.d.ts +29 -0
- package/script/types/0_checklist_changed.d.ts.map +1 -0
- package/script/types/0_checklist_changed.js +28 -0
- package/script/types/0_code_check_result.d.ts +47 -0
- package/script/types/0_code_check_result.d.ts.map +1 -0
- package/script/types/0_code_check_result.js +21 -0
- package/script/types/0_connection_state.d.ts +1 -1
- package/script/types/0_connection_state.js +1 -1
- package/script/types/0_contact.d.ts +2 -2
- package/script/types/0_contact.d.ts.map +1 -1
- package/script/types/0_contact.js +1 -1
- package/script/types/0_dice.d.ts +2 -2
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_dice.js +1 -1
- package/script/types/0_emoji_status.d.ts +48 -0
- package/script/types/0_emoji_status.d.ts.map +1 -0
- package/script/types/0_emoji_status.js +36 -0
- package/script/types/0_failed_invitation.d.ts +8 -4
- package/script/types/0_failed_invitation.d.ts.map +1 -1
- package/script/types/0_failed_invitation.js +3 -3
- package/script/types/0_file_source.d.ts +2 -2
- package/script/types/0_file_source.d.ts.map +1 -1
- package/script/types/0_file_source.js +1 -1
- package/script/types/0_gift_component_rarity.d.ts +50 -0
- package/script/types/0_gift_component_rarity.d.ts.map +1 -0
- package/script/types/0_gift_component_rarity.js +46 -0
- package/script/types/0_gift_value.d.ts +25 -0
- package/script/types/0_gift_value.d.ts.map +1 -0
- package/script/types/0_gift_value.js +21 -0
- package/script/types/0_giveaway_parameters.d.ts +2 -2
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +4 -5
- package/script/types/0_id.d.ts +1 -1
- package/script/types/0_id.js +1 -1
- package/script/types/0_input_emoji_status.d.ts +36 -0
- package/script/types/0_input_emoji_status.d.ts.map +1 -0
- package/script/types/0_input_emoji_status.js +21 -0
- package/script/types/0_invoice.d.ts +3 -2
- package/script/types/0_invoice.d.ts.map +1 -1
- package/script/types/0_invoice.js +1 -1
- package/script/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/script/types/0_keyboard_button_poll_type.js +1 -1
- package/script/types/0_link_preview_media_size.d.ts +22 -0
- package/script/types/0_link_preview_media_size.d.ts.map +1 -0
- package/script/types/0_link_preview_media_size.js +21 -0
- package/script/types/0_live_stream_channel.d.ts +2 -2
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_live_stream_channel.js +1 -1
- package/script/types/0_location.d.ts +1 -1
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +5 -5
- package/script/types/0_login_url.d.ts +1 -1
- package/script/types/0_login_url.js +1 -1
- package/script/types/0_mask_position.d.ts +2 -2
- package/script/types/0_mask_position.d.ts.map +1 -1
- package/script/types/0_mask_position.js +2 -2
- package/script/types/0_message_reference.d.ts +1 -1
- package/script/types/0_message_reference.js +1 -1
- package/script/types/0_message_search_filter.d.ts +3 -2
- package/script/types/0_message_search_filter.d.ts.map +1 -1
- package/script/types/0_message_search_filter.js +1 -1
- package/script/types/0_mini_app_button_info.d.ts +26 -0
- package/script/types/0_mini_app_button_info.d.ts.map +1 -0
- package/script/types/0_mini_app_button_info.js +25 -0
- package/script/types/0_mini_app_mode.d.ts +22 -0
- package/script/types/0_mini_app_mode.d.ts.map +1 -0
- package/script/types/0_mini_app_mode.js +21 -0
- package/script/types/0_network_statistics_entry.d.ts +1 -1
- package/script/types/0_network_statistics_entry.js +1 -1
- package/script/types/0_parse_mode.d.ts +1 -1
- package/script/types/0_parse_mode.js +1 -1
- package/script/types/0_password_check_result.d.ts +39 -0
- package/script/types/0_password_check_result.d.ts.map +1 -0
- package/script/types/0_password_check_result.js +21 -0
- package/script/types/0_price_tag.d.ts +1 -1
- package/script/types/0_price_tag.js +1 -1
- package/script/types/0_reaction.d.ts +4 -1
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +9 -9
- package/script/types/0_refunded_payment.d.ts +2 -2
- package/script/types/0_refunded_payment.d.ts.map +1 -1
- package/script/types/0_refunded_payment.js +2 -2
- package/script/types/0_restriction_reason.d.ts +2 -2
- package/script/types/0_restriction_reason.d.ts.map +1 -1
- package/script/types/0_restriction_reason.js +1 -1
- package/script/types/0_self_destruct_option.d.ts +11 -3
- package/script/types/0_self_destruct_option.d.ts.map +1 -1
- package/script/types/0_self_destruct_option.js +13 -3
- package/script/types/0_shipping_address.d.ts +2 -2
- package/script/types/0_shipping_address.d.ts.map +1 -1
- package/script/types/0_shipping_address.js +1 -1
- package/script/types/0_slow_mode_duration.d.ts +23 -0
- package/script/types/0_slow_mode_duration.d.ts.map +1 -0
- package/script/types/0_slow_mode_duration.js +31 -0
- package/script/types/0_story_reference.d.ts +1 -1
- package/script/types/0_story_reference.js +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.d.ts +20 -0
- package/script/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.js +19 -0
- package/script/types/0_thumbnail.d.ts +1 -1
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +3 -3
- package/script/types/0_translation.d.ts +32 -0
- package/script/types/0_translation.d.ts.map +1 -0
- package/script/types/0_translation.js +48 -0
- package/script/types/0_upload_progress.d.ts +29 -0
- package/script/types/0_upload_progress.d.ts.map +1 -0
- package/script/types/0_upload_progress.js +21 -0
- package/script/types/0_user_status.d.ts +66 -0
- package/script/types/0_user_status.d.ts.map +1 -0
- package/script/types/0_user_status.js +38 -0
- package/script/types/0_video_chat.d.ts +8 -4
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +6 -7
- package/script/types/0_voice.d.ts +2 -2
- package/script/types/0_voice.d.ts.map +1 -1
- package/script/types/0_voice.js +1 -1
- package/script/types/0_voice_transcription.d.ts +31 -0
- package/script/types/0_voice_transcription.d.ts.map +1 -0
- package/script/types/0_voice_transcription.js +29 -0
- package/script/types/0_working_hours_interval.d.ts +27 -0
- package/script/types/0_working_hours_interval.d.ts.map +1 -0
- package/script/types/0_working_hours_interval.js +21 -0
- package/script/types/1_animation.d.ts +2 -2
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_animation.js +2 -2
- package/script/types/1_audio.d.ts +2 -2
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_audio.js +2 -2
- package/script/types/1_bot_command_scope.d.ts +3 -3
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +3 -3
- package/script/types/1_bot_commands.d.ts +30 -0
- package/script/types/1_bot_commands.d.ts.map +1 -0
- package/script/types/1_bot_commands.js +21 -0
- package/script/types/1_chat_p.d.ts +36 -7
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +43 -16
- package/script/types/1_document.d.ts +2 -2
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_document.js +2 -2
- package/script/types/1_giveaway.d.ts +3 -3
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_giveaway.js +1 -1
- package/script/types/1_inline_keyboard_button.d.ts +140 -0
- package/script/types/1_inline_keyboard_button.d.ts.map +1 -0
- package/script/types/1_inline_keyboard_button.js +132 -0
- package/script/types/1_inline_query_result_button.d.ts +3 -3
- package/script/types/1_inline_query_result_button.d.ts.map +1 -1
- package/script/types/1_inline_query_result_button.js +1 -1
- package/script/types/1_input_gift.d.ts +54 -0
- package/script/types/1_input_gift.d.ts.map +1 -0
- package/script/types/1_input_gift.js +35 -0
- package/script/types/1_input_story_content.d.ts +3 -3
- package/script/types/1_input_story_content.d.ts.map +1 -1
- package/script/types/1_input_story_content.js +1 -1
- package/script/types/1_keyboard_button.d.ts +14 -12
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +86 -33
- package/script/types/1_message_reaction.d.ts +3 -3
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +7 -7
- package/script/types/1_mini_app_info.d.ts +32 -0
- package/script/types/1_mini_app_info.d.ts.map +1 -0
- package/script/types/1_mini_app_info.js +30 -0
- package/script/types/1_network_statistics.d.ts +2 -2
- package/script/types/1_network_statistics.d.ts.map +1 -1
- package/script/types/1_network_statistics.js +1 -1
- package/script/types/1_order_info.d.ts +8 -3
- package/script/types/1_order_info.d.ts.map +1 -1
- package/script/types/1_order_info.js +1 -1
- package/script/types/1_photo.d.ts +2 -2
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +3 -3
- package/script/types/1_reaction_count.d.ts +3 -3
- package/script/types/1_reaction_count.d.ts.map +1 -1
- package/script/types/1_reaction_count.js +1 -1
- package/script/types/1_sticker.d.ts +6 -5
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +15 -10
- package/script/types/1_story_reaction.d.ts +4 -4
- package/script/types/1_story_reaction.d.ts.map +1 -1
- package/script/types/1_story_reaction.js +2 -2
- package/script/types/1_venue.d.ts +2 -2
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_venue.js +2 -2
- package/script/types/1_video.d.ts +2 -2
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video.js +2 -2
- package/script/types/1_video_note.d.ts +2 -2
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/1_video_note.js +2 -2
- package/script/types/1_working_hours.d.ts +31 -0
- package/script/types/1_working_hours.d.ts.map +1 -0
- package/script/types/1_working_hours.js +37 -0
- package/script/types/2_chat.d.ts +14 -17
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +22 -27
- package/script/types/2_chat_member.d.ts +72 -15
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +38 -26
- package/script/types/2_inactive_chat.d.ts +3 -3
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inactive_chat.js +3 -4
- package/script/types/2_message_entity.d.ts +148 -0
- package/script/types/2_message_entity.d.ts.map +1 -0
- package/script/types/2_message_entity.js +248 -0
- package/script/types/2_message_interactions.d.ts +2 -2
- package/script/types/2_message_interactions.d.ts.map +1 -1
- package/script/types/2_message_interactions.js +1 -1
- package/script/types/2_message_reaction_count.d.ts +6 -7
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reaction_count.js +6 -9
- package/script/types/2_message_reaction_list_item.d.ts +39 -0
- package/script/types/2_message_reaction_list_item.d.ts.map +1 -0
- package/script/types/2_message_reaction_list_item.js +53 -0
- package/script/types/2_poll_answer.d.ts +32 -0
- package/script/types/2_poll_answer.d.ts.map +1 -0
- package/script/types/2_poll_answer.js +38 -0
- package/script/types/2_reply_markup.d.ts +71 -0
- package/script/types/2_reply_markup.d.ts.map +1 -0
- package/script/types/2_reply_markup.js +131 -0
- package/script/types/2_sticker_set.d.ts +51 -0
- package/script/types/2_sticker_set.d.ts.map +1 -0
- package/script/types/2_sticker_set.js +94 -0
- package/script/types/2_story_content.d.ts +3 -3
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +6 -6
- package/script/types/2_story_interactions.d.ts +3 -3
- package/script/types/2_story_interactions.d.ts.map +1 -1
- package/script/types/2_story_interactions.js +1 -1
- package/script/types/2_story_interactive_area.d.ts +9 -9
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +15 -14
- package/script/types/2_story_privacy.d.ts +46 -0
- package/script/types/2_story_privacy.d.ts.map +1 -0
- package/script/types/2_story_privacy.js +80 -0
- package/script/types/2_successful_payment.d.ts +11 -3
- package/script/types/2_successful_payment.d.ts.map +1 -1
- package/script/types/2_successful_payment.js +2 -2
- package/script/types/2_user.d.ts +73 -0
- package/script/types/2_user.d.ts.map +1 -0
- package/script/types/2_user.js +86 -0
- package/script/types/3_business_connection.d.ts +37 -0
- package/script/types/3_business_connection.d.ts.map +1 -0
- package/script/types/3_business_connection.js +39 -0
- package/script/types/3_chat_settings.d.ts +47 -0
- package/script/types/3_chat_settings.d.ts.map +1 -0
- package/script/types/3_chat_settings.js +54 -0
- package/script/types/3_checklist_item.d.ts +65 -0
- package/script/types/3_checklist_item.d.ts.map +1 -0
- package/script/types/3_checklist_item.js +54 -0
- package/script/types/3_chosen_inline_result.d.ts +38 -0
- package/script/types/3_chosen_inline_result.d.ts.map +1 -0
- package/script/types/3_chosen_inline_result.js +40 -0
- package/script/types/3_forward_header.d.ts +77 -0
- package/script/types/3_forward_header.d.ts.map +1 -0
- package/script/types/3_forward_header.js +76 -0
- package/script/types/3_game.d.ts +40 -0
- package/script/types/3_game.d.ts.map +1 -0
- package/script/types/3_game.js +47 -0
- package/script/types/3_gift_upgraded_component.d.ts +96 -0
- package/script/types/3_gift_upgraded_component.d.ts.map +1 -0
- package/script/types/3_gift_upgraded_component.js +91 -0
- package/script/types/3_inline_query.d.ts +40 -0
- package/script/types/3_inline_query.d.ts.map +1 -0
- package/script/types/3_inline_query.js +63 -0
- package/script/types/3_input_checklist_item.d.ts +31 -0
- package/script/types/3_input_checklist_item.d.ts.map +1 -0
- package/script/types/3_input_checklist_item.js +21 -0
- package/script/types/3_input_media.d.ts +123 -0
- package/script/types/3_input_media.d.ts.map +1 -0
- package/script/types/3_input_media.js +21 -0
- package/script/types/3_input_poll_option.d.ts +31 -0
- package/script/types/3_input_poll_option.d.ts.map +1 -0
- package/script/types/3_input_poll_option.js +21 -0
- package/script/types/3_invite_link.d.ts +47 -0
- package/script/types/3_invite_link.d.ts.map +1 -0
- package/script/types/3_invite_link.js +51 -0
- package/script/types/3_message_reaction_list.d.ts +32 -0
- package/script/types/3_message_reaction_list.d.ts.map +1 -0
- package/script/types/3_message_reaction_list.js +34 -0
- package/script/types/3_message_reactions.d.ts +42 -0
- package/script/types/3_message_reactions.d.ts.map +1 -0
- package/script/types/3_message_reactions.js +57 -0
- package/script/types/3_poll_option.d.ts +34 -0
- package/script/types/3_poll_option.d.ts.map +1 -0
- package/script/types/3_poll_option.js +32 -0
- package/script/types/3_pre_checkout_query.d.ts +42 -0
- package/script/types/3_pre_checkout_query.d.ts.map +1 -0
- package/script/types/3_pre_checkout_query.js +42 -0
- package/script/types/3_reply_quote.d.ts +32 -0
- package/script/types/3_reply_quote.d.ts.map +1 -0
- package/script/types/3_reply_quote.js +33 -0
- package/script/types/3_story.d.ts +13 -14
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/3_story.js +14 -15
- package/script/types/4_chat_member_updated.d.ts +43 -0
- package/script/types/4_chat_member_updated.d.ts.map +1 -0
- package/script/types/4_chat_member_updated.js +55 -0
- package/script/types/4_checklist.d.ts +38 -0
- package/script/types/4_checklist.d.ts.map +1 -0
- package/script/types/4_checklist.js +34 -0
- package/script/types/4_gift.d.ts +100 -0
- package/script/types/4_gift.d.ts.map +1 -0
- package/script/types/4_gift.js +117 -0
- package/script/types/4_join_request.d.ts +39 -0
- package/script/types/4_join_request.d.ts.map +1 -0
- package/script/types/4_join_request.js +66 -0
- package/script/types/4_poll.d.ts +55 -0
- package/script/types/4_poll.d.ts.map +1 -0
- package/script/types/4_poll.js +46 -0
- package/script/types/4_reply_to.d.ts +51 -0
- package/script/types/4_reply_to.d.ts.map +1 -0
- package/script/types/4_reply_to.js +21 -0
- package/script/types/5_claimed_gift.d.ts +44 -0
- package/script/types/5_claimed_gift.d.ts.map +1 -0
- package/script/types/5_claimed_gift.js +46 -0
- package/script/types/5_gift_non_upgraded_information.d.ts +47 -0
- package/script/types/5_gift_non_upgraded_information.d.ts.map +1 -0
- package/script/types/5_gift_non_upgraded_information.js +72 -0
- package/script/types/5_gift_upgraded_information.d.ts +41 -0
- package/script/types/5_gift_upgraded_information.d.ts.map +1 -0
- package/script/types/5_gift_upgraded_information.js +61 -0
- package/script/types/5_link_preview.d.ts +186 -0
- package/script/types/5_link_preview.d.ts.map +1 -0
- package/script/types/5_link_preview.js +208 -0
- package/script/types/6_claimed_gifts.d.ts +33 -0
- package/script/types/6_claimed_gifts.d.ts.map +1 -0
- package/script/types/6_claimed_gifts.js +46 -0
- package/script/types/6_message.d.ts +704 -0
- package/script/types/6_message.d.ts.map +1 -0
- package/script/types/6_message.js +558 -0
- package/script/types/6_message_content.d.ts +124 -0
- package/script/types/6_message_content.d.ts.map +1 -0
- package/script/types/6_message_content.js +21 -0
- package/script/types/7_callback_query.d.ts +43 -0
- package/script/types/7_callback_query.d.ts.map +1 -0
- package/script/types/7_callback_query.js +63 -0
- package/script/types/7_chat_list_item.d.ts +43 -0
- package/script/types/7_chat_list_item.d.ts.map +1 -0
- package/script/types/7_chat_list_item.js +60 -0
- package/script/types/7_inline_query_result.d.ts +251 -0
- package/script/types/7_inline_query_result.d.ts.map +1 -0
- package/script/types/7_inline_query_result.js +384 -0
- package/script/types/7_message_list.d.ts +28 -0
- package/script/types/7_message_list.d.ts.map +1 -0
- package/script/types/7_message_list.js +21 -0
- package/script/types/7_saved_chat.d.ts +35 -0
- package/script/types/7_saved_chat.d.ts.map +1 -0
- package/script/types/7_saved_chat.js +45 -0
- package/script/types/7_topic.d.ts +44 -0
- package/script/types/7_topic.d.ts.map +1 -0
- package/script/types/7_topic.js +64 -0
- package/script/types/8_inline_query_answer.d.ts +32 -0
- package/script/types/8_inline_query_answer.d.ts.map +1 -0
- package/script/types/8_inline_query_answer.js +31 -0
- package/script/types/8_saved_chats.d.ts +33 -0
- package/script/types/8_saved_chats.d.ts.map +1 -0
- package/script/types/8_saved_chats.js +39 -0
- package/script/types/8_update.d.ts +583 -0
- package/script/types/8_update.d.ts.map +1 -0
- package/script/types/8_update.js +21 -0
- package/script/types/_file_id.d.ts +64 -51
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +158 -139
- package/script/types/_getters.d.ts +4 -11
- package/script/types/_getters.d.ts.map +1 -1
- package/script/types/_getters.js +1 -1
- package/script/utilities/0_color.d.ts +1 -1
- package/script/utilities/0_color.js +1 -1
- package/script/utilities/0_env.d.ts.map +1 -1
- package/script/utilities/0_env.js +37 -8
- package/script/utilities/0_gzip.d.ts +22 -0
- package/script/utilities/0_gzip.d.ts.map +1 -0
- package/script/utilities/0_gzip.js +46 -0
- package/script/utilities/0_hash.d.ts +3 -3
- package/script/utilities/0_hash.d.ts.map +1 -1
- package/script/utilities/0_hash.js +1 -1
- package/script/utilities/0_int.d.ts +71 -0
- package/script/utilities/0_int.d.ts.map +1 -0
- package/script/utilities/0_int.js +149 -0
- package/script/utilities/0_misc.d.ts +29 -0
- package/script/utilities/0_misc.d.ts.map +1 -0
- package/script/utilities/0_misc.js +95 -0
- package/script/utilities/0_mutex.d.ts +1 -1
- package/script/utilities/0_mutex.js +5 -20
- package/script/utilities/0_object.d.ts +1 -1
- package/script/utilities/0_object.js +1 -1
- package/script/utilities/0_part_stream.d.ts +4 -4
- package/script/utilities/0_part_stream.d.ts.map +1 -1
- package/script/utilities/0_part_stream.js +13 -27
- package/script/utilities/0_rle.d.ts +3 -3
- package/script/utilities/0_rle.d.ts.map +1 -1
- package/script/utilities/0_rle.js +2 -2
- package/script/utilities/0_text.d.ts +22 -0
- package/script/utilities/0_text.d.ts.map +1 -0
- package/script/utilities/0_text.js +31 -0
- package/script/utilities/0_types.d.ts +1 -1
- package/script/utilities/0_types.js +1 -1
- package/script/utilities/0_units.d.ts +1 -4
- package/script/utilities/0_units.d.ts.map +1 -1
- package/script/utilities/0_units.js +2 -5
- package/script/utilities/1_auth.d.ts +2 -2
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +6 -7
- package/script/utilities/1_base64.d.ts +3 -3
- package/script/utilities/1_base64.d.ts.map +1 -1
- package/script/utilities/1_base64.js +4 -4
- package/script/utilities/1_crypto.d.ts +30 -0
- package/script/utilities/1_crypto.d.ts.map +1 -0
- package/script/utilities/1_crypto.js +83 -0
- package/script/utilities/1_logger.d.ts +3 -3
- package/script/utilities/1_logger.d.ts.map +1 -1
- package/script/utilities/1_logger.js +5 -4
- package/script/utilities/1_math.d.ts +1 -1
- package/script/utilities/1_math.js +7 -7
- package/script/utilities/2_queue.d.ts +2 -2
- package/script/utilities/2_queue.d.ts.map +1 -1
- package/script/utilities/2_queue.js +33 -47
- package/esm/client/0_filters.d.ts +0 -58
- package/esm/client/0_filters.d.ts.map +0 -1
- package/esm/client/0_filters.js +0 -49
- package/esm/client/0_message.d.ts +0 -29
- package/esm/client/0_message.d.ts.map +0 -1
- package/esm/client/0_message.js +0 -83
- package/esm/client/1_client_encrypted.d.ts +0 -52
- package/esm/client/1_client_encrypted.d.ts.map +0 -1
- package/esm/client/1_client_encrypted.js +0 -339
- package/esm/client/1_composer.d.ts +0 -51
- package/esm/client/1_composer.d.ts.map +0 -1
- package/esm/client/1_composer.js +0 -168
- package/esm/client/5_client.d.ts +0 -1372
- package/esm/client/5_client.d.ts.map +0 -1
- package/esm/client/5_client.js +0 -2858
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts +0 -55
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.js +0 -167
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.d.ts +0 -3
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.d.ts.map +0 -1
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.js +0 -308
- package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js +0 -46
- package/esm/deps/jsr.io/@std/assert/1.0.8/assert.d.ts +0 -16
- package/esm/deps/jsr.io/@std/assert/1.0.8/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.8/equal.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.8/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js +0 -183
- package/esm/deps/jsr.io/@std/assert/1.0.8/equals.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.8/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.8/exists.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.8/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js +0 -27
- package/esm/deps/jsr.io/@std/assert/1.0.8/fail.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.8/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.8/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js +0 -52
- package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.8/less.d.ts +0 -19
- package/esm/deps/jsr.io/@std/assert/1.0.8/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/less.js +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.8/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.8/mod.d.ts +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.8/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts +0 -21
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js +0 -159
- package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts +0 -42
- package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.8/throws.d.ts +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.8/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js +0 -44
- package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js +0 -20
- package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts +0 -19
- package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.js +0 -32
- package/esm/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.d.ts +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.js +0 -26
- package/esm/deps/jsr.io/@std/encoding/1.0.5/base64.d.ts +0 -38
- package/esm/deps/jsr.io/@std/encoding/1.0.5/base64.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.5/base64.js +0 -163
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -110
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -276
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -179
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -2
- package/esm/deps/jsr.io/@std/io/0.225.0/_constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/io/0.225.0/_constants.js +0 -4
- package/esm/deps/jsr.io/@std/io/0.225.0/iterate_reader.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/io/0.225.0/iterate_reader.js +0 -96
- package/esm/deps/jsr.io/@std/io/0.225.0/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/io/0.225.0/types.js +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/assert_path.js +0 -7
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/basename.js +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/constants.js +0 -46
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize.js +0 -8
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.js +0 -77
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.js +0 -19
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.js +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/_os.js +0 -9
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.d.ts +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/basename.js +0 -36
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/extname.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/is_absolute.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/join.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/join.js +0 -29
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/_util.js +0 -8
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/basename.js +0 -49
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts +0 -37
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/extname.js +0 -89
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.js +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts +0 -33
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/join.js +0 -42
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts +0 -40
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/normalize.js +0 -57
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.js +0 -27
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/to_file_url.js +0 -28
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/_util.js +0 -15
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts +0 -23
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/basename.js +0 -44
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/extname.js +0 -81
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.js +0 -38
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts +0 -20
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/join.js +0 -74
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts +0 -22
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/normalize.js +0 -134
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.js +0 -34
- package/esm/deps/jsr.io/@std/streams/1.0.8/to_array_buffer.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/streams/1.0.8/to_array_buffer.js +0 -35
- package/esm/tl/0_api.d.ts +0 -15839
- package/esm/tl/0_api.d.ts.map +0 -1
- package/esm/tl/0_api.js +0 -24746
- package/esm/tl/0_tl_raw_reader.d.ts +0 -36
- package/esm/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.js +0 -87
- package/esm/tl/0_tl_raw_writer.d.ts +0 -34
- package/esm/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.js +0 -86
- package/esm/tl/2_deserialize.d.ts +0 -23
- package/esm/tl/2_deserialize.d.ts.map +0 -1
- package/esm/tl/2_deserialize.js +0 -95
- package/esm/tl/2_serialize.d.ts +0 -22
- package/esm/tl/2_serialize.d.ts.map +0 -1
- package/esm/tl/2_serialize.js +0 -160
- package/esm/tl/3_tl_reader.d.ts +0 -26
- package/esm/tl/3_tl_reader.d.ts.map +0 -1
- package/esm/tl/3_tl_reader.js +0 -49
- package/esm/tl/3_utilities.d.ts +0 -34
- package/esm/tl/3_utilities.d.ts.map +0 -1
- package/esm/tl/3_utilities.js +0 -89
- package/esm/tl/4_rpc_result.d.ts +0 -27
- package/esm/tl/4_rpc_result.d.ts.map +0 -1
- package/esm/tl/4_rpc_result.js +0 -28
- package/esm/tl/4_tl_writer.d.ts +0 -25
- package/esm/tl/4_tl_writer.d.ts.map +0 -1
- package/esm/tl/4_tl_writer.js +0 -45
- package/esm/tl/5_message.d.ts +0 -39
- package/esm/tl/5_message.d.ts.map +0 -1
- package/esm/tl/5_message.js +0 -98
- package/esm/transport/2_transport_provider.d.ts +0 -35
- package/esm/transport/2_transport_provider.d.ts.map +0 -1
- package/esm/transport/2_transport_provider.js +0 -81
- package/esm/transport/3_transport_provider_tcp.d.ts +0 -25
- package/esm/transport/3_transport_provider_tcp.d.ts.map +0 -1
- package/esm/transport/3_transport_provider_tcp.js +0 -29
- package/esm/transport/3_transport_provider_web_socket.d.ts +0 -24
- package/esm/transport/3_transport_provider_web_socket.d.ts.map +0 -1
- package/esm/transport/3_transport_provider_web_socket.js +0 -43
- package/esm/types/0_link_preview.d.ts +0 -35
- package/esm/types/0_link_preview.d.ts.map +0 -1
- package/esm/types/0_link_preview.js +0 -28
- package/esm/types/0_message_entity.d.ts +0 -139
- package/esm/types/0_message_entity.d.ts.map +0 -1
- package/esm/types/0_message_entity.js +0 -183
- package/esm/types/0_mini_app_info.d.ts +0 -26
- package/esm/types/0_mini_app_info.d.ts.map +0 -1
- package/esm/types/0_mini_app_info.js +0 -22
- package/esm/types/0_opening_hours.d.ts +0 -26
- package/esm/types/0_opening_hours.d.ts.map +0 -1
- package/esm/types/0_opening_hours.js +0 -25
- package/esm/types/1_input_media.d.ts +0 -122
- package/esm/types/1_input_media.d.ts.map +0 -1
- package/esm/types/1_input_media.js +0 -20
- package/esm/types/1_message_content.d.ts +0 -119
- package/esm/types/1_message_content.d.ts.map +0 -1
- package/esm/types/1_message_content.js +0 -20
- package/esm/types/1_poll_option.d.ts +0 -32
- package/esm/types/1_poll_option.d.ts.map +0 -1
- package/esm/types/1_poll_option.js +0 -27
- package/esm/types/1_reply_quote.d.ts +0 -32
- package/esm/types/1_reply_quote.d.ts.map +0 -1
- package/esm/types/1_reply_quote.js +0 -30
- package/esm/types/1_story_privacy.d.ts +0 -46
- package/esm/types/1_story_privacy.d.ts.map +0 -1
- package/esm/types/1_story_privacy.js +0 -76
- package/esm/types/1_user.d.ts +0 -56
- package/esm/types/1_user.d.ts.map +0 -1
- package/esm/types/1_user.js +0 -47
- package/esm/types/2_business_connection.d.ts +0 -37
- package/esm/types/2_business_connection.d.ts.map +0 -1
- package/esm/types/2_business_connection.js +0 -30
- package/esm/types/2_chosen_inline_result.d.ts +0 -38
- package/esm/types/2_chosen_inline_result.d.ts.map +0 -1
- package/esm/types/2_chosen_inline_result.js +0 -37
- package/esm/types/2_forward_header.d.ts +0 -40
- package/esm/types/2_forward_header.d.ts.map +0 -1
- package/esm/types/2_forward_header.js +0 -55
- package/esm/types/2_game.d.ts +0 -40
- package/esm/types/2_game.d.ts.map +0 -1
- package/esm/types/2_game.js +0 -44
- package/esm/types/2_inline_keyboard_button.d.ts +0 -138
- package/esm/types/2_inline_keyboard_button.d.ts.map +0 -1
- package/esm/types/2_inline_keyboard_button.js +0 -117
- package/esm/types/2_inline_query.d.ts +0 -40
- package/esm/types/2_inline_query.d.ts.map +0 -1
- package/esm/types/2_inline_query.js +0 -60
- package/esm/types/2_invite_link.d.ts +0 -47
- package/esm/types/2_invite_link.d.ts.map +0 -1
- package/esm/types/2_invite_link.js +0 -48
- package/esm/types/2_message_reactions.d.ts +0 -43
- package/esm/types/2_message_reactions.d.ts.map +0 -1
- package/esm/types/2_message_reactions.js +0 -56
- package/esm/types/2_poll.d.ts +0 -55
- package/esm/types/2_poll.d.ts.map +0 -1
- package/esm/types/2_poll.js +0 -43
- package/esm/types/2_pre_checkout_query.d.ts +0 -34
- package/esm/types/2_pre_checkout_query.d.ts.map +0 -1
- package/esm/types/2_pre_checkout_query.js +0 -39
- package/esm/types/2_reply_to.d.ts +0 -35
- package/esm/types/2_reply_to.d.ts.map +0 -1
- package/esm/types/2_reply_to.js +0 -20
- package/esm/types/3_chat_member_updated.d.ts +0 -44
- package/esm/types/3_chat_member_updated.d.ts.map +0 -1
- package/esm/types/3_chat_member_updated.js +0 -53
- package/esm/types/3_join_request.d.ts +0 -39
- package/esm/types/3_join_request.d.ts.map +0 -1
- package/esm/types/3_join_request.js +0 -45
- package/esm/types/3_reply_markup.d.ts +0 -71
- package/esm/types/3_reply_markup.d.ts.map +0 -1
- package/esm/types/3_reply_markup.js +0 -127
- package/esm/types/4_inline_query_result.d.ts +0 -251
- package/esm/types/4_inline_query_result.d.ts.map +0 -1
- package/esm/types/4_inline_query_result.js +0 -380
- package/esm/types/4_message.d.ts +0 -615
- package/esm/types/4_message.d.ts.map +0 -1
- package/esm/types/4_message.js +0 -533
- package/esm/types/5_callback_query.d.ts +0 -43
- package/esm/types/5_callback_query.d.ts.map +0 -1
- package/esm/types/5_callback_query.js +0 -60
- package/esm/types/5_chat_list_item.d.ts +0 -36
- package/esm/types/5_chat_list_item.d.ts.map +0 -1
- package/esm/types/5_chat_list_item.js +0 -86
- package/esm/types/5_inline_query_answer.d.ts +0 -32
- package/esm/types/5_inline_query_answer.d.ts.map +0 -1
- package/esm/types/5_inline_query_answer.js +0 -28
- package/esm/types/6_update.d.ts +0 -388
- package/esm/types/6_update.d.ts.map +0 -1
- package/esm/types/6_update.js +0 -20
- package/esm/utilities/0_bigint.d.ts +0 -29
- package/esm/utilities/0_bigint.d.ts.map +0 -1
- package/esm/utilities/0_bigint.js +0 -90
- package/esm/utilities/0_buffer.d.ts +0 -21
- package/esm/utilities/0_buffer.d.ts.map +0 -1
- package/esm/utilities/0_buffer.js +0 -51
- package/esm/utilities/0_cache_map.d.ts +0 -26
- package/esm/utilities/0_cache_map.d.ts.map +0 -1
- package/esm/utilities/0_cache_map.js +0 -52
- package/esm/utilities/0_crypto.d.ts +0 -27
- package/esm/utilities/0_crypto.d.ts.map +0 -1
- package/esm/utilities/0_crypto.js +0 -48
- package/esm/utilities/0_gunzip.d.ts +0 -2
- package/esm/utilities/0_gunzip.d.ts.map +0 -1
- package/esm/utilities/0_gunzip.js +0 -17
- package/esm/utilities/1_misc.d.ts +0 -29
- package/esm/utilities/1_misc.d.ts.map +0 -1
- package/esm/utilities/1_misc.js +0 -72
- package/script/client/0_filters.d.ts +0 -58
- package/script/client/0_filters.d.ts.map +0 -1
- package/script/client/0_filters.js +0 -52
- package/script/client/0_message.d.ts +0 -29
- package/script/client/0_message.d.ts.map +0 -1
- package/script/client/0_message.js +0 -90
- package/script/client/1_client_encrypted.d.ts +0 -52
- package/script/client/1_client_encrypted.d.ts.map +0 -1
- package/script/client/1_client_encrypted.js +0 -343
- package/script/client/1_composer.d.ts +0 -51
- package/script/client/1_composer.d.ts.map +0 -1
- package/script/client/1_composer.js +0 -175
- package/script/client/5_client.d.ts +0 -1372
- package/script/client/5_client.d.ts.map +0 -1
- package/script/client/5_client.js +0 -2863
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts +0 -55
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.js +0 -182
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.d.ts +0 -3
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.d.ts.map +0 -1
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.js +0 -310
- package/script/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/almost_equals.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/array_includes.js +0 -49
- package/script/deps/jsr.io/@std/assert/1.0.8/assert.d.ts +0 -16
- package/script/deps/jsr.io/@std/assert/1.0.8/assert.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/assert.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.8/equal.d.ts +0 -17
- package/script/deps/jsr.io/@std/assert/1.0.8/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/equal.js +0 -209
- package/script/deps/jsr.io/@std/assert/1.0.8/equals.d.ts +0 -22
- package/script/deps/jsr.io/@std/assert/1.0.8/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/equals.js +0 -48
- package/script/deps/jsr.io/@std/assert/1.0.8/exists.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.8/exists.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/exists.js +0 -30
- package/script/deps/jsr.io/@std/assert/1.0.8/fail.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.8/fail.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/fail.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.8/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.8/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.8/greater.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.8/greater.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/greater.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/instance_of.js +0 -55
- package/script/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/is_error.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.8/less.d.ts +0 -19
- package/script/deps/jsr.io/@std/assert/1.0.8/less.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/less.js +0 -31
- package/script/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.8/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.8/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.8/mod.d.ts +0 -44
- package/script/deps/jsr.io/@std/assert/1.0.8/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/mod.js +0 -61
- package/script/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts +0 -21
- package/script/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/not_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts +0 -28
- package/script/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/object_match.js +0 -162
- package/script/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts +0 -42
- package/script/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/rejects.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/string_includes.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.8/throws.d.ts +0 -45
- package/script/deps/jsr.io/@std/assert/1.0.8/throws.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/throws.js +0 -47
- package/script/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/unimplemented.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.8/unreachable.js +0 -23
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts +0 -19
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.js +0 -35
- package/script/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.d.ts +0 -2
- package/script/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.js +0 -29
- package/script/deps/jsr.io/@std/encoding/1.0.5/base64.d.ts +0 -38
- package/script/deps/jsr.io/@std/encoding/1.0.5/base64.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.5/base64.js +0 -167
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -115
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -283
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -185
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +0 -63
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -242
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/deps/jsr.io/@std/io/0.225.0/_constants.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/io/0.225.0/_constants.js +0 -7
- package/script/deps/jsr.io/@std/io/0.225.0/iterate_reader.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/io/0.225.0/iterate_reader.js +0 -100
- package/script/deps/jsr.io/@std/io/0.225.0/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/io/0.225.0/types.js +0 -18
- package/script/deps/jsr.io/@std/path/1.0.8/_common/assert_path.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/assert_path.js +0 -10
- package/script/deps/jsr.io/@std/path/1.0.8/_common/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/basename.js +0 -45
- package/script/deps/jsr.io/@std/path/1.0.8/_common/constants.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/constants.js +0 -49
- package/script/deps/jsr.io/@std/path/1.0.8/_common/normalize.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/normalize.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/normalize_string.js +0 -80
- package/script/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/strip_trailing_separators.js +0 -22
- package/script/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_common/to_file_url.js +0 -18
- package/script/deps/jsr.io/@std/path/1.0.8/_os.d.ts +0 -2
- package/script/deps/jsr.io/@std/path/1.0.8/_os.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/_os.js +0 -35
- package/script/deps/jsr.io/@std/path/1.0.8/basename.d.ts +0 -28
- package/script/deps/jsr.io/@std/path/1.0.8/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/basename.js +0 -39
- package/script/deps/jsr.io/@std/path/1.0.8/extname.d.ts +0 -23
- package/script/deps/jsr.io/@std/path/1.0.8/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/extname.js +0 -32
- package/script/deps/jsr.io/@std/path/1.0.8/is_absolute.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/is_absolute.js +0 -31
- package/script/deps/jsr.io/@std/path/1.0.8/join.d.ts +0 -23
- package/script/deps/jsr.io/@std/path/1.0.8/join.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/join.js +0 -32
- package/script/deps/jsr.io/@std/path/1.0.8/posix/_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/_util.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts +0 -40
- package/script/deps/jsr.io/@std/path/1.0.8/posix/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/basename.js +0 -52
- package/script/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts +0 -37
- package/script/deps/jsr.io/@std/path/1.0.8/posix/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/extname.js +0 -92
- package/script/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/is_absolute.js +0 -26
- package/script/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts +0 -33
- package/script/deps/jsr.io/@std/path/1.0.8/posix/join.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/join.js +0 -45
- package/script/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts +0 -40
- package/script/deps/jsr.io/@std/path/1.0.8/posix/normalize.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/normalize.js +0 -60
- package/script/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/posix/to_file_url.js +0 -30
- package/script/deps/jsr.io/@std/path/1.0.8/to_file_url.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/to_file_url.js +0 -31
- package/script/deps/jsr.io/@std/path/1.0.8/windows/_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/_util.js +0 -20
- package/script/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts +0 -23
- package/script/deps/jsr.io/@std/path/1.0.8/windows/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/basename.js +0 -47
- package/script/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts +0 -20
- package/script/deps/jsr.io/@std/path/1.0.8/windows/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/extname.js +0 -84
- package/script/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/is_absolute.js +0 -41
- package/script/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts +0 -20
- package/script/deps/jsr.io/@std/path/1.0.8/windows/join.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/join.js +0 -77
- package/script/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts +0 -22
- package/script/deps/jsr.io/@std/path/1.0.8/windows/normalize.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/normalize.js +0 -137
- package/script/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.0.8/windows/to_file_url.js +0 -37
- package/script/deps/jsr.io/@std/streams/1.0.8/to_array_buffer.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/streams/1.0.8/to_array_buffer.js +0 -38
- package/script/tl/0_api.d.ts +0 -15839
- package/script/tl/0_api.d.ts.map +0 -1
- package/script/tl/0_api.js +0 -24772
- package/script/tl/0_tl_raw_reader.d.ts +0 -36
- package/script/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.js +0 -92
- package/script/tl/0_tl_raw_writer.d.ts +0 -34
- package/script/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.js +0 -90
- package/script/tl/2_deserialize.d.ts +0 -23
- package/script/tl/2_deserialize.d.ts.map +0 -1
- package/script/tl/2_deserialize.js +0 -98
- package/script/tl/2_serialize.d.ts +0 -22
- package/script/tl/2_serialize.d.ts.map +0 -1
- package/script/tl/2_serialize.js +0 -163
- package/script/tl/3_tl_reader.d.ts +0 -26
- package/script/tl/3_tl_reader.d.ts.map +0 -1
- package/script/tl/3_tl_reader.js +0 -53
- package/script/tl/3_utilities.d.ts +0 -34
- package/script/tl/3_utilities.d.ts.map +0 -1
- package/script/tl/3_utilities.js +0 -97
- package/script/tl/4_rpc_result.d.ts +0 -27
- package/script/tl/4_rpc_result.d.ts.map +0 -1
- package/script/tl/4_rpc_result.js +0 -32
- package/script/tl/4_tl_writer.d.ts +0 -25
- package/script/tl/4_tl_writer.d.ts.map +0 -1
- package/script/tl/4_tl_writer.js +0 -49
- package/script/tl/5_message.d.ts +0 -39
- package/script/tl/5_message.d.ts.map +0 -1
- package/script/tl/5_message.js +0 -106
- package/script/transport/2_transport_provider.d.ts +0 -35
- package/script/transport/2_transport_provider.d.ts.map +0 -1
- package/script/transport/2_transport_provider.js +0 -86
- package/script/transport/3_transport_provider_tcp.d.ts +0 -25
- package/script/transport/3_transport_provider_tcp.d.ts.map +0 -1
- package/script/transport/3_transport_provider_tcp.js +0 -32
- package/script/transport/3_transport_provider_web_socket.d.ts +0 -24
- package/script/transport/3_transport_provider_web_socket.d.ts.map +0 -1
- package/script/transport/3_transport_provider_web_socket.js +0 -47
- package/script/types/0_link_preview.d.ts +0 -35
- package/script/types/0_link_preview.d.ts.map +0 -1
- package/script/types/0_link_preview.js +0 -31
- package/script/types/0_message_entity.d.ts +0 -139
- package/script/types/0_message_entity.d.ts.map +0 -1
- package/script/types/0_message_entity.js +0 -188
- package/script/types/0_mini_app_info.d.ts +0 -26
- package/script/types/0_mini_app_info.d.ts.map +0 -1
- package/script/types/0_mini_app_info.js +0 -25
- package/script/types/0_opening_hours.d.ts +0 -26
- package/script/types/0_opening_hours.d.ts.map +0 -1
- package/script/types/0_opening_hours.js +0 -28
- package/script/types/1_input_media.d.ts +0 -122
- package/script/types/1_input_media.d.ts.map +0 -1
- package/script/types/1_input_media.js +0 -21
- package/script/types/1_message_content.d.ts +0 -119
- package/script/types/1_message_content.d.ts.map +0 -1
- package/script/types/1_message_content.js +0 -21
- package/script/types/1_poll_option.d.ts +0 -32
- package/script/types/1_poll_option.d.ts.map +0 -1
- package/script/types/1_poll_option.js +0 -30
- package/script/types/1_reply_quote.d.ts +0 -32
- package/script/types/1_reply_quote.d.ts.map +0 -1
- package/script/types/1_reply_quote.js +0 -33
- package/script/types/1_story_privacy.d.ts +0 -46
- package/script/types/1_story_privacy.d.ts.map +0 -1
- package/script/types/1_story_privacy.js +0 -80
- package/script/types/1_user.d.ts +0 -56
- package/script/types/1_user.d.ts.map +0 -1
- package/script/types/1_user.js +0 -50
- package/script/types/2_business_connection.d.ts +0 -37
- package/script/types/2_business_connection.d.ts.map +0 -1
- package/script/types/2_business_connection.js +0 -33
- package/script/types/2_chosen_inline_result.d.ts +0 -38
- package/script/types/2_chosen_inline_result.d.ts.map +0 -1
- package/script/types/2_chosen_inline_result.js +0 -40
- package/script/types/2_forward_header.d.ts +0 -40
- package/script/types/2_forward_header.d.ts.map +0 -1
- package/script/types/2_forward_header.js +0 -58
- package/script/types/2_game.d.ts +0 -40
- package/script/types/2_game.d.ts.map +0 -1
- package/script/types/2_game.js +0 -47
- package/script/types/2_inline_keyboard_button.d.ts +0 -138
- package/script/types/2_inline_keyboard_button.d.ts.map +0 -1
- package/script/types/2_inline_keyboard_button.js +0 -121
- package/script/types/2_inline_query.d.ts +0 -40
- package/script/types/2_inline_query.d.ts.map +0 -1
- package/script/types/2_inline_query.js +0 -63
- package/script/types/2_invite_link.d.ts +0 -47
- package/script/types/2_invite_link.d.ts.map +0 -1
- package/script/types/2_invite_link.js +0 -51
- package/script/types/2_message_reactions.d.ts +0 -43
- package/script/types/2_message_reactions.d.ts.map +0 -1
- package/script/types/2_message_reactions.js +0 -59
- package/script/types/2_poll.d.ts +0 -55
- package/script/types/2_poll.d.ts.map +0 -1
- package/script/types/2_poll.js +0 -46
- package/script/types/2_pre_checkout_query.d.ts +0 -34
- package/script/types/2_pre_checkout_query.d.ts.map +0 -1
- package/script/types/2_pre_checkout_query.js +0 -42
- package/script/types/2_reply_to.d.ts +0 -35
- package/script/types/2_reply_to.d.ts.map +0 -1
- package/script/types/2_reply_to.js +0 -21
- package/script/types/3_chat_member_updated.d.ts +0 -44
- package/script/types/3_chat_member_updated.d.ts.map +0 -1
- package/script/types/3_chat_member_updated.js +0 -56
- package/script/types/3_join_request.d.ts +0 -39
- package/script/types/3_join_request.d.ts.map +0 -1
- package/script/types/3_join_request.js +0 -48
- package/script/types/3_reply_markup.d.ts +0 -71
- package/script/types/3_reply_markup.d.ts.map +0 -1
- package/script/types/3_reply_markup.js +0 -131
- package/script/types/4_inline_query_result.d.ts +0 -251
- package/script/types/4_inline_query_result.d.ts.map +0 -1
- package/script/types/4_inline_query_result.js +0 -384
- package/script/types/4_message.d.ts +0 -615
- package/script/types/4_message.d.ts.map +0 -1
- package/script/types/4_message.js +0 -537
- package/script/types/5_callback_query.d.ts +0 -43
- package/script/types/5_callback_query.d.ts.map +0 -1
- package/script/types/5_callback_query.js +0 -64
- package/script/types/5_chat_list_item.d.ts +0 -36
- package/script/types/5_chat_list_item.d.ts.map +0 -1
- package/script/types/5_chat_list_item.js +0 -93
- package/script/types/5_inline_query_answer.d.ts +0 -32
- package/script/types/5_inline_query_answer.d.ts.map +0 -1
- package/script/types/5_inline_query_answer.js +0 -31
- package/script/types/6_update.d.ts +0 -388
- package/script/types/6_update.d.ts.map +0 -1
- package/script/types/6_update.js +0 -21
- package/script/utilities/0_bigint.d.ts +0 -29
- package/script/utilities/0_bigint.d.ts.map +0 -1
- package/script/utilities/0_bigint.js +0 -98
- package/script/utilities/0_buffer.d.ts +0 -21
- package/script/utilities/0_buffer.d.ts.map +0 -1
- package/script/utilities/0_buffer.js +0 -54
- package/script/utilities/0_cache_map.d.ts +0 -26
- package/script/utilities/0_cache_map.d.ts.map +0 -1
- package/script/utilities/0_cache_map.js +0 -56
- package/script/utilities/0_crypto.d.ts +0 -27
- package/script/utilities/0_crypto.d.ts.map +0 -1
- package/script/utilities/0_crypto.js +0 -52
- package/script/utilities/0_gunzip.d.ts +0 -2
- package/script/utilities/0_gunzip.d.ts.map +0 -1
- package/script/utilities/0_gunzip.js +0 -20
- package/script/utilities/1_misc.d.ts +0 -29
- package/script/utilities/1_misc.d.ts.map +0 -1
- package/script/utilities/1_misc.js +0 -82
- /package/esm/deps/jsr.io/@std/assert/{1.0.8 → 1.0.19}/assertion_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.8 → 1.0.19}/unreachable.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/_constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/iterate_reader.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/assert_path.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.0.8 → 1.0.17}/to_array_buffer.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.8 → 1.0.19}/assertion_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.8 → 1.0.19}/unreachable.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.5 → 1.0.12}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/_constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/iterate_reader.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.225.0 → 0.225.3}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/assert_path.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/normalize_string.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/_common/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/posix/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.0.8 → 1.1.4}/windows/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.0.8 → 1.0.17}/to_array_buffer.d.ts +0 -0
|
@@ -0,0 +1,3409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { delay, MINUTE, SECOND, unreachable } from "../0_deps.js";
|
|
21
|
+
import { AccessError, ConnectionError, InputError } from "../0_errors.js";
|
|
22
|
+
import { drop, getLogger, Mutex, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
23
|
+
import { StorageMemory } from "../2_storage.js";
|
|
24
|
+
import { Api, Mtproto } from "../2_tl.js";
|
|
25
|
+
import { getDcId } from "../3_transport.js";
|
|
26
|
+
import { constructChatP, constructUser2 } from "../3_types.js";
|
|
27
|
+
import { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, MAX_CHANNEL_ID, MAX_CHAT_ID, SYSTEM_LANG_CODE, SYSTEM_VERSION, USERNAME_TTL } from "../4_constants.js";
|
|
28
|
+
import { AuthKeyUnregistered, FloodWait, Migrate, SessionRevoked } from "../4_errors.js";
|
|
29
|
+
import { peerToChatId } from "../tl/2_telegram.js";
|
|
30
|
+
import { AbortableLoop } from "./0_abortable_loop.js";
|
|
31
|
+
import { StorageOperations } from "./0_storage_operations.js";
|
|
32
|
+
import { canBeInputChannel, canBeInputUser, DOWNLOAD_POOL_SIZE, getUsername, toInputChannel, toInputUser } from "./0_utilities.js";
|
|
33
|
+
import { skipInvoke } from "./1_invoke_middleware.js";
|
|
34
|
+
import { AccountManager } from "./2_account_manager.js";
|
|
35
|
+
import { BotInfoManager } from "./2_bot_info_manager.js";
|
|
36
|
+
import { BusinessConnectionManager } from "./2_business_connection_manager.js";
|
|
37
|
+
import { ClientEncrypted } from "./2_client_encrypted.js";
|
|
38
|
+
import { FileManager } from "./2_file_manager.js";
|
|
39
|
+
import { NetworkStatisticsManager } from "./2_network_statistics_manager.js";
|
|
40
|
+
import { PaymentManager } from "./2_payment_manager.js";
|
|
41
|
+
import { ReactionManager } from "./2_reaction_manager.js";
|
|
42
|
+
import { signIn } from "./2_sign_in.js";
|
|
43
|
+
import { TranslationsManager } from "./2_translations_manager.js";
|
|
44
|
+
import { UpdateManager } from "./2_update_manager.js";
|
|
45
|
+
import { ClientEncryptedPool } from "./3_client_encrypted_pool.js";
|
|
46
|
+
import { MessageManager } from "./3_message_manager.js";
|
|
47
|
+
import { VideoChatManager } from "./3_video_chat_manager.js";
|
|
48
|
+
import { CallbackQueryManager } from "./4_callback_query_manager.js";
|
|
49
|
+
import { ChatListManager } from "./4_chat_list_manager.js";
|
|
50
|
+
import { ChatManager } from "./4_chat_manager.js";
|
|
51
|
+
import { ChecklistManager } from "./4_checklist_manager.js";
|
|
52
|
+
import { ForumManager } from "./4_forum_manager.js";
|
|
53
|
+
import { GiftManager } from "./4_gift_manager.js";
|
|
54
|
+
import { InlineQueryManager } from "./4_inline_query_manager.js";
|
|
55
|
+
import { LinkPreviewManager } from "./4_link_preview_manager.js";
|
|
56
|
+
import { PollManager } from "./4_poll_manager.js";
|
|
57
|
+
import { StoryManager } from "./4_story_manager.js";
|
|
58
|
+
import { Composer } from "./5_composer.js";
|
|
59
|
+
export { restartAuth } from "./2_sign_in.js";
|
|
60
|
+
export const handleMigrationError = Symbol("handleMigrationError");
|
|
61
|
+
// global Client ID counter for logs
|
|
62
|
+
let id = 0;
|
|
63
|
+
const getPeer = Symbol();
|
|
64
|
+
const mustGetPeer = Symbol();
|
|
65
|
+
/**
|
|
66
|
+
* An MTKruto client.
|
|
67
|
+
*/
|
|
68
|
+
export class Client extends Composer {
|
|
69
|
+
#clients = new Array();
|
|
70
|
+
#downloadPools = {};
|
|
71
|
+
#uploadPools = {};
|
|
72
|
+
#guaranteeUpdateDelivery;
|
|
73
|
+
// 2_
|
|
74
|
+
#accountManager;
|
|
75
|
+
#botInfoManager;
|
|
76
|
+
#businessConnectionManager;
|
|
77
|
+
#fileManager;
|
|
78
|
+
#networkStatisticsManager;
|
|
79
|
+
#paymentManager;
|
|
80
|
+
#reactionManager;
|
|
81
|
+
#translationsManager;
|
|
82
|
+
#updateManager;
|
|
83
|
+
// 3_
|
|
84
|
+
#messageManager;
|
|
85
|
+
#videoChatManager;
|
|
86
|
+
// 4_
|
|
87
|
+
#callbackQueryManager;
|
|
88
|
+
#chatListManager;
|
|
89
|
+
#chatManager;
|
|
90
|
+
#checklistManager;
|
|
91
|
+
#forumManager;
|
|
92
|
+
#giftManager;
|
|
93
|
+
#inlineQueryManager;
|
|
94
|
+
#linkPreviewManager;
|
|
95
|
+
#pollManager;
|
|
96
|
+
#storyManager;
|
|
97
|
+
// deno-lint-ignore no-explicit-any
|
|
98
|
+
#managers;
|
|
99
|
+
// deno-lint-ignore no-explicit-any
|
|
100
|
+
get managers() {
|
|
101
|
+
return this.#managers ?? (this.#managers ??= {
|
|
102
|
+
// 2_
|
|
103
|
+
accountManager: this.#accountManager,
|
|
104
|
+
botInfoManager: this.#botInfoManager,
|
|
105
|
+
businessConnectionManager: this.#businessConnectionManager,
|
|
106
|
+
fileManager: this.#fileManager,
|
|
107
|
+
networkStatisticsManager: this.#networkStatisticsManager,
|
|
108
|
+
paymentManager: this.#paymentManager,
|
|
109
|
+
reactionManager: this.#reactionManager,
|
|
110
|
+
translationsManager: this.#translationsManager,
|
|
111
|
+
updateManager: this.#updateManager,
|
|
112
|
+
// 3_
|
|
113
|
+
messageManager: this.#messageManager,
|
|
114
|
+
videoChatManager: this.#videoChatManager,
|
|
115
|
+
// 4_
|
|
116
|
+
callbackQueryManager: this.#callbackQueryManager,
|
|
117
|
+
chatListManager: this.#chatListManager,
|
|
118
|
+
chatManager: this.#chatManager,
|
|
119
|
+
checklistManager: this.#checklistManager,
|
|
120
|
+
forumManager: this.#forumManager,
|
|
121
|
+
giftManager: this.#giftManager,
|
|
122
|
+
inlineQueryManager: this.#inlineQueryManager,
|
|
123
|
+
linkPreviewManager: this.#linkPreviewManager,
|
|
124
|
+
pollManager: this.#pollManager,
|
|
125
|
+
storyManager: this.#storyManager,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
#storage_;
|
|
129
|
+
#messageStorage_;
|
|
130
|
+
storage;
|
|
131
|
+
messageStorage;
|
|
132
|
+
#parseMode;
|
|
133
|
+
#apiId;
|
|
134
|
+
#apiHash;
|
|
135
|
+
#transportProvider;
|
|
136
|
+
appVersion;
|
|
137
|
+
deviceModel;
|
|
138
|
+
language;
|
|
139
|
+
platform;
|
|
140
|
+
systemLangCode;
|
|
141
|
+
systemVersion;
|
|
142
|
+
#publicKeys;
|
|
143
|
+
#outgoingMessages;
|
|
144
|
+
#persistCache;
|
|
145
|
+
#disableUpdates;
|
|
146
|
+
#authString;
|
|
147
|
+
#initialDc;
|
|
148
|
+
#L;
|
|
149
|
+
#LsignIn;
|
|
150
|
+
#LupdateGapRecoveryLoop;
|
|
151
|
+
#LstorageWriteLoop;
|
|
152
|
+
#LhandleMigrationError;
|
|
153
|
+
#Lmin;
|
|
154
|
+
/**
|
|
155
|
+
* Constructs the client.
|
|
156
|
+
*/
|
|
157
|
+
constructor(params) {
|
|
158
|
+
super();
|
|
159
|
+
this.#apiId = params?.apiId ?? 0;
|
|
160
|
+
this.#apiHash = params?.apiHash ?? "";
|
|
161
|
+
this.#transportProvider = params?.transportProvider;
|
|
162
|
+
this.#initialDc = params?.initialDc ?? INITIAL_DC;
|
|
163
|
+
this.#storage_ = params?.storage || new StorageMemory();
|
|
164
|
+
this.#persistCache = params?.persistCache ?? false;
|
|
165
|
+
if (!this.#persistCache) {
|
|
166
|
+
this.#messageStorage_ = new StorageMemory();
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.#messageStorage_ = this.#storage_;
|
|
170
|
+
}
|
|
171
|
+
this.storage = new StorageOperations(this.#storage_);
|
|
172
|
+
this.messageStorage = new StorageOperations(this.#messageStorage_);
|
|
173
|
+
this.#parseMode = params?.parseMode ?? null;
|
|
174
|
+
this.#disableUpdates = params?.disableUpdates ?? false;
|
|
175
|
+
this.#authString = params?.authString;
|
|
176
|
+
this.appVersion = params?.appVersion ?? APP_VERSION;
|
|
177
|
+
this.deviceModel = params?.deviceModel ?? DEVICE_MODEL;
|
|
178
|
+
this.language = params?.language ?? LANG_CODE;
|
|
179
|
+
this.platform = params?.platform ?? LANG_PACK;
|
|
180
|
+
this.systemLangCode = params?.systemLangCode ?? SYSTEM_LANG_CODE;
|
|
181
|
+
this.systemVersion = params?.systemVersion ?? SYSTEM_VERSION;
|
|
182
|
+
this.#publicKeys = params?.publicKeys;
|
|
183
|
+
this.#outgoingMessages = params?.outgoingMessages ?? false;
|
|
184
|
+
this.#guaranteeUpdateDelivery = params?.guaranteeUpdateDelivery ?? false;
|
|
185
|
+
const L = this.#L = getLogger("Client").client(id++);
|
|
186
|
+
this.#LsignIn = L.branch("signIn");
|
|
187
|
+
this.#LupdateGapRecoveryLoop = L.branch("updateGapRecoveryLoop");
|
|
188
|
+
this.#LstorageWriteLoop = L.branch("storageWriteLoop");
|
|
189
|
+
this.#LhandleMigrationError = L.branch("[handleMigrationError]");
|
|
190
|
+
this.#Lmin = L.branch("min");
|
|
191
|
+
const c = {
|
|
192
|
+
id,
|
|
193
|
+
getUploadPoolSize: this.#getUploadPoolSize.bind(this),
|
|
194
|
+
invoke: async (function_, params) => {
|
|
195
|
+
if (params?.businessConnectionId) {
|
|
196
|
+
if (Mtproto.is("ping", function_)) {
|
|
197
|
+
unreachable();
|
|
198
|
+
}
|
|
199
|
+
return await this.invoke({ _: "invokeWithBusinessConnection", connection_id: params.businessConnectionId, query: function_ }, params);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
return await this.invoke(function_, params);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
storage: this.storage,
|
|
206
|
+
messageStorage: this.messageStorage,
|
|
207
|
+
guaranteeUpdateDelivery: this.#guaranteeUpdateDelivery,
|
|
208
|
+
setConnectionState: this.#propagateConnectionState.bind(this),
|
|
209
|
+
resetConnectionState: () => this.#stateChangeHandler(this.isConnected),
|
|
210
|
+
getSelfId: this.#getSelfId.bind(this),
|
|
211
|
+
getIsPremium: this.#getIsPremium.bind(this),
|
|
212
|
+
getInputPeer: this.getInputPeer.bind(this),
|
|
213
|
+
getInputChannel: this.getInputChannel.bind(this),
|
|
214
|
+
getInputUser: this.getInputUser.bind(this),
|
|
215
|
+
getInputPeerChatId: this.#getInputPeerChatId.bind(this),
|
|
216
|
+
getPeer: this[mustGetPeer].bind(this),
|
|
217
|
+
handleUpdate: this.#queueHandleCtxUpdate.bind(this),
|
|
218
|
+
parseMode: this.#parseMode,
|
|
219
|
+
outgoingMessages: this.#outgoingMessages,
|
|
220
|
+
dropPendingUpdates: params?.dropPendingUpdates,
|
|
221
|
+
isDisconnected: () => this.isDisconnected,
|
|
222
|
+
langPack: this.platform,
|
|
223
|
+
langCode: this.language,
|
|
224
|
+
};
|
|
225
|
+
// 2_
|
|
226
|
+
this.#accountManager = new AccountManager(c);
|
|
227
|
+
this.#botInfoManager = new BotInfoManager(c);
|
|
228
|
+
this.#businessConnectionManager = new BusinessConnectionManager(c);
|
|
229
|
+
const fileManager = this.#fileManager = new FileManager(c);
|
|
230
|
+
this.#networkStatisticsManager = new NetworkStatisticsManager(c);
|
|
231
|
+
this.#paymentManager = new PaymentManager(c);
|
|
232
|
+
this.#reactionManager = new ReactionManager(c);
|
|
233
|
+
this.#translationsManager = new TranslationsManager(c);
|
|
234
|
+
this.#updateManager = new UpdateManager(c);
|
|
235
|
+
// 3_
|
|
236
|
+
const messageManager = this.#messageManager = new MessageManager({ ...c, fileManager });
|
|
237
|
+
this.#videoChatManager = new VideoChatManager({ ...c, fileManager });
|
|
238
|
+
// 4_
|
|
239
|
+
this.#callbackQueryManager = new CallbackQueryManager({ ...c, messageManager });
|
|
240
|
+
this.#chatListManager = new ChatListManager({ ...c, fileManager, messageManager });
|
|
241
|
+
this.#chatManager = new ChatManager({ ...c, fileManager, messageManager });
|
|
242
|
+
this.#checklistManager = new ChecklistManager({ ...c, messageManager });
|
|
243
|
+
this.#forumManager = new ForumManager({ ...c, messageManager });
|
|
244
|
+
this.#giftManager = new GiftManager({ ...c, messageManager });
|
|
245
|
+
this.#inlineQueryManager = new InlineQueryManager({ ...c, messageManager });
|
|
246
|
+
this.#linkPreviewManager = new LinkPreviewManager({ ...c, messageManager });
|
|
247
|
+
this.#pollManager = new PollManager({ ...c, messageManager });
|
|
248
|
+
this.#storyManager = new StoryManager({ ...c, fileManager, messageManager });
|
|
249
|
+
this.#updateManager.setUpdateHandler(this.#handleUpdate.bind(this));
|
|
250
|
+
if (params?.defaultHandlers ?? true) {
|
|
251
|
+
this.invoke.use(async ({ error }, next) => {
|
|
252
|
+
if (error instanceof FloodWait && error.seconds <= 10) {
|
|
253
|
+
L.warning("sleeping for", error.seconds, "because of:", error);
|
|
254
|
+
await delay(error.seconds * SECOND);
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
return next();
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
#setMainClient(client) {
|
|
264
|
+
this.#disconnectAllClients();
|
|
265
|
+
this.#clients = [client];
|
|
266
|
+
client.handlers.onUpdate = (updates) => {
|
|
267
|
+
this.#updateManager.processUpdates(updates, true, null);
|
|
268
|
+
this.#lastUpdates = new Date();
|
|
269
|
+
};
|
|
270
|
+
client.handlers.onDeserializationError = async () => {
|
|
271
|
+
await this.#updateManager.recoverUpdateGap("deserialization error");
|
|
272
|
+
};
|
|
273
|
+
client.handlers.onNewServerSalt = async (serverSalt) => {
|
|
274
|
+
await this.storage.setServerSalt(serverSalt);
|
|
275
|
+
};
|
|
276
|
+
client.onConnectionStateChange = this.#onConnectionStateChange.bind(this);
|
|
277
|
+
}
|
|
278
|
+
#newClient(dc, main, isCdn) {
|
|
279
|
+
const client = new ClientEncrypted(dc, this.#apiId, {
|
|
280
|
+
appVersion: this.appVersion,
|
|
281
|
+
deviceModel: this.deviceModel,
|
|
282
|
+
langCode: this.language,
|
|
283
|
+
langPack: this.platform,
|
|
284
|
+
systemLangCode: this.systemLangCode,
|
|
285
|
+
systemVersion: this.systemVersion,
|
|
286
|
+
transportProvider: this.#transportProvider,
|
|
287
|
+
isCdn: isCdn,
|
|
288
|
+
disableUpdates: !main || isCdn,
|
|
289
|
+
publicKeys: this.#publicKeys,
|
|
290
|
+
});
|
|
291
|
+
client.connectionCallback = this.#networkStatisticsManager.getTransportReadWriteCallback(isCdn);
|
|
292
|
+
return client;
|
|
293
|
+
}
|
|
294
|
+
#disconnectAllClients() {
|
|
295
|
+
for (const client of this.#clients) {
|
|
296
|
+
client.disconnect();
|
|
297
|
+
}
|
|
298
|
+
for (const pool of Object.values(this.#downloadPools)) {
|
|
299
|
+
pool.disconnect();
|
|
300
|
+
}
|
|
301
|
+
for (const pool of Object.values(this.#uploadPools)) {
|
|
302
|
+
pool.disconnect();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
get #client() {
|
|
306
|
+
return this.#clients[0];
|
|
307
|
+
}
|
|
308
|
+
// direct ClientEncrypted property proxies
|
|
309
|
+
get isConnected() {
|
|
310
|
+
return this.#client?.isConnected ?? false;
|
|
311
|
+
}
|
|
312
|
+
get isDisconnected() {
|
|
313
|
+
return this.#client?.isDisconnected ?? true;
|
|
314
|
+
}
|
|
315
|
+
#propagateConnectionState(connectionState) {
|
|
316
|
+
this.#queueHandleCtxUpdate({ connectionState });
|
|
317
|
+
this.#lastPropagatedConnectionState = connectionState;
|
|
318
|
+
}
|
|
319
|
+
#lastPropagatedConnectionState = null;
|
|
320
|
+
#stateChangeHandler = ((isConnected) => {
|
|
321
|
+
const connectionState = isConnected ? "ready" : "notConnected";
|
|
322
|
+
if (this.#lastPropagatedConnectionState !== connectionState) {
|
|
323
|
+
this.#propagateConnectionState(connectionState);
|
|
324
|
+
}
|
|
325
|
+
}).bind(this);
|
|
326
|
+
#storageInited = false;
|
|
327
|
+
async #initStorage() {
|
|
328
|
+
if (!this.#storageInited) {
|
|
329
|
+
await this.storage.initialize();
|
|
330
|
+
if (!this.#guaranteeUpdateDelivery) {
|
|
331
|
+
await this.storage.deleteUpdates();
|
|
332
|
+
await this.storage.commit(true);
|
|
333
|
+
}
|
|
334
|
+
this.#storageInited = true;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
#connectMutex = new Mutex();
|
|
338
|
+
/**
|
|
339
|
+
* Loads the session if `setDc` was not called, initializes and connnects
|
|
340
|
+
* a `ClientPlain` to generate auth key if there was none, and connects the client.
|
|
341
|
+
* Before establishing the connection, the session is saved.
|
|
342
|
+
*/
|
|
343
|
+
async connect() {
|
|
344
|
+
const unlock = await this.#connectMutex.lock();
|
|
345
|
+
try {
|
|
346
|
+
if (this.isConnected) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
await this.#initStorage();
|
|
350
|
+
if (this.#authString && !this.#authStringImported) {
|
|
351
|
+
await this.importAuthString(this.#authString);
|
|
352
|
+
}
|
|
353
|
+
const auth = this.storage.auth.mustGet();
|
|
354
|
+
if (auth.authKey !== null && auth.dc !== null) {
|
|
355
|
+
if (!this.#client || this.#client.dc !== auth.dc) {
|
|
356
|
+
this.#client?.disconnect();
|
|
357
|
+
this.#setMainClient(this.#newClient(auth.dc, true, false));
|
|
358
|
+
}
|
|
359
|
+
await this.#client.setAuthKey(auth.authKey);
|
|
360
|
+
if (this.#client.serverSalt === 0n) {
|
|
361
|
+
this.#client.serverSalt = await this.storage.getServerSalt() ?? 0n;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
const dc = auth.dc ?? this.#initialDc;
|
|
366
|
+
if (!this.#client || this.#client.dc !== dc) {
|
|
367
|
+
this.#client?.disconnect();
|
|
368
|
+
this.#setMainClient(this.#newClient(dc, true, false));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
await this.#client.connect();
|
|
372
|
+
await this.storage.auth.update((v) => {
|
|
373
|
+
v.authKey = this.#client.authKey;
|
|
374
|
+
v.dc = this.#client.dc;
|
|
375
|
+
});
|
|
376
|
+
await this.storage.setServerSalt(this.#client.serverSalt);
|
|
377
|
+
this.#updateGapRecoveryLoop.start();
|
|
378
|
+
this.#clientDisconnectionLoop.start();
|
|
379
|
+
if (!this.#messageStorage_.isMemory) {
|
|
380
|
+
this.#storageWriteLoop.start();
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
this.#L.debug("not starting storageWriteLoop");
|
|
384
|
+
}
|
|
385
|
+
await this.storage.commit(true);
|
|
386
|
+
}
|
|
387
|
+
finally {
|
|
388
|
+
unlock();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
async [handleMigrationError](err) {
|
|
392
|
+
let newDc = String(err.dc);
|
|
393
|
+
if (Math.abs(getDcId(this.#client.dc, this.#client.isCdn)) >= 10_000) {
|
|
394
|
+
newDc += "-test";
|
|
395
|
+
}
|
|
396
|
+
this.disconnect();
|
|
397
|
+
await this.storage.auth.update((v) => {
|
|
398
|
+
v.authKey = null;
|
|
399
|
+
v.dc = newDc;
|
|
400
|
+
});
|
|
401
|
+
await this.connect();
|
|
402
|
+
this.#LhandleMigrationError.debug(`migrated to DC${newDc}`);
|
|
403
|
+
}
|
|
404
|
+
async disconnect() {
|
|
405
|
+
this.#disconnectAllClients();
|
|
406
|
+
this.#clientDisconnectionLoop.abort();
|
|
407
|
+
this.#updateGapRecoveryLoop.abort();
|
|
408
|
+
this.#storageWriteLoop.abort();
|
|
409
|
+
this.#updateManager.closeAllChats();
|
|
410
|
+
await this.storage.commit(true);
|
|
411
|
+
await this.messageStorage.commit(true);
|
|
412
|
+
}
|
|
413
|
+
#lastPropagatedAuthorizationState = null;
|
|
414
|
+
async #propagateAuthorizationState(authorized) {
|
|
415
|
+
if (this.#lastPropagatedAuthorizationState !== authorized) {
|
|
416
|
+
await this.#handleCtxUpdate({ authorizationState: { isAuthorized: authorized } });
|
|
417
|
+
this.#lastPropagatedAuthorizationState = authorized;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
async #getSelfId() {
|
|
421
|
+
const id = await this.storage.getAccountId();
|
|
422
|
+
if (id === null) {
|
|
423
|
+
throw new Error("Unauthorized");
|
|
424
|
+
}
|
|
425
|
+
return id;
|
|
426
|
+
}
|
|
427
|
+
async #getIsPremium() {
|
|
428
|
+
const maybeIsPremium = await this.storage.getIsPremium();
|
|
429
|
+
if (maybeIsPremium !== null) {
|
|
430
|
+
return maybeIsPremium;
|
|
431
|
+
}
|
|
432
|
+
return this.#lastGetMe?.isPremium ?? false;
|
|
433
|
+
}
|
|
434
|
+
#lastUpdates = new Date();
|
|
435
|
+
#updateGapRecoveryLoop = new AbortableLoop(async (loop, signal) => {
|
|
436
|
+
await delay(60 * SECOND, { signal });
|
|
437
|
+
if (!this.isConnected) {
|
|
438
|
+
loop.abort();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
if (Date.now() - this.#lastUpdates.getTime() >= 15 * MINUTE) {
|
|
442
|
+
drop(this.#updateManager.recoverUpdateGap("lastUpdates").then(() => {
|
|
443
|
+
this.#lastUpdates = new Date();
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
}, (loop, err) => {
|
|
447
|
+
if (!this.isConnected) {
|
|
448
|
+
loop.abort();
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
this.#LupdateGapRecoveryLoop.error(err);
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
#clientDisconnectionLoop = new AbortableLoop(async (loop, signal) => {
|
|
455
|
+
await delay(60 * SECOND, { signal });
|
|
456
|
+
if (!this.isConnected) {
|
|
457
|
+
loop.abort();
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const now = Date.now();
|
|
461
|
+
const disconnectAfter = 5 * MINUTE;
|
|
462
|
+
for (const [i, client] of this.#clients.entries()) {
|
|
463
|
+
if (i > 0 && !client.isDisconnected && client.lastRequest && now - client.lastRequest.getTime() >= disconnectAfter) {
|
|
464
|
+
client?.disconnect();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}, (loop) => {
|
|
468
|
+
if (!this.isConnected) {
|
|
469
|
+
loop.abort();
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
#storageWriteLoop = new AbortableLoop(async (_loop, signal) => {
|
|
473
|
+
await delay(5 * SECOND, { signal });
|
|
474
|
+
await this.messageStorage.commit();
|
|
475
|
+
await this.storage.commit();
|
|
476
|
+
}, (err) => {
|
|
477
|
+
this.#LstorageWriteLoop.error(err);
|
|
478
|
+
});
|
|
479
|
+
async #checkAuthorization() {
|
|
480
|
+
if (this.#lastGetMe) {
|
|
481
|
+
return this.#lastGetMe;
|
|
482
|
+
}
|
|
483
|
+
try {
|
|
484
|
+
await this.#updateManager.fetchState("#checkAuthorization");
|
|
485
|
+
const me = await this.#getMe();
|
|
486
|
+
await this.#propagateAuthorizationState(true);
|
|
487
|
+
drop(this.#updateManager.recoverUpdateGap("#checkAuthorization"));
|
|
488
|
+
return me;
|
|
489
|
+
}
|
|
490
|
+
catch (err) {
|
|
491
|
+
if (!(err instanceof AuthKeyUnregistered) && !(err instanceof SessionRevoked)) {
|
|
492
|
+
throw err;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Send a user verification code.
|
|
498
|
+
*
|
|
499
|
+
* @param phoneNumber The phone number to send the code to.
|
|
500
|
+
* @method ac
|
|
501
|
+
*/
|
|
502
|
+
async sendCode(phoneNumber) {
|
|
503
|
+
const me = await this.#checkAuthorization();
|
|
504
|
+
if (me) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
await this.#accountManager.sendCode(phoneNumber, this.#apiId, this.#apiHash);
|
|
509
|
+
}
|
|
510
|
+
catch (err) {
|
|
511
|
+
if (err instanceof Migrate) {
|
|
512
|
+
await this[handleMigrationError](err);
|
|
513
|
+
await this.#accountManager.sendCode(phoneNumber, this.#apiId, this.#apiHash);
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
throw err;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Check if a code entered by the user was the same as the verification code.
|
|
522
|
+
*
|
|
523
|
+
* @param code A code entered by the user.
|
|
524
|
+
* @method ac
|
|
525
|
+
*/
|
|
526
|
+
async checkCode(code) {
|
|
527
|
+
const result = await this.#accountManager.checkCode(code);
|
|
528
|
+
if (result.type === "signedIn") {
|
|
529
|
+
await this.storage.auth.update((v) => {
|
|
530
|
+
v.userId = result.userId;
|
|
531
|
+
v.isBot = false;
|
|
532
|
+
});
|
|
533
|
+
this.#LsignIn.debug("signed in as user");
|
|
534
|
+
await this.#propagateAuthorizationState(true);
|
|
535
|
+
await this.#updateManager.fetchState("checkCode");
|
|
536
|
+
}
|
|
537
|
+
return result;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Get the user account password's hint.
|
|
541
|
+
*
|
|
542
|
+
* @method ac
|
|
543
|
+
*/
|
|
544
|
+
async getPasswordHint() {
|
|
545
|
+
return await this.#accountManager.getPasswordHint();
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Check whether a password entered by the user is the same as the account's one.
|
|
549
|
+
*
|
|
550
|
+
* @param password The password to check
|
|
551
|
+
* @returns The result of the check.
|
|
552
|
+
* @method ac
|
|
553
|
+
*/
|
|
554
|
+
async checkPassword(password) {
|
|
555
|
+
const result = await this.#accountManager.checkPassword(password);
|
|
556
|
+
if (result.type === "signedIn") {
|
|
557
|
+
await this.storage.auth.update((v) => {
|
|
558
|
+
v.userId = result.userId;
|
|
559
|
+
v.isBot = false;
|
|
560
|
+
});
|
|
561
|
+
await this.storage.commit(true);
|
|
562
|
+
this.#LsignIn.debug("signed in as user");
|
|
563
|
+
await this.#propagateAuthorizationState(true);
|
|
564
|
+
await this.#updateManager.fetchState("checkPassword");
|
|
565
|
+
}
|
|
566
|
+
return result;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Check whether a bot token is valid.
|
|
570
|
+
*
|
|
571
|
+
* @param password The password to check
|
|
572
|
+
* @returns The result of the check.
|
|
573
|
+
* @method ac
|
|
574
|
+
*/
|
|
575
|
+
async checkBotToken(botToken) {
|
|
576
|
+
const me = await this.#checkAuthorization();
|
|
577
|
+
if (me) {
|
|
578
|
+
return {
|
|
579
|
+
type: "signedIn",
|
|
580
|
+
userId: me.id,
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
while (true) {
|
|
584
|
+
try {
|
|
585
|
+
const result = await this.#accountManager.checkBotToken(botToken, this.#apiId, this.#apiHash);
|
|
586
|
+
if (result.type === "signedIn") {
|
|
587
|
+
await this.storage.auth.update((v) => {
|
|
588
|
+
v.userId = result.userId;
|
|
589
|
+
v.isBot = true;
|
|
590
|
+
});
|
|
591
|
+
await this.storage.commit(true);
|
|
592
|
+
this.#LsignIn.debug("signed in as bot");
|
|
593
|
+
await this.#propagateAuthorizationState(true);
|
|
594
|
+
await this.#updateManager.fetchState("checkBotToken");
|
|
595
|
+
}
|
|
596
|
+
return result;
|
|
597
|
+
}
|
|
598
|
+
catch (err) {
|
|
599
|
+
if (err instanceof Migrate) {
|
|
600
|
+
await this[handleMigrationError](err);
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
throw err;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Signs in using the provided parameters if not already signed in.
|
|
611
|
+
* If no parameters are provided, the credentials will be prompted in runtime.
|
|
612
|
+
*
|
|
613
|
+
* Notes:
|
|
614
|
+
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
615
|
+
* 3. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
616
|
+
*/
|
|
617
|
+
async signIn(params) {
|
|
618
|
+
await signIn(this, this.#LsignIn, params);
|
|
619
|
+
}
|
|
620
|
+
async signOut() {
|
|
621
|
+
try {
|
|
622
|
+
await Promise.all([
|
|
623
|
+
this.storage.reset(),
|
|
624
|
+
this.invoke({ _: "auth.logOut" }).then(() => {
|
|
625
|
+
this.#propagateAuthorizationState(false);
|
|
626
|
+
}),
|
|
627
|
+
]);
|
|
628
|
+
}
|
|
629
|
+
finally {
|
|
630
|
+
this.#lastGetMe = null;
|
|
631
|
+
this.disconnect();
|
|
632
|
+
await this.connect();
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Same as calling `.connect()` followed by `.signIn(params)`.
|
|
637
|
+
*/
|
|
638
|
+
async start(params) {
|
|
639
|
+
await this.connect();
|
|
640
|
+
await this.signIn(params);
|
|
641
|
+
}
|
|
642
|
+
async #getClient(params) {
|
|
643
|
+
let client;
|
|
644
|
+
switch (params.type) {
|
|
645
|
+
case undefined:
|
|
646
|
+
client = await this.#getMainClient(params.dc);
|
|
647
|
+
break;
|
|
648
|
+
case "download":
|
|
649
|
+
client = await this.#getDownloadClient(params.dc);
|
|
650
|
+
break;
|
|
651
|
+
case "upload":
|
|
652
|
+
client = await this.#getUploadClient();
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
if (client !== this.#client && !this.isDisconnected && client.isDisconnected) {
|
|
656
|
+
await client.connect();
|
|
657
|
+
}
|
|
658
|
+
return client;
|
|
659
|
+
}
|
|
660
|
+
#getMainClientMutex = new Mutex();
|
|
661
|
+
async #getMainClient(dc) {
|
|
662
|
+
if (dc === undefined || dc === this.#client?.dc) {
|
|
663
|
+
return this.#client;
|
|
664
|
+
}
|
|
665
|
+
let client = this.#clients.find((v) => v.dc === dc);
|
|
666
|
+
if (client) {
|
|
667
|
+
return client;
|
|
668
|
+
}
|
|
669
|
+
const unlock = await this.#getMainClientMutex.lock();
|
|
670
|
+
client = this.#clients.find((v) => v.dc === dc);
|
|
671
|
+
if (client) {
|
|
672
|
+
return client;
|
|
673
|
+
}
|
|
674
|
+
try {
|
|
675
|
+
client = this.#newClient(dc, false, false);
|
|
676
|
+
await this.#setupClient(client);
|
|
677
|
+
this.#clients.push(client);
|
|
678
|
+
return client;
|
|
679
|
+
}
|
|
680
|
+
finally {
|
|
681
|
+
unlock();
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
async #getDownloadClient(dc) {
|
|
685
|
+
dc ??= this.#client.dc;
|
|
686
|
+
const pool = this.#downloadPools[dc] ??= new ClientEncryptedPool();
|
|
687
|
+
if (!pool.size) {
|
|
688
|
+
if (!pool.size) {
|
|
689
|
+
for (let i = 0; i < DOWNLOAD_POOL_SIZE; ++i) {
|
|
690
|
+
pool.add(this.#newClient(dc, false, true));
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
const client = pool.nextClient();
|
|
695
|
+
if (client.authKey.length) {
|
|
696
|
+
return client;
|
|
697
|
+
}
|
|
698
|
+
await this.#setupClient(client);
|
|
699
|
+
return client;
|
|
700
|
+
}
|
|
701
|
+
async #getUploadPoolSize() {
|
|
702
|
+
const dc = this.#client.dc;
|
|
703
|
+
return (dc !== "2" && dc !== "4") || await this.#getIsPremium() ? 8 : 4;
|
|
704
|
+
}
|
|
705
|
+
async #getUploadClient() {
|
|
706
|
+
const dc = this.#client.dc;
|
|
707
|
+
const poolSize = await this.#getUploadPoolSize();
|
|
708
|
+
const pool = this.#uploadPools[dc] ??= new ClientEncryptedPool();
|
|
709
|
+
if (!pool.size) {
|
|
710
|
+
for (let i = 0; i < poolSize; ++i) {
|
|
711
|
+
pool.add(await this.#newClient(dc, false, true));
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const client = pool.nextClient();
|
|
715
|
+
if (client.authKey.length) {
|
|
716
|
+
return client;
|
|
717
|
+
}
|
|
718
|
+
await this.#setupClient(client);
|
|
719
|
+
return client;
|
|
720
|
+
}
|
|
721
|
+
async #setupClient(client) {
|
|
722
|
+
const storage = client.dc === this.#client.dc ? this.storage : new StorageOperations(this.storage.provider.branch(client.dc + (client.isCdn ? "_cdn" : "")));
|
|
723
|
+
await storage.initialize();
|
|
724
|
+
const auth = storage.auth.mustGet();
|
|
725
|
+
const serverSalt = await storage.getServerSalt();
|
|
726
|
+
if (auth.authKey !== null) {
|
|
727
|
+
await client.setAuthKey(auth.authKey);
|
|
728
|
+
if (serverSalt) {
|
|
729
|
+
client.serverSalt = serverSalt;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
await client.connect();
|
|
733
|
+
if (auth.authKey === null) {
|
|
734
|
+
await this.#importAuthorization(client);
|
|
735
|
+
}
|
|
736
|
+
await storage.auth.update((v) => v.authKey = client.authKey);
|
|
737
|
+
if (client.dc !== this.#client.dc) {
|
|
738
|
+
await storage.setServerSalt(client.serverSalt);
|
|
739
|
+
client.handlers.onNewServerSalt = async (serverSalt) => {
|
|
740
|
+
await storage.setServerSalt(serverSalt);
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
async #importAuthorization(client) {
|
|
745
|
+
if (this.#client.dc === client.dc && this.#client.isCdn === client.isCdn) {
|
|
746
|
+
const auth = this.storage.auth.mustGet();
|
|
747
|
+
const serverSalt = await this.storage.getServerSalt();
|
|
748
|
+
if (auth.authKey !== null) {
|
|
749
|
+
await client.setAuthKey(auth.authKey);
|
|
750
|
+
if (serverSalt) {
|
|
751
|
+
client.serverSalt = serverSalt;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
const exportedAuthorization = await this.#client.invoke({ _: "auth.exportAuthorization", dc_id: getDcId(client.dc, client.isCdn) });
|
|
757
|
+
await client.invoke({ ...exportedAuthorization, _: "auth.importAuthorization" });
|
|
758
|
+
}
|
|
759
|
+
async #invoke(function_, params) {
|
|
760
|
+
if (!this.#client) {
|
|
761
|
+
throw new ConnectionError("The connection is not open.");
|
|
762
|
+
}
|
|
763
|
+
let n = 1;
|
|
764
|
+
let client;
|
|
765
|
+
while (true) {
|
|
766
|
+
client = params ? await this.#getClient(params) : this.#client;
|
|
767
|
+
const main = client === this.#client;
|
|
768
|
+
try {
|
|
769
|
+
const result = await client.invoke(function_);
|
|
770
|
+
if (main) {
|
|
771
|
+
try {
|
|
772
|
+
await this.#updateManager.processResult(result);
|
|
773
|
+
}
|
|
774
|
+
catch (err) {
|
|
775
|
+
this.#L.error("failed to process result:", err);
|
|
776
|
+
}
|
|
777
|
+
if (Api.isOfEnum("Update", result) || Api.isOfEnum("Updates", result)) {
|
|
778
|
+
return new Promise((resolve) => {
|
|
779
|
+
this.#updateManager.processUpdates(result, true, Mtproto.is("ping", function_) ? null : function_, () => resolve(result));
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
return result;
|
|
784
|
+
}
|
|
785
|
+
catch (err) {
|
|
786
|
+
if (err instanceof AuthKeyUnregistered && !main) {
|
|
787
|
+
await this.#importAuthorization(client);
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
else if (err instanceof ConnectionError && !main && !this.isDisconnected) {
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
else if (await this.#handleInvokeError(Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
throw err;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
#handleInvokeError = skipInvoke();
|
|
803
|
+
/**
|
|
804
|
+
* Invokes a function waiting and returning its reply.
|
|
805
|
+
* Requires the client to be connected.
|
|
806
|
+
*
|
|
807
|
+
* @param function_ The function to invoke.
|
|
808
|
+
*/
|
|
809
|
+
invoke = Object.assign(this.#invoke, {
|
|
810
|
+
use: (handler) => {
|
|
811
|
+
const handle = this.#handleInvokeError;
|
|
812
|
+
this.#handleInvokeError = async (ctx, next) => {
|
|
813
|
+
let result = null;
|
|
814
|
+
return await handle(ctx, async () => {
|
|
815
|
+
if (result !== null)
|
|
816
|
+
return result;
|
|
817
|
+
result = await handler(ctx, next);
|
|
818
|
+
return result;
|
|
819
|
+
});
|
|
820
|
+
};
|
|
821
|
+
},
|
|
822
|
+
});
|
|
823
|
+
exportAuthString() {
|
|
824
|
+
return this.storage.exportAuthString(this.#apiId);
|
|
825
|
+
}
|
|
826
|
+
#authStringImported = false;
|
|
827
|
+
async importAuthString(authString) {
|
|
828
|
+
if (this.isConnected) {
|
|
829
|
+
throw new Error("Cannot import auth string while the client is connected");
|
|
830
|
+
}
|
|
831
|
+
await this.#initStorage();
|
|
832
|
+
await this.storage.importAuthString(authString);
|
|
833
|
+
this.#authStringImported = true;
|
|
834
|
+
if (!this.#apiId) {
|
|
835
|
+
this.#apiId = this.storage.auth.mustGet().apiId;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
async #getUserAccessHash(userId) {
|
|
839
|
+
const users = await this.invoke({ _: "users.getUsers", id: [{ _: "inputUser", user_id: userId, access_hash: 0n }] });
|
|
840
|
+
const user = Api.is("user", users[0]) ? users[0] : undefined;
|
|
841
|
+
return user?.access_hash ?? 0n;
|
|
842
|
+
}
|
|
843
|
+
async #getChannelAccessHash(channelId) {
|
|
844
|
+
const channels = await this.invoke({ _: "channels.getChannels", id: [{ _: "inputChannel", channel_id: channelId, access_hash: 0n }] });
|
|
845
|
+
const channel = Api.is("channel", channels.chats[0]) ? channels.chats[0] : undefined;
|
|
846
|
+
return channel?.access_hash ?? 0n;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Get a chat's inputPeer. Useful when calling API functions directly.
|
|
850
|
+
*
|
|
851
|
+
* @param id The identifier of a chat.
|
|
852
|
+
*/
|
|
853
|
+
async getInputPeer(id) {
|
|
854
|
+
if (id === "me" || id === await this.#getSelfId()) {
|
|
855
|
+
return { _: "inputPeerSelf" };
|
|
856
|
+
}
|
|
857
|
+
const inputPeer = await this.#getInputPeerInner(id);
|
|
858
|
+
if (((Api.is("inputPeerUser", inputPeer) || Api.is("inputPeerChannel", inputPeer)) && inputPeer.access_hash === 0n) && this.storage.isBot) {
|
|
859
|
+
if ("channel_id" in inputPeer) {
|
|
860
|
+
inputPeer.access_hash = await this.#getChannelAccessHash(inputPeer.channel_id);
|
|
861
|
+
}
|
|
862
|
+
else {
|
|
863
|
+
inputPeer.access_hash = await this.#getUserAccessHash(inputPeer.user_id);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if ((Api.is("inputPeerUser", inputPeer) || Api.is("inputPeerChannel", inputPeer)) && inputPeer.access_hash === 0n) {
|
|
867
|
+
throw new AccessError(`The chat ${id} cannot be accessed.`);
|
|
868
|
+
}
|
|
869
|
+
return inputPeer;
|
|
870
|
+
}
|
|
871
|
+
async #getInputPeerChatId(inputPeer) {
|
|
872
|
+
if (Api.isOneOf(["inputPeerSelf", "inputUserSelf"], inputPeer)) {
|
|
873
|
+
return await this.#getSelfId();
|
|
874
|
+
}
|
|
875
|
+
else if (Api.isOneOf(["inputPeerEmpty", "inputUserEmpty", "inputChannelEmpty"], inputPeer)) {
|
|
876
|
+
unreachable();
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
return Api.peerToChatId(inputPeer);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
|
|
884
|
+
*
|
|
885
|
+
* @param id The identifier of the channel or the supergroup.
|
|
886
|
+
*/
|
|
887
|
+
async getInputChannel(id) {
|
|
888
|
+
const inputPeer = await this.getInputPeer(id);
|
|
889
|
+
if (!canBeInputChannel(inputPeer)) {
|
|
890
|
+
throw new TypeError(`The chat ${id} is not a channel neither a supergroup.`);
|
|
891
|
+
}
|
|
892
|
+
return toInputChannel(inputPeer);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Get a user's inputUser. Useful when calling API functions directly.
|
|
896
|
+
*
|
|
897
|
+
* @param id The identifier of the user.
|
|
898
|
+
*/
|
|
899
|
+
async getInputUser(id) {
|
|
900
|
+
const inputPeer = await this.getInputPeer(id);
|
|
901
|
+
if (!canBeInputUser(inputPeer)) {
|
|
902
|
+
throw new TypeError(`The chat ${id} is not a private chat.`);
|
|
903
|
+
}
|
|
904
|
+
return toInputUser(inputPeer);
|
|
905
|
+
}
|
|
906
|
+
async #getInputPeerInner(id) {
|
|
907
|
+
const idn = Number(id);
|
|
908
|
+
if (!isNaN(idn)) {
|
|
909
|
+
id = idn;
|
|
910
|
+
}
|
|
911
|
+
let peer;
|
|
912
|
+
if (typeof id === "string") {
|
|
913
|
+
id = getUsername(id);
|
|
914
|
+
let resolvedId = 0;
|
|
915
|
+
const maybeUsername = await this.messageStorage.usernames.get([id]);
|
|
916
|
+
if (maybeUsername !== null && Date.now() - maybeUsername[1].getTime() < USERNAME_TTL) {
|
|
917
|
+
const [id] = maybeUsername;
|
|
918
|
+
resolvedId = id;
|
|
919
|
+
}
|
|
920
|
+
else {
|
|
921
|
+
const resolved = await this.invoke({ _: "contacts.resolveUsername", username: id });
|
|
922
|
+
this.#updateManager.processChats(resolved.chats, resolved);
|
|
923
|
+
this.#updateManager.processUsers(resolved.users, resolved);
|
|
924
|
+
if (Api.is("peerUser", resolved.peer)) {
|
|
925
|
+
resolvedId = Api.peerToChatId(resolved.peer);
|
|
926
|
+
}
|
|
927
|
+
else if (Api.is("peerChannel", resolved.peer)) {
|
|
928
|
+
resolvedId = Api.peerToChatId(resolved.peer);
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
unreachable();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
const resolvedIdType = Api.getChatIdPeerType(resolvedId);
|
|
935
|
+
if (resolvedIdType === "user") {
|
|
936
|
+
const accessHash = await this.messageStorage.getUserAccessHash(resolvedId);
|
|
937
|
+
peer = { _: "inputPeerUser", user_id: Api.chatIdToPeerId(resolvedId), access_hash: accessHash ?? 0n };
|
|
938
|
+
}
|
|
939
|
+
else if (resolvedIdType === "channel") {
|
|
940
|
+
const accessHash = await this.messageStorage.getChannelAccessHash(resolvedId);
|
|
941
|
+
peer = { _: "inputPeerChannel", channel_id: Api.chatIdToPeerId(resolvedId), access_hash: accessHash ?? 0n };
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
unreachable();
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
else if (id > 0) {
|
|
948
|
+
const accessHash = await this.messageStorage.getUserAccessHash(id);
|
|
949
|
+
peer = { _: "inputPeerUser", user_id: Api.chatIdToPeerId(id), access_hash: accessHash ?? 0n };
|
|
950
|
+
}
|
|
951
|
+
else if (-MAX_CHAT_ID <= id) {
|
|
952
|
+
peer = { _: "inputPeerChat", chat_id: BigInt(Math.abs(id)) };
|
|
953
|
+
}
|
|
954
|
+
else if (ZERO_CHANNEL_ID - MAX_CHANNEL_ID <= id && id !== ZERO_CHANNEL_ID) {
|
|
955
|
+
const accessHash = await this.messageStorage.getChannelAccessHash(id);
|
|
956
|
+
peer = { _: "inputPeerChannel", channel_id: Api.chatIdToPeerId(id), access_hash: accessHash ?? 0n };
|
|
957
|
+
}
|
|
958
|
+
else {
|
|
959
|
+
throw new InputError("The ID is of an format unknown.");
|
|
960
|
+
}
|
|
961
|
+
if (!Api.is("inputPeerChat", peer) && !peer.access_hash) {
|
|
962
|
+
// TODO
|
|
963
|
+
// const chatId = Api.peerToChatId(peer);
|
|
964
|
+
// const minPeerReference = await this.messageStorage.getLastMinPeerReference(chatId);
|
|
965
|
+
// if (minPeerReference) {
|
|
966
|
+
// const minInputPeer = await this.#getMinInputPeer(canBeInputChannel(peer) ? "channel" : "user", { ...minPeerReference, senderId: chatId });
|
|
967
|
+
// if (minInputPeer) {
|
|
968
|
+
// this.#Lmin.debug("resolved input min peer", minInputPeer);
|
|
969
|
+
// peer = minInputPeer;
|
|
970
|
+
// }
|
|
971
|
+
// }
|
|
972
|
+
}
|
|
973
|
+
return peer;
|
|
974
|
+
}
|
|
975
|
+
async #getMinInputPeer(type, reference) {
|
|
976
|
+
const peer_ = await this.messageStorage.peers.get([reference.chatId]);
|
|
977
|
+
if (peer_ !== null && (peer_[0].type === "channel" || peer_[0].type === "supergroup")) {
|
|
978
|
+
const peer = { _: "inputPeerChannel", channel_id: BigInt(peer_[0].id), access_hash: peer_[1] };
|
|
979
|
+
if (type === "user") {
|
|
980
|
+
return { _: "inputPeerUserFromMessage", peer, msg_id: reference.messageId, user_id: Api.chatIdToPeerId(reference.senderId) };
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
return { _: "inputPeerChannelFromMessage", peer, msg_id: reference.messageId, channel_id: Api.chatIdToPeerId(reference.senderId) };
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
else {
|
|
987
|
+
return null;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
async [getPeer](peer) {
|
|
991
|
+
const id = Api.peerToChatId(peer);
|
|
992
|
+
const entity = await this.messageStorage.peers.get([id]);
|
|
993
|
+
if (entity === null) {
|
|
994
|
+
if (entity === null && this.storage.isBot && Api.is("peerUser", peer) || Api.is("peerChannel", peer)) {
|
|
995
|
+
await this.getInputPeer(id);
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
return entity;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
return await this.messageStorage.peers.get([id]);
|
|
1002
|
+
}
|
|
1003
|
+
[mustGetPeer](peer) {
|
|
1004
|
+
return this.messageStorage.peers.mustGet([peerToChatId(peer)]);
|
|
1005
|
+
}
|
|
1006
|
+
async #handleCtxUpdate(update) {
|
|
1007
|
+
if (this.#disableUpdates && !("authorizationState" in update) && !("connectionState" in update)) {
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
try {
|
|
1011
|
+
await this.handleUpdate(this, update);
|
|
1012
|
+
}
|
|
1013
|
+
catch (err) {
|
|
1014
|
+
this.#L.error("Failed to handle update:", err);
|
|
1015
|
+
throw err;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
#queueHandleCtxUpdate(update) {
|
|
1019
|
+
this.#updateManager.getHandleUpdateQueue(UpdateManager.MAIN_BOX_ID).add(async () => {
|
|
1020
|
+
await this.#handleCtxUpdate(update);
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
async #handleUpdate(update) {
|
|
1024
|
+
const maybePromises = new Array();
|
|
1025
|
+
if (Api.is("updateUserName", update)) {
|
|
1026
|
+
const value = [Number(update.user_id), new Date()];
|
|
1027
|
+
for (const username_ of update.usernames) {
|
|
1028
|
+
const username = username_.username.toLowerCase();
|
|
1029
|
+
this.messageStorage.usernames.set([username], value);
|
|
1030
|
+
}
|
|
1031
|
+
const peer = { ...update, _: "peerUser" };
|
|
1032
|
+
const peer_ = await this[getPeer](peer);
|
|
1033
|
+
if (peer_ !== null) {
|
|
1034
|
+
const username = update.usernames[0];
|
|
1035
|
+
if (username !== undefined) {
|
|
1036
|
+
peer_[0].username = username.username;
|
|
1037
|
+
const also = update.usernames.filter((v) => v !== username);
|
|
1038
|
+
if (also.length) {
|
|
1039
|
+
peer_[0].also = also.map((v) => v.username);
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
delete peer_[0].also;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
delete peer_[0].username;
|
|
1047
|
+
}
|
|
1048
|
+
this.messageStorage.setPeer2(peer_[0], peer_[1]);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (this.#messageManager.canHandleUpdate(update)) {
|
|
1052
|
+
maybePromises.push(() => this.#messageManager.handleUpdate(update));
|
|
1053
|
+
}
|
|
1054
|
+
if (this.#chatManager.canHandleUpdate(update)) {
|
|
1055
|
+
maybePromises.push(() => this.#chatManager.handleUpdate(update));
|
|
1056
|
+
}
|
|
1057
|
+
if (this.#pollManager.canHandleUpdate(update)) {
|
|
1058
|
+
maybePromises.push(() => this.#pollManager.handleUpdate(update));
|
|
1059
|
+
}
|
|
1060
|
+
if (this.#videoChatManager.canHandleUpdate(update)) {
|
|
1061
|
+
maybePromises.push(() => this.#videoChatManager.handleUpdate(update));
|
|
1062
|
+
}
|
|
1063
|
+
if (this.#callbackQueryManager.canHandleUpdate(update)) {
|
|
1064
|
+
maybePromises.push(() => this.#callbackQueryManager.handleUpdate(update));
|
|
1065
|
+
}
|
|
1066
|
+
if (this.#inlineQueryManager.canHandleUpdate(update)) {
|
|
1067
|
+
maybePromises.push(() => this.#inlineQueryManager.handleUpdate(update));
|
|
1068
|
+
}
|
|
1069
|
+
if (this.#linkPreviewManager.canHandleUpdate(update)) {
|
|
1070
|
+
maybePromises.push(() => this.#linkPreviewManager.handleUpdate(update));
|
|
1071
|
+
}
|
|
1072
|
+
if (this.#reactionManager.canHandleUpdate(update)) {
|
|
1073
|
+
maybePromises.push(() => this.#reactionManager.handleUpdate(update));
|
|
1074
|
+
}
|
|
1075
|
+
if (this.#chatListManager.canHandleUpdate(update)) {
|
|
1076
|
+
maybePromises.push(() => this.#chatListManager.handleUpdate(update));
|
|
1077
|
+
}
|
|
1078
|
+
if (this.#storyManager.canHandleUpdate(update)) {
|
|
1079
|
+
maybePromises.push(() => this.#storyManager.handleUpdate(update));
|
|
1080
|
+
}
|
|
1081
|
+
if (this.#businessConnectionManager.canHandleUpdate(update)) {
|
|
1082
|
+
maybePromises.push(() => this.#businessConnectionManager.handleUpdate(update));
|
|
1083
|
+
}
|
|
1084
|
+
if (this.#storyManager.canHandleUpdate(update)) {
|
|
1085
|
+
maybePromises.push(() => this.#storyManager.handleUpdate(update));
|
|
1086
|
+
}
|
|
1087
|
+
if (this.#paymentManager.canHandleUpdate(update)) {
|
|
1088
|
+
maybePromises.push(() => this.#paymentManager.handleUpdate(update));
|
|
1089
|
+
}
|
|
1090
|
+
if (this.#translationsManager.canHandleUpdate(update)) {
|
|
1091
|
+
maybePromises.push(() => this.#translationsManager.handleUpdate(update));
|
|
1092
|
+
}
|
|
1093
|
+
if (this.#botInfoManager.canHandleUpdate(update)) {
|
|
1094
|
+
maybePromises.push(() => this.#botInfoManager.handleUpdate(update));
|
|
1095
|
+
}
|
|
1096
|
+
if (this.#accountManager.canHandleUpdate(update)) {
|
|
1097
|
+
maybePromises.push(() => this.#accountManager.handleUpdate(update));
|
|
1098
|
+
}
|
|
1099
|
+
return () => Promise.resolve().then(async () => {
|
|
1100
|
+
const updates = [{ update }];
|
|
1101
|
+
for (const maybePromise of maybePromises) {
|
|
1102
|
+
try {
|
|
1103
|
+
const value = maybePromise();
|
|
1104
|
+
const update = value instanceof Promise ? await value : value;
|
|
1105
|
+
if (update) {
|
|
1106
|
+
updates.push(update);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
catch (err) {
|
|
1110
|
+
this.#L.error("failed to construct update:", err);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
for (const update of updates) {
|
|
1114
|
+
try {
|
|
1115
|
+
await this.#handleCtxUpdate(update);
|
|
1116
|
+
}
|
|
1117
|
+
finally {
|
|
1118
|
+
if ("deletedMessages" in update) {
|
|
1119
|
+
for (const { chatId, messageId } of update.deletedMessages) {
|
|
1120
|
+
await this.messageStorage.setMessage(chatId, messageId, null);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
#lastGetMe = null;
|
|
1128
|
+
async #getMe() {
|
|
1129
|
+
if (this.#lastGetMe !== null) {
|
|
1130
|
+
return this.#lastGetMe;
|
|
1131
|
+
}
|
|
1132
|
+
else {
|
|
1133
|
+
const user = await this.#getMeInner();
|
|
1134
|
+
this.#lastGetMe = user;
|
|
1135
|
+
return user;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
async #getMeInner() {
|
|
1139
|
+
let chatP = (await this[getPeer]({ _: "peerUser", user_id: BigInt(await this.#getSelfId()) }))?.[0] ?? null;
|
|
1140
|
+
if (chatP === null) {
|
|
1141
|
+
const users = await this.invoke({ _: "users.getUsers", id: [{ _: "inputUserSelf" }] });
|
|
1142
|
+
chatP = constructChatP(Api.as("user", users[0]));
|
|
1143
|
+
await this.storage.setIsPremium(chatP.isPremium);
|
|
1144
|
+
}
|
|
1145
|
+
const user = constructUser2(chatP);
|
|
1146
|
+
this.#lastGetMe = user;
|
|
1147
|
+
return user;
|
|
1148
|
+
}
|
|
1149
|
+
#previouslyConnected = false;
|
|
1150
|
+
#lastConnectionState = false;
|
|
1151
|
+
#onConnectionStateChange(isConnected) {
|
|
1152
|
+
if (this.#lastConnectionState !== isConnected) {
|
|
1153
|
+
if (isConnected) {
|
|
1154
|
+
if (this.#previouslyConnected) {
|
|
1155
|
+
drop(this.#updateManager.recoverUpdateGap("reconnect"));
|
|
1156
|
+
}
|
|
1157
|
+
this.#previouslyConnected = true;
|
|
1158
|
+
}
|
|
1159
|
+
const connectionState = isConnected ? "ready" : "notConnected";
|
|
1160
|
+
this.#queueHandleCtxUpdate({ connectionState });
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
//
|
|
1164
|
+
// ========================= ACCOUNT ========================= //
|
|
1165
|
+
//
|
|
1166
|
+
/**
|
|
1167
|
+
* Get information on the currently authorized user.
|
|
1168
|
+
*
|
|
1169
|
+
* @method ac
|
|
1170
|
+
* @returns Information on the currently authorized user.
|
|
1171
|
+
*/
|
|
1172
|
+
async getMe() {
|
|
1173
|
+
if (this.#lastGetMe === null) {
|
|
1174
|
+
const me = await this.#checkAuthorization();
|
|
1175
|
+
if (!me) {
|
|
1176
|
+
throw new InputError("Not signed in.");
|
|
1177
|
+
}
|
|
1178
|
+
else {
|
|
1179
|
+
return me;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
return await this.#getMeInner();
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1186
|
+
*
|
|
1187
|
+
* @method ac
|
|
1188
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1189
|
+
* @param username The username to show.
|
|
1190
|
+
*/
|
|
1191
|
+
async showUsername(id, username) {
|
|
1192
|
+
await this.#accountManager.showUsername(id, username);
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1196
|
+
*
|
|
1197
|
+
* @method ac
|
|
1198
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1199
|
+
* @param username The username to hide.
|
|
1200
|
+
*/
|
|
1201
|
+
async hideUsername(id, username) {
|
|
1202
|
+
await this.#accountManager.hideUsername(id, username);
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Check the availability of a username. User-only.
|
|
1206
|
+
*
|
|
1207
|
+
* @method ac
|
|
1208
|
+
* @param username The username to check.
|
|
1209
|
+
* @returns Whether the username is available.
|
|
1210
|
+
*/
|
|
1211
|
+
async checkUsername(username, params) {
|
|
1212
|
+
return await this.#accountManager.checkUsername(username, params);
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Set the username of the current account. User-only.
|
|
1216
|
+
*
|
|
1217
|
+
* @method ac
|
|
1218
|
+
* @param username The username to set.
|
|
1219
|
+
*/
|
|
1220
|
+
async setUsername(username) {
|
|
1221
|
+
await this.#accountManager.setUsername(username);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Remove the current account's username. User-only.
|
|
1225
|
+
*
|
|
1226
|
+
* @method ac
|
|
1227
|
+
*/
|
|
1228
|
+
async removeUsername() {
|
|
1229
|
+
await this.#accountManager.removeUsername();
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1233
|
+
*
|
|
1234
|
+
* @method ac
|
|
1235
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1236
|
+
* @param order The new order to use.
|
|
1237
|
+
* @returns Whether the order was changed.
|
|
1238
|
+
*/
|
|
1239
|
+
async reorderUsernames(id, order) {
|
|
1240
|
+
return await this.#accountManager.reorderUsernames(id, order);
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Hide all usernames from a supergroup or a channel's profile. User-only.
|
|
1244
|
+
*
|
|
1245
|
+
* @method ac
|
|
1246
|
+
* @param id A supergroup ID or a channel ID.
|
|
1247
|
+
* @returns Whether any username was hidden.
|
|
1248
|
+
*/
|
|
1249
|
+
async hideUsernames(id) {
|
|
1250
|
+
return await this.#accountManager.hideUsernames(id);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Get a business connection. Bot-only.
|
|
1254
|
+
*
|
|
1255
|
+
* @method ac
|
|
1256
|
+
* @param id The identifier of the business connection.
|
|
1257
|
+
* @cache
|
|
1258
|
+
*/
|
|
1259
|
+
async getBusinessConnection(id) {
|
|
1260
|
+
return await this.#businessConnectionManager.getBusinessConnection(id);
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Set the current account's online status. User-only.
|
|
1264
|
+
*
|
|
1265
|
+
* @method ac
|
|
1266
|
+
* @param isOnline The new online status.
|
|
1267
|
+
*/
|
|
1268
|
+
async setIsOnline(isOnline) {
|
|
1269
|
+
await this.#accountManager.setIsOnline(isOnline);
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Set the current account's emoji status. User-only.
|
|
1273
|
+
*
|
|
1274
|
+
* @method ac
|
|
1275
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1276
|
+
*/
|
|
1277
|
+
async setEmojiStatus(emojiStatus, params) {
|
|
1278
|
+
await this.#accountManager.setEmojiStatus(emojiStatus, params);
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Remove the current account's emoji status. User-only.
|
|
1282
|
+
*
|
|
1283
|
+
* @method ac
|
|
1284
|
+
*/
|
|
1285
|
+
async removeEmojiStatus() {
|
|
1286
|
+
await this.#accountManager.removeEmojiStatus();
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Set the emoji status of a channel. User-only.
|
|
1290
|
+
*
|
|
1291
|
+
* @method ac
|
|
1292
|
+
* @param chatId The identifier of a channel.
|
|
1293
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1294
|
+
*/
|
|
1295
|
+
async setChannelEmojiStatus(chatId, emojiStatus, params) {
|
|
1296
|
+
await this.#accountManager.setChannelEmojiStatus(chatId, emojiStatus, params);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Remove the emoji status of a channel. User-only.
|
|
1300
|
+
*
|
|
1301
|
+
* @method ac
|
|
1302
|
+
* @param chatId The identifier of a channel.
|
|
1303
|
+
*/
|
|
1304
|
+
async removeChannelEmojiStatus(chatId) {
|
|
1305
|
+
await this.#accountManager.removeChannelEmojiStatus(chatId);
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Set the emoji status of a bot's user. Bot-only.
|
|
1309
|
+
*
|
|
1310
|
+
* @method ac
|
|
1311
|
+
* @param userId The identifier of a user of the bot.
|
|
1312
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1313
|
+
*/
|
|
1314
|
+
async setUserEmojiStatus(userId, emojiStatus, params) {
|
|
1315
|
+
await this.#accountManager.setUserEmojiStatus(userId, emojiStatus, params);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Remove the emoji status of a bot's user. Bot-only.
|
|
1319
|
+
*
|
|
1320
|
+
* @method ac
|
|
1321
|
+
* @param userId The identifier of a user of the bot.
|
|
1322
|
+
*/
|
|
1323
|
+
async removeUserEmojiStatus(userId) {
|
|
1324
|
+
await this.#accountManager.removeUserEmojiStatus(userId);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Update the profile of the current user. At least one parameter must be specified. User-only.
|
|
1328
|
+
*
|
|
1329
|
+
* @method ac
|
|
1330
|
+
*/
|
|
1331
|
+
async updateProfile(params) {
|
|
1332
|
+
await this.#accountManager.updateProfile(params);
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Set the birthday of the current user. User-only.
|
|
1336
|
+
*
|
|
1337
|
+
* @method ac
|
|
1338
|
+
*/
|
|
1339
|
+
async setBirthday(params) {
|
|
1340
|
+
await this.#accountManager.setBirthday(params);
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Set the personal channel of the current user. User-only.
|
|
1344
|
+
*
|
|
1345
|
+
* @method ac
|
|
1346
|
+
*/
|
|
1347
|
+
async setPersonalChannel(params) {
|
|
1348
|
+
await this.#accountManager.setPersonalChannel(params);
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Set the name color of the current user. User-only.
|
|
1352
|
+
*
|
|
1353
|
+
* @method ac
|
|
1354
|
+
* @param color The identifier of the color to set.
|
|
1355
|
+
*/
|
|
1356
|
+
async setNameColor(color, params) {
|
|
1357
|
+
await this.#accountManager.setNameColor(color, params);
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Set the profile color of the current user. User-only.
|
|
1361
|
+
*
|
|
1362
|
+
* @method ac
|
|
1363
|
+
* @param color The identifier of the color to set.
|
|
1364
|
+
*/
|
|
1365
|
+
async setProfileColor(color, params) {
|
|
1366
|
+
await this.#accountManager.setProfileColor(color, params);
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Set the location of the current user. User-only.
|
|
1370
|
+
*
|
|
1371
|
+
* @method ac
|
|
1372
|
+
*/
|
|
1373
|
+
async setLocation(params) {
|
|
1374
|
+
await this.#accountManager.setLocation(params);
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* Set the working hours of the current user. User-only.
|
|
1378
|
+
*
|
|
1379
|
+
* @method ac
|
|
1380
|
+
*/
|
|
1381
|
+
async setWorkingHours(params) {
|
|
1382
|
+
await this.#accountManager.setWorkingHours(params);
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Enable sponsored messages on the current user. User-only.
|
|
1386
|
+
*
|
|
1387
|
+
* @method ac
|
|
1388
|
+
*/
|
|
1389
|
+
async enableSponsoredMessages() {
|
|
1390
|
+
await this.#accountManager.enableSponsoredMessages();
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Disable sponsored messages on the current user. User-only.
|
|
1394
|
+
*
|
|
1395
|
+
* @method ac
|
|
1396
|
+
*/
|
|
1397
|
+
async disableSponsoredMessages() {
|
|
1398
|
+
await this.#accountManager.disableSponsoredMessages();
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Pause the business bot in a chat. User-only.
|
|
1402
|
+
*
|
|
1403
|
+
* @method ac
|
|
1404
|
+
*/
|
|
1405
|
+
async pauseBusinessBotConnection(chatId) {
|
|
1406
|
+
await this.#accountManager.pauseBusinessBotConnection(chatId);
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Resume the business bot in a chat. User-only.
|
|
1410
|
+
*
|
|
1411
|
+
* @method ac
|
|
1412
|
+
*/
|
|
1413
|
+
async resumeBusinessBotConnection(chatId) {
|
|
1414
|
+
await this.#accountManager.resumeBusinessBotConnection(chatId);
|
|
1415
|
+
}
|
|
1416
|
+
//
|
|
1417
|
+
// ========================= MESSAGES ========================= //
|
|
1418
|
+
//
|
|
1419
|
+
/**
|
|
1420
|
+
* Send a text message.
|
|
1421
|
+
*
|
|
1422
|
+
* @method ms
|
|
1423
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
1424
|
+
* @param text The message's text.
|
|
1425
|
+
* @returns The sent text message.
|
|
1426
|
+
*/
|
|
1427
|
+
async sendMessage(chatId, text, params) {
|
|
1428
|
+
return await this.#messageManager.sendMessage(chatId, text, params);
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Stream a drafted text message. Bot-only.
|
|
1432
|
+
*
|
|
1433
|
+
* @method ms
|
|
1434
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
1435
|
+
* @param draftId The identifier of the draft.
|
|
1436
|
+
* @param text The message's text.
|
|
1437
|
+
*/
|
|
1438
|
+
async sendMessageDraft(chatId, draftId, text, params) {
|
|
1439
|
+
await this.#messageManager.sendMessageDraft(chatId, draftId, text, params);
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Send a photo.
|
|
1443
|
+
*
|
|
1444
|
+
* @method ms
|
|
1445
|
+
* @param chatId The identifier of a chat to send the photo to.
|
|
1446
|
+
* @param photo The photo to send.
|
|
1447
|
+
* @returns The sent photo.
|
|
1448
|
+
*/
|
|
1449
|
+
async sendPhoto(chatId, photo, params) {
|
|
1450
|
+
return await this.#messageManager.sendPhoto(chatId, photo, params);
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Send a document.
|
|
1454
|
+
*
|
|
1455
|
+
* @method ms
|
|
1456
|
+
* @param chatId The identifier of a chat to send the document to.
|
|
1457
|
+
* @param document The document to send.
|
|
1458
|
+
* @returns The sent document.
|
|
1459
|
+
*/
|
|
1460
|
+
async sendDocument(chatId, document, params) {
|
|
1461
|
+
return await this.#messageManager.sendDocument(chatId, document, params);
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Send a sticker.
|
|
1465
|
+
*
|
|
1466
|
+
* @method ms
|
|
1467
|
+
* @param chatId The identifier of a chat to send the sticker to.
|
|
1468
|
+
* @param document The sticker to send.
|
|
1469
|
+
* @returns The sent sticker.
|
|
1470
|
+
*/
|
|
1471
|
+
async sendSticker(chatId, sticker, params) {
|
|
1472
|
+
return await this.#messageManager.sendSticker(chatId, sticker, params);
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Send a video.
|
|
1476
|
+
*
|
|
1477
|
+
* @method ms
|
|
1478
|
+
* @param chatId The identifier of a chat to send the video to.
|
|
1479
|
+
* @param video The video to send.
|
|
1480
|
+
* @returns The sent video.
|
|
1481
|
+
*/
|
|
1482
|
+
async sendVideo(chatId, video, params) {
|
|
1483
|
+
return await this.#messageManager.sendVideo(chatId, video, params);
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Send an animation.
|
|
1487
|
+
*
|
|
1488
|
+
* @method ms
|
|
1489
|
+
* @param chatId The identifier of a chat to send the animation to.
|
|
1490
|
+
* @param animation The animation to send.
|
|
1491
|
+
* @returns The sent animation.
|
|
1492
|
+
*/
|
|
1493
|
+
async sendAnimation(chatId, animation, params) {
|
|
1494
|
+
return await this.#messageManager.sendAnimation(chatId, animation, params);
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Send a voice message.
|
|
1498
|
+
*
|
|
1499
|
+
* @method ms
|
|
1500
|
+
* @param chatId The identifier of a chat to send the voice message to.
|
|
1501
|
+
* @param voice The voice to send.
|
|
1502
|
+
* @returns The sent voice message.
|
|
1503
|
+
*/
|
|
1504
|
+
async sendVoice(chatId, voice, params) {
|
|
1505
|
+
return await this.#messageManager.sendVoice(chatId, voice, params);
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Send an audio file.
|
|
1509
|
+
*
|
|
1510
|
+
* @method ms
|
|
1511
|
+
* @param chatId The identifier of a chat to send the audio file to.
|
|
1512
|
+
* @param audio The audio to send.
|
|
1513
|
+
* @returns The sent audio filr.
|
|
1514
|
+
*/
|
|
1515
|
+
async sendAudio(chatId, audio, params) {
|
|
1516
|
+
return await this.#messageManager.sendAudio(chatId, audio, params);
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Send a media group.
|
|
1520
|
+
*
|
|
1521
|
+
* @method ms
|
|
1522
|
+
* @param chatId The identifier of a chat to send the media group to.
|
|
1523
|
+
* @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
|
|
1524
|
+
* @returns The sent messages.
|
|
1525
|
+
*/
|
|
1526
|
+
async sendMediaGroup(chatId, media, params) {
|
|
1527
|
+
return await this.#messageManager.sendMediaGroup(chatId, media, params);
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Send a video note.
|
|
1531
|
+
*
|
|
1532
|
+
* @method ms
|
|
1533
|
+
* @param chatId The identifier of a chat to send the video note to.
|
|
1534
|
+
* @param videoNote The video note to send.
|
|
1535
|
+
* @returns The sent video note.
|
|
1536
|
+
*/
|
|
1537
|
+
async sendVideoNote(chatId, videoNote, params) {
|
|
1538
|
+
return await this.#messageManager.sendVideoNote(chatId, videoNote, params);
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Send a location.
|
|
1542
|
+
*
|
|
1543
|
+
* @method ms
|
|
1544
|
+
* @param chatId The identifier of a chat to send the location to.
|
|
1545
|
+
* @param latitude The location's latitude.
|
|
1546
|
+
* @param longitude The location's longitude.
|
|
1547
|
+
* @returns The sent location.
|
|
1548
|
+
*/
|
|
1549
|
+
async sendLocation(chatId, latitude, longitude, params) {
|
|
1550
|
+
return await this.#messageManager.sendLocation(chatId, latitude, longitude, params);
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Send a contact.
|
|
1554
|
+
*
|
|
1555
|
+
* @method ms
|
|
1556
|
+
* @param chatId The identifier of a chat to send the contact to.
|
|
1557
|
+
* @param firstName The contact's first name.
|
|
1558
|
+
* @param number The contact's phone number.
|
|
1559
|
+
* @returns The sent contact.
|
|
1560
|
+
*/
|
|
1561
|
+
async sendContact(chatId, firstName, number, params) {
|
|
1562
|
+
return await this.#messageManager.sendContact(chatId, firstName, number, params);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Send a dice.
|
|
1566
|
+
*
|
|
1567
|
+
* @method ms
|
|
1568
|
+
* @param chatId The identifier of a chat to send the dice to.
|
|
1569
|
+
* @returns The sent dice.
|
|
1570
|
+
*/
|
|
1571
|
+
async sendDice(chatId, params) {
|
|
1572
|
+
return await this.#messageManager.sendDice(chatId, params);
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* Send a venue.
|
|
1576
|
+
*
|
|
1577
|
+
* @method ms
|
|
1578
|
+
* @param chatId The identifier of a chat to send the venue to.
|
|
1579
|
+
* @param latitude The latitude of the venue.
|
|
1580
|
+
* @param longitude The longitude of the venue.
|
|
1581
|
+
* @param title The title of the venue.
|
|
1582
|
+
* @param address The written address of the venue.
|
|
1583
|
+
* @returns The sent venue.
|
|
1584
|
+
*/
|
|
1585
|
+
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
1586
|
+
return await this.#messageManager.sendVenue(chatId, latitude, longitude, title, address, params);
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Send a poll.
|
|
1590
|
+
*
|
|
1591
|
+
* @method ms
|
|
1592
|
+
* @param chatId The identifier of a chat to send the poll to.
|
|
1593
|
+
* @param question The poll's question.
|
|
1594
|
+
* @param options The poll's options.
|
|
1595
|
+
* @returns The sent poll.
|
|
1596
|
+
*/
|
|
1597
|
+
async sendPoll(chatId, question, options, params) {
|
|
1598
|
+
return await this.#messageManager.sendPoll(chatId, question, options, params);
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* Send a checklist. User-only.
|
|
1602
|
+
*
|
|
1603
|
+
* @method ms
|
|
1604
|
+
* @param chatId The identifier of a chat to send the checklist to.
|
|
1605
|
+
* @param title The checklist's title.
|
|
1606
|
+
* @param items The checklist's items.
|
|
1607
|
+
* @returns The sent checklist.
|
|
1608
|
+
*/
|
|
1609
|
+
async sendChecklist(chatId, title, items, params) {
|
|
1610
|
+
return await this.#messageManager.sendChecklist(chatId, title, items, params);
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Send an invoice. Bot-only.
|
|
1614
|
+
*
|
|
1615
|
+
* @method ms
|
|
1616
|
+
* @param chatId The identifier of a chat to send the invoice to.
|
|
1617
|
+
* @param title The invoice's title.
|
|
1618
|
+
* @param description The invoice's description.
|
|
1619
|
+
* @param payload The invoice's payload.
|
|
1620
|
+
* @param currency The invoice's currency.
|
|
1621
|
+
* @param prices The invoice's price tags.
|
|
1622
|
+
* @returns The sent invoice.
|
|
1623
|
+
*/
|
|
1624
|
+
async sendInvoice(chatId, title, description, payload, currency, prices, params) {
|
|
1625
|
+
return await this.#messageManager.sendInvoice(chatId, title, description, payload, currency, prices, params);
|
|
1626
|
+
}
|
|
1627
|
+
/**
|
|
1628
|
+
* Edit a message's text.
|
|
1629
|
+
*
|
|
1630
|
+
* @method ms
|
|
1631
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1632
|
+
* @param messageId The identifier of the message.
|
|
1633
|
+
* @param text The new text of the message.
|
|
1634
|
+
* @returns The edited text message.
|
|
1635
|
+
*/
|
|
1636
|
+
async editMessageText(chatId, messageId, text, params) {
|
|
1637
|
+
return await this.#messageManager.editMessageText(chatId, messageId, text, params);
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Edit a message's caption.
|
|
1641
|
+
*
|
|
1642
|
+
* @method ms
|
|
1643
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1644
|
+
* @param messageId The identifier of the message.
|
|
1645
|
+
* @param text The new caption of the message.
|
|
1646
|
+
* @returns The edited message.
|
|
1647
|
+
*/
|
|
1648
|
+
async editMessageCaption(chatId, messageId, params) {
|
|
1649
|
+
return await this.#messageManager.editMessageCaption(chatId, messageId, params);
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Edit a message's media.
|
|
1653
|
+
*
|
|
1654
|
+
* @method ms
|
|
1655
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1656
|
+
* @param messageId The identifier of the message.
|
|
1657
|
+
* @param media The new media of the message.
|
|
1658
|
+
* @returns The edited message.
|
|
1659
|
+
*/
|
|
1660
|
+
async editMessageMedia(chatId, messageId, media, params) {
|
|
1661
|
+
return await this.#messageManager.editMessageMedia(chatId, messageId, media, params);
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Edit an inline message's media.
|
|
1665
|
+
*
|
|
1666
|
+
* @method ms
|
|
1667
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1668
|
+
* @param media The new media of the message.
|
|
1669
|
+
*/
|
|
1670
|
+
async editInlineMessageMedia(inlineMessageId, media, params) {
|
|
1671
|
+
await this.#messageManager.editInlineMessageMedia(inlineMessageId, media, params);
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Edit an inline message's text. Bot-only.
|
|
1675
|
+
*
|
|
1676
|
+
* @method ms
|
|
1677
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1678
|
+
* @param text The new text of the message.
|
|
1679
|
+
*/
|
|
1680
|
+
async editInlineMessageText(inlineMessageId, text, params) {
|
|
1681
|
+
await this.#messageManager.editInlineMessageText(inlineMessageId, text, params);
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Edit an inline message's caption. Bot-only.
|
|
1685
|
+
*
|
|
1686
|
+
* @method ms
|
|
1687
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1688
|
+
*/
|
|
1689
|
+
async editInlineMessageCaption(inlineMessageId, params) {
|
|
1690
|
+
await this.#messageManager.editInlineMessageCaption(inlineMessageId, params);
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Edit a message's reply markup.
|
|
1694
|
+
*
|
|
1695
|
+
* @method ms
|
|
1696
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1697
|
+
* @param messageId The identifier of the message.
|
|
1698
|
+
* @returns The edited message.
|
|
1699
|
+
*/
|
|
1700
|
+
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
1701
|
+
return await this.#messageManager.editMessageReplyMarkup(chatId, messageId, params);
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Edit an inline message's reply markup. Bot-only.
|
|
1705
|
+
*
|
|
1706
|
+
* @method ms
|
|
1707
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1708
|
+
*/
|
|
1709
|
+
async editInlineMessageReplyMarkup(inlineMessageId, params) {
|
|
1710
|
+
await this.#messageManager.editInlineMessageReplyMarkup(inlineMessageId, params);
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Edit a message's live location.
|
|
1714
|
+
*
|
|
1715
|
+
* @method ms
|
|
1716
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1717
|
+
* @param messageId The identifier of the message.
|
|
1718
|
+
* @param latitude The new latitude.
|
|
1719
|
+
* @param longitude The new longitude.
|
|
1720
|
+
* @returns The edited location message.
|
|
1721
|
+
*/
|
|
1722
|
+
async editMessageLiveLocation(chatId, messageId, latitude, longitude, params) {
|
|
1723
|
+
return await this.#messageManager.editMessageLiveLocation(chatId, messageId, latitude, longitude, params);
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Edit an inline message's live location. Bot-only.
|
|
1727
|
+
*
|
|
1728
|
+
* @method ms
|
|
1729
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1730
|
+
* @param latitude The new latitude.
|
|
1731
|
+
* @param longitude The new longitude.
|
|
1732
|
+
* @returns The edited location message.
|
|
1733
|
+
*/
|
|
1734
|
+
async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
|
|
1735
|
+
await this.#messageManager.editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params);
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* Retrieve multiple messages.
|
|
1739
|
+
*
|
|
1740
|
+
* @method ms
|
|
1741
|
+
* @param chatId The identifier of a chat to retrieve the messages from.
|
|
1742
|
+
* @param messageIds The identifiers of the messages to retrieve.
|
|
1743
|
+
* @example ```ts
|
|
1744
|
+
* const message = await client.getMessages("@MTKruto", [210, 212]);
|
|
1745
|
+
* ```
|
|
1746
|
+
* @returns The retrieved messages.
|
|
1747
|
+
* @cache
|
|
1748
|
+
*/
|
|
1749
|
+
async getMessages(chatId, messageIds) {
|
|
1750
|
+
return await this.#messageManager.getMessages(chatId, messageIds);
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Retrieve a single message.
|
|
1754
|
+
*
|
|
1755
|
+
* @method ms
|
|
1756
|
+
* @param chatId The identifier of a chat.
|
|
1757
|
+
* @param messageId The identifier of the message to retrieve.
|
|
1758
|
+
* @example ```ts
|
|
1759
|
+
* const message = await client.getMessage("@MTKruto", 212);
|
|
1760
|
+
* ```
|
|
1761
|
+
* @returns The retrieved message.
|
|
1762
|
+
* @cache
|
|
1763
|
+
*/
|
|
1764
|
+
async getMessage(chatId, messageId) {
|
|
1765
|
+
return await this.#messageManager.getMessage(chatId, messageId);
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Retrieve a message using its link.
|
|
1769
|
+
*
|
|
1770
|
+
* @method ms
|
|
1771
|
+
* @param link A message link.
|
|
1772
|
+
* @example ```ts
|
|
1773
|
+
* const message = await client.resolveMessageLink("https://t.me/MTKruto/212");
|
|
1774
|
+
* ```
|
|
1775
|
+
* @returns The message that was linked to.
|
|
1776
|
+
*/
|
|
1777
|
+
async resolveMessageLink(link) {
|
|
1778
|
+
return await this.#messageManager.resolveMessageLink(link);
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Delete multiple messages.
|
|
1782
|
+
*
|
|
1783
|
+
* @method ms
|
|
1784
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1785
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
1786
|
+
*/
|
|
1787
|
+
async deleteMessages(chatId, messageIds, params) {
|
|
1788
|
+
await this.#messageManager.deleteMessages(chatId, messageIds, params);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Delete a single message.
|
|
1792
|
+
*
|
|
1793
|
+
* @method ms
|
|
1794
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1795
|
+
* @param messageId The identifier of the message to delete.
|
|
1796
|
+
*/
|
|
1797
|
+
async deleteMessage(chatId, messageId, params) {
|
|
1798
|
+
await this.#messageManager.deleteMessages(chatId, [messageId], params);
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
1802
|
+
*
|
|
1803
|
+
* @method ms
|
|
1804
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
1805
|
+
* @param memberId The identifier of the member.
|
|
1806
|
+
*/
|
|
1807
|
+
async deleteChatMemberMessages(chatId, memberId) {
|
|
1808
|
+
await this.#messageManager.deleteChatMemberMessages(chatId, memberId);
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Delete multiple scheduled messages.
|
|
1812
|
+
*
|
|
1813
|
+
* @method ms
|
|
1814
|
+
* @param chatId The identifier of a chat.
|
|
1815
|
+
* @param messageIds The identifiers of the scheduled messages to delete.
|
|
1816
|
+
*/
|
|
1817
|
+
async deleteScheduledMessages(chatId, messageIds) {
|
|
1818
|
+
await this.#messageManager.deleteScheduledMessages(chatId, messageIds);
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Delete a scheduled message.
|
|
1822
|
+
*
|
|
1823
|
+
* @method ms
|
|
1824
|
+
* @param chatId The identifier of a chat.
|
|
1825
|
+
* @param messageId The identifier of the scheduled message to delete.
|
|
1826
|
+
*/
|
|
1827
|
+
async deleteScheduledMessage(chatId, messageId) {
|
|
1828
|
+
await this.#messageManager.deleteScheduledMessage(chatId, messageId);
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Send multiple scheduled messages before their schedule.
|
|
1832
|
+
*
|
|
1833
|
+
* @method ms
|
|
1834
|
+
* @param chatId The identifier of a chat.
|
|
1835
|
+
* @param messageIds The identifiers of the scheduled messages to send.
|
|
1836
|
+
*/
|
|
1837
|
+
async sendScheduledMessages(chatId, messageIds) {
|
|
1838
|
+
return await this.#messageManager.sendScheduledMessages(chatId, messageIds);
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Send a scheduled message before its schedule.
|
|
1842
|
+
*
|
|
1843
|
+
* @method ms
|
|
1844
|
+
* @param chatId The identifier of a chat.
|
|
1845
|
+
* @param messageId The identifier of the scheduled message to send.
|
|
1846
|
+
*/
|
|
1847
|
+
async sendScheduledMessage(chatId, messageId) {
|
|
1848
|
+
return await this.#messageManager.sendScheduledMessage(chatId, messageId);
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Pin a message in a chat.
|
|
1852
|
+
*
|
|
1853
|
+
* @method ms
|
|
1854
|
+
* @param chatId The identifier of a chat.
|
|
1855
|
+
* @param messageId The identifier of the message.
|
|
1856
|
+
*/
|
|
1857
|
+
async pinMessage(chatId, messageId, params) {
|
|
1858
|
+
await this.#messageManager.pinMessage(chatId, messageId, params);
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Unpin a pinned message.
|
|
1862
|
+
*
|
|
1863
|
+
* @method ms
|
|
1864
|
+
* @param chatId The identifier of a chat.
|
|
1865
|
+
* @param messageId The identifier of the message.
|
|
1866
|
+
*/
|
|
1867
|
+
async unpinMessage(chatId, messageId, params) {
|
|
1868
|
+
await this.#messageManager.unpinMessage(chatId, messageId, params);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Unpin all pinned messages.
|
|
1872
|
+
*
|
|
1873
|
+
* @method ms
|
|
1874
|
+
* @param chatId The identifier of a chat.
|
|
1875
|
+
*/
|
|
1876
|
+
async unpinMessages(chatId, params) {
|
|
1877
|
+
await this.#messageManager.unpinMessages(chatId, params);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Forward multiple messages.
|
|
1881
|
+
*
|
|
1882
|
+
* @method ms
|
|
1883
|
+
* @param from The identifier of a chat to forward the messages from.
|
|
1884
|
+
* @param to The identifier of a chat to forward the messages to.
|
|
1885
|
+
* @param messageIds The identifiers of the messages to forward.
|
|
1886
|
+
* @returns The forwarded messages.
|
|
1887
|
+
*/
|
|
1888
|
+
async forwardMessages(from, to, messageIds, params) {
|
|
1889
|
+
return await this.#messageManager.forwardMessages(from, to, messageIds, params);
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Forward a single message.
|
|
1893
|
+
*
|
|
1894
|
+
* @method ms
|
|
1895
|
+
* @param from The identifier of a chat to forward the message from.
|
|
1896
|
+
* @param to The identifier of a chat to forward the message to.
|
|
1897
|
+
* @param messageId The identifier of the message to forward.
|
|
1898
|
+
* @returns The forwarded message.
|
|
1899
|
+
*/
|
|
1900
|
+
async forwardMessage(from, to, messageId, params) {
|
|
1901
|
+
return (await this.forwardMessages(from, to, [messageId], params))[0];
|
|
1902
|
+
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Stop a poll.
|
|
1905
|
+
*
|
|
1906
|
+
* @method ms
|
|
1907
|
+
* @param chatId The chat that includes the poll.
|
|
1908
|
+
* @param messageId The idenfifier of the poll's message.
|
|
1909
|
+
* @returns The new state of the poll.
|
|
1910
|
+
*/
|
|
1911
|
+
async stopPoll(chatId, messageId, params) {
|
|
1912
|
+
return await this.#messageManager.stopPoll(chatId, messageId, params);
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* Send a chat action.
|
|
1916
|
+
*
|
|
1917
|
+
* @method ms
|
|
1918
|
+
* @param chatId The identifier of a chat to send the chat action to.
|
|
1919
|
+
* @param action The chat action.
|
|
1920
|
+
* @param messageThreadId The thread to send the chat action to.
|
|
1921
|
+
*/
|
|
1922
|
+
async sendChatAction(chatId, action, params) {
|
|
1923
|
+
await this.#messageManager.sendChatAction(chatId, action, params);
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Search for messages. User-only.
|
|
1927
|
+
*
|
|
1928
|
+
* @method ms
|
|
1929
|
+
*/
|
|
1930
|
+
async searchMessages(params) {
|
|
1931
|
+
return await this.#messageManager.searchMessages(params);
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Mark messages as read. User-only.
|
|
1935
|
+
*
|
|
1936
|
+
* @method ms
|
|
1937
|
+
* @param chatId The identifier of the chat which the messages belong to.
|
|
1938
|
+
* @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
|
|
1939
|
+
*/
|
|
1940
|
+
async readMessages(chatId, untilMessageId) {
|
|
1941
|
+
await this.#messageManager.readMessages(chatId, untilMessageId);
|
|
1942
|
+
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Start a bot. User-only.
|
|
1945
|
+
*
|
|
1946
|
+
* @method ms
|
|
1947
|
+
* @param botId The identifier of the bot to start.
|
|
1948
|
+
* @returns The start message.
|
|
1949
|
+
*/
|
|
1950
|
+
async startBot(botId, params) {
|
|
1951
|
+
return await this.#messageManager.startBot(botId, params);
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* Transcribe a voice message. User-only.
|
|
1955
|
+
*
|
|
1956
|
+
* @method ms
|
|
1957
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1958
|
+
* @param messageId The identifier of the message.
|
|
1959
|
+
* @cache
|
|
1960
|
+
*/
|
|
1961
|
+
async transcribeVoice(chatId, messageId) {
|
|
1962
|
+
return await this.#messageManager.transcribeVoice(chatId, messageId);
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Get a sticker set.
|
|
1966
|
+
*
|
|
1967
|
+
* @method ms
|
|
1968
|
+
* @param name The name of the sticker set or its link.
|
|
1969
|
+
*/
|
|
1970
|
+
async getStickerSet(name) {
|
|
1971
|
+
return await this.#messageManager.getStickerSet(name);
|
|
1972
|
+
}
|
|
1973
|
+
/*
|
|
1974
|
+
* Get the link preview for a message that is about to be sent. User-only.
|
|
1975
|
+
*
|
|
1976
|
+
* @method ms
|
|
1977
|
+
* @param text The message's text.
|
|
1978
|
+
*/
|
|
1979
|
+
async getLinkPreview(text, params) {
|
|
1980
|
+
return await this.#linkPreviewManager.getLinkPreview(text, params);
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* Open a mini app. User-only.
|
|
1984
|
+
*
|
|
1985
|
+
* @method ms
|
|
1986
|
+
* @param botId The identifier of a bot with the mini app.
|
|
1987
|
+
* @param chatId The identifier of the chat from which the mini app is opened.
|
|
1988
|
+
* @cache
|
|
1989
|
+
*/
|
|
1990
|
+
async openMiniApp(botId, chatId, params) {
|
|
1991
|
+
return await this.#messageManager.openMiniApp(botId, chatId, params);
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
|
|
1995
|
+
*
|
|
1996
|
+
* @method ms
|
|
1997
|
+
* @cache
|
|
1998
|
+
*/
|
|
1999
|
+
async getProgressId() {
|
|
2000
|
+
return await this.#fileManager.getProgressId();
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Get messages saved from a specific chat.
|
|
2004
|
+
*
|
|
2005
|
+
* @method ms
|
|
2006
|
+
* @param chatId The identifier of a chat.
|
|
2007
|
+
*/
|
|
2008
|
+
async getSavedMessages(chatId, params) {
|
|
2009
|
+
return await this.#messageManager.getSavedMessages(chatId, params);
|
|
2010
|
+
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Get a list of saved chats.
|
|
2013
|
+
*
|
|
2014
|
+
* @method ms
|
|
2015
|
+
*/
|
|
2016
|
+
async getSavedChats(params) {
|
|
2017
|
+
return await this.#messageManager.getSavedChats(params);
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* Get a list of reactions made to a message. User-only.
|
|
2021
|
+
*
|
|
2022
|
+
* @param chatId The identifier of a chat.
|
|
2023
|
+
* @param messageId The identifier of the message.
|
|
2024
|
+
* @method ms
|
|
2025
|
+
*/
|
|
2026
|
+
async getMessageReactions(chatId, messageId, params) {
|
|
2027
|
+
return await this.#messageManager.getMessageReactions(chatId, messageId, params);
|
|
2028
|
+
}
|
|
2029
|
+
//
|
|
2030
|
+
// ========================= POLLS ========================= //
|
|
2031
|
+
//
|
|
2032
|
+
/**
|
|
2033
|
+
* Cast a vote. User-only.
|
|
2034
|
+
*
|
|
2035
|
+
* @method pl
|
|
2036
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
2037
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
2038
|
+
* @param optionIndexes The indexes of the options to cast for.
|
|
2039
|
+
*/
|
|
2040
|
+
async vote(chatId, messageId, optionIndexes) {
|
|
2041
|
+
await this.#pollManager.vote(chatId, messageId, optionIndexes);
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* Retract a vote. User-only.
|
|
2045
|
+
*
|
|
2046
|
+
* @method pl
|
|
2047
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
2048
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
2049
|
+
*/
|
|
2050
|
+
async retractVote(chatId, messageId) {
|
|
2051
|
+
await this.#pollManager.retractVote(chatId, messageId);
|
|
2052
|
+
}
|
|
2053
|
+
//
|
|
2054
|
+
// ========================= CHECKLISTS ========================= //
|
|
2055
|
+
//
|
|
2056
|
+
/**
|
|
2057
|
+
* Add items to a checklist. User-only.
|
|
2058
|
+
*
|
|
2059
|
+
* @param chatId The identifier of a chat.
|
|
2060
|
+
* @param messageId The identifier of the checklist message.
|
|
2061
|
+
* @param items The items to add.
|
|
2062
|
+
* @method cl
|
|
2063
|
+
*/
|
|
2064
|
+
async addToChecklist(chatId, messageId, items) {
|
|
2065
|
+
await this.#checklistManager.addToChecklist(chatId, messageId, items);
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Update a checklist. User-only.
|
|
2069
|
+
*
|
|
2070
|
+
* @param chatId The identifier of a chat.
|
|
2071
|
+
* @param messageId The identifier of the checklist message.
|
|
2072
|
+
* @method cl
|
|
2073
|
+
*/
|
|
2074
|
+
async updateChecklist(chatId, messageId, params) {
|
|
2075
|
+
await this.#checklistManager.updateChecklist(chatId, messageId, params);
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Check multiple items of a checklist. User-only.
|
|
2079
|
+
*
|
|
2080
|
+
* @param chatId The identifier of a chat.
|
|
2081
|
+
* @param messageId The identifier of the checklist message.
|
|
2082
|
+
* @param items The identifiers of the items to check.
|
|
2083
|
+
* @method cl
|
|
2084
|
+
*/
|
|
2085
|
+
async checkChecklistItems(chatId, messageId, items) {
|
|
2086
|
+
await this.#checklistManager.checkChecklistItems(chatId, messageId, items);
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Uncheck multiple items of a checklist. User-only.
|
|
2090
|
+
*
|
|
2091
|
+
* @param chatId The identifier of a chat.
|
|
2092
|
+
* @param messageId The identifier of the checklist message.
|
|
2093
|
+
* @param items The identifiers of the items to uncheck.
|
|
2094
|
+
* @method cl
|
|
2095
|
+
*/
|
|
2096
|
+
async uncheckChecklistItems(chatId, messageId, items) {
|
|
2097
|
+
await this.#checklistManager.uncheckChecklistItems(chatId, messageId, items);
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Check a single item of a checklist. User-only.
|
|
2101
|
+
*
|
|
2102
|
+
* @param chatId The identifier of a chat.
|
|
2103
|
+
* @param messageId The identifier of the checklist message.
|
|
2104
|
+
* @param item The identifier of the item to check.
|
|
2105
|
+
* @method cl
|
|
2106
|
+
*/
|
|
2107
|
+
async checkChecklistItem(chatId, messageId, item) {
|
|
2108
|
+
await this.#checklistManager.checkChecklistItem(chatId, messageId, item);
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Uncheck a single item of a checklist. User-only.
|
|
2112
|
+
*
|
|
2113
|
+
* @param chatId The identifier of a chat.
|
|
2114
|
+
* @param messageId The identifier of the checklist message.
|
|
2115
|
+
* @param item The identifier of the item to uncheck.
|
|
2116
|
+
* @method cl
|
|
2117
|
+
*/
|
|
2118
|
+
async uncheckChecklistItem(chatId, messageId, item) {
|
|
2119
|
+
await this.#checklistManager.uncheckChecklistItem(chatId, messageId, item);
|
|
2120
|
+
}
|
|
2121
|
+
//
|
|
2122
|
+
// ========================= FILES ========================= //
|
|
2123
|
+
//
|
|
2124
|
+
/**
|
|
2125
|
+
* Download a chunk of a file.
|
|
2126
|
+
*
|
|
2127
|
+
* @method fs
|
|
2128
|
+
* @param fileId The identifier of a file.
|
|
2129
|
+
* @example ```ts
|
|
2130
|
+
* const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
|
|
2131
|
+
* ```
|
|
2132
|
+
* @returns The downloaded chunk.
|
|
2133
|
+
* @cache file
|
|
2134
|
+
*/
|
|
2135
|
+
async downloadChunk(fileId, params) {
|
|
2136
|
+
const controller = new AbortController();
|
|
2137
|
+
for await (const chunk of this.#fileManager.download(fileId, { ...params, signal: controller.signal })) {
|
|
2138
|
+
controller.abort();
|
|
2139
|
+
return chunk;
|
|
2140
|
+
}
|
|
2141
|
+
unreachable();
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Download a file.
|
|
2145
|
+
*
|
|
2146
|
+
* @method fs
|
|
2147
|
+
* @param fileId The identifier of the file to download.
|
|
2148
|
+
* @example ```ts
|
|
2149
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
2150
|
+
* await outFile.write(chunk);
|
|
2151
|
+
* }
|
|
2152
|
+
* ```
|
|
2153
|
+
* @returns A generator yielding the contents of the file.
|
|
2154
|
+
* @cache file
|
|
2155
|
+
*/
|
|
2156
|
+
async *download(fileId, params) {
|
|
2157
|
+
for await (const chunk of this.#fileManager.download(fileId, params)) {
|
|
2158
|
+
yield chunk;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* Get custom emoji documents for download.
|
|
2163
|
+
*
|
|
2164
|
+
* @method fs
|
|
2165
|
+
* @param id Identifier of one or more of custom emojis.
|
|
2166
|
+
* @returns The custom emoji documents.
|
|
2167
|
+
* @cache
|
|
2168
|
+
*/
|
|
2169
|
+
async getCustomEmojiStickers(id) {
|
|
2170
|
+
return await this.#fileManager.getCustomEmojiStickers(id);
|
|
2171
|
+
}
|
|
2172
|
+
//
|
|
2173
|
+
// ========================= CHATS ========================= //
|
|
2174
|
+
//
|
|
2175
|
+
/**
|
|
2176
|
+
* Get chats from a chat list. User-only.
|
|
2177
|
+
*
|
|
2178
|
+
* @method ch
|
|
2179
|
+
*/
|
|
2180
|
+
async getChats(params) {
|
|
2181
|
+
return await this.#chatListManager.getChats(params?.from, params?.after, params?.limit);
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Get pinned chats from a chat list. User-only.
|
|
2185
|
+
*
|
|
2186
|
+
* @method ch
|
|
2187
|
+
* @param from The chat list to get the pinned chats from. Defaults to main.
|
|
2188
|
+
*/
|
|
2189
|
+
async getPinnedChats(from) {
|
|
2190
|
+
return await this.#chatListManager.getPinnedChats(from);
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Get a chat.
|
|
2194
|
+
*
|
|
2195
|
+
* @method ch
|
|
2196
|
+
* @cache
|
|
2197
|
+
*/
|
|
2198
|
+
async getChat(chatId) {
|
|
2199
|
+
return await this.#chatListManager.getChat(chatId);
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Get chat history. User-only.
|
|
2203
|
+
*
|
|
2204
|
+
* @method ch
|
|
2205
|
+
* @param chatId The identifier of a chat.
|
|
2206
|
+
*/
|
|
2207
|
+
async getHistory(chatId, params) {
|
|
2208
|
+
return await this.#messageManager.getHistory(chatId, params);
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Set a chat's available reactions. User-only.
|
|
2212
|
+
*
|
|
2213
|
+
* @method ch
|
|
2214
|
+
* @param chatId The identifier of a chat.
|
|
2215
|
+
* @param availableReactions The new available reactions.
|
|
2216
|
+
*/
|
|
2217
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
2218
|
+
await this.#chatManager.setAvailableReactions(chatId, availableReactions);
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Set a chat's photo.
|
|
2222
|
+
*
|
|
2223
|
+
* @method ch
|
|
2224
|
+
* @param chatId The identifier of a chat.
|
|
2225
|
+
* @param photo A photo to set as the chat's photo.
|
|
2226
|
+
*/
|
|
2227
|
+
async setChatPhoto(chatId, photo, params) {
|
|
2228
|
+
await this.#chatManager.setChatPhoto(chatId, photo, params);
|
|
2229
|
+
}
|
|
2230
|
+
/**
|
|
2231
|
+
* Delete a chat's photo.
|
|
2232
|
+
*
|
|
2233
|
+
* @method ch
|
|
2234
|
+
* @param chatId The identifier of a chat.
|
|
2235
|
+
*/
|
|
2236
|
+
async deleteChatPhoto(chatId) {
|
|
2237
|
+
await this.#chatManager.deleteChatPhoto(chatId);
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Ban a member from a chat.
|
|
2241
|
+
*
|
|
2242
|
+
* @method ch
|
|
2243
|
+
* @param chatId The identifier of a chat.
|
|
2244
|
+
* @param memberId The identifier of the member.
|
|
2245
|
+
*/
|
|
2246
|
+
async banChatMember(chatId, memberId, params) {
|
|
2247
|
+
await this.#chatManager.banChatMember(chatId, memberId, params);
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* Unban a member from a chat.
|
|
2251
|
+
*
|
|
2252
|
+
* @method ch
|
|
2253
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2254
|
+
* @param memberId The identifier of the member.
|
|
2255
|
+
*/
|
|
2256
|
+
async unbanChatMember(chatId, memberId) {
|
|
2257
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
2261
|
+
*
|
|
2262
|
+
* @method ch
|
|
2263
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2264
|
+
* @param memberId The identifier of the member.
|
|
2265
|
+
*/
|
|
2266
|
+
async kickChatMember(chatId, memberId) {
|
|
2267
|
+
await this.#chatManager.banChatMember(chatId, memberId);
|
|
2268
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Set the rights of a chat member.
|
|
2272
|
+
*
|
|
2273
|
+
* @method ch
|
|
2274
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2275
|
+
* @param memberId The identifier of the member.
|
|
2276
|
+
*/
|
|
2277
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
2278
|
+
await this.#chatManager.setChatMemberRights(chatId, memberId, params);
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* Get the administrators of a chat.
|
|
2282
|
+
*
|
|
2283
|
+
* @method ch
|
|
2284
|
+
* @param chatId The identifier of a chat.
|
|
2285
|
+
* @returns The chat's administrators.
|
|
2286
|
+
*/
|
|
2287
|
+
async getChatAdministrators(chatId) {
|
|
2288
|
+
return await this.#chatListManager.getChatAdministrators(chatId);
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* Enable join requests in a chat. User-only.
|
|
2292
|
+
*
|
|
2293
|
+
* @method ch
|
|
2294
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
2295
|
+
*/
|
|
2296
|
+
async enableJoinRequests(chatId) {
|
|
2297
|
+
await this.#chatManager.enableJoinRequests(chatId);
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Disable join requests in a chat. User-only.
|
|
2301
|
+
*
|
|
2302
|
+
* @method ch
|
|
2303
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
2304
|
+
*/
|
|
2305
|
+
async disableJoinRequests(chatId) {
|
|
2306
|
+
await this.#chatManager.disableJoinRequests(chatId);
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Get inactive chats. User-only.
|
|
2310
|
+
*
|
|
2311
|
+
* @method ch
|
|
2312
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
2313
|
+
*/
|
|
2314
|
+
async getInactiveChats() {
|
|
2315
|
+
return await this.#accountManager.getInactiveChats();
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* Get the invite links created for a chat. User-only.
|
|
2319
|
+
*
|
|
2320
|
+
* @method ch
|
|
2321
|
+
* @param chatId The identifier of a chat.
|
|
2322
|
+
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
2323
|
+
*/
|
|
2324
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
2325
|
+
return await this.#chatManager.getCreatedInviteLinks(chatId, params);
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* Join a chat. User-only.
|
|
2329
|
+
*
|
|
2330
|
+
* @method ch
|
|
2331
|
+
* @param chatId The identifier of a chat.
|
|
2332
|
+
*/
|
|
2333
|
+
async joinChat(chatId) {
|
|
2334
|
+
await this.#chatManager.joinChat(chatId);
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* Leave a chat.
|
|
2338
|
+
*
|
|
2339
|
+
* @method ch
|
|
2340
|
+
* @param chatId The identifier of a chat.
|
|
2341
|
+
*/
|
|
2342
|
+
async leaveChat(chatId) {
|
|
2343
|
+
await this.#chatManager.leaveChat(chatId);
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Get information on a user's chat membership.
|
|
2347
|
+
*
|
|
2348
|
+
* @method ch
|
|
2349
|
+
* @param chatId The identifier of a chat.
|
|
2350
|
+
* @param userId The identifier of the user.
|
|
2351
|
+
*/
|
|
2352
|
+
async getChatMember(chatId, userId) {
|
|
2353
|
+
return await this.#chatListManager.getChatMember(chatId, userId);
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* Get the members of a chat.
|
|
2357
|
+
*
|
|
2358
|
+
* @method ch
|
|
2359
|
+
* @param chatId The identifier of a chat.
|
|
2360
|
+
*/
|
|
2361
|
+
async getChatMembers(chatId, params) {
|
|
2362
|
+
return await this.#chatListManager.getChatMembers(chatId, params);
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Set a chat's sticker set.
|
|
2366
|
+
*
|
|
2367
|
+
* @method ch
|
|
2368
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2369
|
+
* @param setName The name of the set.
|
|
2370
|
+
*/
|
|
2371
|
+
async setChatStickerSet(chatId, setName) {
|
|
2372
|
+
await this.#messageManager.setChatStickerSet(chatId, setName);
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* Delete a chat's sticker set.
|
|
2376
|
+
*
|
|
2377
|
+
* @method ch
|
|
2378
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2379
|
+
*/
|
|
2380
|
+
async deleteChatStickerSet(chatId) {
|
|
2381
|
+
await this.#messageManager.deleteChatStickerSet(chatId);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
2385
|
+
*
|
|
2386
|
+
* @method ch
|
|
2387
|
+
* @param chatId The identifier of a chat.
|
|
2388
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
2389
|
+
*/
|
|
2390
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
2391
|
+
await this.#chatManager.setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Create an invite link.
|
|
2395
|
+
*
|
|
2396
|
+
* @method ch
|
|
2397
|
+
* @param chatId The identifier of a chat to create the invite link for.
|
|
2398
|
+
* @returns The newly created invite link.
|
|
2399
|
+
*/
|
|
2400
|
+
async createInviteLink(chatId, params) {
|
|
2401
|
+
return await this.#chatManager.createInviteLink(chatId, params);
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Approve a join request.
|
|
2405
|
+
*
|
|
2406
|
+
* @method ch
|
|
2407
|
+
* @param chatId The identifier of a chat with the join request.
|
|
2408
|
+
* @param userId The user who made the join request.
|
|
2409
|
+
*/
|
|
2410
|
+
async approveJoinRequest(chatId, userId) {
|
|
2411
|
+
await this.#chatManager.approveJoinRequest(chatId, userId);
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* Decline a join request.
|
|
2415
|
+
*
|
|
2416
|
+
* @method ch
|
|
2417
|
+
* @param chatId The identifier of a chat with the join request.
|
|
2418
|
+
* @param userId The user who made the join request.
|
|
2419
|
+
*/
|
|
2420
|
+
async declineJoinRequest(chatId, userId) {
|
|
2421
|
+
await this.#chatManager.declineJoinRequest(chatId, userId);
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* Approve all join requests. User-only.
|
|
2425
|
+
*
|
|
2426
|
+
* @method ch
|
|
2427
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
2428
|
+
*/
|
|
2429
|
+
async approveJoinRequests(chatId, params) {
|
|
2430
|
+
await this.#chatManager.approveJoinRequests(chatId, params);
|
|
2431
|
+
}
|
|
2432
|
+
/**
|
|
2433
|
+
* Decline all join requests. User-only.
|
|
2434
|
+
*
|
|
2435
|
+
* @method ch
|
|
2436
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
2437
|
+
*/
|
|
2438
|
+
async declineJoinRequests(chatId, params) {
|
|
2439
|
+
await this.#chatManager.declineJoinRequests(chatId, params);
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Get pending join requests in a chat. User-only.
|
|
2443
|
+
*
|
|
2444
|
+
* @method ch
|
|
2445
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
2446
|
+
*/
|
|
2447
|
+
async getJoinRequests(chatId, params) {
|
|
2448
|
+
return await this.#chatManager.getJoinRequests(chatId, params);
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* Add a single user to a chat.
|
|
2452
|
+
*
|
|
2453
|
+
* @method ch
|
|
2454
|
+
* @param chatId The identifier of a chat to add the user to.
|
|
2455
|
+
* @param userId The identifier of the user to add to the chat.
|
|
2456
|
+
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
2457
|
+
*/
|
|
2458
|
+
async addChatMember(chatId, userId, params) {
|
|
2459
|
+
return await this.#chatManager.addChatMember(chatId, userId, params);
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Add multiple users at once to a channel or a supergroup.
|
|
2463
|
+
*
|
|
2464
|
+
* @method ch
|
|
2465
|
+
* @param chatId The identifier of the channel or supergroup to add the users to.
|
|
2466
|
+
* @param userId The identifiers of the users to add to the channel or supergroup.
|
|
2467
|
+
* @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
|
|
2468
|
+
*/
|
|
2469
|
+
async addChatMembers(chatId, userIds) {
|
|
2470
|
+
return await this.#chatManager.addChatMembers(chatId, userIds);
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Open a chat.
|
|
2474
|
+
*
|
|
2475
|
+
* @method ch
|
|
2476
|
+
* @param chatId The identifier of a chat to open.
|
|
2477
|
+
*/
|
|
2478
|
+
async openChat(chatId, params) {
|
|
2479
|
+
await this.#updateManager.openChat(chatId, params);
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* Close a chat previously opened by openChat.
|
|
2483
|
+
*
|
|
2484
|
+
* @method ch
|
|
2485
|
+
* @param chatId The identifier of a chat to close.
|
|
2486
|
+
*/
|
|
2487
|
+
async closeChat(chatId) {
|
|
2488
|
+
await this.#updateManager.closeChat(chatId);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Create a group. User-only.
|
|
2492
|
+
*
|
|
2493
|
+
* @method ch
|
|
2494
|
+
* @param title The title of the group.
|
|
2495
|
+
* @returns The created group.
|
|
2496
|
+
*/
|
|
2497
|
+
async createGroup(title, params) {
|
|
2498
|
+
return await this.#chatListManager.createGroup(title, params);
|
|
2499
|
+
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Create a supergroup. User-only.
|
|
2502
|
+
*
|
|
2503
|
+
* @method ch
|
|
2504
|
+
* @param title The title of the supergroup.
|
|
2505
|
+
* @returns The created supergroup.
|
|
2506
|
+
*/
|
|
2507
|
+
async createSupergroup(title, params) {
|
|
2508
|
+
return await this.#chatListManager.createSupergroup(title, params);
|
|
2509
|
+
}
|
|
2510
|
+
/**
|
|
2511
|
+
* Create a channel. User-only.
|
|
2512
|
+
*
|
|
2513
|
+
* @method ch
|
|
2514
|
+
* @param title The title of the channel.
|
|
2515
|
+
* @returns The created channel.
|
|
2516
|
+
*/
|
|
2517
|
+
async createChannel(title, params) {
|
|
2518
|
+
return await this.#chatListManager.createChannel(title, params);
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Set the time to live of the messages of a chat. User-only.
|
|
2522
|
+
*
|
|
2523
|
+
* @method ch
|
|
2524
|
+
* @param chatId The identifier of a chat.
|
|
2525
|
+
* @param messageTtl The time to live of the messages in seconds.
|
|
2526
|
+
*/
|
|
2527
|
+
async setMessageTtl(chatId, messageTtl) {
|
|
2528
|
+
await this.#chatListManager.setMessageTtl(chatId, messageTtl);
|
|
2529
|
+
}
|
|
2530
|
+
/**
|
|
2531
|
+
* Archive multiple chats. User-only.
|
|
2532
|
+
*
|
|
2533
|
+
* @method ch
|
|
2534
|
+
* @param chatIds The identifiers of the chats to archive.
|
|
2535
|
+
*/
|
|
2536
|
+
async archiveChats(chatIds) {
|
|
2537
|
+
await this.#chatListManager.archiveChats(chatIds);
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Archive a single chat. User-only.
|
|
2541
|
+
*
|
|
2542
|
+
* @method ch
|
|
2543
|
+
* @param chatId The identifier of a chat.
|
|
2544
|
+
*/
|
|
2545
|
+
async archiveChat(chatId) {
|
|
2546
|
+
await this.#chatListManager.archiveChat(chatId);
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Unarchive multiple chats. User-only.
|
|
2550
|
+
*
|
|
2551
|
+
* @method ch
|
|
2552
|
+
* @param chatIds The identifiers of the chats to unarchive.
|
|
2553
|
+
*/
|
|
2554
|
+
async unarchiveChats(chatIds) {
|
|
2555
|
+
await this.#chatListManager.unarchiveChats(chatIds);
|
|
2556
|
+
}
|
|
2557
|
+
/**
|
|
2558
|
+
* Unarchive a single chat. User-only.
|
|
2559
|
+
*
|
|
2560
|
+
* @method ch
|
|
2561
|
+
* @param chatId The identifier of a chat.
|
|
2562
|
+
*/
|
|
2563
|
+
async unarchiveChat(chatId) {
|
|
2564
|
+
await this.#chatListManager.unarchiveChat(chatId);
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* Get common chats between a user and the current one. User-only.
|
|
2568
|
+
*
|
|
2569
|
+
* @method ch
|
|
2570
|
+
* @param userId The identifier of the user to get the common chats with them.
|
|
2571
|
+
*/
|
|
2572
|
+
async getCommonChats(userId, params) {
|
|
2573
|
+
return await this.#chatListManager.getCommonChats(userId, params);
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Get the settings of a chat. User-only.
|
|
2577
|
+
*
|
|
2578
|
+
* @method ch
|
|
2579
|
+
* @param chatId The identifier of a chat.
|
|
2580
|
+
*/
|
|
2581
|
+
async getChatSettings(chatId) {
|
|
2582
|
+
return await this.#chatListManager.getChatSettings(chatId);
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* Disable business bots in a private chat. User-only.
|
|
2586
|
+
*
|
|
2587
|
+
* @method ch
|
|
2588
|
+
* @param chatId The identifier of the private chat to disable business bots in.
|
|
2589
|
+
*/
|
|
2590
|
+
async disableBusinessBots(chatId) {
|
|
2591
|
+
await this.#chatListManager.disableBusinessBots(chatId);
|
|
2592
|
+
}
|
|
2593
|
+
/**
|
|
2594
|
+
* Enable business bots in a private chat. User-only.
|
|
2595
|
+
*
|
|
2596
|
+
* @method ch
|
|
2597
|
+
* @param chatId The identifier of the private chat to enable business bots in.
|
|
2598
|
+
*/
|
|
2599
|
+
async enableBusinessBots(chatId) {
|
|
2600
|
+
await this.#chatListManager.enableBusinessBots(chatId);
|
|
2601
|
+
}
|
|
2602
|
+
/**
|
|
2603
|
+
* Disable slow mode in a group. User-only.
|
|
2604
|
+
*
|
|
2605
|
+
* @method ch
|
|
2606
|
+
* @param chatId The identifier of the group to disable slow mode in.
|
|
2607
|
+
*/
|
|
2608
|
+
async disableSlowMode(chatId) {
|
|
2609
|
+
await this.#chatManager.disableSlowMode(chatId);
|
|
2610
|
+
}
|
|
2611
|
+
/**
|
|
2612
|
+
* Change slow mode in a group. User-only.
|
|
2613
|
+
*
|
|
2614
|
+
* @method ch
|
|
2615
|
+
* @param chatId The identifier of the group to change slow mode in.
|
|
2616
|
+
* @param duration New slow mode duration.
|
|
2617
|
+
*/
|
|
2618
|
+
async setSlowMode(chatId, duration) {
|
|
2619
|
+
await this.#chatManager.setSlowMode(chatId, duration);
|
|
2620
|
+
}
|
|
2621
|
+
/**
|
|
2622
|
+
* Change the title of a chat.
|
|
2623
|
+
*
|
|
2624
|
+
* @method ch
|
|
2625
|
+
* @param chatId The identifier of a chat.
|
|
2626
|
+
* @param title The new title.
|
|
2627
|
+
*/
|
|
2628
|
+
async setChatTitle(chatId, title) {
|
|
2629
|
+
await this.#chatManager.setChatTitle(chatId, title);
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
* Change the description of a chat.
|
|
2633
|
+
*
|
|
2634
|
+
* @method ch
|
|
2635
|
+
* @param chatId The identifier of a chat.
|
|
2636
|
+
* @param description The new description.
|
|
2637
|
+
*/
|
|
2638
|
+
async setChatDescription(chatId, description) {
|
|
2639
|
+
await this.#chatManager.setChatDescription(chatId, description);
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* Hide the member list of a group to non-admins. User-only.
|
|
2643
|
+
*
|
|
2644
|
+
* @method ch
|
|
2645
|
+
* @param chatId The identifier of the group.
|
|
2646
|
+
*/
|
|
2647
|
+
async hideMemberList(chatId) {
|
|
2648
|
+
await this.#chatManager.hideMemberList(chatId);
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* Show the member list of a group to non-admins. User-only.
|
|
2652
|
+
*
|
|
2653
|
+
* @method ch
|
|
2654
|
+
* @param chatId The identifier of the group.
|
|
2655
|
+
*/
|
|
2656
|
+
async showMemberList(chatId) {
|
|
2657
|
+
await this.#chatManager.showMemberList(chatId);
|
|
2658
|
+
}
|
|
2659
|
+
/**
|
|
2660
|
+
* Enable topics in a group. User-only.
|
|
2661
|
+
*
|
|
2662
|
+
* @method ch
|
|
2663
|
+
* @param chatId The identifier of the group.
|
|
2664
|
+
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
2665
|
+
*/
|
|
2666
|
+
async enableTopics(chatId, isShownAsTabs) {
|
|
2667
|
+
await this.#chatManager.enableTopics(chatId, isShownAsTabs);
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Disable topics in a group. User-only.
|
|
2671
|
+
*
|
|
2672
|
+
* @method ch
|
|
2673
|
+
* @param chatId The identifier of the group.
|
|
2674
|
+
*/
|
|
2675
|
+
async disableTopics(chatId) {
|
|
2676
|
+
await this.#chatManager.disableTopics(chatId);
|
|
2677
|
+
}
|
|
2678
|
+
/**
|
|
2679
|
+
* Enable automatic anti-spam in a group. User-only.
|
|
2680
|
+
*
|
|
2681
|
+
* @method ch
|
|
2682
|
+
* @param chatId The identifier of the group.
|
|
2683
|
+
*/
|
|
2684
|
+
async enableAntispam(chatId) {
|
|
2685
|
+
await this.#chatManager.enableAntispam(chatId);
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* Disable automatic anti-spam in a group. User-only.
|
|
2689
|
+
*
|
|
2690
|
+
* @method ch
|
|
2691
|
+
* @param chatId The identifier of the group.
|
|
2692
|
+
*/
|
|
2693
|
+
async disableAntispam(chatId) {
|
|
2694
|
+
await this.#chatManager.disableAntispam(chatId);
|
|
2695
|
+
}
|
|
2696
|
+
/**
|
|
2697
|
+
* Enable post signatures in a channel. User-only.
|
|
2698
|
+
*
|
|
2699
|
+
* @method ch
|
|
2700
|
+
* @param chatId The identifier of the channel.
|
|
2701
|
+
*/
|
|
2702
|
+
async enableSignatures(chatId, params) {
|
|
2703
|
+
await this.#chatManager.enableSignatures(chatId, params);
|
|
2704
|
+
}
|
|
2705
|
+
/**
|
|
2706
|
+
* Disable post signatures in a channel. User-only.
|
|
2707
|
+
*
|
|
2708
|
+
* @method ch
|
|
2709
|
+
* @param chatId The identifier of the channel.
|
|
2710
|
+
*/
|
|
2711
|
+
async disableSignatures(chatId) {
|
|
2712
|
+
await this.#chatManager.disableSignatures(chatId);
|
|
2713
|
+
}
|
|
2714
|
+
/**
|
|
2715
|
+
* Delete a chat. User-only.
|
|
2716
|
+
*
|
|
2717
|
+
* @method ch
|
|
2718
|
+
* @param chatId The identifier of a chat.
|
|
2719
|
+
*/
|
|
2720
|
+
async deleteChat(chatId) {
|
|
2721
|
+
await this.#chatManager.deleteChat(chatId);
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* Get discussion chat suggestions. User-only.
|
|
2725
|
+
*
|
|
2726
|
+
* @method ch
|
|
2727
|
+
*/
|
|
2728
|
+
async getDiscussionChatSuggestions() {
|
|
2729
|
+
return await this.#chatManager.getDiscussionChatSuggestions();
|
|
2730
|
+
}
|
|
2731
|
+
/**
|
|
2732
|
+
* Set a channel's discussion chat. User-only.
|
|
2733
|
+
*
|
|
2734
|
+
* @method ch
|
|
2735
|
+
* @param chatId The identifier of a channel.
|
|
2736
|
+
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
2737
|
+
*/
|
|
2738
|
+
async setDiscussionChat(chatId, discussionChatId) {
|
|
2739
|
+
await this.#chatManager.setDiscussionChat(chatId, discussionChatId);
|
|
2740
|
+
}
|
|
2741
|
+
/**
|
|
2742
|
+
* Transfer the ownership of a chat. User-only.
|
|
2743
|
+
*
|
|
2744
|
+
* @method ch
|
|
2745
|
+
* @param chatId The identifier of a chat.
|
|
2746
|
+
* @param userId The identifier of the new owner.
|
|
2747
|
+
* @param password The password of the current account.
|
|
2748
|
+
*/
|
|
2749
|
+
async transferChatOwnership(chatId, userId, password) {
|
|
2750
|
+
await this.#chatManager.transferChatOwnership(chatId, userId, password);
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* Create a forum topic.
|
|
2754
|
+
*
|
|
2755
|
+
* @method ch
|
|
2756
|
+
* @param chatId The identifier of a chat.
|
|
2757
|
+
* @param title The title of the topic.
|
|
2758
|
+
* @returns The created topic.
|
|
2759
|
+
*/
|
|
2760
|
+
async createTopic(chatId, title, params) {
|
|
2761
|
+
return await this.#forumManager.createTopic(chatId, title, params);
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Edit a forum topic.
|
|
2765
|
+
*
|
|
2766
|
+
* @method ch
|
|
2767
|
+
* @param chatId The identifier of a chat.
|
|
2768
|
+
* @param topicId The identifier of the topic.
|
|
2769
|
+
* @param title The new title of the topic.
|
|
2770
|
+
* @returns The new topic.
|
|
2771
|
+
*/
|
|
2772
|
+
async editTopic(chatId, topicId, title, params) {
|
|
2773
|
+
return await this.#forumManager.editTopic(chatId, topicId, title, params);
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
* Hide the general forum topic.
|
|
2777
|
+
*
|
|
2778
|
+
* @method ch
|
|
2779
|
+
* @param chatId The identifier of a chat.
|
|
2780
|
+
*/
|
|
2781
|
+
async hideGeneralTopic(chatId) {
|
|
2782
|
+
await this.#forumManager.hideGeneralTopic(chatId);
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Show the general forum topic.
|
|
2786
|
+
*
|
|
2787
|
+
* @method ch
|
|
2788
|
+
* @param chatId The identifier of a chat.
|
|
2789
|
+
*/
|
|
2790
|
+
async showGeneralTopic(chatId) {
|
|
2791
|
+
await this.#forumManager.showGeneralTopic(chatId);
|
|
2792
|
+
}
|
|
2793
|
+
/**
|
|
2794
|
+
* Close a forum topic.
|
|
2795
|
+
*
|
|
2796
|
+
* @method ch
|
|
2797
|
+
* @param chatId The identifier of a chat.
|
|
2798
|
+
* @param topicId The identifier of the topic.
|
|
2799
|
+
*/
|
|
2800
|
+
async closeTopic(chatId, topicId) {
|
|
2801
|
+
await this.#forumManager.closeTopic(chatId, topicId);
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* Reopen a forum topic.
|
|
2805
|
+
*
|
|
2806
|
+
* @method ch
|
|
2807
|
+
* @param chatId The identifier of a chat.
|
|
2808
|
+
* @param topicId The identifier of the topic.
|
|
2809
|
+
*/
|
|
2810
|
+
async reopenTopic(chatId, topicId) {
|
|
2811
|
+
await this.#forumManager.reopenTopic(chatId, topicId);
|
|
2812
|
+
}
|
|
2813
|
+
/**
|
|
2814
|
+
* Pin a forum topic.
|
|
2815
|
+
*
|
|
2816
|
+
* @method ch
|
|
2817
|
+
* @param chatId The identifier of a chat.
|
|
2818
|
+
* @param topicId The identifier of the topic.
|
|
2819
|
+
*/
|
|
2820
|
+
async pinTopic(chatId, topicId) {
|
|
2821
|
+
await this.#forumManager.pinTopic(chatId, topicId);
|
|
2822
|
+
}
|
|
2823
|
+
/**
|
|
2824
|
+
* Unpin a forum topic.
|
|
2825
|
+
*
|
|
2826
|
+
* @method ch
|
|
2827
|
+
* @param chatId The identifier of a chat.
|
|
2828
|
+
* @param topicId The identifier of the topic.
|
|
2829
|
+
*/
|
|
2830
|
+
async unpinTopic(chatId, topicId) {
|
|
2831
|
+
await this.#forumManager.unpinTopic(chatId, topicId);
|
|
2832
|
+
}
|
|
2833
|
+
/**
|
|
2834
|
+
* Promote a chat member.
|
|
2835
|
+
*
|
|
2836
|
+
* @method ch
|
|
2837
|
+
* @param chatId The identifier of a chat.
|
|
2838
|
+
* @param userId The identifier of the user to promote.
|
|
2839
|
+
*/
|
|
2840
|
+
async promoteChatMember(chatId, userId, params) {
|
|
2841
|
+
await this.#chatManager.promoteChatMember(chatId, userId, params);
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* Change the tag of a chat member.
|
|
2845
|
+
*
|
|
2846
|
+
* @method ch
|
|
2847
|
+
* @param chatId The identifier of a chat.
|
|
2848
|
+
* @param userId The identifier of the user that is a member of the chat.
|
|
2849
|
+
*/
|
|
2850
|
+
async setChatMemberTag(chatId, userId, params) {
|
|
2851
|
+
await this.#chatManager.setChatMemberTag(chatId, userId, params);
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Enable sharing in a chat. User-only.
|
|
2855
|
+
*
|
|
2856
|
+
* @method ch
|
|
2857
|
+
* @param chatId The identifier of a chat.
|
|
2858
|
+
*/
|
|
2859
|
+
async enableSharing(chatId) {
|
|
2860
|
+
await this.#chatManager.enableSharing(chatId);
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Disable sharing in a chat. User-only.
|
|
2864
|
+
*
|
|
2865
|
+
* @method ch
|
|
2866
|
+
* @param chatId The identifier of a chat.
|
|
2867
|
+
*/
|
|
2868
|
+
async disableSharing(chatId) {
|
|
2869
|
+
await this.#chatManager.disableSharing(chatId);
|
|
2870
|
+
}
|
|
2871
|
+
/**
|
|
2872
|
+
* Get recommended channels. User-only.
|
|
2873
|
+
*
|
|
2874
|
+
* @method ch
|
|
2875
|
+
* @returns A list of recommended channels.
|
|
2876
|
+
*/
|
|
2877
|
+
async getRecommendedChannels() {
|
|
2878
|
+
return await this.#chatManager.getRecommendedChannels();
|
|
2879
|
+
}
|
|
2880
|
+
/**
|
|
2881
|
+
* Get similar channels. User-only.
|
|
2882
|
+
*
|
|
2883
|
+
* @method ch
|
|
2884
|
+
* @param chatId The identifier of a channel to get similar channels for.
|
|
2885
|
+
* @returns A list of similar channels.
|
|
2886
|
+
*/
|
|
2887
|
+
async getSimilarChannels(chatId) {
|
|
2888
|
+
return await this.#chatManager.getSimilarChannels(chatId);
|
|
2889
|
+
}
|
|
2890
|
+
/**
|
|
2891
|
+
* Get similar bots. User-only.
|
|
2892
|
+
*
|
|
2893
|
+
* @method ch
|
|
2894
|
+
* @param chatId The identifier of a bot to get similar bots for.
|
|
2895
|
+
* @returns A list of similar bots.
|
|
2896
|
+
*/
|
|
2897
|
+
async getSimilarBots(chatId) {
|
|
2898
|
+
return await this.#chatManager.getSimilarBots(chatId);
|
|
2899
|
+
}
|
|
2900
|
+
//
|
|
2901
|
+
// ========================= CALLBACK QUERIES ========================= //
|
|
2902
|
+
//
|
|
2903
|
+
/**
|
|
2904
|
+
* Send a callback query. User-only.
|
|
2905
|
+
*
|
|
2906
|
+
* @method cq
|
|
2907
|
+
* @param botId The identifier of the bot to send the callback query to.
|
|
2908
|
+
* @param messageId The identifier of the message that includes at a button responsible for the callback query question.
|
|
2909
|
+
* @param question The callback query's question.
|
|
2910
|
+
* @returns The bot's answer to the callback query.
|
|
2911
|
+
* @cache
|
|
2912
|
+
*/
|
|
2913
|
+
async sendCallbackQuery(botId, messageId, question) {
|
|
2914
|
+
return await this.#callbackQueryManager.sendCallbackQuery(botId, messageId, question);
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* Answer a callback query. Bot-only.
|
|
2918
|
+
*
|
|
2919
|
+
* @method cq
|
|
2920
|
+
* @param id ID of the callback query to answer.
|
|
2921
|
+
*/
|
|
2922
|
+
async answerCallbackQuery(id, params) {
|
|
2923
|
+
await this.#callbackQueryManager.answerCallbackQuery(id, params);
|
|
2924
|
+
}
|
|
2925
|
+
//
|
|
2926
|
+
// ========================= INLINE QUERIES ========================= //
|
|
2927
|
+
//
|
|
2928
|
+
/**
|
|
2929
|
+
* Send an inline query. User-only.
|
|
2930
|
+
*
|
|
2931
|
+
* @method iq
|
|
2932
|
+
* @param botId The identifier of a bot to send the inline query to.
|
|
2933
|
+
* @param chatId The identifier of the chat from which the inline query is sent.
|
|
2934
|
+
* @returns The bot's answer to the inline query.
|
|
2935
|
+
* @cache
|
|
2936
|
+
*/
|
|
2937
|
+
async sendInlineQuery(botId, chatId, params) {
|
|
2938
|
+
return await this.#inlineQueryManager.sendInlineQuery(botId, chatId, params);
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* Answer an inline query. Bot-only.
|
|
2942
|
+
*
|
|
2943
|
+
* @method iq
|
|
2944
|
+
* @param id The identifier of the inline query to answer.
|
|
2945
|
+
* @param results The results to answer with.
|
|
2946
|
+
*/
|
|
2947
|
+
async answerInlineQuery(id, results, params) {
|
|
2948
|
+
await this.#inlineQueryManager.answerInlineQuery(id, results, params);
|
|
2949
|
+
}
|
|
2950
|
+
//
|
|
2951
|
+
// ========================= BOTS ========================= //
|
|
2952
|
+
//
|
|
2953
|
+
/**
|
|
2954
|
+
* Set the bot's description in the given language. Bot-only.
|
|
2955
|
+
*
|
|
2956
|
+
* @method bs
|
|
2957
|
+
*/
|
|
2958
|
+
async setMyDescription(params) {
|
|
2959
|
+
await this.#botInfoManager.setMyDescription(params);
|
|
2960
|
+
}
|
|
2961
|
+
/**
|
|
2962
|
+
* Set the bot's name in the given language. Bot-only.
|
|
2963
|
+
*
|
|
2964
|
+
* @method bs
|
|
2965
|
+
*/
|
|
2966
|
+
async setMyName(params) {
|
|
2967
|
+
await this.#botInfoManager.setMyName(params);
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
2971
|
+
*
|
|
2972
|
+
* @method bs
|
|
2973
|
+
*/
|
|
2974
|
+
async setMyShortDescription(params) {
|
|
2975
|
+
await this.#botInfoManager.setMyShortDescription(params);
|
|
2976
|
+
}
|
|
2977
|
+
/**
|
|
2978
|
+
* Get the bot's description in the given language. Bot-only.
|
|
2979
|
+
*
|
|
2980
|
+
* @method bs
|
|
2981
|
+
* @returns The current bot's description in the specified language.
|
|
2982
|
+
*/
|
|
2983
|
+
async getMyDescription(params) {
|
|
2984
|
+
return await this.#botInfoManager.getMyDescription(params);
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* Get the bot's name in the given language. Bot-only.
|
|
2988
|
+
*
|
|
2989
|
+
* @method bs
|
|
2990
|
+
* @returns The current bot's name in the specified language.
|
|
2991
|
+
*/
|
|
2992
|
+
async getMyName(params) {
|
|
2993
|
+
return await this.#botInfoManager.getMyName(params);
|
|
2994
|
+
}
|
|
2995
|
+
/**
|
|
2996
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
2997
|
+
*
|
|
2998
|
+
* @method bs
|
|
2999
|
+
* @returns The current bot's short description in the specified language.
|
|
3000
|
+
*/
|
|
3001
|
+
async getMyShortDescription(params) {
|
|
3002
|
+
return await this.#botInfoManager.getMyShortDescription(params);
|
|
3003
|
+
}
|
|
3004
|
+
/**
|
|
3005
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
3006
|
+
*
|
|
3007
|
+
* @method bs
|
|
3008
|
+
* @param commands The commands to set.
|
|
3009
|
+
*/
|
|
3010
|
+
async setMyCommands(commands, params) {
|
|
3011
|
+
await this.#botInfoManager.setMyCommands(commands, params);
|
|
3012
|
+
}
|
|
3013
|
+
/**
|
|
3014
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
3015
|
+
*
|
|
3016
|
+
* @method bs
|
|
3017
|
+
* @returns The current bot's commands in the specified language.
|
|
3018
|
+
*/
|
|
3019
|
+
async getMyCommands(params) {
|
|
3020
|
+
return await this.#botInfoManager.getMyCommands(params);
|
|
3021
|
+
}
|
|
3022
|
+
//
|
|
3023
|
+
// ========================= REACTIONS ========================= //
|
|
3024
|
+
//
|
|
3025
|
+
/**
|
|
3026
|
+
* Change reactions made to a message.
|
|
3027
|
+
*
|
|
3028
|
+
* @method re
|
|
3029
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
3030
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
3031
|
+
* @param reactions The new reactions.
|
|
3032
|
+
*/
|
|
3033
|
+
async setReactions(chatId, messageId, reactions, params) {
|
|
3034
|
+
await this.#messageManager.setReactions(chatId, messageId, reactions, params);
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Make a reaction to a message.
|
|
3038
|
+
*
|
|
3039
|
+
* @method re
|
|
3040
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
3041
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
3042
|
+
* @param reaction The reaction to add.
|
|
3043
|
+
*/
|
|
3044
|
+
async addReaction(chatId, messageId, reaction, params) {
|
|
3045
|
+
await this.#messageManager.addReaction(chatId, messageId, reaction, params);
|
|
3046
|
+
}
|
|
3047
|
+
/**
|
|
3048
|
+
* Undo a reaction made to a message.
|
|
3049
|
+
*
|
|
3050
|
+
* @method re
|
|
3051
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
3052
|
+
* @param messageId The identifier of the message which the reaction was made to.
|
|
3053
|
+
* @param reaction The reaction to remove.
|
|
3054
|
+
*/
|
|
3055
|
+
async removeReaction(chatId, messageId, reaction) {
|
|
3056
|
+
await this.#messageManager.removeReaction(chatId, messageId, reaction);
|
|
3057
|
+
}
|
|
3058
|
+
//
|
|
3059
|
+
// ========================= STORIES ========================= //
|
|
3060
|
+
//
|
|
3061
|
+
/**
|
|
3062
|
+
* Create a story. User-only.
|
|
3063
|
+
*
|
|
3064
|
+
* @method st
|
|
3065
|
+
* @param content The content of the story.
|
|
3066
|
+
* @returns The created story.
|
|
3067
|
+
*/
|
|
3068
|
+
async createStory(chatId, content, params) {
|
|
3069
|
+
return await this.#storyManager.createStory(chatId, content, params);
|
|
3070
|
+
}
|
|
3071
|
+
/**
|
|
3072
|
+
* Retrieve multiple stories. User-only.
|
|
3073
|
+
*
|
|
3074
|
+
* @method st
|
|
3075
|
+
* @param chatId The identifier of a chat.
|
|
3076
|
+
* @param storyIds The identifiers of the stories to retrieve.
|
|
3077
|
+
* @returns The retrieved stories.
|
|
3078
|
+
*/
|
|
3079
|
+
async getStories(chatId, storyIds) {
|
|
3080
|
+
if (!storyIds.length) {
|
|
3081
|
+
return [];
|
|
3082
|
+
}
|
|
3083
|
+
return await this.#storyManager.getStories(chatId, storyIds);
|
|
3084
|
+
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Retrieve a single story. User-only.
|
|
3087
|
+
*
|
|
3088
|
+
* @method st
|
|
3089
|
+
* @param chatId The identifier of a chat.
|
|
3090
|
+
* @param storyId The identifier of the story to retrieve.
|
|
3091
|
+
* @returns The retrieved story.
|
|
3092
|
+
*/
|
|
3093
|
+
async getStory(chatId, storyId) {
|
|
3094
|
+
return await this.#storyManager.getStory(chatId, storyId);
|
|
3095
|
+
}
|
|
3096
|
+
/**
|
|
3097
|
+
* Delete multiple stories. User-only.
|
|
3098
|
+
*
|
|
3099
|
+
* @method st
|
|
3100
|
+
* @param chatId The identifier of a chat.
|
|
3101
|
+
* @param storyIds The identifiers of the stories to delete.
|
|
3102
|
+
*/
|
|
3103
|
+
async deleteStories(chatId, storyIds) {
|
|
3104
|
+
await this.#storyManager.deleteStories(chatId, storyIds);
|
|
3105
|
+
}
|
|
3106
|
+
/**
|
|
3107
|
+
* Delete a single story. User-only.
|
|
3108
|
+
*
|
|
3109
|
+
* @method st
|
|
3110
|
+
* @param chatId The identifier of a chat.
|
|
3111
|
+
* @param storyId The identifier of the story to delete.
|
|
3112
|
+
*/
|
|
3113
|
+
async deleteStory(chatId, storyId) {
|
|
3114
|
+
await this.#storyManager.deleteStory(chatId, storyId);
|
|
3115
|
+
}
|
|
3116
|
+
/**
|
|
3117
|
+
* Add multiple stories to highlights. User-only.
|
|
3118
|
+
*
|
|
3119
|
+
* @method st
|
|
3120
|
+
* @param chatId The identifier of a chat.
|
|
3121
|
+
* @param storyIds The identifiers of the stories to add to highlights.
|
|
3122
|
+
*/
|
|
3123
|
+
async addStoriesToHighlights(chatId, storyIds) {
|
|
3124
|
+
await this.#storyManager.addStoriesToHighlights(chatId, storyIds);
|
|
3125
|
+
}
|
|
3126
|
+
/**
|
|
3127
|
+
* Add a single story to highlights. User-only.
|
|
3128
|
+
*
|
|
3129
|
+
* @method st
|
|
3130
|
+
* @param chatId The identifier of a chat.
|
|
3131
|
+
* @param storyId The identifier of the story to add to highlights.
|
|
3132
|
+
*/
|
|
3133
|
+
async addStoryToHighlights(chatId, storyId) {
|
|
3134
|
+
await this.#storyManager.addStoryToHighlights(chatId, storyId);
|
|
3135
|
+
}
|
|
3136
|
+
/**
|
|
3137
|
+
* Remove multiple stories from highlights. User-only.
|
|
3138
|
+
*
|
|
3139
|
+
* @method st
|
|
3140
|
+
* @param chatId The identifier of a chat.
|
|
3141
|
+
* @param storyIds The identifiers of the stories to remove from highlights.
|
|
3142
|
+
*/
|
|
3143
|
+
async removeStoriesFromHighlights(chatId, storyIds) {
|
|
3144
|
+
await this.#storyManager.removeStoriesFromHighlights(chatId, storyIds);
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* Remove a single story from highlights. User-only.
|
|
3148
|
+
*
|
|
3149
|
+
* @method st
|
|
3150
|
+
* @param chatId The identifier of a chat.
|
|
3151
|
+
* @param storyId The identifier of the story to remove from highlights.
|
|
3152
|
+
*/
|
|
3153
|
+
async removeStoryFromHighlights(chatId, storyId) {
|
|
3154
|
+
await this.#storyManager.removeStoryFromHighlights(chatId, storyId);
|
|
3155
|
+
}
|
|
3156
|
+
//
|
|
3157
|
+
// ========================= MISC ========================= //
|
|
3158
|
+
//
|
|
3159
|
+
/**
|
|
3160
|
+
* Get network statistics. This might not always be available.
|
|
3161
|
+
*
|
|
3162
|
+
* @method mc
|
|
3163
|
+
*/
|
|
3164
|
+
async getNetworkStatistics() {
|
|
3165
|
+
return await this.#networkStatisticsManager.getNetworkStatistics();
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* Block a user. User-only.
|
|
3169
|
+
*
|
|
3170
|
+
* @method mc
|
|
3171
|
+
* @param userId The identifier of the user to block.
|
|
3172
|
+
*/
|
|
3173
|
+
async blockUser(userId) {
|
|
3174
|
+
await this.#messageManager.blockUser(userId);
|
|
3175
|
+
}
|
|
3176
|
+
/**
|
|
3177
|
+
* Unblock a user. User-only.
|
|
3178
|
+
*
|
|
3179
|
+
* @method mc
|
|
3180
|
+
* @param userId The identifier of the user to unblock.
|
|
3181
|
+
*/
|
|
3182
|
+
async unblockUser(userId) {
|
|
3183
|
+
await this.#messageManager.unblockUser(userId);
|
|
3184
|
+
}
|
|
3185
|
+
//
|
|
3186
|
+
// ========================= VIDEO CHATS ========================= //
|
|
3187
|
+
//
|
|
3188
|
+
/**
|
|
3189
|
+
* Start a video chat. User-only.
|
|
3190
|
+
*
|
|
3191
|
+
* @method vc
|
|
3192
|
+
* @param chatId The identifier of a chat to start the video chat in.
|
|
3193
|
+
* @returns The started video chat.
|
|
3194
|
+
*/
|
|
3195
|
+
async startVideoChat(chatId, params) {
|
|
3196
|
+
return await this.#videoChatManager.startVideoChat(chatId, params);
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Schedule a video chat. User-only.
|
|
3200
|
+
*
|
|
3201
|
+
* @method vc
|
|
3202
|
+
* @param chatId The identifier of a chat to schedule the video chat in.
|
|
3203
|
+
* @param startAt A point in time within the future in which the video chat will be started.
|
|
3204
|
+
* @returns The scheduled video chat.
|
|
3205
|
+
*/
|
|
3206
|
+
async scheduleVideoChat(chatId, startAt, params) {
|
|
3207
|
+
return await this.#videoChatManager.scheduleVideoChat(chatId, startAt, params);
|
|
3208
|
+
}
|
|
3209
|
+
/**
|
|
3210
|
+
* Join a video chat. User-only.
|
|
3211
|
+
*
|
|
3212
|
+
* @method vc
|
|
3213
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3214
|
+
* @param params_ WebRTC connection parameters.
|
|
3215
|
+
* @returns Parameters to be passed to the used WebRTC library.
|
|
3216
|
+
*/
|
|
3217
|
+
async joinVideoChat(id, params_, params) {
|
|
3218
|
+
return await this.#videoChatManager.joinVideoChat(id, params_, params);
|
|
3219
|
+
}
|
|
3220
|
+
/**
|
|
3221
|
+
* Leave a video chat. User-only.
|
|
3222
|
+
*
|
|
3223
|
+
* @method vc
|
|
3224
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3225
|
+
*/
|
|
3226
|
+
async leaveVideoChat(id) {
|
|
3227
|
+
await this.#videoChatManager.leaveVideoChat(id);
|
|
3228
|
+
}
|
|
3229
|
+
/**
|
|
3230
|
+
* Join a live stream. User-only.
|
|
3231
|
+
*
|
|
3232
|
+
* @method vc
|
|
3233
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3234
|
+
*/
|
|
3235
|
+
async joinLiveStream(id) {
|
|
3236
|
+
await this.#videoChatManager.joinLiveStream(id);
|
|
3237
|
+
}
|
|
3238
|
+
/**
|
|
3239
|
+
* Get a video chat. User-only.
|
|
3240
|
+
*
|
|
3241
|
+
* @method vc
|
|
3242
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3243
|
+
* @cache
|
|
3244
|
+
*/
|
|
3245
|
+
async getVideoChat(id) {
|
|
3246
|
+
return await this.#videoChatManager.getVideoChat(id);
|
|
3247
|
+
}
|
|
3248
|
+
/**
|
|
3249
|
+
* Get live stream channels. User-only.
|
|
3250
|
+
*
|
|
3251
|
+
* @method vc
|
|
3252
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3253
|
+
*/
|
|
3254
|
+
async getLiveStreamChannels(id) {
|
|
3255
|
+
return await this.#videoChatManager.getLiveStreamChannels(id);
|
|
3256
|
+
}
|
|
3257
|
+
/**
|
|
3258
|
+
* Download a live stream segment. User-only.
|
|
3259
|
+
*
|
|
3260
|
+
* @method vc
|
|
3261
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3262
|
+
* @param channelId Stream channel ID.
|
|
3263
|
+
* @param scale Stream channel scale.
|
|
3264
|
+
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
3265
|
+
*/
|
|
3266
|
+
async downloadLiveStreamSegment(id, channelId, scale, timestamp, params) {
|
|
3267
|
+
return await this.#videoChatManager.downloadLiveStreamSegment(id, channelId, scale, timestamp, params);
|
|
3268
|
+
}
|
|
3269
|
+
//
|
|
3270
|
+
// ========================= PAYMENTS ========================= //
|
|
3271
|
+
//
|
|
3272
|
+
/**
|
|
3273
|
+
* Answer a pre-checkout query. Bot-only.
|
|
3274
|
+
*
|
|
3275
|
+
* @method pa
|
|
3276
|
+
* @param preCheckoutQueryId The identifier of the pre-checkout query.
|
|
3277
|
+
* @param ok Whether the checkout is going to be processed.
|
|
3278
|
+
*/
|
|
3279
|
+
async answerPreCheckoutQuery(preCheckoutQueryId, ok, params) {
|
|
3280
|
+
await this.#paymentManager.answerPreCheckoutQuery(preCheckoutQueryId, ok, params);
|
|
3281
|
+
}
|
|
3282
|
+
/**
|
|
3283
|
+
* Refund a star payment. Bot-only.
|
|
3284
|
+
*
|
|
3285
|
+
* @method pa
|
|
3286
|
+
* @param userId The identifier of the user that was charged.
|
|
3287
|
+
* @param telegramPaymentChargeId The identifier of the charge.
|
|
3288
|
+
*/
|
|
3289
|
+
async refundStarPayment(userId, telegramPaymentChargeId) {
|
|
3290
|
+
await this.#paymentManager.refundStarPayment(userId, telegramPaymentChargeId);
|
|
3291
|
+
}
|
|
3292
|
+
//
|
|
3293
|
+
// ========================= CONTACTS ========================= //
|
|
3294
|
+
//
|
|
3295
|
+
/**
|
|
3296
|
+
* Get contacts. User-only.
|
|
3297
|
+
*
|
|
3298
|
+
* @method co
|
|
3299
|
+
*/
|
|
3300
|
+
async getContacts() {
|
|
3301
|
+
return await this.#accountManager.getContacts();
|
|
3302
|
+
}
|
|
3303
|
+
/**
|
|
3304
|
+
* Delete multiple contacts. User-only.
|
|
3305
|
+
*
|
|
3306
|
+
* @method co
|
|
3307
|
+
* @param userIds The identifiers of contacts to delete.
|
|
3308
|
+
*/
|
|
3309
|
+
async deleteContacts(userIds) {
|
|
3310
|
+
await this.#accountManager.deleteContacts(userIds);
|
|
3311
|
+
}
|
|
3312
|
+
/**
|
|
3313
|
+
* Delete a single contact. User-only.
|
|
3314
|
+
*
|
|
3315
|
+
* @method co
|
|
3316
|
+
* @param userId The identifier of the contact to delete.
|
|
3317
|
+
*/
|
|
3318
|
+
async deleteContact(userId) {
|
|
3319
|
+
await this.#accountManager.deleteContact(userId);
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* Add a contact. User-only.
|
|
3323
|
+
*
|
|
3324
|
+
* @method co
|
|
3325
|
+
* @param userId The identifier of the user to add as contact.
|
|
3326
|
+
*/
|
|
3327
|
+
async addContact(userId, params) {
|
|
3328
|
+
await this.#accountManager.addContact(userId, params);
|
|
3329
|
+
}
|
|
3330
|
+
//
|
|
3331
|
+
// ========================= TRANSLATIONS ========================= //
|
|
3332
|
+
//
|
|
3333
|
+
/**
|
|
3334
|
+
* Get translations. User-only.
|
|
3335
|
+
*
|
|
3336
|
+
* @method ta
|
|
3337
|
+
* @cache
|
|
3338
|
+
*/
|
|
3339
|
+
async getTranslations(params) {
|
|
3340
|
+
return await this.#translationsManager.getTranslations(params);
|
|
3341
|
+
}
|
|
3342
|
+
//
|
|
3343
|
+
// ========================= GIFTS ========================= //
|
|
3344
|
+
//
|
|
3345
|
+
/**
|
|
3346
|
+
* Get available gifts.
|
|
3347
|
+
*
|
|
3348
|
+
* @method gf
|
|
3349
|
+
*/
|
|
3350
|
+
async getGifts() {
|
|
3351
|
+
return await this.#giftManager.getGifts();
|
|
3352
|
+
}
|
|
3353
|
+
/**
|
|
3354
|
+
* Get gifts claimed by a user or a channel. User-only.
|
|
3355
|
+
*
|
|
3356
|
+
* @method gf
|
|
3357
|
+
* @param chatId The identifier of a user or a channel to get gifts for.
|
|
3358
|
+
*/
|
|
3359
|
+
async getClaimedGifts(chatId, params) {
|
|
3360
|
+
return await this.#giftManager.getClaimedGifts(chatId, params);
|
|
3361
|
+
}
|
|
3362
|
+
/**
|
|
3363
|
+
* Send a gift.
|
|
3364
|
+
*
|
|
3365
|
+
* @method gf
|
|
3366
|
+
* @param chatId The identifier of a user or a channel to send the gift to.
|
|
3367
|
+
* @param giftId The identifier of the gift to send.
|
|
3368
|
+
*/
|
|
3369
|
+
async sendGift(chatId, giftId, params) {
|
|
3370
|
+
await this.#giftManager.sendGift(chatId, giftId, params);
|
|
3371
|
+
}
|
|
3372
|
+
/**
|
|
3373
|
+
* Sell a gift.
|
|
3374
|
+
*
|
|
3375
|
+
* @method gf
|
|
3376
|
+
* @param gift The gift to sell.
|
|
3377
|
+
*/
|
|
3378
|
+
async sellGift(gift) {
|
|
3379
|
+
await this.#giftManager.sellGift(gift);
|
|
3380
|
+
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Craft gifts.
|
|
3383
|
+
*
|
|
3384
|
+
* @method gf
|
|
3385
|
+
* @param gift The gifts to craft.
|
|
3386
|
+
*/
|
|
3387
|
+
async craftGifts(gifts) {
|
|
3388
|
+
await this.#giftManager.craftGifts(gifts);
|
|
3389
|
+
}
|
|
3390
|
+
/**
|
|
3391
|
+
* Get a gift using its slug.
|
|
3392
|
+
*
|
|
3393
|
+
* @method gf
|
|
3394
|
+
* @param slug The slug of a gift.
|
|
3395
|
+
*/
|
|
3396
|
+
async getGift(slug) {
|
|
3397
|
+
return await this.#giftManager.getGift(slug);
|
|
3398
|
+
}
|
|
3399
|
+
/**
|
|
3400
|
+
* Transfer a gift. User-only.
|
|
3401
|
+
*
|
|
3402
|
+
* @method gf
|
|
3403
|
+
* @param chatId The identifier of a chat to transfer the gift to.
|
|
3404
|
+
* @param gift The gift to transfer.
|
|
3405
|
+
*/
|
|
3406
|
+
async transferGift(chatId, gift) {
|
|
3407
|
+
return await this.#giftManager.transferGift(chatId, gift);
|
|
3408
|
+
}
|
|
3409
|
+
}
|