@mtkruto/node 0.67.2 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +12 -12
- package/esm/0_deps.js +14 -14
- package/esm/0_errors.js +2 -6
- package/esm/3_errors.js +2 -12
- package/esm/3_types.d.ts +4 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +4 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_errors.d.ts +2 -2
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +2 -12
- package/esm/_dnt.polyfills.d.ts +99 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/client/0_client_abstract.d.ts +3 -3
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_filters.d.ts +1 -1
- package/esm/client/0_filters.d.ts.map +1 -1
- package/esm/client/0_filters.js +3 -3
- package/esm/client/0_filters_test.d.ts.map +1 -1
- package/esm/client/0_html.d.ts +1 -1
- package/esm/client/0_html.d.ts.map +1 -1
- package/esm/client/0_html.js +1 -1
- package/esm/client/0_markdown.d.ts +1 -1
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +8 -8
- package/esm/client/0_markdown_test.d.ts.map +1 -1
- package/esm/client/0_params.d.ts +44 -8
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts +5 -5
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +1 -1
- package/esm/client/0_password_test.d.ts.map +1 -1
- package/esm/client/0_storage_operations.d.ts +4 -4
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +159 -171
- package/esm/client/0_storage_operations_test.d.ts.map +1 -1
- package/esm/client/0_update_processor.d.ts +2 -2
- package/esm/client/0_update_processor.d.ts.map +1 -1
- package/esm/client/0_utilities.d.ts +1 -1
- package/esm/client/0_utilities.js +8 -8
- package/esm/client/0_utilities_test.d.ts.map +1 -1
- package/esm/client/1_client_plain.d.ts +3 -3
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +5 -23
- package/esm/client/1_composer.d.ts +3 -3
- package/esm/client/1_composer.d.ts.map +1 -1
- package/esm/client/1_composer.js +14 -27
- package/esm/client/1_types.d.ts +4 -4
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +3 -3
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +86 -98
- package/esm/client/2_bot_info_manager.d.ts +3 -3
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +26 -38
- package/esm/client/2_business_connection_manager.d.ts +3 -3
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +10 -23
- package/esm/client/2_client_encrypted.d.ts +2 -2
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +194 -211
- package/esm/client/2_file_manager.d.ts +7 -6
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +303 -245
- package/esm/client/2_file_manager_test.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.d.ts +1 -1
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +8 -21
- package/esm/client/2_payment_manager.d.ts +4 -4
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +7 -20
- package/esm/client/2_reaction_manager.d.ts +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +7 -20
- package/esm/client/2_translations_manager.d.ts +4 -4
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +97 -107
- package/esm/client/2_update_manager.d.ts +2 -2
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +766 -761
- package/esm/client/3_client_encrypted_pool.d.ts +1 -1
- package/esm/client/3_client_encrypted_pool.d.ts.map +1 -1
- package/esm/client/3_client_encrypted_pool.js +10 -26
- package/esm/client/3_client_encrypted_pool_test.d.ts.map +1 -1
- package/esm/client/3_message_manager.d.ts +11 -8
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +580 -466
- package/esm/client/3_message_manager_test.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.d.ts +6 -6
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +61 -72
- package/esm/client/4_callback_query_manager.d.ts +5 -5
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +18 -30
- package/esm/client/4_chat_list_manager.d.ts +6 -6
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +328 -324
- package/esm/client/4_chat_manager.d.ts +7 -7
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +120 -133
- package/esm/client/4_forum_manager.d.ts +4 -4
- package/esm/client/4_forum_manager.d.ts.map +1 -1
- package/esm/client/4_forum_manager.js +67 -73
- package/esm/client/4_gift_manager.d.ts +4 -4
- package/esm/client/4_gift_manager.d.ts.map +1 -1
- package/esm/client/4_gift_manager.js +17 -30
- package/esm/client/4_inline_query_manager.d.ts +5 -5
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +16 -28
- package/esm/client/4_link_preview_manager.d.ts +5 -5
- package/esm/client/4_link_preview_manager.d.ts.map +1 -1
- package/esm/client/4_link_preview_manager.js +6 -19
- package/esm/client/4_poll_manager.d.ts +4 -4
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +44 -57
- package/esm/client/4_story_manager.d.ts +7 -7
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +43 -55
- package/esm/client/5_client.d.ts +34 -15
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +1299 -1291
- package/esm/connection/0_connection.d.ts +1 -1
- package/esm/connection/0_connection.d.ts.map +1 -1
- package/esm/connection/1_connection_tcp.node.d.ts +1 -1
- package/esm/connection/1_connection_tcp.node.d.ts.map +1 -1
- package/esm/connection/1_connection_tcp.node.js +49 -66
- package/esm/connection/1_connection_web_socket.d.ts +1 -1
- package/esm/connection/1_connection_web_socket.d.ts.map +1 -1
- package/esm/connection/1_connection_web_socket.js +75 -91
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/{script/deps/jsr.io/@std/assert/1.0.13 → esm/deps/jsr.io/@std/assert/1.0.14}/assert.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts +15 -0
- package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.js +20 -0
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.js +17 -2
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.js +31 -47
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/1.0.14/tee.js +79 -0
- package/esm/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
- package/esm/deps/jsr.io/@std/internal/1.0.10/_os.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/_os.js +12 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/os.d.ts +3 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/os.js +5 -0
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/basename.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/basename.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/extname.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/join.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/normalize.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/to_file_url.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/_util.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/basename.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/extname.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/from_file_url.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/is_absolute.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/join.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/normalize.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts.map +1 -1
- package/esm/mod.js +2 -12
- package/esm/session/0_session_state.js +12 -38
- package/esm/session/1_session.d.ts +2 -2
- package/esm/session/1_session.d.ts.map +1 -1
- package/esm/session/1_session.js +49 -72
- package/esm/session/2_session_encrypted.d.ts +2 -2
- package/esm/session/2_session_encrypted.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.js +324 -320
- package/esm/session/2_session_plain.js +1 -1
- package/esm/storage/0_storage.d.ts +1 -1
- package/esm/storage/0_storage.d.ts.map +1 -1
- package/esm/storage/1_utilities.d.ts +14 -11
- package/esm/storage/1_utilities.d.ts.map +1 -1
- package/esm/storage/1_utilities.js +17 -17
- package/esm/storage/1_utilities_test.d.ts.map +1 -1
- package/esm/storage/2_storage_indexed_db.d.ts +1 -1
- package/esm/storage/2_storage_indexed_db.d.ts.map +1 -1
- package/esm/storage/2_storage_indexed_db.js +29 -47
- package/esm/storage/2_storage_local_storage.node.d.ts +1 -1
- package/esm/storage/2_storage_local_storage.node.d.ts.map +1 -1
- package/esm/storage/2_storage_local_storage.node.js +15 -28
- package/esm/storage/2_storage_memory.d.ts +2 -2
- package/esm/storage/2_storage_memory.d.ts.map +1 -1
- package/esm/storage/2_storage_memory.js +26 -43
- package/esm/storage/2_storage_session_storage.d.ts +2 -2
- package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
- package/esm/storage/2_storage_session_storage.js +6 -19
- package/esm/tl/0_utilities.js +1 -1
- package/esm/tl/0_utilities_test.d.ts.map +1 -1
- package/esm/tl/1_tl_reader.d.ts +1 -1
- package/esm/tl/1_tl_reader.d.ts.map +1 -1
- package/esm/tl/1_tl_reader.js +82 -90
- package/esm/tl/1_tl_reader_test.d.ts.map +1 -1
- package/esm/tl/1_tl_writer.d.ts +1 -1
- package/esm/tl/1_tl_writer.d.ts.map +1 -1
- package/esm/tl/1_tl_writer.js +155 -164
- package/esm/tl/1_tl_writer_test.d.ts.map +1 -1
- package/esm/tl/1_utilities.d.ts +1 -1
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +2 -2
- package/esm/tl/2_message.js +1 -1
- package/esm/tl/2_mtproto.d.ts +1 -1
- package/esm/tl/2_mtproto.d.ts.map +1 -1
- package/esm/tl/2_telegram.d.ts +1 -1
- package/esm/tl/2_telegram.d.ts.map +1 -1
- package/esm/transport/0_obfuscation.d.ts +1 -1
- package/esm/transport/0_obfuscation.d.ts.map +1 -1
- package/esm/transport/0_obfuscation.js +2 -2
- package/esm/transport/0_transport.d.ts +1 -1
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/transport/0_transport.js +1 -8
- package/esm/transport/1_transport_abridged.d.ts +1 -1
- package/esm/transport/1_transport_abridged.d.ts.map +1 -1
- package/esm/transport/1_transport_abridged.js +11 -24
- package/esm/transport/1_transport_intermediate.d.ts +1 -1
- package/esm/transport/1_transport_intermediate.d.ts.map +1 -1
- package/esm/transport/1_transport_intermediate.js +10 -23
- package/esm/transport/1_transport_provider.d.ts +2 -2
- package/esm/transport/1_transport_provider.d.ts.map +1 -1
- package/esm/transport/2_transport_provider_tcp.d.ts +1 -1
- package/esm/transport/2_transport_provider_tcp.d.ts.map +1 -1
- package/esm/transport/2_transport_provider_web_socket.d.ts +1 -1
- package/esm/transport/2_transport_provider_web_socket.d.ts.map +1 -1
- package/esm/transport/2_transport_provider_web_socket.js +1 -1
- package/esm/types/0_birthday.d.ts +1 -1
- package/esm/types/0_birthday.d.ts.map +1 -1
- package/esm/types/0_callback_query_answer.d.ts +1 -1
- package/esm/types/0_callback_query_answer.d.ts.map +1 -1
- package/esm/types/0_callback_query_question.js +2 -2
- package/esm/types/0_chat_administrator_rights.d.ts +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/esm/types/0_chat_member_rights.d.ts +1 -1
- package/esm/types/0_chat_member_rights.d.ts.map +1 -1
- package/esm/types/0_contact.d.ts +1 -1
- package/esm/types/0_contact.d.ts.map +1 -1
- package/esm/types/0_dice.d.ts +1 -1
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_failed_invitation.d.ts +1 -1
- package/esm/types/0_failed_invitation.d.ts.map +1 -1
- package/esm/types/0_invoice.d.ts +1 -1
- package/esm/types/0_invoice.d.ts.map +1 -1
- package/esm/types/0_live_stream_channel.d.ts +1 -1
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_mask_position.d.ts +1 -1
- package/esm/types/0_mask_position.d.ts.map +1 -1
- package/esm/types/0_mask_position.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +1 -1
- package/esm/types/0_message_search_filter.d.ts +1 -1
- package/esm/types/0_message_search_filter.d.ts.map +1 -1
- package/esm/types/0_opening_hours.d.ts +1 -1
- package/esm/types/0_opening_hours.d.ts.map +1 -1
- package/esm/types/0_reaction.js +5 -5
- package/esm/types/0_refunded_payment.d.ts +1 -1
- package/esm/types/0_refunded_payment.d.ts.map +1 -1
- package/esm/types/0_restriction_reason.d.ts +1 -1
- package/esm/types/0_restriction_reason.d.ts.map +1 -1
- package/esm/types/0_self_destruct_option.js +3 -3
- package/esm/types/0_shipping_address.d.ts +1 -1
- package/esm/types/0_shipping_address.d.ts.map +1 -1
- package/esm/types/0_slow_mode_duration.js +2 -2
- 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_voice.d.ts +1 -1
- package/esm/types/0_voice.d.ts.map +1 -1
- package/esm/types/0_voice_transcription.d.ts +1 -1
- package/esm/types/0_voice_transcription.d.ts.map +1 -1
- package/esm/types/1_animation.d.ts +1 -1
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_audio.d.ts +1 -1
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.d.ts +2 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_chat_p.d.ts +2 -2
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +2 -2
- package/esm/types/1_document.d.ts +1 -1
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_giveaway.d.ts +2 -2
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_inline_keyboard_button.d.ts +3 -3
- package/esm/types/1_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_inline_keyboard_button.js +4 -4
- package/esm/types/1_inline_query_result_button.d.ts +1 -1
- package/esm/types/1_inline_query_result_button.d.ts.map +1 -1
- package/esm/types/1_input_media.d.ts +4 -4
- package/esm/types/1_input_media.d.ts.map +1 -1
- package/esm/types/1_input_story_content.d.ts +1 -1
- package/esm/types/1_input_story_content.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.d.ts +3 -3
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +1 -1
- package/esm/types/1_message_reaction.d.ts +1 -1
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +2 -2
- package/esm/types/1_mini_app_info.d.ts +2 -2
- package/esm/types/1_mini_app_info.d.ts.map +1 -1
- package/esm/types/1_network_statistics.d.ts +1 -1
- package/esm/types/1_network_statistics.d.ts.map +1 -1
- package/esm/types/1_order_info.d.ts +2 -2
- package/esm/types/1_order_info.d.ts.map +1 -1
- package/esm/types/1_photo.d.ts +1 -1
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_poll_option.d.ts +2 -2
- package/esm/types/1_poll_option.d.ts.map +1 -1
- package/esm/types/1_poll_option.js +2 -2
- package/esm/types/1_reaction_count.d.ts +2 -2
- package/esm/types/1_reaction_count.d.ts.map +1 -1
- package/esm/types/1_reply_quote.d.ts +2 -2
- package/esm/types/1_reply_quote.d.ts.map +1 -1
- package/esm/types/1_sticker.d.ts +4 -4
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_reaction.d.ts +2 -2
- package/esm/types/1_story_reaction.d.ts.map +1 -1
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/1_user.d.ts.map +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/1_venue.d.ts +1 -1
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_video.d.ts +1 -1
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video_note.d.ts +1 -1
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/2_business_connection.d.ts +3 -3
- package/esm/types/2_business_connection.d.ts.map +1 -1
- package/esm/types/2_chat.d.ts +6 -6
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +3 -3
- package/esm/types/2_chat_member.d.ts +4 -4
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +1 -1
- package/esm/types/2_chat_settings.d.ts +1 -1
- package/esm/types/2_chat_settings.d.ts.map +1 -1
- package/esm/types/2_chat_settings.js +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +3 -3
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_forward_header.d.ts +4 -4
- package/esm/types/2_forward_header.d.ts.map +1 -1
- package/esm/types/2_forward_header.js +6 -6
- package/esm/types/2_game.d.ts +3 -3
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_gift_upgraded_component.d.ts +2 -2
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.d.ts +1 -1
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inline_query.d.ts +3 -3
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +1 -1
- package/esm/types/2_invite_link.d.ts +3 -3
- package/esm/types/2_invite_link.d.ts.map +1 -1
- package/esm/types/2_message_interactions.d.ts +1 -1
- package/esm/types/2_message_interactions.d.ts.map +1 -1
- package/esm/types/2_message_reaction_count.d.ts +4 -4
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reactions.d.ts +4 -4
- package/esm/types/2_message_reactions.d.ts.map +1 -1
- package/esm/types/2_poll.d.ts +3 -3
- package/esm/types/2_poll.d.ts.map +1 -1
- package/esm/types/2_poll.js +3 -3
- package/esm/types/2_poll_answer.d.ts +22 -3
- package/esm/types/2_poll_answer.d.ts.map +1 -1
- package/esm/types/2_poll_answer.js +19 -0
- package/esm/types/2_pre_checkout_query.d.ts +4 -4
- package/esm/types/2_pre_checkout_query.d.ts.map +1 -1
- package/esm/types/2_reply_markup.d.ts +3 -3
- package/esm/types/2_reply_markup.d.ts.map +1 -1
- package/esm/types/2_reply_to.d.ts +2 -2
- package/esm/types/2_reply_to.d.ts.map +1 -1
- 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 +2 -2
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_interactions.d.ts +2 -2
- package/esm/types/2_story_interactions.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.d.ts +5 -5
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_successful_payment.d.ts +2 -2
- package/esm/types/2_successful_payment.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.d.ts +5 -5
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_gift.d.ts +4 -4
- package/esm/types/3_gift.d.ts.map +1 -1
- package/esm/types/3_join_request.d.ts +4 -4
- package/esm/types/3_join_request.d.ts.map +1 -1
- package/esm/types/3_story.d.ts +8 -8
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/4_claimed_gift.d.ts +4 -4
- package/esm/types/4_claimed_gift.d.ts.map +1 -1
- package/esm/types/4_link_preview.d.ts +5 -5
- package/esm/types/4_link_preview.d.ts.map +1 -1
- package/esm/types/5_claimed_gifts.d.ts +2 -2
- package/esm/types/5_claimed_gifts.d.ts.map +1 -1
- package/esm/types/5_claimed_gifts.js +3 -3
- package/esm/types/5_message.d.ts +29 -29
- package/esm/types/5_message.d.ts.map +1 -1
- package/esm/types/5_message.js +8 -8
- package/esm/types/5_message_content.d.ts +4 -4
- package/esm/types/5_message_content.d.ts.map +1 -1
- package/esm/types/6_callback_query.d.ts +3 -3
- package/esm/types/6_callback_query.d.ts.map +1 -1
- package/esm/types/6_callback_query.js +2 -2
- package/esm/types/6_chat_list_item.d.ts +4 -4
- package/esm/types/6_chat_list_item.d.ts.map +1 -1
- package/esm/types/6_chat_list_item.js +6 -6
- package/esm/types/6_inline_query_result.d.ts +6 -6
- package/esm/types/6_inline_query_result.d.ts.map +1 -1
- package/esm/types/6_inline_query_result.js +16 -16
- package/esm/types/6_saved_chat.d.ts +36 -0
- package/esm/types/6_saved_chat.d.ts.map +1 -0
- package/esm/types/6_saved_chat.js +43 -0
- package/esm/types/6_topic.d.ts +2 -2
- package/esm/types/6_topic.d.ts.map +1 -1
- package/esm/types/6_topic.js +1 -1
- package/esm/types/7_inline_query_answer.d.ts +2 -2
- package/esm/types/7_inline_query_answer.d.ts.map +1 -1
- package/esm/types/7_saved_chats.d.ts +33 -0
- package/esm/types/7_saved_chats.d.ts.map +1 -0
- package/esm/types/7_saved_chats.js +36 -0
- package/esm/types/7_update.d.ts +44 -25
- package/esm/types/7_update.d.ts.map +1 -1
- package/esm/types/_file_id.d.ts +60 -49
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +92 -73
- package/esm/types/_getters.d.ts +3 -3
- package/esm/types/_getters.d.ts.map +1 -1
- package/esm/utilities/0_bigint.js +5 -5
- package/esm/utilities/0_bigint_test.d.ts.map +1 -1
- package/esm/utilities/0_buffer.d.ts +1 -1
- package/esm/utilities/0_buffer.d.ts.map +1 -1
- package/esm/utilities/0_buffer.js +3 -3
- package/esm/utilities/0_buffer_test.d.ts.map +1 -1
- package/esm/utilities/0_env.js +1 -1
- package/esm/utilities/0_hash.d.ts +2 -2
- package/esm/utilities/0_hash.d.ts.map +1 -1
- package/esm/utilities/0_misc.d.ts.map +1 -1
- package/esm/utilities/0_misc.js +4 -3
- package/esm/utilities/0_mutex.js +4 -19
- package/esm/utilities/0_part_stream.js +11 -25
- package/esm/utilities/0_part_stream_test.d.ts.map +1 -1
- package/esm/utilities/0_rle.d.ts +2 -2
- package/esm/utilities/0_rle.d.ts.map +1 -1
- package/esm/utilities/0_rle.js +1 -1
- package/esm/utilities/0_rle_test.d.ts.map +1 -1
- package/esm/utilities/0_text.d.ts +20 -1
- package/esm/utilities/0_text.d.ts.map +1 -1
- package/esm/utilities/0_text.js +19 -0
- package/esm/utilities/1_auth.d.ts +1 -1
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_auth.js +1 -1
- package/esm/utilities/1_base64.d.ts +1 -1
- package/esm/utilities/1_base64.d.ts.map +1 -1
- package/esm/utilities/1_base64.js +1 -1
- package/esm/utilities/1_base64_test.d.ts.map +1 -1
- package/esm/utilities/1_crypto.js +42 -53
- package/esm/utilities/1_crypto_test.d.ts.map +1 -1
- package/esm/utilities/1_logger.d.ts +2 -2
- package/esm/utilities/1_logger.js +2 -2
- package/esm/utilities/1_math.js +2 -2
- package/esm/utilities/1_math_test.d.ts.map +1 -1
- package/esm/utilities/2_queue.js +29 -47
- package/package.json +1 -1
- package/script/0_deps.d.ts +12 -12
- package/script/0_deps.js +14 -14
- package/script/0_errors.js +2 -6
- package/script/2_tl.js +17 -7
- package/script/3_errors.js +2 -12
- package/script/3_types.d.ts +4 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +4 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +17 -7
- package/script/4_errors.d.ts +2 -2
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +2 -12
- package/script/_dnt.polyfills.d.ts +99 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +128 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/client/0_client_abstract.d.ts +3 -3
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_filters.d.ts +1 -1
- package/script/client/0_filters.d.ts.map +1 -1
- package/script/client/0_filters.js +3 -3
- package/script/client/0_filters_test.d.ts.map +1 -1
- package/script/client/0_html.d.ts +1 -1
- package/script/client/0_html.d.ts.map +1 -1
- package/script/client/0_html.js +1 -1
- package/script/client/0_markdown.d.ts +1 -1
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +8 -8
- package/script/client/0_markdown_test.d.ts.map +1 -1
- package/script/client/0_params.d.ts +44 -8
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts +5 -5
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +18 -8
- package/script/client/0_password_test.d.ts.map +1 -1
- package/script/client/0_storage_operations.d.ts +4 -4
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +159 -171
- package/script/client/0_storage_operations_test.d.ts.map +1 -1
- package/script/client/0_update_processor.d.ts +2 -2
- package/script/client/0_update_processor.d.ts.map +1 -1
- package/script/client/0_utilities.d.ts +1 -1
- package/script/client/0_utilities.js +8 -8
- package/script/client/0_utilities_test.d.ts.map +1 -1
- package/script/client/1_client_plain.d.ts +3 -3
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +5 -23
- package/script/client/1_composer.d.ts +3 -3
- package/script/client/1_composer.d.ts.map +1 -1
- package/script/client/1_composer.js +14 -27
- package/script/client/1_types.d.ts +4 -4
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +3 -3
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +86 -98
- package/script/client/2_bot_info_manager.d.ts +3 -3
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +26 -38
- package/script/client/2_business_connection_manager.d.ts +3 -3
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +10 -23
- package/script/client/2_client_encrypted.d.ts +2 -2
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +195 -212
- package/script/client/2_file_manager.d.ts +7 -6
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +320 -252
- package/script/client/2_file_manager_test.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.d.ts +1 -1
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +8 -21
- package/script/client/2_payment_manager.d.ts +4 -4
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +7 -20
- package/script/client/2_reaction_manager.d.ts +3 -3
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +7 -20
- package/script/client/2_translations_manager.d.ts +4 -4
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +98 -108
- package/script/client/2_update_manager.d.ts +2 -2
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +766 -761
- package/script/client/3_client_encrypted_pool.d.ts +1 -1
- package/script/client/3_client_encrypted_pool.d.ts.map +1 -1
- package/script/client/3_client_encrypted_pool.js +10 -26
- package/script/client/3_client_encrypted_pool_test.d.ts.map +1 -1
- package/script/client/3_message_manager.d.ts +11 -8
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +580 -466
- package/script/client/3_message_manager_test.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.d.ts +6 -6
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +61 -72
- package/script/client/4_callback_query_manager.d.ts +5 -5
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +18 -30
- package/script/client/4_chat_list_manager.d.ts +6 -6
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +328 -324
- package/script/client/4_chat_manager.d.ts +7 -7
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +120 -133
- package/script/client/4_forum_manager.d.ts +4 -4
- package/script/client/4_forum_manager.d.ts.map +1 -1
- package/script/client/4_forum_manager.js +67 -73
- package/script/client/4_gift_manager.d.ts +4 -4
- package/script/client/4_gift_manager.d.ts.map +1 -1
- package/script/client/4_gift_manager.js +17 -30
- package/script/client/4_inline_query_manager.d.ts +5 -5
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +16 -28
- package/script/client/4_link_preview_manager.d.ts +5 -5
- package/script/client/4_link_preview_manager.d.ts.map +1 -1
- package/script/client/4_link_preview_manager.js +6 -19
- package/script/client/4_poll_manager.d.ts +4 -4
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +44 -57
- package/script/client/4_story_manager.d.ts +7 -7
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +43 -55
- package/script/client/5_client.d.ts +34 -15
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +1299 -1291
- package/script/connection/0_connection.d.ts +1 -1
- package/script/connection/0_connection.d.ts.map +1 -1
- package/script/connection/1_connection_tcp.node.d.ts +1 -1
- package/script/connection/1_connection_tcp.node.d.ts.map +1 -1
- package/script/connection/1_connection_tcp.node.js +49 -66
- package/script/connection/1_connection_web_socket.d.ts +1 -1
- package/script/connection/1_connection_web_socket.d.ts.map +1 -1
- package/script/connection/1_connection_web_socket.js +92 -98
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/{esm/deps/jsr.io/@std/assert/1.0.13 → script/deps/jsr.io/@std/assert/1.0.14}/assert.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.js +17 -7
- package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts +15 -0
- package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.js +23 -0
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.js +34 -9
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.js +31 -47
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/1.0.14/tee.js +82 -0
- package/script/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
- package/script/deps/jsr.io/@std/internal/1.0.10/_os.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/_os.js +48 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/format.js +17 -7
- package/script/deps/jsr.io/@std/internal/1.0.10/os.d.ts +3 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/os.js +8 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/styles.js +17 -7
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/basename.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.js +2 -2
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/basename.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/extname.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/join.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/normalize.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/to_file_url.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.js +2 -2
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/_util.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/basename.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/extname.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/from_file_url.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/is_absolute.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/join.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/normalize.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts.map +1 -1
- package/script/mod.js +19 -19
- package/script/session/0_session_state.js +12 -38
- package/script/session/1_session.d.ts +2 -2
- package/script/session/1_session.d.ts.map +1 -1
- package/script/session/1_session.js +66 -79
- package/script/session/2_session_encrypted.d.ts +2 -2
- package/script/session/2_session_encrypted.d.ts.map +1 -1
- package/script/session/2_session_encrypted.js +325 -321
- package/script/session/2_session_plain.js +1 -1
- package/script/storage/0_storage.d.ts +1 -1
- package/script/storage/0_storage.d.ts.map +1 -1
- package/script/storage/1_utilities.d.ts +14 -11
- package/script/storage/1_utilities.d.ts.map +1 -1
- package/script/storage/1_utilities.js +39 -39
- package/script/storage/1_utilities_test.d.ts.map +1 -1
- package/script/storage/2_storage_indexed_db.d.ts +1 -1
- package/script/storage/2_storage_indexed_db.d.ts.map +1 -1
- package/script/storage/2_storage_indexed_db.js +29 -47
- package/script/storage/2_storage_local_storage.node.d.ts +1 -1
- package/script/storage/2_storage_local_storage.node.d.ts.map +1 -1
- package/script/storage/2_storage_local_storage.node.js +15 -28
- package/script/storage/2_storage_memory.d.ts +2 -2
- package/script/storage/2_storage_memory.d.ts.map +1 -1
- package/script/storage/2_storage_memory.js +26 -43
- package/script/storage/2_storage_session_storage.d.ts +2 -2
- package/script/storage/2_storage_session_storage.d.ts.map +1 -1
- package/script/storage/2_storage_session_storage.js +6 -19
- package/script/tl/0_utilities.js +1 -1
- package/script/tl/0_utilities_test.d.ts.map +1 -1
- package/script/tl/1_tl_reader.d.ts +1 -1
- package/script/tl/1_tl_reader.d.ts.map +1 -1
- package/script/tl/1_tl_reader.js +83 -91
- package/script/tl/1_tl_reader_test.d.ts.map +1 -1
- package/script/tl/1_tl_writer.d.ts +1 -1
- package/script/tl/1_tl_writer.d.ts.map +1 -1
- package/script/tl/1_tl_writer.js +156 -165
- package/script/tl/1_tl_writer_test.d.ts.map +1 -1
- package/script/tl/1_utilities.d.ts +1 -1
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +2 -2
- package/script/tl/2_message.js +1 -1
- package/script/tl/2_mtproto.d.ts +1 -1
- package/script/tl/2_mtproto.d.ts.map +1 -1
- package/script/tl/2_telegram.d.ts +1 -1
- package/script/tl/2_telegram.d.ts.map +1 -1
- package/script/tl/2_telegram.js +17 -7
- package/script/transport/0_obfuscation.d.ts +1 -1
- package/script/transport/0_obfuscation.d.ts.map +1 -1
- package/script/transport/0_obfuscation.js +19 -9
- package/script/transport/0_transport.d.ts +1 -1
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/transport/0_transport.js +1 -8
- package/script/transport/1_transport_abridged.d.ts +1 -1
- package/script/transport/1_transport_abridged.d.ts.map +1 -1
- package/script/transport/1_transport_abridged.js +11 -24
- package/script/transport/1_transport_intermediate.d.ts +1 -1
- package/script/transport/1_transport_intermediate.d.ts.map +1 -1
- package/script/transport/1_transport_intermediate.js +10 -23
- package/script/transport/1_transport_provider.d.ts +2 -2
- package/script/transport/1_transport_provider.d.ts.map +1 -1
- package/script/transport/2_transport_provider_tcp.d.ts +1 -1
- package/script/transport/2_transport_provider_tcp.d.ts.map +1 -1
- package/script/transport/2_transport_provider_web_socket.d.ts +1 -1
- package/script/transport/2_transport_provider_web_socket.d.ts.map +1 -1
- package/script/transport/2_transport_provider_web_socket.js +1 -1
- package/script/types/0_birthday.d.ts +1 -1
- package/script/types/0_birthday.d.ts.map +1 -1
- package/script/types/0_callback_query_answer.d.ts +1 -1
- package/script/types/0_callback_query_answer.d.ts.map +1 -1
- package/script/types/0_callback_query_question.js +2 -2
- package/script/types/0_chat_administrator_rights.d.ts +1 -1
- package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/script/types/0_chat_member_rights.d.ts +1 -1
- package/script/types/0_chat_member_rights.d.ts.map +1 -1
- package/script/types/0_contact.d.ts +1 -1
- package/script/types/0_contact.d.ts.map +1 -1
- package/script/types/0_dice.d.ts +1 -1
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_failed_invitation.d.ts +1 -1
- package/script/types/0_failed_invitation.d.ts.map +1 -1
- package/script/types/0_invoice.d.ts +1 -1
- package/script/types/0_invoice.d.ts.map +1 -1
- package/script/types/0_live_stream_channel.d.ts +1 -1
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_mask_position.d.ts +1 -1
- package/script/types/0_mask_position.d.ts.map +1 -1
- package/script/types/0_mask_position.js +1 -1
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +1 -1
- package/script/types/0_message_search_filter.d.ts +1 -1
- package/script/types/0_message_search_filter.d.ts.map +1 -1
- package/script/types/0_opening_hours.d.ts +1 -1
- package/script/types/0_opening_hours.d.ts.map +1 -1
- package/script/types/0_reaction.js +5 -5
- package/script/types/0_refunded_payment.d.ts +1 -1
- package/script/types/0_refunded_payment.d.ts.map +1 -1
- package/script/types/0_restriction_reason.d.ts +1 -1
- package/script/types/0_restriction_reason.d.ts.map +1 -1
- package/script/types/0_self_destruct_option.js +3 -3
- package/script/types/0_shipping_address.d.ts +1 -1
- package/script/types/0_shipping_address.d.ts.map +1 -1
- package/script/types/0_slow_mode_duration.js +2 -2
- 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_voice.d.ts +1 -1
- package/script/types/0_voice.d.ts.map +1 -1
- package/script/types/0_voice_transcription.d.ts +1 -1
- package/script/types/0_voice_transcription.d.ts.map +1 -1
- package/script/types/1_animation.d.ts +1 -1
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_audio.d.ts +1 -1
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.d.ts +2 -2
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_chat_p.d.ts +2 -2
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +2 -2
- package/script/types/1_document.d.ts +1 -1
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_giveaway.d.ts +2 -2
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_inline_keyboard_button.d.ts +3 -3
- package/script/types/1_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/1_inline_keyboard_button.js +4 -4
- package/script/types/1_inline_query_result_button.d.ts +1 -1
- package/script/types/1_inline_query_result_button.d.ts.map +1 -1
- package/script/types/1_input_media.d.ts +4 -4
- package/script/types/1_input_media.d.ts.map +1 -1
- package/script/types/1_input_story_content.d.ts +1 -1
- package/script/types/1_input_story_content.d.ts.map +1 -1
- package/script/types/1_keyboard_button.d.ts +3 -3
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +1 -1
- package/script/types/1_message_reaction.d.ts +1 -1
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +2 -2
- package/script/types/1_mini_app_info.d.ts +2 -2
- package/script/types/1_mini_app_info.d.ts.map +1 -1
- package/script/types/1_network_statistics.d.ts +1 -1
- package/script/types/1_network_statistics.d.ts.map +1 -1
- package/script/types/1_order_info.d.ts +2 -2
- package/script/types/1_order_info.d.ts.map +1 -1
- package/script/types/1_photo.d.ts +1 -1
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_poll_option.d.ts +2 -2
- package/script/types/1_poll_option.d.ts.map +1 -1
- package/script/types/1_poll_option.js +2 -2
- package/script/types/1_reaction_count.d.ts +2 -2
- package/script/types/1_reaction_count.d.ts.map +1 -1
- package/script/types/1_reply_quote.d.ts +2 -2
- package/script/types/1_reply_quote.d.ts.map +1 -1
- package/script/types/1_sticker.d.ts +4 -4
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +2 -2
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_reaction.d.ts +2 -2
- package/script/types/1_story_reaction.d.ts.map +1 -1
- package/script/types/1_user.d.ts +2 -2
- package/script/types/1_user.d.ts.map +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts +1 -1
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_video.d.ts +1 -1
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video_note.d.ts +1 -1
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/2_business_connection.d.ts +3 -3
- package/script/types/2_business_connection.d.ts.map +1 -1
- package/script/types/2_chat.d.ts +6 -6
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +3 -3
- package/script/types/2_chat_member.d.ts +4 -4
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +1 -1
- package/script/types/2_chat_settings.d.ts +1 -1
- package/script/types/2_chat_settings.d.ts.map +1 -1
- package/script/types/2_chat_settings.js +1 -1
- package/script/types/2_chosen_inline_result.d.ts +3 -3
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_forward_header.d.ts +4 -4
- package/script/types/2_forward_header.d.ts.map +1 -1
- package/script/types/2_forward_header.js +6 -6
- package/script/types/2_game.d.ts +3 -3
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_gift_upgraded_component.d.ts +2 -2
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/script/types/2_inactive_chat.d.ts +1 -1
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inline_query.d.ts +3 -3
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +1 -1
- package/script/types/2_invite_link.d.ts +3 -3
- package/script/types/2_invite_link.d.ts.map +1 -1
- package/script/types/2_message_interactions.d.ts +1 -1
- package/script/types/2_message_interactions.d.ts.map +1 -1
- package/script/types/2_message_reaction_count.d.ts +4 -4
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reactions.d.ts +4 -4
- package/script/types/2_message_reactions.d.ts.map +1 -1
- package/script/types/2_poll.d.ts +3 -3
- package/script/types/2_poll.d.ts.map +1 -1
- package/script/types/2_poll.js +3 -3
- package/script/types/2_poll_answer.d.ts +22 -3
- package/script/types/2_poll_answer.d.ts.map +1 -1
- package/script/types/2_poll_answer.js +19 -0
- package/script/types/2_pre_checkout_query.d.ts +4 -4
- package/script/types/2_pre_checkout_query.d.ts.map +1 -1
- package/script/types/2_reply_markup.d.ts +3 -3
- package/script/types/2_reply_markup.d.ts.map +1 -1
- package/script/types/2_reply_to.d.ts +2 -2
- package/script/types/2_reply_to.d.ts.map +1 -1
- 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 +2 -2
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_interactions.d.ts +2 -2
- package/script/types/2_story_interactions.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.d.ts +5 -5
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_successful_payment.d.ts +2 -2
- package/script/types/2_successful_payment.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.d.ts +5 -5
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_gift.d.ts +4 -4
- package/script/types/3_gift.d.ts.map +1 -1
- package/script/types/3_join_request.d.ts +4 -4
- package/script/types/3_join_request.d.ts.map +1 -1
- package/script/types/3_story.d.ts +8 -8
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/4_claimed_gift.d.ts +4 -4
- package/script/types/4_claimed_gift.d.ts.map +1 -1
- package/script/types/4_link_preview.d.ts +5 -5
- package/script/types/4_link_preview.d.ts.map +1 -1
- package/script/types/5_claimed_gifts.d.ts +2 -2
- package/script/types/5_claimed_gifts.d.ts.map +1 -1
- package/script/types/5_claimed_gifts.js +3 -3
- package/script/types/5_message.d.ts +29 -29
- package/script/types/5_message.d.ts.map +1 -1
- package/script/types/5_message.js +8 -8
- package/script/types/5_message_content.d.ts +4 -4
- package/script/types/5_message_content.d.ts.map +1 -1
- package/script/types/6_callback_query.d.ts +3 -3
- package/script/types/6_callback_query.d.ts.map +1 -1
- package/script/types/6_callback_query.js +2 -2
- package/script/types/6_chat_list_item.d.ts +4 -4
- package/script/types/6_chat_list_item.d.ts.map +1 -1
- package/script/types/6_chat_list_item.js +6 -6
- package/script/types/6_inline_query_result.d.ts +6 -6
- package/script/types/6_inline_query_result.d.ts.map +1 -1
- package/script/types/6_inline_query_result.js +16 -16
- package/script/types/6_saved_chat.d.ts +36 -0
- package/script/types/6_saved_chat.d.ts.map +1 -0
- package/script/types/6_saved_chat.js +46 -0
- package/script/types/6_topic.d.ts +2 -2
- package/script/types/6_topic.d.ts.map +1 -1
- package/script/types/6_topic.js +1 -1
- package/script/types/7_inline_query_answer.d.ts +2 -2
- package/script/types/7_inline_query_answer.d.ts.map +1 -1
- package/script/types/7_saved_chats.d.ts +33 -0
- package/script/types/7_saved_chats.d.ts.map +1 -0
- package/script/types/7_saved_chats.js +39 -0
- package/script/types/7_update.d.ts +44 -25
- package/script/types/7_update.d.ts.map +1 -1
- package/script/types/_file_id.d.ts +60 -49
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +155 -136
- package/script/types/_getters.d.ts +3 -3
- package/script/types/_getters.d.ts.map +1 -1
- package/script/utilities/0_bigint.js +22 -12
- package/script/utilities/0_bigint_test.d.ts.map +1 -1
- package/script/utilities/0_buffer.d.ts +1 -1
- package/script/utilities/0_buffer.d.ts.map +1 -1
- package/script/utilities/0_buffer.js +3 -3
- package/script/utilities/0_buffer_test.d.ts.map +1 -1
- package/script/utilities/0_env.js +18 -8
- package/script/utilities/0_hash.d.ts +2 -2
- package/script/utilities/0_hash.d.ts.map +1 -1
- package/script/utilities/0_hash.js +17 -7
- package/script/utilities/0_misc.d.ts.map +1 -1
- package/script/utilities/0_misc.js +21 -10
- package/script/utilities/0_mutex.js +4 -19
- package/script/utilities/0_part_stream.js +11 -25
- package/script/utilities/0_part_stream_test.d.ts.map +1 -1
- package/script/utilities/0_rle.d.ts +2 -2
- package/script/utilities/0_rle.d.ts.map +1 -1
- package/script/utilities/0_rle.js +1 -1
- package/script/utilities/0_rle_test.d.ts.map +1 -1
- package/script/utilities/0_text.d.ts +20 -1
- package/script/utilities/0_text.d.ts.map +1 -1
- package/script/utilities/0_text.js +19 -0
- package/script/utilities/1_auth.d.ts +1 -1
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +18 -8
- package/script/utilities/1_base64.d.ts +1 -1
- package/script/utilities/1_base64.d.ts.map +1 -1
- package/script/utilities/1_base64.js +1 -1
- package/script/utilities/1_base64_test.d.ts.map +1 -1
- package/script/utilities/1_crypto.js +60 -61
- package/script/utilities/1_crypto_test.d.ts.map +1 -1
- package/script/utilities/1_logger.d.ts +2 -2
- package/script/utilities/1_logger.js +2 -2
- package/script/utilities/1_math.js +2 -2
- package/script/utilities/1_math_test.d.ts.map +1 -1
- package/script/utilities/2_queue.js +30 -48
- package/esm/deps/jsr.io/@std/async/1.0.13/tee.js +0 -102
- package/esm/deps/jsr.io/@std/path/1.1.0/_os.d.ts +0 -2
- package/esm/deps/jsr.io/@std/path/1.1.0/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.0/_os.js +0 -9
- package/script/deps/jsr.io/@std/async/1.0.13/tee.js +0 -105
- package/script/deps/jsr.io/@std/path/1.1.0/_os.d.ts +0 -2
- package/script/deps/jsr.io/@std/path/1.1.0/_os.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.0/_os.js +0 -35
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.js +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.js +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.js +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts +0 -0
- /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.js +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.js +0 -0
|
@@ -17,18 +17,6 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
21
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
22
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
23
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
24
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
25
|
-
};
|
|
26
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
27
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
|
-
};
|
|
31
|
-
var _ChatListManager_instances, _ChatListManager_c, _ChatListManager_sendChatUpdate, _ChatListManager_chats, _ChatListManager_archivedChats, _ChatListManager_getChatAnywhere, _ChatListManager_getChatList, _ChatListManager_pinnedChats, _ChatListManager_pinnedArchiveChats, _ChatListManager_storageHadPinnedChats, _ChatListManager_pinnedChatsLoaded, _ChatListManager_loadPinnedChats, _ChatListManager_fetchPinnedChats, _ChatListManager_getPinnedChats, _ChatListManager_updateOrAddChat, _ChatListManager_removeChat, _ChatListManager_handleUpdateFolderPeers, _ChatListManager_handleUpdatePinnedDialogs, _ChatListManager_handleUpdateChannel, _ChatListManager_handleUpdateChat, _ChatListManager_handleUpdateUser, _ChatListManager_getFullChat, _ChatListManager_checkChatTitle, _ChatListManager_createChannel, _ChatListManager_moveChatsToFolder, _ChatListManager_toggleBusinessBotsPaused;
|
|
32
20
|
import { unreachable } from "../0_deps.js";
|
|
33
21
|
import { InputError } from "../0_errors.js";
|
|
34
22
|
import { fromUnixTimestamp } from "../1_utilities.js";
|
|
@@ -46,67 +34,71 @@ const chatListManagerUpdates = [
|
|
|
46
34
|
"updateUserName",
|
|
47
35
|
];
|
|
48
36
|
export class ChatListManager {
|
|
37
|
+
#c;
|
|
49
38
|
constructor(c) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
this.#c = c;
|
|
40
|
+
}
|
|
41
|
+
#sendChatUpdate(chatId, added) {
|
|
42
|
+
try {
|
|
43
|
+
this.#c.storage.assertUser("");
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const [chat] = this.#getChatAnywhere(chatId);
|
|
49
|
+
const update = chat === undefined ? { deletedChat: { chatId } } : added ? { newChat: chat } : { editedChat: chat };
|
|
50
|
+
this.#c.handleUpdate(update);
|
|
59
51
|
}
|
|
60
52
|
async reassignChatLastMessage(chatId, add = false, sendUpdate = true) {
|
|
61
53
|
try {
|
|
62
|
-
|
|
54
|
+
this.#c.storage.assertUser("");
|
|
63
55
|
}
|
|
64
56
|
catch {
|
|
65
57
|
return () => Promise.resolve();
|
|
66
58
|
}
|
|
67
|
-
const [chat, listId] =
|
|
59
|
+
const [chat, listId] = this.#getChatAnywhere(chatId);
|
|
68
60
|
if (!chat && !add) {
|
|
69
61
|
return () => Promise.resolve();
|
|
70
62
|
}
|
|
71
|
-
const message_ = await
|
|
72
|
-
if (message_
|
|
73
|
-
const message = await
|
|
63
|
+
const message_ = await this.#c.messageStorage.getLastMessage(chatId);
|
|
64
|
+
if (message_ !== null) {
|
|
65
|
+
const message = await this.#c.messageManager.constructMessage(message_);
|
|
74
66
|
if (chat) {
|
|
75
67
|
chat.order = getChatListItemOrder(message, chat.pinned);
|
|
76
68
|
chat.lastMessage = message;
|
|
77
|
-
await
|
|
69
|
+
await this.#c.storage.setChat(listId, chatId, chat.pinned, message.id, fromUnixTimestamp(message.date));
|
|
78
70
|
}
|
|
79
71
|
else {
|
|
80
|
-
const pinnedChats = await
|
|
81
|
-
const chat = await constructChatListItem3(chatId, pinnedChats.indexOf(chatId), message,
|
|
82
|
-
if (chat
|
|
72
|
+
const pinnedChats = await this.#getPinnedChats(listId);
|
|
73
|
+
const chat = await constructChatListItem3(chatId, pinnedChats.indexOf(chatId), message, this.#c.getEntity);
|
|
74
|
+
if (chat === null) {
|
|
83
75
|
unreachable();
|
|
84
76
|
}
|
|
85
|
-
|
|
86
|
-
await
|
|
77
|
+
this.#chats.set(chatId, chat);
|
|
78
|
+
await this.#c.storage.setChat(listId, chatId, chat.pinned, chat.lastMessage?.id ?? 0, fromUnixTimestamp(chat.lastMessage?.date ?? 0));
|
|
87
79
|
}
|
|
88
80
|
if (sendUpdate) {
|
|
89
|
-
return () =>
|
|
81
|
+
return () => this.#sendChatUpdate(chatId, !chat);
|
|
90
82
|
}
|
|
91
83
|
return () => Promise.resolve();
|
|
92
84
|
}
|
|
93
|
-
const message = (await
|
|
85
|
+
const message = (await this.#c.messageManager.getHistory(chatId, { limit: 1 }))[0];
|
|
94
86
|
if (message) {
|
|
95
87
|
if (chat) {
|
|
96
88
|
chat.order = getChatListItemOrder(message, chat.pinned);
|
|
97
89
|
chat.lastMessage = message;
|
|
98
|
-
await
|
|
90
|
+
await this.#c.storage.setChat(listId, chatId, chat.pinned, message.id, fromUnixTimestamp(message.date));
|
|
99
91
|
}
|
|
100
92
|
else {
|
|
101
|
-
const pinnedChats = await
|
|
102
|
-
const chat = await constructChatListItem3(chatId, pinnedChats.indexOf(chatId), message,
|
|
103
|
-
if (chat
|
|
93
|
+
const pinnedChats = await this.#getPinnedChats(listId);
|
|
94
|
+
const chat = await constructChatListItem3(chatId, pinnedChats.indexOf(chatId), message, this.#c.getEntity);
|
|
95
|
+
if (chat === null) {
|
|
104
96
|
unreachable();
|
|
105
97
|
}
|
|
106
|
-
|
|
98
|
+
this.#chats.set(chatId, chat);
|
|
107
99
|
}
|
|
108
100
|
if (sendUpdate) {
|
|
109
|
-
return () =>
|
|
101
|
+
return () => this.#sendChatUpdate(chatId, !chat);
|
|
110
102
|
}
|
|
111
103
|
return () => Promise.resolve();
|
|
112
104
|
}
|
|
@@ -114,33 +106,205 @@ export class ChatListManager {
|
|
|
114
106
|
chat.order = getChatListItemOrder(undefined, chat.pinned);
|
|
115
107
|
chat.lastMessage = undefined;
|
|
116
108
|
if (sendUpdate) {
|
|
117
|
-
return () =>
|
|
109
|
+
return () => this.#sendChatUpdate(chatId, false);
|
|
118
110
|
}
|
|
119
111
|
}
|
|
120
112
|
return () => Promise.resolve();
|
|
121
113
|
}
|
|
114
|
+
#chats = new Map();
|
|
115
|
+
#archivedChats = new Map();
|
|
116
|
+
#getChatAnywhere(chatId) {
|
|
117
|
+
let chat = this.#chats.get(chatId);
|
|
118
|
+
if (chat) {
|
|
119
|
+
return [chat, 0];
|
|
120
|
+
}
|
|
121
|
+
chat = this.#archivedChats.get(chatId);
|
|
122
|
+
if (chat) {
|
|
123
|
+
return [chat, 1];
|
|
124
|
+
}
|
|
125
|
+
return [undefined, -1];
|
|
126
|
+
}
|
|
127
|
+
#getChatList(listId) {
|
|
128
|
+
switch (listId) {
|
|
129
|
+
case 0:
|
|
130
|
+
return this.#chats;
|
|
131
|
+
case 1:
|
|
132
|
+
return this.#archivedChats;
|
|
133
|
+
default:
|
|
134
|
+
throw new Error(`Invalid chat list: ${listId}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
#pinnedChats = new Array();
|
|
138
|
+
#pinnedArchiveChats = new Array();
|
|
139
|
+
#storageHadPinnedChats = false;
|
|
140
|
+
#pinnedChatsLoaded = false;
|
|
141
|
+
async #loadPinnedChats() {
|
|
142
|
+
const [pinnedChats, pinnedArchiveChats] = await Promise.all([this.#c.storage.getPinnedChats(0), this.#c.storage.getPinnedChats(1)]);
|
|
143
|
+
if (pinnedChats !== null && pinnedArchiveChats !== null) {
|
|
144
|
+
this.#pinnedChats = pinnedChats;
|
|
145
|
+
this.#pinnedArchiveChats = pinnedArchiveChats;
|
|
146
|
+
this.#storageHadPinnedChats = true;
|
|
147
|
+
}
|
|
148
|
+
this.#pinnedChatsLoaded = true;
|
|
149
|
+
}
|
|
150
|
+
async #fetchPinnedChats(listId = null) {
|
|
151
|
+
if (listId === null || listId === 0) {
|
|
152
|
+
const dialogs = await this.#c.invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
|
|
153
|
+
const pinnedChats = new Array();
|
|
154
|
+
for (const dialog of dialogs.dialogs) {
|
|
155
|
+
pinnedChats.push(Api.peerToChatId(dialog.peer));
|
|
156
|
+
}
|
|
157
|
+
this.#pinnedChats = pinnedChats;
|
|
158
|
+
await this.#c.storage.setPinnedChats(0, this.#pinnedChats);
|
|
159
|
+
}
|
|
160
|
+
if (listId === null || listId === 1) {
|
|
161
|
+
const dialogs = await this.#c.invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
|
|
162
|
+
const pinnedArchiveChats = new Array();
|
|
163
|
+
for (const dialog of dialogs.dialogs) {
|
|
164
|
+
pinnedArchiveChats.push(Api.peerToChatId(dialog.peer));
|
|
165
|
+
}
|
|
166
|
+
this.#pinnedArchiveChats = pinnedArchiveChats;
|
|
167
|
+
await this.#c.storage.setPinnedChats(1, this.#pinnedArchiveChats);
|
|
168
|
+
}
|
|
169
|
+
if (listId !== null && listId !== 0 && listId !== 1) {
|
|
170
|
+
unreachable();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async #getPinnedChats(listId) {
|
|
174
|
+
if (!this.#pinnedChatsLoaded) {
|
|
175
|
+
await this.#loadPinnedChats();
|
|
176
|
+
}
|
|
177
|
+
if (!this.#storageHadPinnedChats) {
|
|
178
|
+
await this.#fetchPinnedChats();
|
|
179
|
+
}
|
|
180
|
+
switch (listId) {
|
|
181
|
+
case 0:
|
|
182
|
+
return this.#pinnedChats;
|
|
183
|
+
case 1:
|
|
184
|
+
return this.#pinnedArchiveChats;
|
|
185
|
+
default:
|
|
186
|
+
unreachable();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async #updateOrAddChat(chatId) {
|
|
190
|
+
const [chat, listId] = this.#getChatAnywhere(chatId);
|
|
191
|
+
if (chat !== undefined) {
|
|
192
|
+
const newChat = await constructChatListItem3(chatId, chat.pinned, chat.lastMessage, this.#c.getEntity);
|
|
193
|
+
if (newChat !== null) {
|
|
194
|
+
this.#getChatList(listId).set(chatId, newChat);
|
|
195
|
+
this.#sendChatUpdate(chatId, false);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
const chat = await constructChatListItem(chatId, -1, -1, this.#c.getEntity, this.#c.messageManager.getMessage.bind(this.#c.messageManager));
|
|
200
|
+
if (chat !== null) {
|
|
201
|
+
this.#getChatList(0).set(chatId, chat);
|
|
202
|
+
await this.reassignChatLastMessage(chatId, false, false);
|
|
203
|
+
this.#sendChatUpdate(chatId, true);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
#removeChat(chatId) {
|
|
208
|
+
const [chat, listId] = this.#getChatAnywhere(chatId);
|
|
209
|
+
if (chat !== undefined) {
|
|
210
|
+
this.#getChatList(listId).delete(chatId);
|
|
211
|
+
this.#sendChatUpdate(chatId, false);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
#handleUpdateFolderPeers(update) {
|
|
215
|
+
for (const { peer, folder_id: listId } of update.folder_peers) {
|
|
216
|
+
const chatId = Api.peerToChatId(peer);
|
|
217
|
+
const [chat, currentListId] = this.#getChatAnywhere(chatId);
|
|
218
|
+
if (chat !== undefined && listId !== currentListId) {
|
|
219
|
+
this.#getChatList(currentListId).delete(chatId);
|
|
220
|
+
this.#getChatList(listId).set(chatId, chat);
|
|
221
|
+
this.#sendChatUpdate(chatId, true);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async #handleUpdatePinnedDialogs(update) {
|
|
226
|
+
const listId = update.folder_id ?? 0;
|
|
227
|
+
await this.#fetchPinnedChats(update.folder_id);
|
|
228
|
+
const chats = this.#getChatList(listId);
|
|
229
|
+
const pinnedChats = await this.#getPinnedChats(listId);
|
|
230
|
+
for (const [i, chatId] of pinnedChats.entries()) {
|
|
231
|
+
const chat = chats.get(chatId);
|
|
232
|
+
if (chat !== undefined) {
|
|
233
|
+
chat.order = getChatListItemOrder(chat.lastMessage, i);
|
|
234
|
+
chat.pinned = i;
|
|
235
|
+
await this.#sendChatUpdate(chatId, false);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
for (const chat of chats.values()) {
|
|
239
|
+
if (chat.pinned !== -1 && pinnedChats.indexOf(chat.chat.id) === -1) {
|
|
240
|
+
chat.order = getChatListItemOrder(chat.lastMessage, -1);
|
|
241
|
+
chat.pinned = -1;
|
|
242
|
+
await this.#sendChatUpdate(chat.chat.id, false);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
await this.#c.storage.setPinnedChats(listId, await this.#getPinnedChats(listId));
|
|
246
|
+
}
|
|
247
|
+
async #handleUpdateChannel(update) {
|
|
248
|
+
const peer = { ...update, _: "peerChannel" };
|
|
249
|
+
const channel = await this.#c.getEntity(peer);
|
|
250
|
+
const chatId = Api.peerToChatId(peer);
|
|
251
|
+
await this.#c.storage.setFullChat(chatId, null);
|
|
252
|
+
if (channel !== null && "left" in channel && channel.left) {
|
|
253
|
+
this.#removeChat(chatId);
|
|
254
|
+
}
|
|
255
|
+
else if (Api.is("channelForbidden", channel)) {
|
|
256
|
+
this.#removeChat(chatId);
|
|
257
|
+
}
|
|
258
|
+
else if (Api.is("channel", channel)) {
|
|
259
|
+
await this.#updateOrAddChat(chatId);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
async #handleUpdateChat(update) {
|
|
263
|
+
const peer = { ...update, _: "peerChat" };
|
|
264
|
+
const chat = await this.#c.getEntity(peer);
|
|
265
|
+
const chatId = Api.peerToChatId(peer);
|
|
266
|
+
await this.#c.storage.setFullChat(chatId, null);
|
|
267
|
+
if (chat !== null && "left" in chat && chat.left) {
|
|
268
|
+
await this.#removeChat(chatId);
|
|
269
|
+
}
|
|
270
|
+
else if (Api.is("chatForbidden", chat)) {
|
|
271
|
+
await this.#removeChat(chatId);
|
|
272
|
+
}
|
|
273
|
+
else if (Api.is("chat", chat)) {
|
|
274
|
+
await this.#updateOrAddChat(chatId);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
async #handleUpdateUser(update) {
|
|
278
|
+
const peer = { ...update, _: "peerUser" };
|
|
279
|
+
const chat = await this.#c.getEntity(peer);
|
|
280
|
+
const chatId = Api.peerToChatId(peer);
|
|
281
|
+
await this.#c.storage.setFullChat(chatId, null);
|
|
282
|
+
if (chat !== null) {
|
|
283
|
+
await this.#updateOrAddChat(chatId);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
122
286
|
async getChats(from = "main", after, limit = 100) {
|
|
123
|
-
|
|
124
|
-
if (after && !
|
|
287
|
+
this.#c.storage.assertUser("getChats");
|
|
288
|
+
if (after && !this.#chats.get(after.chat.id)) {
|
|
125
289
|
throw new InputError("Invalid after");
|
|
126
290
|
}
|
|
127
291
|
if (limit <= 0 || limit > 100) {
|
|
128
292
|
limit = 100;
|
|
129
293
|
}
|
|
130
294
|
const listId = getChatListId(from);
|
|
131
|
-
const dialogs = await
|
|
132
|
-
const pinnedChats = await
|
|
295
|
+
const dialogs = await this.#c.invoke({ _: "messages.getDialogs", limit, offset_id: after?.lastMessage?.id ?? 0, offset_date: after?.lastMessage?.date ?? 0, offset_peer: after ? await this.#c.getInputPeer(after.chat.id) : { _: "inputPeerEmpty" }, hash: 0n, folder_id: listId });
|
|
296
|
+
const pinnedChats = await this.#getPinnedChats(listId);
|
|
133
297
|
if (!(Api.is("messages.dialogs", dialogs)) && !(Api.is("messages.dialogsSlice", dialogs))) {
|
|
134
298
|
unreachable();
|
|
135
299
|
}
|
|
136
300
|
if (dialogs.dialogs.length < limit) {
|
|
137
|
-
await
|
|
301
|
+
await this.#c.storage.setHasAllChats(listId, true);
|
|
138
302
|
}
|
|
139
303
|
const chats = new Array();
|
|
140
304
|
for (const dialog of dialogs.dialogs) {
|
|
141
|
-
const chat = await constructChatListItem4(dialog, dialogs, pinnedChats,
|
|
305
|
+
const chat = await constructChatListItem4(dialog, dialogs, pinnedChats, this.#c.getEntity, this.#c.messageManager.getMessage.bind(this.#c.messageManager), this.#c.fileManager.getStickerSetName.bind(this.#c.fileManager));
|
|
142
306
|
chats.push(chat);
|
|
143
|
-
await
|
|
307
|
+
await this.#c.storage.setChat(listId, chat.chat.id, chat.pinned, chat.lastMessage?.id ?? 0, fromUnixTimestamp(chat.lastMessage?.date ?? 0));
|
|
144
308
|
}
|
|
145
309
|
return chats;
|
|
146
310
|
}
|
|
@@ -155,54 +319,76 @@ export class ChatListManager {
|
|
|
155
319
|
}
|
|
156
320
|
}
|
|
157
321
|
else if (Api.is("updatePinnedDialogs", update)) {
|
|
158
|
-
await
|
|
322
|
+
await this.#handleUpdatePinnedDialogs(update);
|
|
159
323
|
}
|
|
160
324
|
else if (Api.is("updateFolderPeers", update)) {
|
|
161
|
-
|
|
325
|
+
this.#handleUpdateFolderPeers(update);
|
|
162
326
|
}
|
|
163
327
|
else if (Api.is("updateChannel", update)) {
|
|
164
|
-
await
|
|
328
|
+
await this.#handleUpdateChannel(update);
|
|
165
329
|
}
|
|
166
330
|
else if (Api.is("updateChat", update)) {
|
|
167
|
-
await
|
|
331
|
+
await this.#handleUpdateChat(update);
|
|
168
332
|
}
|
|
169
333
|
else if (Api.is("updateUser", update) || Api.is("updateUserName", update)) {
|
|
170
|
-
await
|
|
334
|
+
await this.#handleUpdateUser(update);
|
|
171
335
|
}
|
|
172
336
|
else {
|
|
173
337
|
unreachable();
|
|
174
338
|
}
|
|
175
339
|
return null;
|
|
176
340
|
}
|
|
341
|
+
async #getFullChat(chatId) {
|
|
342
|
+
const inputPeer = await this.#c.getInputPeer(chatId);
|
|
343
|
+
const chatId_ = await this.#c.getInputPeerChatId(inputPeer);
|
|
344
|
+
let fullChat = await this.#c.storage.getFullChat(chatId_);
|
|
345
|
+
if (fullChat !== null) {
|
|
346
|
+
return fullChat;
|
|
347
|
+
}
|
|
348
|
+
if (canBeInputUser(inputPeer)) {
|
|
349
|
+
fullChat = (await this.#c.invoke({ _: "users.getFullUser", id: toInputUser(inputPeer) })).full_user;
|
|
350
|
+
}
|
|
351
|
+
else if (Api.is("inputPeerChat", inputPeer)) {
|
|
352
|
+
fullChat = (await this.#c.invoke({ ...inputPeer, _: "messages.getFullChat" })).full_chat;
|
|
353
|
+
}
|
|
354
|
+
else if (canBeInputChannel(inputPeer)) {
|
|
355
|
+
fullChat = (await this.#c.invoke({ _: "channels.getFullChannel", channel: toInputChannel(inputPeer) })).full_chat;
|
|
356
|
+
}
|
|
357
|
+
await this.#c.storage.setFullChat(chatId_, fullChat);
|
|
358
|
+
if (fullChat !== null && "call" in fullChat && Api.is("inputGroupCall", fullChat.call)) {
|
|
359
|
+
await this.#c.storage.setGroupCallAccessHash(fullChat.call.id, fullChat.call.access_hash);
|
|
360
|
+
}
|
|
361
|
+
return fullChat;
|
|
362
|
+
}
|
|
177
363
|
async getChat(chatId) {
|
|
178
|
-
const fullChat = await
|
|
179
|
-
if (fullChat
|
|
364
|
+
const fullChat = await this.#getFullChat(chatId);
|
|
365
|
+
if (fullChat === null) {
|
|
180
366
|
throw new InputError("Chat not found.");
|
|
181
367
|
}
|
|
182
|
-
return await constructChat(fullChat,
|
|
368
|
+
return await constructChat(fullChat, this.#c.getEntity);
|
|
183
369
|
}
|
|
184
370
|
async getChatAdministrators(chatId) {
|
|
185
|
-
const peer = await
|
|
371
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
186
372
|
if (canBeInputChannel(peer)) {
|
|
187
373
|
const channel = toInputChannel(peer);
|
|
188
|
-
const participants = await
|
|
374
|
+
const participants = await this.#c.invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
|
|
189
375
|
if (Api.is("channels.channelParticipantsNotModified", participants)) {
|
|
190
376
|
unreachable();
|
|
191
377
|
}
|
|
192
378
|
const chatMembers = new Array();
|
|
193
379
|
for (const p of participants.participants) {
|
|
194
|
-
chatMembers.push(await constructChatMember(p,
|
|
380
|
+
chatMembers.push(await constructChatMember(p, this.#c.getEntity));
|
|
195
381
|
}
|
|
196
382
|
return chatMembers;
|
|
197
383
|
}
|
|
198
384
|
else if (Api.is("inputPeerChat", peer)) {
|
|
199
|
-
const fullChat = await
|
|
385
|
+
const fullChat = await this.#getFullChat(chatId);
|
|
200
386
|
if (!fullChat || !("participants" in fullChat) || !Api.is("chatParticipants", fullChat.participants)) {
|
|
201
387
|
unreachable();
|
|
202
388
|
}
|
|
203
389
|
const chatMembers = new Array();
|
|
204
390
|
for (const p of fullChat.participants.participants) {
|
|
205
|
-
chatMembers.push(await constructChatMember(p,
|
|
391
|
+
chatMembers.push(await constructChatMember(p, this.#c.getEntity));
|
|
206
392
|
}
|
|
207
393
|
return chatMembers;
|
|
208
394
|
}
|
|
@@ -211,44 +397,44 @@ export class ChatListManager {
|
|
|
211
397
|
}
|
|
212
398
|
}
|
|
213
399
|
async getChatMember(chatId, userId) {
|
|
214
|
-
const peer = await
|
|
400
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
215
401
|
if (canBeInputChannel(peer)) {
|
|
216
|
-
const { participant } = await
|
|
217
|
-
return await constructChatMember(participant,
|
|
402
|
+
const { participant } = await this.#c.invoke({ _: "channels.getParticipant", channel: toInputChannel(peer), participant: await this.#c.getInputPeer(userId) });
|
|
403
|
+
return await constructChatMember(participant, this.#c.getEntity);
|
|
218
404
|
}
|
|
219
405
|
else if (Api.is("inputPeerChat", peer)) {
|
|
220
|
-
const user = await
|
|
221
|
-
const userId_ = BigInt(await
|
|
222
|
-
const fullChat = await
|
|
223
|
-
const participant = Api.as("chatParticipants", fullChat.participants).participants.find((v) => v.user_id
|
|
224
|
-
return await constructChatMember(participant,
|
|
406
|
+
const user = await this.#c.getInputUser(userId);
|
|
407
|
+
const userId_ = BigInt(await this.#c.getInputPeerChatId(user));
|
|
408
|
+
const fullChat = await this.#c.invoke({ ...peer, _: "messages.getFullChat" }).then((v) => Api.as("chatFull", v.full_chat));
|
|
409
|
+
const participant = Api.as("chatParticipants", fullChat.participants).participants.find((v) => v.user_id === userId_);
|
|
410
|
+
return await constructChatMember(participant, this.#c.getEntity);
|
|
225
411
|
}
|
|
226
412
|
else {
|
|
227
413
|
throw new InputError("Expected a channel, supergroup, or group ID. Got a user ID instead.");
|
|
228
414
|
}
|
|
229
415
|
}
|
|
230
416
|
async getChatMembers(chatId, params) {
|
|
231
|
-
const peer = await
|
|
417
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
232
418
|
if (canBeInputChannel(peer)) {
|
|
233
419
|
const channel = toInputChannel(peer);
|
|
234
|
-
const participants = await
|
|
420
|
+
const participants = await this.#c.invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsRecent" }, offset: params?.offset ?? 0, limit: getLimit(params?.limit), hash: 0n });
|
|
235
421
|
if (Api.is("channels.channelParticipantsNotModified", participants)) {
|
|
236
422
|
unreachable();
|
|
237
423
|
}
|
|
238
424
|
const chatMembers = new Array();
|
|
239
425
|
for (const p of participants.participants) {
|
|
240
|
-
chatMembers.push(await constructChatMember(p,
|
|
426
|
+
chatMembers.push(await constructChatMember(p, this.#c.getEntity));
|
|
241
427
|
}
|
|
242
428
|
return chatMembers;
|
|
243
429
|
}
|
|
244
430
|
else if (Api.is("inputPeerChat", peer)) {
|
|
245
|
-
const fullChat = await
|
|
431
|
+
const fullChat = await this.#getFullChat(chatId);
|
|
246
432
|
if (!fullChat || !("participants" in fullChat) || !Api.is("chatParticipants", fullChat.participants)) {
|
|
247
433
|
unreachable();
|
|
248
434
|
}
|
|
249
435
|
const chatMembers = new Array();
|
|
250
436
|
for (const p of fullChat.participants.participants) {
|
|
251
|
-
chatMembers.push(await constructChatMember(p,
|
|
437
|
+
chatMembers.push(await constructChatMember(p, this.#c.getEntity));
|
|
252
438
|
}
|
|
253
439
|
return chatMembers;
|
|
254
440
|
}
|
|
@@ -256,63 +442,95 @@ export class ChatListManager {
|
|
|
256
442
|
unreachable();
|
|
257
443
|
}
|
|
258
444
|
}
|
|
445
|
+
#checkChatTitle(title) {
|
|
446
|
+
title = title.trim();
|
|
447
|
+
if (!title) {
|
|
448
|
+
throw new InputError("Title cannot be empty.");
|
|
449
|
+
}
|
|
450
|
+
return title;
|
|
451
|
+
}
|
|
259
452
|
async createGroup(title, params) {
|
|
260
|
-
|
|
261
|
-
title =
|
|
262
|
-
const { updates } = await
|
|
453
|
+
this.#c.storage.assertUser("createGroup");
|
|
454
|
+
title = this.#checkChatTitle(title);
|
|
455
|
+
const { updates } = await this.#c.invoke({
|
|
263
456
|
_: "messages.createChat",
|
|
264
457
|
title,
|
|
265
|
-
users: await Promise.all((params?.users ?? []).map((v) =>
|
|
458
|
+
users: await Promise.all((params?.users ?? []).map((v) => this.#c.getInputUser(v))),
|
|
266
459
|
ttl_period: params?.messageTtl || undefined,
|
|
267
460
|
});
|
|
268
461
|
if (!("chats" in updates) || updates.chats.length < 1) {
|
|
269
462
|
unreachable();
|
|
270
463
|
}
|
|
271
464
|
const chat = updates.chats[0];
|
|
272
|
-
if (chat._
|
|
465
|
+
if (chat._ !== "chat") {
|
|
466
|
+
unreachable();
|
|
467
|
+
}
|
|
468
|
+
return constructChatP(chat);
|
|
469
|
+
}
|
|
470
|
+
async #createChannel(type, title, params) {
|
|
471
|
+
title = this.#checkChatTitle(title);
|
|
472
|
+
const updates = await this.#c.invoke({
|
|
473
|
+
_: "channels.createChannel",
|
|
474
|
+
broadcast: type === "channel" ? true : undefined,
|
|
475
|
+
megagroup: type === "supergroup" ? true : undefined,
|
|
476
|
+
forum: params && ("forum" in params) && params.forum ? true : undefined,
|
|
477
|
+
title,
|
|
478
|
+
about: params?.description || "",
|
|
479
|
+
ttl_period: params?.messageTtl || undefined,
|
|
480
|
+
});
|
|
481
|
+
if (!("chats" in updates) || updates.chats.length < 1) {
|
|
482
|
+
unreachable();
|
|
483
|
+
}
|
|
484
|
+
const chat = updates.chats[0];
|
|
485
|
+
if (chat._ !== "channel") {
|
|
273
486
|
unreachable();
|
|
274
487
|
}
|
|
275
488
|
return constructChatP(chat);
|
|
276
489
|
}
|
|
277
490
|
async createSupergroup(title, params) {
|
|
278
|
-
|
|
279
|
-
return (await
|
|
491
|
+
this.#c.storage.assertUser("createSupergroup");
|
|
492
|
+
return (await this.#createChannel("supergroup", title, params));
|
|
280
493
|
}
|
|
281
494
|
async createChannel(title, params) {
|
|
282
|
-
|
|
283
|
-
return (await
|
|
495
|
+
this.#c.storage.assertUser("createChannel");
|
|
496
|
+
return (await this.#createChannel("channel", title, params));
|
|
284
497
|
}
|
|
285
498
|
async setMessageTtl(chatId, messageTtl) {
|
|
286
|
-
|
|
287
|
-
const peer = await
|
|
499
|
+
this.#c.storage.assertUser("setMessageTtl");
|
|
500
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
288
501
|
const period = messageTtl;
|
|
289
|
-
await
|
|
502
|
+
await this.#c.invoke({ _: "messages.setHistoryTTL", peer, period });
|
|
503
|
+
}
|
|
504
|
+
async #moveChatsToFolder(chatIds, folderId) {
|
|
505
|
+
const peers = await Promise.all(chatIds.map((v) => this.#c.getInputPeer(v)));
|
|
506
|
+
const inputFolderPeers = peers.map((v) => ({ _: "inputFolderPeer", peer: v, folder_id: folderId }));
|
|
507
|
+
await this.#c.invoke({ _: "folders.editPeerFolders", folder_peers: inputFolderPeers });
|
|
290
508
|
}
|
|
291
509
|
async archiveChats(chatIds) {
|
|
292
|
-
|
|
293
|
-
await
|
|
510
|
+
this.#c.storage.assertUser("archiveChats");
|
|
511
|
+
await this.#moveChatsToFolder(chatIds, 1);
|
|
294
512
|
}
|
|
295
513
|
async archiveChat(chatId) {
|
|
296
|
-
|
|
514
|
+
this.#c.storage.assertUser("archiveChat");
|
|
297
515
|
await this.archiveChats([chatId]);
|
|
298
516
|
}
|
|
299
517
|
async unarchiveChats(chatIds) {
|
|
300
|
-
|
|
301
|
-
await
|
|
518
|
+
this.#c.storage.assertUser("unarchiveChats");
|
|
519
|
+
await this.#moveChatsToFolder(chatIds, 0);
|
|
302
520
|
}
|
|
303
521
|
async unarchiveChat(chatId) {
|
|
304
|
-
|
|
522
|
+
this.#c.storage.assertUser("unarchiveChat");
|
|
305
523
|
await this.unarchiveChats([chatId]);
|
|
306
524
|
}
|
|
307
525
|
async getCommonChats(userId, params) {
|
|
308
|
-
|
|
309
|
-
const max_id = params?.fromChatId ? await
|
|
526
|
+
this.#c.storage.assertUser("getCommonChats");
|
|
527
|
+
const max_id = params?.fromChatId ? await this.#c.getInputPeerChatId(await this.#c.getInputPeer(params.fromChatId)) : 0;
|
|
310
528
|
if (max_id < 0) {
|
|
311
529
|
throw new InputError("fromChatId must be a chat identifier.");
|
|
312
530
|
}
|
|
313
|
-
const user_id = await
|
|
531
|
+
const user_id = await this.#c.getInputUser(userId);
|
|
314
532
|
const limit = getLimit(params?.limit);
|
|
315
|
-
const result = await
|
|
533
|
+
const result = await this.#c.invoke({ _: "messages.getCommonChats", user_id, max_id: Api.chatIdToPeerId(max_id), limit });
|
|
316
534
|
const chats = new Array();
|
|
317
535
|
for (const chat of result.chats) {
|
|
318
536
|
if (!Api.is("chatEmpty", chat)) {
|
|
@@ -322,238 +540,24 @@ export class ChatListManager {
|
|
|
322
540
|
return chats;
|
|
323
541
|
}
|
|
324
542
|
async getChatSettings(chatId) {
|
|
325
|
-
|
|
326
|
-
const peer = await
|
|
327
|
-
const settings = await
|
|
543
|
+
this.#c.storage.assertUser("getChatSettings");
|
|
544
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
545
|
+
const settings = await this.#c.invoke({ _: "messages.getPeerSettings", peer });
|
|
328
546
|
return constructChatSettings(settings);
|
|
329
547
|
}
|
|
548
|
+
async #toggleBusinessBotsPaused(chatId, paused) {
|
|
549
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
550
|
+
if (!canBeInputUser(peer)) {
|
|
551
|
+
throw new InputError("A private chat was expected.");
|
|
552
|
+
}
|
|
553
|
+
await this.#c.invoke({ _: "account.toggleConnectedBotPaused", peer, paused });
|
|
554
|
+
}
|
|
330
555
|
async disableBusinessBots(chatId) {
|
|
331
|
-
|
|
332
|
-
await
|
|
556
|
+
this.#c.storage.assertUser("disableBusinessBots");
|
|
557
|
+
await this.#toggleBusinessBotsPaused(chatId, true);
|
|
333
558
|
}
|
|
334
559
|
async enableBusinessBots(chatId) {
|
|
335
|
-
|
|
336
|
-
await
|
|
560
|
+
this.#c.storage.assertUser("enableBusinessBots");
|
|
561
|
+
await this.#toggleBusinessBotsPaused(chatId, false);
|
|
337
562
|
}
|
|
338
563
|
}
|
|
339
|
-
_ChatListManager_c = new WeakMap(), _ChatListManager_chats = new WeakMap(), _ChatListManager_archivedChats = new WeakMap(), _ChatListManager_pinnedChats = new WeakMap(), _ChatListManager_pinnedArchiveChats = new WeakMap(), _ChatListManager_storageHadPinnedChats = new WeakMap(), _ChatListManager_pinnedChatsLoaded = new WeakMap(), _ChatListManager_instances = new WeakSet(), _ChatListManager_sendChatUpdate = function _ChatListManager_sendChatUpdate(chatId, added) {
|
|
340
|
-
try {
|
|
341
|
-
__classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("");
|
|
342
|
-
}
|
|
343
|
-
catch {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
const [chat] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
|
|
347
|
-
const update = chat === undefined ? { deletedChat: { chatId } } : added ? { newChat: chat } : { editedChat: chat };
|
|
348
|
-
__classPrivateFieldGet(this, _ChatListManager_c, "f").handleUpdate(update);
|
|
349
|
-
}, _ChatListManager_getChatAnywhere = function _ChatListManager_getChatAnywhere(chatId) {
|
|
350
|
-
let chat = __classPrivateFieldGet(this, _ChatListManager_chats, "f").get(chatId);
|
|
351
|
-
if (chat) {
|
|
352
|
-
return [chat, 0];
|
|
353
|
-
}
|
|
354
|
-
chat = __classPrivateFieldGet(this, _ChatListManager_archivedChats, "f").get(chatId);
|
|
355
|
-
if (chat) {
|
|
356
|
-
return [chat, 1];
|
|
357
|
-
}
|
|
358
|
-
return [undefined, -1];
|
|
359
|
-
}, _ChatListManager_getChatList = function _ChatListManager_getChatList(listId) {
|
|
360
|
-
switch (listId) {
|
|
361
|
-
case 0:
|
|
362
|
-
return __classPrivateFieldGet(this, _ChatListManager_chats, "f");
|
|
363
|
-
case 1:
|
|
364
|
-
return __classPrivateFieldGet(this, _ChatListManager_archivedChats, "f");
|
|
365
|
-
default:
|
|
366
|
-
throw new Error(`Invalid chat list: ${listId}`);
|
|
367
|
-
}
|
|
368
|
-
}, _ChatListManager_loadPinnedChats = async function _ChatListManager_loadPinnedChats() {
|
|
369
|
-
const [pinnedChats, pinnedArchiveChats] = await Promise.all([__classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getPinnedChats(0), __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getPinnedChats(1)]);
|
|
370
|
-
if (pinnedChats != null && pinnedArchiveChats != null) {
|
|
371
|
-
__classPrivateFieldSet(this, _ChatListManager_pinnedChats, pinnedChats, "f");
|
|
372
|
-
__classPrivateFieldSet(this, _ChatListManager_pinnedArchiveChats, pinnedArchiveChats, "f");
|
|
373
|
-
__classPrivateFieldSet(this, _ChatListManager_storageHadPinnedChats, true, "f");
|
|
374
|
-
}
|
|
375
|
-
__classPrivateFieldSet(this, _ChatListManager_pinnedChatsLoaded, true, "f");
|
|
376
|
-
}, _ChatListManager_fetchPinnedChats = async function _ChatListManager_fetchPinnedChats(listId = null) {
|
|
377
|
-
if (listId == null || listId == 0) {
|
|
378
|
-
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
|
|
379
|
-
const pinnedChats = new Array();
|
|
380
|
-
for (const dialog of dialogs.dialogs) {
|
|
381
|
-
pinnedChats.push(Api.peerToChatId(dialog.peer));
|
|
382
|
-
}
|
|
383
|
-
__classPrivateFieldSet(this, _ChatListManager_pinnedChats, pinnedChats, "f");
|
|
384
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(0, __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f"));
|
|
385
|
-
}
|
|
386
|
-
if (listId == null || listId == 1) {
|
|
387
|
-
const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
|
|
388
|
-
const pinnedArchiveChats = new Array();
|
|
389
|
-
for (const dialog of dialogs.dialogs) {
|
|
390
|
-
pinnedArchiveChats.push(Api.peerToChatId(dialog.peer));
|
|
391
|
-
}
|
|
392
|
-
__classPrivateFieldSet(this, _ChatListManager_pinnedArchiveChats, pinnedArchiveChats, "f");
|
|
393
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(1, __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f"));
|
|
394
|
-
}
|
|
395
|
-
if (listId != null && listId != 0 && listId != 1) {
|
|
396
|
-
unreachable();
|
|
397
|
-
}
|
|
398
|
-
}, _ChatListManager_getPinnedChats = async function _ChatListManager_getPinnedChats(listId) {
|
|
399
|
-
if (!__classPrivateFieldGet(this, _ChatListManager_pinnedChatsLoaded, "f")) {
|
|
400
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_loadPinnedChats).call(this);
|
|
401
|
-
}
|
|
402
|
-
if (!__classPrivateFieldGet(this, _ChatListManager_storageHadPinnedChats, "f")) {
|
|
403
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_fetchPinnedChats).call(this);
|
|
404
|
-
}
|
|
405
|
-
switch (listId) {
|
|
406
|
-
case 0:
|
|
407
|
-
return __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f");
|
|
408
|
-
case 1:
|
|
409
|
-
return __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f");
|
|
410
|
-
default:
|
|
411
|
-
unreachable();
|
|
412
|
-
}
|
|
413
|
-
}, _ChatListManager_updateOrAddChat = async function _ChatListManager_updateOrAddChat(chatId) {
|
|
414
|
-
const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
|
|
415
|
-
if (chat !== undefined) {
|
|
416
|
-
const newChat = await constructChatListItem3(chatId, chat.pinned, chat.lastMessage, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
|
|
417
|
-
if (newChat != null) {
|
|
418
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).set(chatId, newChat);
|
|
419
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
const chat = await constructChatListItem(chatId, -1, -1, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity, __classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager.getMessage.bind(__classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager));
|
|
424
|
-
if (chat != null) {
|
|
425
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, 0).set(chatId, chat);
|
|
426
|
-
await this.reassignChatLastMessage(chatId, false, false);
|
|
427
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, true);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}, _ChatListManager_removeChat = function _ChatListManager_removeChat(chatId) {
|
|
431
|
-
const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
|
|
432
|
-
if (chat !== undefined) {
|
|
433
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).delete(chatId);
|
|
434
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
|
|
435
|
-
}
|
|
436
|
-
}, _ChatListManager_handleUpdateFolderPeers = function _ChatListManager_handleUpdateFolderPeers(update) {
|
|
437
|
-
for (const { peer, folder_id: listId } of update.folder_peers) {
|
|
438
|
-
const chatId = Api.peerToChatId(peer);
|
|
439
|
-
const [chat, currentListId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
|
|
440
|
-
if (chat !== undefined && listId != currentListId) {
|
|
441
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, currentListId).delete(chatId);
|
|
442
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).set(chatId, chat);
|
|
443
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, true);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}, _ChatListManager_handleUpdatePinnedDialogs = async function _ChatListManager_handleUpdatePinnedDialogs(update) {
|
|
447
|
-
const listId = update.folder_id ?? 0;
|
|
448
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_fetchPinnedChats).call(this, update.folder_id);
|
|
449
|
-
const chats = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId);
|
|
450
|
-
const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
|
|
451
|
-
for (const [i, chatId] of pinnedChats.entries()) {
|
|
452
|
-
const chat = chats.get(chatId);
|
|
453
|
-
if (chat !== undefined) {
|
|
454
|
-
chat.order = getChatListItemOrder(chat.lastMessage, i);
|
|
455
|
-
chat.pinned = i;
|
|
456
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
for (const chat of chats.values()) {
|
|
460
|
-
if (chat.pinned != -1 && pinnedChats.indexOf(chat.chat.id) == -1) {
|
|
461
|
-
chat.order = getChatListItemOrder(chat.lastMessage, -1);
|
|
462
|
-
chat.pinned = -1;
|
|
463
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chat.chat.id, false);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(listId, await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId));
|
|
467
|
-
}, _ChatListManager_handleUpdateChannel = async function _ChatListManager_handleUpdateChannel(update) {
|
|
468
|
-
const peer = { ...update, _: "peerChannel" };
|
|
469
|
-
const channel = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
470
|
-
const chatId = Api.peerToChatId(peer);
|
|
471
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
472
|
-
if (channel != null && "left" in channel && channel.left) {
|
|
473
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
474
|
-
}
|
|
475
|
-
else if (Api.is("channelForbidden", channel)) {
|
|
476
|
-
__classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
477
|
-
}
|
|
478
|
-
else if (Api.is("channel", channel)) {
|
|
479
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
480
|
-
}
|
|
481
|
-
}, _ChatListManager_handleUpdateChat = async function _ChatListManager_handleUpdateChat(update) {
|
|
482
|
-
const peer = { ...update, _: "peerChat" };
|
|
483
|
-
const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
484
|
-
const chatId = Api.peerToChatId(peer);
|
|
485
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
486
|
-
if (chat != null && "left" in chat && chat.left) {
|
|
487
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
488
|
-
}
|
|
489
|
-
else if (Api.is("chatForbidden", chat)) {
|
|
490
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
|
|
491
|
-
}
|
|
492
|
-
else if (Api.is("chat", chat)) {
|
|
493
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
494
|
-
}
|
|
495
|
-
}, _ChatListManager_handleUpdateUser = async function _ChatListManager_handleUpdateUser(update) {
|
|
496
|
-
const peer = { ...update, _: "peerUser" };
|
|
497
|
-
const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
|
|
498
|
-
const chatId = Api.peerToChatId(peer);
|
|
499
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
|
|
500
|
-
if (chat != null) {
|
|
501
|
-
await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
|
|
502
|
-
}
|
|
503
|
-
}, _ChatListManager_getFullChat = async function _ChatListManager_getFullChat(chatId) {
|
|
504
|
-
const inputPeer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
505
|
-
const chatId_ = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeerChatId(inputPeer);
|
|
506
|
-
let fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getFullChat(chatId_);
|
|
507
|
-
if (fullChat != null) {
|
|
508
|
-
return fullChat;
|
|
509
|
-
}
|
|
510
|
-
if (canBeInputUser(inputPeer)) {
|
|
511
|
-
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id: toInputUser(inputPeer) })).full_user;
|
|
512
|
-
}
|
|
513
|
-
else if (Api.is("inputPeerChat", inputPeer)) {
|
|
514
|
-
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...inputPeer, _: "messages.getFullChat" })).full_chat;
|
|
515
|
-
}
|
|
516
|
-
else if (canBeInputChannel(inputPeer)) {
|
|
517
|
-
fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel: toInputChannel(inputPeer) })).full_chat;
|
|
518
|
-
}
|
|
519
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId_, fullChat);
|
|
520
|
-
if (fullChat != null && "call" in fullChat && Api.is("inputGroupCall", fullChat.call)) {
|
|
521
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setGroupCallAccessHash(fullChat.call.id, fullChat.call.access_hash);
|
|
522
|
-
}
|
|
523
|
-
return fullChat;
|
|
524
|
-
}, _ChatListManager_checkChatTitle = function _ChatListManager_checkChatTitle(title) {
|
|
525
|
-
title = title.trim();
|
|
526
|
-
if (!title) {
|
|
527
|
-
throw new InputError("Title cannot be empty.");
|
|
528
|
-
}
|
|
529
|
-
return title;
|
|
530
|
-
}, _ChatListManager_createChannel = async function _ChatListManager_createChannel(type, title, params) {
|
|
531
|
-
title = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_checkChatTitle).call(this, title);
|
|
532
|
-
const updates = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({
|
|
533
|
-
_: "channels.createChannel",
|
|
534
|
-
broadcast: type == "channel" ? true : undefined,
|
|
535
|
-
megagroup: type == "supergroup" ? true : undefined,
|
|
536
|
-
forum: params && ("forum" in params) && params.forum ? true : undefined,
|
|
537
|
-
title,
|
|
538
|
-
about: params?.description || "",
|
|
539
|
-
ttl_period: params?.messageTtl || undefined,
|
|
540
|
-
});
|
|
541
|
-
if (!("chats" in updates) || updates.chats.length < 1) {
|
|
542
|
-
unreachable();
|
|
543
|
-
}
|
|
544
|
-
const chat = updates.chats[0];
|
|
545
|
-
if (chat._ != "channel") {
|
|
546
|
-
unreachable();
|
|
547
|
-
}
|
|
548
|
-
return constructChatP(chat);
|
|
549
|
-
}, _ChatListManager_moveChatsToFolder = async function _ChatListManager_moveChatsToFolder(chatIds, folderId) {
|
|
550
|
-
const peers = await Promise.all(chatIds.map((v) => __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(v)));
|
|
551
|
-
const inputFolderPeers = peers.map((v) => ({ _: "inputFolderPeer", peer: v, folder_id: folderId }));
|
|
552
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "folders.editPeerFolders", folder_peers: inputFolderPeers });
|
|
553
|
-
}, _ChatListManager_toggleBusinessBotsPaused = async function _ChatListManager_toggleBusinessBotsPaused(chatId, paused) {
|
|
554
|
-
const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
|
|
555
|
-
if (!canBeInputUser(peer)) {
|
|
556
|
-
throw new InputError("A private chat was expected.");
|
|
557
|
-
}
|
|
558
|
-
await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "account.toggleConnectedBotPaused", peer, paused });
|
|
559
|
-
};
|