@mtkruto/node 0.1.191 → 0.1.201
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/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.js +6 -6
- package/esm/3_storage.d.ts +5 -5
- package/esm/3_storage.js +5 -5
- package/esm/3_types.d.ts +6 -5
- package/esm/3_types.js +6 -5
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +0 -20
- package/esm/client/1_business_connection_manager.d.ts +11 -0
- package/esm/client/1_business_connection_manager.js +47 -0
- package/esm/client/1_update_manager.d.ts +8 -1
- package/esm/client/1_update_manager.js +88 -8
- package/esm/client/2_message_manager.d.ts +7 -6
- package/esm/client/2_message_manager.js +48 -31
- package/esm/client/4_client.d.ts +426 -428
- package/esm/client/4_client.js +570 -530
- package/esm/storage/0_storage.d.ts +5 -0
- package/esm/storage/0_storage.js +20 -0
- package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
- package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
- package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
- package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
- package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
- package/esm/tl/2_types.d.ts +1071 -183
- package/esm/tl/2_types.js +2916 -464
- package/esm/tl/3_functions.d.ts +381 -17
- package/esm/tl/3_functions.js +1002 -120
- package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
- package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
- package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
- package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/esm/tl/{6_message.js → 7_message.js} +3 -3
- package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_photo.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/2_business_connection.d.ts +11 -0
- package/esm/types/2_business_connection.js +12 -0
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/esm/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.js +1 -1
- package/esm/types/4_inline_query_result.d.ts +1 -1
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +9 -3
- package/esm/types/4_message.js +22 -5
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/package.json +1 -1
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.js +6 -6
- package/script/3_storage.d.ts +5 -5
- package/script/3_storage.js +5 -5
- package/script/3_types.d.ts +6 -5
- package/script/3_types.js +6 -5
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -0
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +1 -23
- package/script/client/1_business_connection_manager.d.ts +11 -0
- package/script/client/1_business_connection_manager.js +51 -0
- package/script/client/1_update_manager.d.ts +8 -1
- package/script/client/1_update_manager.js +88 -8
- package/script/client/2_message_manager.d.ts +7 -6
- package/script/client/2_message_manager.js +47 -30
- package/script/client/4_client.d.ts +426 -428
- package/script/client/4_client.js +570 -530
- package/script/storage/0_storage.d.ts +5 -0
- package/script/storage/0_storage.js +20 -0
- package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
- package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
- package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
- package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
- package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
- package/script/tl/2_types.d.ts +1071 -183
- package/script/tl/2_types.js +3028 -504
- package/script/tl/3_functions.d.ts +381 -17
- package/script/tl/3_functions.js +1047 -143
- package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
- package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
- package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
- package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/script/tl/{6_message.js → 7_message.js} +8 -8
- package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
- package/script/types/0_chat_photo.js +9 -9
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_thumbnail.js +6 -6
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_photo.js +7 -7
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/2_business_connection.d.ts +11 -0
- package/script/types/2_business_connection.js +16 -0
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_story_content.js +4 -4
- package/script/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.js +2 -2
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +2 -2
- package/script/types/4_message.d.ts +9 -3
- package/script/types/4_message.js +37 -20
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
- /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
- /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
- /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/esm/types/{1__getters.js → _getters.js} +0 -0
- /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/script/types/{0_venue.js → 1_venue.js} +0 -0
- /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/script/types/{0__file_id.js → _file_id.js} +0 -0
- /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
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");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _Client_instances, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_parseMode, _Client_publicKeys, _Client_ignoreOutgoing, _Client_storeMessages, _Client_Lauthorize, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_namespaceProxies, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
13
|
+
var _Client_instances, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_parseMode, _Client_publicKeys, _Client_ignoreOutgoing, _Client_storeMessages, _Client_Lauthorize, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_namespaceProxies, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.Client = exports.handleMigrationError = exports.restartAuth = exports.Composer = void 0;
|
|
16
16
|
const _0_errors_js_1 = require("../0_errors.js");
|
|
@@ -24,6 +24,7 @@ const _0_password_js_1 = require("./0_password.js");
|
|
|
24
24
|
const _0_utilities_js_1 = require("./0_utilities.js");
|
|
25
25
|
const _1_account_manager_js_1 = require("./1_account_manager.js");
|
|
26
26
|
const _1_bot_info_manager_js_1 = require("./1_bot_info_manager.js");
|
|
27
|
+
const _1_business_connection_manager_js_1 = require("./1_business_connection_manager.js");
|
|
27
28
|
const _1_client_encrypted_js_1 = require("./1_client_encrypted.js");
|
|
28
29
|
const _1_client_plain_js_1 = require("./1_client_plain.js");
|
|
29
30
|
const _1_composer_js_1 = require("./1_composer.js");
|
|
@@ -81,6 +82,7 @@ class Client extends Composer {
|
|
|
81
82
|
_Client_botInfoManager.set(this, void 0);
|
|
82
83
|
_Client_fileManager.set(this, void 0);
|
|
83
84
|
_Client_reactionManager.set(this, void 0);
|
|
85
|
+
_Client_businessConnectionManager.set(this, void 0);
|
|
84
86
|
_Client_messageManager.set(this, void 0);
|
|
85
87
|
_Client_storyManager.set(this, void 0);
|
|
86
88
|
_Client_callbackQueryManager.set(this, void 0);
|
|
@@ -204,7 +206,7 @@ class Client extends Composer {
|
|
|
204
206
|
const reactions = "messageInteractions" in update ? update.messageInteractions : undefined;
|
|
205
207
|
const mustGetMsg = () => {
|
|
206
208
|
if (msg !== undefined) {
|
|
207
|
-
return { chatId: msg.chat.id, messageId: msg.id, senderId: (msg.from ?? msg.senderChat)?.id };
|
|
209
|
+
return { chatId: msg.chat.id, messageId: msg.id, businessConnectionId: msg.businessConnectionId, senderId: (msg.from ?? msg.senderChat)?.id };
|
|
208
210
|
}
|
|
209
211
|
else if (reactions !== undefined) {
|
|
210
212
|
return { chatId: reactions.chatId, messageId: reactions.messageId };
|
|
@@ -263,74 +265,74 @@ class Client extends Composer {
|
|
|
263
265
|
return () => update;
|
|
264
266
|
},
|
|
265
267
|
reply: (text, params) => {
|
|
266
|
-
const { chatId, messageId } = mustGetMsg();
|
|
268
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
267
269
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
268
|
-
return this.sendMessage(chatId, text, { ...params, replyToMessageId });
|
|
270
|
+
return this.sendMessage(chatId, text, { ...params, replyToMessageId, businessConnectionId });
|
|
269
271
|
},
|
|
270
272
|
replyPoll: (question, options, params) => {
|
|
271
|
-
const { chatId, messageId } = mustGetMsg();
|
|
273
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
272
274
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
273
|
-
return this.sendPoll(chatId, question, options, { ...params, replyToMessageId });
|
|
275
|
+
return this.sendPoll(chatId, question, options, { ...params, replyToMessageId, businessConnectionId });
|
|
274
276
|
},
|
|
275
277
|
replyPhoto: (photo, params) => {
|
|
276
|
-
const { chatId, messageId } = mustGetMsg();
|
|
278
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
277
279
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
278
|
-
return this.sendPhoto(chatId, photo, { ...params, replyToMessageId });
|
|
280
|
+
return this.sendPhoto(chatId, photo, { ...params, replyToMessageId, businessConnectionId });
|
|
279
281
|
},
|
|
280
282
|
replyDocument: (document, params) => {
|
|
281
|
-
const { chatId, messageId } = mustGetMsg();
|
|
283
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
282
284
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
283
|
-
return this.sendDocument(chatId, document, { ...params, replyToMessageId });
|
|
285
|
+
return this.sendDocument(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
284
286
|
},
|
|
285
287
|
replySticker: (sticker, params) => {
|
|
286
|
-
const { chatId, messageId } = mustGetMsg();
|
|
288
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
287
289
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
288
|
-
return this.sendSticker(chatId, sticker, { ...params, replyToMessageId });
|
|
290
|
+
return this.sendSticker(chatId, sticker, { ...params, replyToMessageId, businessConnectionId });
|
|
289
291
|
},
|
|
290
292
|
replyContact: (firstName, number, params) => {
|
|
291
|
-
const { chatId, messageId } = mustGetMsg();
|
|
293
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
292
294
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
293
|
-
return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId });
|
|
295
|
+
return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId, businessConnectionId });
|
|
294
296
|
},
|
|
295
297
|
replyLocation: (latitude, longitude, params) => {
|
|
296
|
-
const { chatId, messageId } = mustGetMsg();
|
|
298
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
297
299
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
298
|
-
return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
300
|
+
return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId, businessConnectionId });
|
|
299
301
|
},
|
|
300
302
|
replyDice: (params) => {
|
|
301
|
-
const { chatId, messageId } = mustGetMsg();
|
|
303
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
302
304
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
303
|
-
return this.sendDice(chatId, { ...params, replyToMessageId });
|
|
305
|
+
return this.sendDice(chatId, { ...params, replyToMessageId, businessConnectionId });
|
|
304
306
|
},
|
|
305
307
|
replyVenue: (latitude, longitude, title, address, params) => {
|
|
306
|
-
const { chatId, messageId } = mustGetMsg();
|
|
308
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
307
309
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
308
|
-
return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
310
|
+
return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId, businessConnectionId });
|
|
309
311
|
},
|
|
310
312
|
replyVideo: (video, params) => {
|
|
311
|
-
const { chatId, messageId } = mustGetMsg();
|
|
313
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
312
314
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
313
|
-
return this.sendVideo(chatId, video, { ...params, replyToMessageId });
|
|
315
|
+
return this.sendVideo(chatId, video, { ...params, replyToMessageId, businessConnectionId });
|
|
314
316
|
},
|
|
315
317
|
replyAnimation: (document, params) => {
|
|
316
|
-
const { chatId, messageId } = mustGetMsg();
|
|
318
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
317
319
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
318
|
-
return this.sendAnimation(chatId, document, { ...params, replyToMessageId });
|
|
320
|
+
return this.sendAnimation(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
319
321
|
},
|
|
320
322
|
replyVoice: (document, params) => {
|
|
321
|
-
const { chatId, messageId } = mustGetMsg();
|
|
323
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
322
324
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
323
|
-
return this.sendVoice(chatId, document, { ...params, replyToMessageId });
|
|
325
|
+
return this.sendVoice(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
324
326
|
},
|
|
325
327
|
replyAudio: (document, params) => {
|
|
326
|
-
const { chatId, messageId } = mustGetMsg();
|
|
328
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
327
329
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
328
|
-
return this.sendAudio(chatId, document, { ...params, replyToMessageId });
|
|
330
|
+
return this.sendAudio(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
329
331
|
},
|
|
330
332
|
replyVideoNote: (videoNote, params) => {
|
|
331
|
-
const { chatId, messageId } = mustGetMsg();
|
|
333
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
332
334
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
333
|
-
return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId });
|
|
335
|
+
return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId, businessConnectionId });
|
|
334
336
|
},
|
|
335
337
|
delete: () => {
|
|
336
338
|
const { chatId, messageId } = mustGetMsg();
|
|
@@ -535,6 +537,13 @@ class Client extends Composer {
|
|
|
535
537
|
const { chatId } = mustGetMsg();
|
|
536
538
|
return this.deleteChatStickerSet(chatId);
|
|
537
539
|
},
|
|
540
|
+
getBusinessConnection: () => {
|
|
541
|
+
const { businessConnectionId } = mustGetMsg();
|
|
542
|
+
if (!businessConnectionId) {
|
|
543
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
544
|
+
}
|
|
545
|
+
return this.getBusinessConnection(businessConnectionId);
|
|
546
|
+
},
|
|
538
547
|
};
|
|
539
548
|
return (0, _1_utilities_js_1.cleanObject)(context);
|
|
540
549
|
});
|
|
@@ -640,6 +649,14 @@ class Client extends Composer {
|
|
|
640
649
|
const c = {
|
|
641
650
|
id,
|
|
642
651
|
api: this.api,
|
|
652
|
+
invoke: async (function_, businessConnectionId) => {
|
|
653
|
+
if (businessConnectionId) {
|
|
654
|
+
return await this.api.invokeWithBusinessConnection({ connection_id: businessConnectionId, query: function_ });
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
return await this.invoke(function_);
|
|
658
|
+
}
|
|
659
|
+
},
|
|
643
660
|
storage: this.storage,
|
|
644
661
|
messageStorage: this.messageStorage,
|
|
645
662
|
guaranteeUpdateDelivery: __classPrivateFieldGet(this, _Client_guaranteeUpdateDelivery, "f"),
|
|
@@ -668,8 +685,7 @@ class Client extends Composer {
|
|
|
668
685
|
if (ctx.error instanceof _4_errors_js_1.AuthKeyUnregistered && dcId) {
|
|
669
686
|
try {
|
|
670
687
|
const exportedAuth = await this.api.auth.exportAuthorization({ dc_id: dcId });
|
|
671
|
-
await client.
|
|
672
|
-
// throw 1;
|
|
688
|
+
await client.api.auth.importAuthorization(exportedAuth);
|
|
673
689
|
return true;
|
|
674
690
|
}
|
|
675
691
|
catch (err) {
|
|
@@ -704,6 +720,7 @@ class Client extends Composer {
|
|
|
704
720
|
__classPrivateFieldSet(this, _Client_botInfoManager, new _1_bot_info_manager_js_1.BotInfoManager(c), "f");
|
|
705
721
|
__classPrivateFieldSet(this, _Client_fileManager, new _1_file_manager_js_1.FileManager(c), "f");
|
|
706
722
|
__classPrivateFieldSet(this, _Client_reactionManager, new _1_reaction_manager_js_1.ReactionManager(c), "f");
|
|
723
|
+
__classPrivateFieldSet(this, _Client_businessConnectionManager, new _1_business_connection_manager_js_1.BusinessConnectionManager(c), "f");
|
|
707
724
|
__classPrivateFieldSet(this, _Client_messageManager, new _2_message_manager_js_1.MessageManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f") }), "f");
|
|
708
725
|
__classPrivateFieldSet(this, _Client_callbackQueryManager, new _3_callback_query_manager_js_1.CallbackQueryManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
709
726
|
__classPrivateFieldSet(this, _Client_storyManager, new _3_story_manager_js_1.StoryManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
@@ -818,7 +835,7 @@ class Client extends Composer {
|
|
|
818
835
|
}
|
|
819
836
|
await this.connect();
|
|
820
837
|
}
|
|
821
|
-
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_storeMessages = new WeakMap(), _Client_Lauthorize = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_namespaceProxies = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
|
|
838
|
+
async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_storeMessages = new WeakMap(), _Client_Lauthorize = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_namespaceProxies = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
|
|
822
839
|
const apiId = this.apiId || await this.storage.getApiId();
|
|
823
840
|
if (!apiId) {
|
|
824
841
|
throw new Error("apiId not set");
|
|
@@ -849,21 +866,18 @@ class Client extends Composer {
|
|
|
849
866
|
__classPrivateFieldGet(this, _Client_pingLoopAbortController, "f")?.abort();
|
|
850
867
|
}
|
|
851
868
|
/**
|
|
852
|
-
*
|
|
869
|
+
* Authorizes the client with one of the following:
|
|
853
870
|
*
|
|
854
871
|
* - Bot token (`string`)
|
|
855
|
-
* - Exported authorization (`types.AuthExportedAuthorization`)
|
|
856
872
|
* - User authorization handlers (`AuthorizeUserParams`)
|
|
857
873
|
*
|
|
858
|
-
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](
|
|
874
|
+
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
|
|
859
875
|
*
|
|
860
876
|
* Notes:
|
|
861
877
|
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
862
878
|
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
863
|
-
* 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
|
|
864
879
|
*
|
|
865
|
-
* [1]: https://core.telegram.org/method/
|
|
866
|
-
* [2]: https://core.telegram.org/method/updates.getState
|
|
880
|
+
* [1]: https://core.telegram.org/method/updates.getState
|
|
867
881
|
*/
|
|
868
882
|
async authorize(params) {
|
|
869
883
|
try {
|
|
@@ -915,11 +929,6 @@ class Client extends Composer {
|
|
|
915
929
|
await __classPrivateFieldGet(this, _Client_updateManager, "f").fetchState("authorize");
|
|
916
930
|
return;
|
|
917
931
|
}
|
|
918
|
-
if (params instanceof _2_tl_js_1.types.auth.ExportedAuthorization) {
|
|
919
|
-
await this.api.auth.importAuthorization({ id: params.id, bytes: params.bytes });
|
|
920
|
-
__classPrivateFieldGet(this, _Client_Lauthorize, "f").debug("authorization imported");
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
932
|
auth: while (true) {
|
|
924
933
|
try {
|
|
925
934
|
let phone;
|
|
@@ -1060,7 +1069,7 @@ class Client extends Composer {
|
|
|
1060
1069
|
inputPeer.access_hash = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getUserAccessHash).call(this, inputPeer.user_id);
|
|
1061
1070
|
}
|
|
1062
1071
|
}
|
|
1063
|
-
|
|
1072
|
+
if ((inputPeer instanceof _2_tl_js_1.types.InputPeerUser || inputPeer instanceof _2_tl_js_1.types.InputPeerChannel && inputPeer.access_hash == 0n) && await this.storage.getAccountType() == "user") {
|
|
1064
1073
|
throw new _0_errors_js_1.AccessError(`Cannot access the chat ${id} because there is no access hash for it.`);
|
|
1065
1074
|
}
|
|
1066
1075
|
return inputPeer;
|
|
@@ -1253,6 +1262,77 @@ class Client extends Composer {
|
|
|
1253
1262
|
}
|
|
1254
1263
|
return await this.messageStorage.getEntity(id);
|
|
1255
1264
|
}
|
|
1265
|
+
//
|
|
1266
|
+
// ========================= ACCOUNT ========================= //
|
|
1267
|
+
//
|
|
1268
|
+
/**
|
|
1269
|
+
* Get information on the currently authorized user.
|
|
1270
|
+
*
|
|
1271
|
+
* @method ac
|
|
1272
|
+
*/
|
|
1273
|
+
async getMe() {
|
|
1274
|
+
let user_ = await this[getEntity](new _2_tl_js_1.types.PeerUser({ user_id: BigInt(await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getSelfId).call(this)) }));
|
|
1275
|
+
if (user_ == null) {
|
|
1276
|
+
const users = await this.api.users.getUsers({ id: [new _2_tl_js_1.types.InputUserSelf()] });
|
|
1277
|
+
user_ = users[0][_2_tl_js_1.as](_2_tl_js_1.types.User);
|
|
1278
|
+
await this.messageStorage.setEntity(user_);
|
|
1279
|
+
}
|
|
1280
|
+
const user = (0, _3_types_js_1.constructUser)(user_);
|
|
1281
|
+
__classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
|
|
1282
|
+
return user;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1286
|
+
*
|
|
1287
|
+
* @method ac
|
|
1288
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1289
|
+
* @param username The username to show.
|
|
1290
|
+
*/
|
|
1291
|
+
async showUsername(id, username) {
|
|
1292
|
+
await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1296
|
+
*
|
|
1297
|
+
* @method ac
|
|
1298
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1299
|
+
* @param username The username to hide.
|
|
1300
|
+
*/
|
|
1301
|
+
async hideUsername(id, username) {
|
|
1302
|
+
await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1306
|
+
*
|
|
1307
|
+
* @method ac
|
|
1308
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1309
|
+
* @param order The new order to use.
|
|
1310
|
+
* @returns Whether the order was changed.
|
|
1311
|
+
*/
|
|
1312
|
+
async reorderUsernames(id, order) {
|
|
1313
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
1317
|
+
*
|
|
1318
|
+
* @method ac
|
|
1319
|
+
* @param id A supergroup ID or a channel ID.
|
|
1320
|
+
*/
|
|
1321
|
+
async hideUsernames(id) {
|
|
1322
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Get a business connection. Bot-only.
|
|
1326
|
+
*
|
|
1327
|
+
* @method ac
|
|
1328
|
+
* @param id The identifier of the business connection.
|
|
1329
|
+
*/
|
|
1330
|
+
async getBusinessConnection(id) {
|
|
1331
|
+
return await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").getBusinessConnection(id);
|
|
1332
|
+
}
|
|
1333
|
+
//
|
|
1334
|
+
// ========================= MESSAGES ========================= //
|
|
1335
|
+
//
|
|
1256
1336
|
/**
|
|
1257
1337
|
* Send a text message.
|
|
1258
1338
|
*
|
|
@@ -1264,6 +1344,154 @@ class Client extends Composer {
|
|
|
1264
1344
|
async sendMessage(chatId, text, params) {
|
|
1265
1345
|
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendMessage(chatId, text, params);
|
|
1266
1346
|
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Send a photo.
|
|
1349
|
+
*
|
|
1350
|
+
* @method ms
|
|
1351
|
+
* @param chatId The chat to send the photo to.
|
|
1352
|
+
* @param photo The photo to send.
|
|
1353
|
+
* @returns The sent photo.
|
|
1354
|
+
*/
|
|
1355
|
+
async sendPhoto(chatId, photo, params) {
|
|
1356
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPhoto(chatId, photo, params);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Send a document.
|
|
1360
|
+
*
|
|
1361
|
+
* @method ms
|
|
1362
|
+
* @param chatId The chat to send the document to.
|
|
1363
|
+
* @param document The document to send.
|
|
1364
|
+
* @returns The sent document.
|
|
1365
|
+
*/
|
|
1366
|
+
async sendDocument(chatId, document, params) {
|
|
1367
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDocument(chatId, document, params);
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Send a sticker.
|
|
1371
|
+
*
|
|
1372
|
+
* @method ms
|
|
1373
|
+
* @param chatId The chat to send the sticker to.
|
|
1374
|
+
* @param document The sticker to send.
|
|
1375
|
+
* @returns The sent sticker.
|
|
1376
|
+
*/
|
|
1377
|
+
async sendSticker(chatId, sticker, params) {
|
|
1378
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendSticker(chatId, sticker, params);
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Send a video.
|
|
1382
|
+
*
|
|
1383
|
+
* @method ms
|
|
1384
|
+
* @param chatId The chat to send the video to.
|
|
1385
|
+
* @param video The video to send.
|
|
1386
|
+
* @returns The sent video.
|
|
1387
|
+
*/
|
|
1388
|
+
async sendVideo(chatId, video, params) {
|
|
1389
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideo(chatId, video, params);
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Send an animation.
|
|
1393
|
+
*
|
|
1394
|
+
* @method ms
|
|
1395
|
+
* @param chatId The chat to send the animation to.
|
|
1396
|
+
* @param animation The animation to send.
|
|
1397
|
+
* @returns The sent animation.
|
|
1398
|
+
*/
|
|
1399
|
+
async sendAnimation(chatId, animation, params) {
|
|
1400
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAnimation(chatId, animation, params);
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Send a voice message.
|
|
1404
|
+
*
|
|
1405
|
+
* @method ms
|
|
1406
|
+
* @param chatId The chat to send the voice message to.
|
|
1407
|
+
* @param voice The voice to send.
|
|
1408
|
+
* @returns The sent voice message.
|
|
1409
|
+
*/
|
|
1410
|
+
async sendVoice(chatId, voice, params) {
|
|
1411
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVoice(chatId, voice, params);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Send an audio file.
|
|
1415
|
+
*
|
|
1416
|
+
* @method ms
|
|
1417
|
+
* @param chatId The chat to send the audio file to.
|
|
1418
|
+
* @param audio The audio to send.
|
|
1419
|
+
* @returns The sent audio filr.
|
|
1420
|
+
*/
|
|
1421
|
+
async sendAudio(chatId, audio, params) {
|
|
1422
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAudio(chatId, audio, params);
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Send a video note.
|
|
1426
|
+
*
|
|
1427
|
+
* @method ms
|
|
1428
|
+
* @param chatId The chat to send the video note to.
|
|
1429
|
+
* @param videoNote The video note to send.
|
|
1430
|
+
* @returns The sent video note.
|
|
1431
|
+
*/
|
|
1432
|
+
async sendVideoNote(chatId, videoNote, params) {
|
|
1433
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideoNote(chatId, videoNote, params);
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Send a location.
|
|
1437
|
+
*
|
|
1438
|
+
* @method ms
|
|
1439
|
+
* @param chatId The chat to send the location to.
|
|
1440
|
+
* @param latitude The location's latitude.
|
|
1441
|
+
* @param longitude The location's longitude.
|
|
1442
|
+
* @returns The sent location.
|
|
1443
|
+
*/
|
|
1444
|
+
async sendLocation(chatId, latitude, longitude, params) {
|
|
1445
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendLocation(chatId, latitude, longitude, params);
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* Send a contact.
|
|
1449
|
+
*
|
|
1450
|
+
* @method ms
|
|
1451
|
+
* @param chatId The chat to send the contact to.
|
|
1452
|
+
* @param firstName The contact's first name.
|
|
1453
|
+
* @param number The contact's phone number.
|
|
1454
|
+
* @returns The sent contact.
|
|
1455
|
+
*/
|
|
1456
|
+
async sendContact(chatId, firstName, number, params) {
|
|
1457
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendContact(chatId, firstName, number, params);
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Send a dice.
|
|
1461
|
+
*
|
|
1462
|
+
* @method ms
|
|
1463
|
+
* @param chatId The chat to send the dice to.
|
|
1464
|
+
* @returns The sent dice.
|
|
1465
|
+
*/
|
|
1466
|
+
async sendDice(chatId, params) {
|
|
1467
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDice(chatId, params);
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Send a venue.
|
|
1471
|
+
*
|
|
1472
|
+
* @method ms
|
|
1473
|
+
* @param chatId The chat to send the venue to.
|
|
1474
|
+
* @param latitude The latitude of the venue.
|
|
1475
|
+
* @param longitude The longitude of the venue.
|
|
1476
|
+
* @param title The title of the venue.
|
|
1477
|
+
* @param address The written address of the venue.
|
|
1478
|
+
* @returns The sent venue.
|
|
1479
|
+
*/
|
|
1480
|
+
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
1481
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVenue(chatId, latitude, longitude, title, address, params);
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Send a poll.
|
|
1485
|
+
*
|
|
1486
|
+
* @method ms
|
|
1487
|
+
* @param chatId The chat to send the poll to.
|
|
1488
|
+
* @param question The poll's question.
|
|
1489
|
+
* @param options The poll's options.
|
|
1490
|
+
* @returns The sent poll.
|
|
1491
|
+
*/
|
|
1492
|
+
async sendPoll(chatId, question, options, params) {
|
|
1493
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPoll(chatId, question, options, params);
|
|
1494
|
+
}
|
|
1267
1495
|
/**
|
|
1268
1496
|
* Edit a message's text.
|
|
1269
1497
|
*
|
|
@@ -1360,82 +1588,87 @@ class Client extends Composer {
|
|
|
1360
1588
|
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getMessage(chatId, messageId);
|
|
1361
1589
|
}
|
|
1362
1590
|
/**
|
|
1363
|
-
*
|
|
1591
|
+
* Delete multiple messages.
|
|
1364
1592
|
*
|
|
1365
|
-
* @method
|
|
1366
|
-
* @param
|
|
1367
|
-
* @
|
|
1368
|
-
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
1369
|
-
* await outFile.write(chunk);
|
|
1370
|
-
* }
|
|
1371
|
-
* ```
|
|
1372
|
-
* @returns A generator yielding the contents of the file.
|
|
1593
|
+
* @method ms
|
|
1594
|
+
* @param chatId The identifier of the chat that contains the messages.
|
|
1595
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
1373
1596
|
*/
|
|
1374
|
-
async
|
|
1375
|
-
|
|
1376
|
-
yield chunk;
|
|
1377
|
-
}
|
|
1597
|
+
async deleteMessages(chatId, messageIds, params) {
|
|
1598
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, messageIds, params);
|
|
1378
1599
|
}
|
|
1379
1600
|
/**
|
|
1380
|
-
*
|
|
1601
|
+
* Delete a single message.
|
|
1381
1602
|
*
|
|
1382
1603
|
* @method ms
|
|
1383
|
-
* @param
|
|
1384
|
-
* @param
|
|
1385
|
-
* @param messageIds The identifiers of the messages to forward.
|
|
1386
|
-
* @returns The forwarded messages.
|
|
1604
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1605
|
+
* @param messageId The identifier of the message to delete.
|
|
1387
1606
|
*/
|
|
1388
|
-
async
|
|
1389
|
-
|
|
1607
|
+
async deleteMessage(chatId, messageId, params) {
|
|
1608
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, [messageId], params);
|
|
1390
1609
|
}
|
|
1391
1610
|
/**
|
|
1392
|
-
*
|
|
1611
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
1393
1612
|
*
|
|
1394
1613
|
* @method ms
|
|
1395
|
-
* @param
|
|
1396
|
-
* @param
|
|
1397
|
-
* @param messageId The identifier of the message to forward.
|
|
1398
|
-
* @returns The forwarded message.
|
|
1614
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1615
|
+
* @param memberId The identifier of the member.
|
|
1399
1616
|
*/
|
|
1400
|
-
async
|
|
1401
|
-
|
|
1617
|
+
async deleteChatMemberMessages(chatId, memberId) {
|
|
1618
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatMemberMessages(chatId, memberId);
|
|
1402
1619
|
}
|
|
1403
1620
|
/**
|
|
1404
|
-
*
|
|
1621
|
+
* Pin a message in a chat.
|
|
1405
1622
|
*
|
|
1406
|
-
* @method
|
|
1623
|
+
* @method ms
|
|
1624
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1625
|
+
* @param messageId The message's identifier.
|
|
1407
1626
|
*/
|
|
1408
|
-
async
|
|
1409
|
-
|
|
1410
|
-
if (user_ == null) {
|
|
1411
|
-
const users = await this.api.users.getUsers({ id: [new _2_tl_js_1.types.InputUserSelf()] });
|
|
1412
|
-
user_ = users[0][_2_tl_js_1.as](_2_tl_js_1.types.User);
|
|
1413
|
-
await this.messageStorage.setEntity(user_);
|
|
1414
|
-
}
|
|
1415
|
-
const user = (0, _3_types_js_1.constructUser)(user_);
|
|
1416
|
-
__classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
|
|
1417
|
-
return user;
|
|
1627
|
+
async pinMessage(chatId, messageId, params) {
|
|
1628
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").pinMessage(chatId, messageId, params);
|
|
1418
1629
|
}
|
|
1419
1630
|
/**
|
|
1420
|
-
*
|
|
1631
|
+
* Unpin a pinned message.
|
|
1421
1632
|
*
|
|
1422
|
-
* @method
|
|
1423
|
-
* @param
|
|
1633
|
+
* @method ms
|
|
1634
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1635
|
+
* @param messageId The message's identifier.
|
|
1424
1636
|
*/
|
|
1425
|
-
async
|
|
1426
|
-
await __classPrivateFieldGet(this,
|
|
1637
|
+
async unpinMessage(chatId, messageId) {
|
|
1638
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessage(chatId, messageId);
|
|
1427
1639
|
}
|
|
1428
1640
|
/**
|
|
1429
|
-
*
|
|
1641
|
+
* Unpin all pinned messages.
|
|
1430
1642
|
*
|
|
1431
1643
|
* @method ms
|
|
1432
|
-
* @param chatId The
|
|
1433
|
-
* @param question The poll's question.
|
|
1434
|
-
* @param options The poll's options.
|
|
1435
|
-
* @returns The sent poll.
|
|
1644
|
+
* @param chatId The identifier of the chat.
|
|
1436
1645
|
*/
|
|
1437
|
-
async
|
|
1438
|
-
|
|
1646
|
+
async unpinMessages(chatId) {
|
|
1647
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessages(chatId);
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Forward multiple messages.
|
|
1651
|
+
*
|
|
1652
|
+
* @method ms
|
|
1653
|
+
* @param from The identifier of the chat to forward the messages from.
|
|
1654
|
+
* @param to The identifier of the chat to forward the messages to.
|
|
1655
|
+
* @param messageIds The identifiers of the messages to forward.
|
|
1656
|
+
* @returns The forwarded messages.
|
|
1657
|
+
*/
|
|
1658
|
+
async forwardMessages(from, to, messageIds, params) {
|
|
1659
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").forwardMessages(from, to, messageIds, params);
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Forward a single message.
|
|
1663
|
+
*
|
|
1664
|
+
* @method ms
|
|
1665
|
+
* @param from The identifier of the chat to forward the message from.
|
|
1666
|
+
* @param to The identifier of the chat to forward the message to.
|
|
1667
|
+
* @param messageId The identifier of the message to forward.
|
|
1668
|
+
* @returns The forwarded message.
|
|
1669
|
+
*/
|
|
1670
|
+
async forwardMessage(from, to, messageId, params) {
|
|
1671
|
+
return await this.forwardMessages(from, to, [messageId], params).then((v) => v[0]);
|
|
1439
1672
|
}
|
|
1440
1673
|
/**
|
|
1441
1674
|
* Stop a poll.
|
|
@@ -1460,446 +1693,393 @@ class Client extends Composer {
|
|
|
1460
1693
|
await __classPrivateFieldGet(this, _Client_messageManager, "f").sendChatAction(chatId, action, params);
|
|
1461
1694
|
}
|
|
1462
1695
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
*
|
|
1465
|
-
* @method fs
|
|
1466
|
-
* @param contents The contents of the file.
|
|
1467
|
-
* @returns The uploaded file.
|
|
1468
|
-
*/
|
|
1469
|
-
// deno-lint-ignore no-explicit-any
|
|
1470
|
-
async upload(contents, params) {
|
|
1471
|
-
return await __classPrivateFieldGet(this, _Client_fileManager, "f").upload(contents, params);
|
|
1472
|
-
}
|
|
1473
|
-
/**
|
|
1474
|
-
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1475
|
-
*
|
|
1476
|
-
* @method bs
|
|
1477
|
-
* @param commands The commands to set.
|
|
1478
|
-
*/
|
|
1479
|
-
async setMyCommands(commands, params) {
|
|
1480
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
|
|
1481
|
-
}
|
|
1482
|
-
/**
|
|
1483
|
-
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1484
|
-
*
|
|
1485
|
-
* @method bs
|
|
1486
|
-
* @returns The current bot's commands in the specified language.
|
|
1487
|
-
*/
|
|
1488
|
-
async getMyCommands(params) {
|
|
1489
|
-
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
|
|
1490
|
-
}
|
|
1491
|
-
/**
|
|
1492
|
-
* Answer an inline query. Bot-only.
|
|
1493
|
-
*
|
|
1494
|
-
* @method iq
|
|
1495
|
-
* @param id The ID of the inline query to answer.
|
|
1496
|
-
* @param results The results to answer with.
|
|
1497
|
-
*/
|
|
1498
|
-
async answerInlineQuery(id, results, params) {
|
|
1499
|
-
await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
|
|
1500
|
-
}
|
|
1501
|
-
/**
|
|
1502
|
-
* Set the bot's description in the given language. Bot-only.
|
|
1503
|
-
*
|
|
1504
|
-
* @method bs
|
|
1505
|
-
*/
|
|
1506
|
-
async setMyDescription(params) {
|
|
1507
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
|
|
1508
|
-
}
|
|
1509
|
-
/**
|
|
1510
|
-
* Set the bot's name in the given language. Bot-only.
|
|
1511
|
-
*
|
|
1512
|
-
* @method bs
|
|
1513
|
-
*/
|
|
1514
|
-
async setMyName(params) {
|
|
1515
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
|
|
1516
|
-
}
|
|
1517
|
-
/**
|
|
1518
|
-
* Set the bot's short description in the given language. Bot-only.
|
|
1696
|
+
* Search the messages of a chat. User-only.
|
|
1519
1697
|
*
|
|
1520
|
-
* @method
|
|
1698
|
+
* @method ms
|
|
1699
|
+
* @param chatId The identifier of the chat to search the messages in.
|
|
1700
|
+
* @param query The message search query.
|
|
1521
1701
|
*/
|
|
1522
|
-
async
|
|
1523
|
-
await __classPrivateFieldGet(this,
|
|
1702
|
+
async searchMessages(chatId, query, params) {
|
|
1703
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
|
|
1524
1704
|
}
|
|
1705
|
+
//
|
|
1706
|
+
// ========================= FILES ========================= //
|
|
1707
|
+
//
|
|
1525
1708
|
/**
|
|
1526
|
-
*
|
|
1709
|
+
* Download a file.
|
|
1527
1710
|
*
|
|
1528
|
-
* @method
|
|
1529
|
-
* @
|
|
1711
|
+
* @method fs
|
|
1712
|
+
* @param fileId The identifier of the file to download.
|
|
1713
|
+
* @example ```ts
|
|
1714
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
1715
|
+
* await outFile.write(chunk);
|
|
1716
|
+
* }
|
|
1717
|
+
* ```
|
|
1718
|
+
* @returns A generator yielding the contents of the file.
|
|
1530
1719
|
*/
|
|
1531
|
-
async
|
|
1532
|
-
|
|
1720
|
+
async *download(fileId, params) {
|
|
1721
|
+
for await (const chunk of __classPrivateFieldGet(this, _Client_fileManager, "f").download(fileId, params)) {
|
|
1722
|
+
yield chunk;
|
|
1723
|
+
}
|
|
1533
1724
|
}
|
|
1534
1725
|
/**
|
|
1535
|
-
* Get
|
|
1726
|
+
* Get custom emoji documents for download.
|
|
1536
1727
|
*
|
|
1537
|
-
* @method
|
|
1538
|
-
* @
|
|
1728
|
+
* @method fs
|
|
1729
|
+
* @param id Identifier of one or more of custom emojis.
|
|
1730
|
+
* @returns The custom emoji documents.
|
|
1539
1731
|
*/
|
|
1540
|
-
async
|
|
1541
|
-
return await __classPrivateFieldGet(this,
|
|
1732
|
+
async getCustomEmojiStickers(id) {
|
|
1733
|
+
return await __classPrivateFieldGet(this, _Client_fileManager, "f").getCustomEmojiStickers(id);
|
|
1542
1734
|
}
|
|
1735
|
+
//
|
|
1736
|
+
// ========================= CHATS ========================= //
|
|
1737
|
+
//
|
|
1543
1738
|
/**
|
|
1544
|
-
* Get
|
|
1739
|
+
* Get chats from a chat list. User-only.
|
|
1545
1740
|
*
|
|
1546
|
-
* @method
|
|
1547
|
-
* @returns The current bot's short description in the specified language.
|
|
1741
|
+
* @method ch
|
|
1548
1742
|
*/
|
|
1549
|
-
async
|
|
1550
|
-
return await __classPrivateFieldGet(this,
|
|
1743
|
+
async getChats(params) {
|
|
1744
|
+
return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChats(params?.from, params?.after, params?.limit);
|
|
1551
1745
|
}
|
|
1552
1746
|
/**
|
|
1553
|
-
*
|
|
1747
|
+
* Get a chat.
|
|
1554
1748
|
*
|
|
1555
|
-
* @method
|
|
1556
|
-
* @param chatId The identifier of the chat that contains the messages.
|
|
1557
|
-
* @param messageIds The identifiers of the messages to delete.
|
|
1749
|
+
* @method ch
|
|
1558
1750
|
*/
|
|
1559
|
-
async
|
|
1560
|
-
await __classPrivateFieldGet(this,
|
|
1751
|
+
async getChat(chatId) {
|
|
1752
|
+
return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChat(chatId);
|
|
1561
1753
|
}
|
|
1562
1754
|
/**
|
|
1563
|
-
*
|
|
1755
|
+
* Get chat history. User-only.
|
|
1564
1756
|
*
|
|
1565
|
-
* @method
|
|
1566
|
-
* @param chatId The identifier of the chat
|
|
1567
|
-
* @param messageId The identifier of the message to delete.
|
|
1757
|
+
* @method ch
|
|
1758
|
+
* @param chatId The identifier of the chat to get its history.
|
|
1568
1759
|
*/
|
|
1569
|
-
async
|
|
1570
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1760
|
+
async getHistory(chatId, params) {
|
|
1761
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getHistory(chatId, params);
|
|
1571
1762
|
}
|
|
1572
1763
|
/**
|
|
1573
|
-
*
|
|
1764
|
+
* Set a chat's available reactions. User-only.
|
|
1574
1765
|
*
|
|
1575
|
-
* @method
|
|
1576
|
-
* @param chatId The
|
|
1577
|
-
* @param
|
|
1578
|
-
* @returns The sent photo.
|
|
1766
|
+
* @method ch
|
|
1767
|
+
* @param chatId The identifier of the chat.
|
|
1768
|
+
* @param availableReactions The new available reactions.
|
|
1579
1769
|
*/
|
|
1580
|
-
async
|
|
1581
|
-
|
|
1770
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
1771
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setAvailableReactions(chatId, availableReactions);
|
|
1582
1772
|
}
|
|
1583
1773
|
/**
|
|
1584
|
-
*
|
|
1774
|
+
* Set a chat's photo.
|
|
1585
1775
|
*
|
|
1586
|
-
* @method
|
|
1587
|
-
* @param chatId The
|
|
1588
|
-
* @param
|
|
1589
|
-
* @returns The sent document.
|
|
1776
|
+
* @method ch
|
|
1777
|
+
* @param chatId The identifier of the chat.
|
|
1778
|
+
* @param photo A photo to set as the chat's photo.
|
|
1590
1779
|
*/
|
|
1591
|
-
async
|
|
1592
|
-
|
|
1780
|
+
async setChatPhoto(chatId, photo, params) {
|
|
1781
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatPhoto(chatId, photo, params);
|
|
1593
1782
|
}
|
|
1594
1783
|
/**
|
|
1595
|
-
*
|
|
1784
|
+
* Delete a chat's photo.
|
|
1596
1785
|
*
|
|
1597
|
-
* @method
|
|
1598
|
-
* @param chatId The
|
|
1599
|
-
* @param document The sticker to send.
|
|
1600
|
-
* @returns The sent sticker.
|
|
1786
|
+
* @method ch
|
|
1787
|
+
* @param chatId The identifier of the chat.
|
|
1601
1788
|
*/
|
|
1602
|
-
async
|
|
1603
|
-
|
|
1789
|
+
async deleteChatPhoto(chatId) {
|
|
1790
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatPhoto(chatId);
|
|
1604
1791
|
}
|
|
1605
1792
|
/**
|
|
1606
|
-
*
|
|
1793
|
+
* Ban a member from a chat.
|
|
1607
1794
|
*
|
|
1608
|
-
* @method
|
|
1609
|
-
* @param chatId The
|
|
1610
|
-
* @param
|
|
1611
|
-
* @returns The sent video.
|
|
1795
|
+
* @method ch
|
|
1796
|
+
* @param chatId The identifier of the chat.
|
|
1797
|
+
* @param memberId The identifier of the member.
|
|
1612
1798
|
*/
|
|
1613
|
-
async
|
|
1614
|
-
|
|
1799
|
+
async banChatMember(chatId, memberId, params) {
|
|
1800
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId, params);
|
|
1615
1801
|
}
|
|
1616
1802
|
/**
|
|
1617
|
-
*
|
|
1803
|
+
* Unban a member from a chat.
|
|
1618
1804
|
*
|
|
1619
|
-
* @method
|
|
1620
|
-
* @param chatId The chat
|
|
1621
|
-
* @param
|
|
1622
|
-
* @returns The sent animation.
|
|
1805
|
+
* @method ch
|
|
1806
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1807
|
+
* @param memberId The identifier of the member.
|
|
1623
1808
|
*/
|
|
1624
|
-
async
|
|
1625
|
-
|
|
1809
|
+
async unbanChatMember(chatId, memberId) {
|
|
1810
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
1626
1811
|
}
|
|
1627
1812
|
/**
|
|
1628
|
-
*
|
|
1813
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
1629
1814
|
*
|
|
1630
|
-
* @method
|
|
1631
|
-
* @param chatId The
|
|
1632
|
-
* @param
|
|
1633
|
-
* @returns The sent voice message.
|
|
1815
|
+
* @method ch
|
|
1816
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1817
|
+
* @param memberId The identifier of the member.
|
|
1634
1818
|
*/
|
|
1635
|
-
async
|
|
1636
|
-
|
|
1819
|
+
async kickChatMember(chatId, memberId) {
|
|
1820
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId);
|
|
1821
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
1637
1822
|
}
|
|
1638
1823
|
/**
|
|
1639
|
-
*
|
|
1824
|
+
* Set the rights of a chat member.
|
|
1640
1825
|
*
|
|
1641
|
-
* @method
|
|
1642
|
-
* @param chatId The
|
|
1643
|
-
* @param
|
|
1644
|
-
* @returns The sent audio filr.
|
|
1826
|
+
* @method ch
|
|
1827
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1828
|
+
* @param memberId The identifier of a member.
|
|
1645
1829
|
*/
|
|
1646
|
-
async
|
|
1647
|
-
|
|
1830
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
1831
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatMemberRights(chatId, memberId, params);
|
|
1648
1832
|
}
|
|
1649
1833
|
/**
|
|
1650
|
-
*
|
|
1834
|
+
* Get the administrators of a chat.
|
|
1651
1835
|
*
|
|
1652
|
-
* @method
|
|
1653
|
-
* @param chatId The
|
|
1654
|
-
* @
|
|
1655
|
-
* @returns The sent video note.
|
|
1836
|
+
* @method ch
|
|
1837
|
+
* @param chatId The identifier of the chat.
|
|
1838
|
+
* @returns The chat's administrators.
|
|
1656
1839
|
*/
|
|
1657
|
-
async
|
|
1658
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1840
|
+
async getChatAdministrators(chatId) {
|
|
1841
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatAdministrators(chatId);
|
|
1659
1842
|
}
|
|
1660
1843
|
/**
|
|
1661
|
-
*
|
|
1844
|
+
* Enable join requests in a chat. User-only.
|
|
1662
1845
|
*
|
|
1663
|
-
* @method
|
|
1664
|
-
* @param chatId The chat
|
|
1665
|
-
* @param latitude The location's latitude.
|
|
1666
|
-
* @param longitude The location's longitude.
|
|
1667
|
-
* @returns The sent location.
|
|
1846
|
+
* @method ch
|
|
1847
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
1668
1848
|
*/
|
|
1669
|
-
async
|
|
1670
|
-
|
|
1849
|
+
async enableJoinRequests(chatId) {
|
|
1850
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
|
|
1671
1851
|
}
|
|
1672
1852
|
/**
|
|
1673
|
-
*
|
|
1853
|
+
* Disable join requests in a chat. User-only.
|
|
1674
1854
|
*
|
|
1675
|
-
* @method
|
|
1676
|
-
* @param chatId The chat
|
|
1677
|
-
* @param firstName The contact's first name.
|
|
1678
|
-
* @param number The contact's phone number.
|
|
1679
|
-
* @returns The sent contact.
|
|
1855
|
+
* @method ch
|
|
1856
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
1680
1857
|
*/
|
|
1681
|
-
async
|
|
1682
|
-
|
|
1858
|
+
async disableJoinRequests(chatId) {
|
|
1859
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
|
|
1683
1860
|
}
|
|
1684
1861
|
/**
|
|
1685
|
-
*
|
|
1862
|
+
* Get inactive chats. User-only.
|
|
1686
1863
|
*
|
|
1687
|
-
* @method
|
|
1688
|
-
* @
|
|
1689
|
-
* @returns The sent dice.
|
|
1864
|
+
* @method ch
|
|
1865
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
1690
1866
|
*/
|
|
1691
|
-
async
|
|
1692
|
-
return await __classPrivateFieldGet(this,
|
|
1867
|
+
async getInactiveChats() {
|
|
1868
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
|
|
1693
1869
|
}
|
|
1694
1870
|
/**
|
|
1695
|
-
*
|
|
1871
|
+
* Get the invite links created for a chat. User-only.
|
|
1696
1872
|
*
|
|
1697
|
-
* @method
|
|
1698
|
-
* @param chatId The
|
|
1699
|
-
* @
|
|
1700
|
-
* @param longitude The longitude of the venue.
|
|
1701
|
-
* @param title The title of the venue.
|
|
1702
|
-
* @param address The written address of the venue.
|
|
1703
|
-
* @returns The sent venue.
|
|
1873
|
+
* @method ch
|
|
1874
|
+
* @param chatId The identifier of the chat.
|
|
1875
|
+
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
1704
1876
|
*/
|
|
1705
|
-
async
|
|
1706
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1877
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
1878
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
|
|
1707
1879
|
}
|
|
1708
1880
|
/**
|
|
1709
|
-
*
|
|
1881
|
+
* Join a chat. User-only.
|
|
1710
1882
|
*
|
|
1711
|
-
* @method
|
|
1883
|
+
* @method ch
|
|
1884
|
+
* @param chatId The identifier of the chat to join.
|
|
1712
1885
|
*/
|
|
1713
|
-
async
|
|
1714
|
-
|
|
1886
|
+
async joinChat(chatId) {
|
|
1887
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
|
|
1715
1888
|
}
|
|
1716
1889
|
/**
|
|
1717
|
-
*
|
|
1890
|
+
* Leave a chat.
|
|
1718
1891
|
*
|
|
1719
1892
|
* @method ch
|
|
1893
|
+
* @param chatId The identifier of the chat to leave.
|
|
1720
1894
|
*/
|
|
1721
|
-
async
|
|
1722
|
-
|
|
1895
|
+
async leaveChat(chatId) {
|
|
1896
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").leaveChat(chatId);
|
|
1723
1897
|
}
|
|
1724
1898
|
/**
|
|
1725
|
-
* Get a chat.
|
|
1899
|
+
* Get information on a user's chat membership.
|
|
1726
1900
|
*
|
|
1727
1901
|
* @method ch
|
|
1902
|
+
* @param chatId The identifier of a chat that includes the user.
|
|
1903
|
+
* @param userId The identifier of the user.
|
|
1728
1904
|
*/
|
|
1729
|
-
async
|
|
1730
|
-
return await __classPrivateFieldGet(this,
|
|
1905
|
+
async getChatMember(chatId, userId) {
|
|
1906
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
|
|
1731
1907
|
}
|
|
1732
1908
|
/**
|
|
1733
|
-
*
|
|
1909
|
+
* Set a chat's sticker set.
|
|
1734
1910
|
*
|
|
1735
1911
|
* @method ch
|
|
1736
|
-
* @param chatId The identifier of the chat
|
|
1912
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1913
|
+
* @param setName The name of the set.
|
|
1737
1914
|
*/
|
|
1738
|
-
async
|
|
1739
|
-
|
|
1915
|
+
async setChatStickerSet(chatId, setName) {
|
|
1916
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
|
|
1740
1917
|
}
|
|
1741
1918
|
/**
|
|
1742
|
-
*
|
|
1919
|
+
* Delete a chat's sticker set.
|
|
1743
1920
|
*
|
|
1744
|
-
* @method
|
|
1745
|
-
* @param
|
|
1746
|
-
* @returns The custom emoji documents.
|
|
1921
|
+
* @method ch
|
|
1922
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1747
1923
|
*/
|
|
1748
|
-
async
|
|
1749
|
-
|
|
1924
|
+
async deleteChatStickerSet(chatId) {
|
|
1925
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
|
|
1750
1926
|
}
|
|
1751
1927
|
/**
|
|
1752
|
-
* Set a chat's
|
|
1928
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
1753
1929
|
*
|
|
1754
1930
|
* @method ch
|
|
1755
1931
|
* @param chatId The identifier of the chat.
|
|
1756
|
-
* @param
|
|
1932
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
1757
1933
|
*/
|
|
1758
|
-
async
|
|
1759
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1934
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
1935
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
1760
1936
|
}
|
|
1761
1937
|
/**
|
|
1762
|
-
*
|
|
1938
|
+
* Create an invite link.
|
|
1763
1939
|
*
|
|
1764
|
-
* @method
|
|
1765
|
-
* @param chatId The identifier of the chat
|
|
1766
|
-
* @
|
|
1767
|
-
* @param reactions The new reactions.
|
|
1940
|
+
* @method ch
|
|
1941
|
+
* @param chatId The identifier of the chat to create the invite link for.
|
|
1942
|
+
* @returns The newly created invite link.
|
|
1768
1943
|
*/
|
|
1769
|
-
async
|
|
1770
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1944
|
+
async createInviteLink(chatId, params) {
|
|
1945
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
|
|
1771
1946
|
}
|
|
1947
|
+
//
|
|
1948
|
+
// ========================= CALLBACK QUERIES ========================= //
|
|
1949
|
+
//
|
|
1772
1950
|
/**
|
|
1773
|
-
*
|
|
1951
|
+
* Answer a callback query. Bot-only.
|
|
1774
1952
|
*
|
|
1775
|
-
* @method
|
|
1776
|
-
* @param
|
|
1777
|
-
* @param messageId The identifier of the message to add the reaction to.
|
|
1778
|
-
* @param reaction The reaction to add.
|
|
1953
|
+
* @method cq
|
|
1954
|
+
* @param id ID of the callback query to answer.
|
|
1779
1955
|
*/
|
|
1780
|
-
async
|
|
1781
|
-
await __classPrivateFieldGet(this,
|
|
1956
|
+
async answerCallbackQuery(id, params) {
|
|
1957
|
+
await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").answerCallbackQuery(id, params);
|
|
1782
1958
|
}
|
|
1959
|
+
//
|
|
1960
|
+
// ========================= INLINE QUERIES ========================= //
|
|
1961
|
+
//
|
|
1783
1962
|
/**
|
|
1784
|
-
*
|
|
1963
|
+
* Answer an inline query. Bot-only.
|
|
1785
1964
|
*
|
|
1786
|
-
* @method
|
|
1787
|
-
* @param
|
|
1788
|
-
* @param
|
|
1789
|
-
* @param reaction The reaction to remove.
|
|
1965
|
+
* @method iq
|
|
1966
|
+
* @param id The ID of the inline query to answer.
|
|
1967
|
+
* @param results The results to answer with.
|
|
1790
1968
|
*/
|
|
1791
|
-
async
|
|
1792
|
-
await __classPrivateFieldGet(this,
|
|
1969
|
+
async answerInlineQuery(id, results, params) {
|
|
1970
|
+
await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
|
|
1793
1971
|
}
|
|
1972
|
+
//
|
|
1973
|
+
// ========================= BOTS ========================= //
|
|
1974
|
+
//
|
|
1794
1975
|
/**
|
|
1795
|
-
* Set
|
|
1976
|
+
* Set the bot's description in the given language. Bot-only.
|
|
1796
1977
|
*
|
|
1797
|
-
* @method
|
|
1798
|
-
* @param chatId The identifier of the chat.
|
|
1799
|
-
* @param photo A photo to set as the chat's photo.
|
|
1978
|
+
* @method bs
|
|
1800
1979
|
*/
|
|
1801
|
-
async
|
|
1802
|
-
await __classPrivateFieldGet(this,
|
|
1980
|
+
async setMyDescription(params) {
|
|
1981
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
|
|
1803
1982
|
}
|
|
1804
1983
|
/**
|
|
1805
|
-
*
|
|
1984
|
+
* Set the bot's name in the given language. Bot-only.
|
|
1806
1985
|
*
|
|
1807
|
-
* @method
|
|
1808
|
-
* @param chatId The identifier of the chat.
|
|
1986
|
+
* @method bs
|
|
1809
1987
|
*/
|
|
1810
|
-
async
|
|
1811
|
-
await __classPrivateFieldGet(this,
|
|
1988
|
+
async setMyName(params) {
|
|
1989
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
|
|
1812
1990
|
}
|
|
1813
1991
|
/**
|
|
1814
|
-
*
|
|
1992
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
1815
1993
|
*
|
|
1816
|
-
* @method
|
|
1817
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1818
|
-
* @param memberId The identifier of the member.
|
|
1994
|
+
* @method bs
|
|
1819
1995
|
*/
|
|
1820
|
-
async
|
|
1821
|
-
await __classPrivateFieldGet(this,
|
|
1996
|
+
async setMyShortDescription(params) {
|
|
1997
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyShortDescription(params);
|
|
1822
1998
|
}
|
|
1823
1999
|
/**
|
|
1824
|
-
*
|
|
2000
|
+
* Get the bot's description in the given language. Bot-only.
|
|
1825
2001
|
*
|
|
1826
|
-
* @method
|
|
1827
|
-
* @
|
|
1828
|
-
* @param messageId The message's identifier.
|
|
2002
|
+
* @method bs
|
|
2003
|
+
* @returns The current bot's description in the specified language.
|
|
1829
2004
|
*/
|
|
1830
|
-
async
|
|
1831
|
-
await __classPrivateFieldGet(this,
|
|
2005
|
+
async getMyDescription(params) {
|
|
2006
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyDescription(params);
|
|
1832
2007
|
}
|
|
1833
2008
|
/**
|
|
1834
|
-
*
|
|
2009
|
+
* Get the bot's name in the given language. Bot-only.
|
|
1835
2010
|
*
|
|
1836
|
-
* @method
|
|
1837
|
-
* @
|
|
1838
|
-
* @param messageId The message's identifier.
|
|
2011
|
+
* @method bs
|
|
2012
|
+
* @returns The current bot's name in the specified language.
|
|
1839
2013
|
*/
|
|
1840
|
-
async
|
|
1841
|
-
await __classPrivateFieldGet(this,
|
|
2014
|
+
async getMyName(params) {
|
|
2015
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyName(params);
|
|
1842
2016
|
}
|
|
1843
2017
|
/**
|
|
1844
|
-
*
|
|
2018
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
1845
2019
|
*
|
|
1846
|
-
* @method
|
|
1847
|
-
* @
|
|
2020
|
+
* @method bs
|
|
2021
|
+
* @returns The current bot's short description in the specified language.
|
|
1848
2022
|
*/
|
|
1849
|
-
async
|
|
1850
|
-
await __classPrivateFieldGet(this,
|
|
2023
|
+
async getMyShortDescription(params) {
|
|
2024
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyShortDescription(params);
|
|
1851
2025
|
}
|
|
1852
2026
|
/**
|
|
1853
|
-
*
|
|
2027
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1854
2028
|
*
|
|
1855
|
-
* @method
|
|
1856
|
-
* @param
|
|
1857
|
-
* @param memberId The identifier of the member.
|
|
2029
|
+
* @method bs
|
|
2030
|
+
* @param commands The commands to set.
|
|
1858
2031
|
*/
|
|
1859
|
-
async
|
|
1860
|
-
await __classPrivateFieldGet(this,
|
|
2032
|
+
async setMyCommands(commands, params) {
|
|
2033
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
|
|
1861
2034
|
}
|
|
1862
2035
|
/**
|
|
1863
|
-
*
|
|
2036
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1864
2037
|
*
|
|
1865
|
-
* @method
|
|
1866
|
-
* @
|
|
1867
|
-
* @param memberId The identifier of the member.
|
|
2038
|
+
* @method bs
|
|
2039
|
+
* @returns The current bot's commands in the specified language.
|
|
1868
2040
|
*/
|
|
1869
|
-
async
|
|
1870
|
-
await __classPrivateFieldGet(this,
|
|
2041
|
+
async getMyCommands(params) {
|
|
2042
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
|
|
1871
2043
|
}
|
|
2044
|
+
//
|
|
2045
|
+
// ========================= REACTIONS ========================= //
|
|
2046
|
+
//
|
|
1872
2047
|
/**
|
|
1873
|
-
*
|
|
2048
|
+
* Change reactions made to a message.
|
|
1874
2049
|
*
|
|
1875
|
-
* @method
|
|
1876
|
-
* @param chatId The identifier of the chat
|
|
1877
|
-
* @param
|
|
2050
|
+
* @method re
|
|
2051
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2052
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
2053
|
+
* @param reactions The new reactions.
|
|
1878
2054
|
*/
|
|
1879
|
-
async
|
|
1880
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1881
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
2055
|
+
async setReactions(chatId, messageId, reactions, params) {
|
|
2056
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setReactions(chatId, messageId, reactions, params);
|
|
1882
2057
|
}
|
|
1883
2058
|
/**
|
|
1884
|
-
*
|
|
2059
|
+
* Make a reaction to a message.
|
|
1885
2060
|
*
|
|
1886
|
-
* @method
|
|
1887
|
-
* @param chatId The identifier of the chat
|
|
1888
|
-
* @param
|
|
2061
|
+
* @method re
|
|
2062
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2063
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
2064
|
+
* @param reaction The reaction to add.
|
|
1889
2065
|
*/
|
|
1890
|
-
async
|
|
1891
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
2066
|
+
async addReaction(chatId, messageId, reaction, params) {
|
|
2067
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").addReaction(chatId, messageId, reaction, params);
|
|
1892
2068
|
}
|
|
1893
2069
|
/**
|
|
1894
|
-
*
|
|
2070
|
+
* Undo a reaction made to a message.
|
|
1895
2071
|
*
|
|
1896
|
-
* @method
|
|
1897
|
-
* @param chatId The identifier of the chat.
|
|
1898
|
-
* @
|
|
2072
|
+
* @method re
|
|
2073
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2074
|
+
* @param messageId The identifier of the message which the reaction was made to.
|
|
2075
|
+
* @param reaction The reaction to remove.
|
|
1899
2076
|
*/
|
|
1900
|
-
async
|
|
1901
|
-
|
|
2077
|
+
async removeReaction(chatId, messageId, reaction) {
|
|
2078
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").removeReaction(chatId, messageId, reaction);
|
|
1902
2079
|
}
|
|
2080
|
+
//
|
|
2081
|
+
// ========================= STORIES ========================= //
|
|
2082
|
+
//
|
|
1903
2083
|
/**
|
|
1904
2084
|
* Create a story. User-only.
|
|
1905
2085
|
*
|
|
@@ -1994,130 +2174,16 @@ class Client extends Composer {
|
|
|
1994
2174
|
async removeStoryFromHighlights(chatId, storyId) {
|
|
1995
2175
|
await __classPrivateFieldGet(this, _Client_storyManager, "f").removeStoryFromHighlights(chatId, storyId);
|
|
1996
2176
|
}
|
|
2177
|
+
//
|
|
2178
|
+
// ========================= MISC ========================= //
|
|
2179
|
+
//
|
|
1997
2180
|
/**
|
|
1998
|
-
*
|
|
1999
|
-
*
|
|
2000
|
-
* @method ch
|
|
2001
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
2002
|
-
*/
|
|
2003
|
-
async enableJoinRequests(chatId) {
|
|
2004
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
|
|
2005
|
-
}
|
|
2006
|
-
/**
|
|
2007
|
-
* Disable join requests in a chat. User-only.
|
|
2008
|
-
*
|
|
2009
|
-
* @method ch
|
|
2010
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
2011
|
-
*/
|
|
2012
|
-
async disableJoinRequests(chatId) {
|
|
2013
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
|
|
2014
|
-
}
|
|
2015
|
-
/**
|
|
2016
|
-
* Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
|
|
2017
|
-
*
|
|
2018
|
-
* @method ac
|
|
2019
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2020
|
-
* @param username The username to show.
|
|
2021
|
-
*/
|
|
2022
|
-
async showUsername(id, username) {
|
|
2023
|
-
await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
|
|
2024
|
-
}
|
|
2025
|
-
/**
|
|
2026
|
-
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
2027
|
-
*
|
|
2028
|
-
* @method ac
|
|
2029
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2030
|
-
* @param username The username to hide.
|
|
2031
|
-
*/
|
|
2032
|
-
async hideUsername(id, username) {
|
|
2033
|
-
await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
|
|
2034
|
-
}
|
|
2035
|
-
/**
|
|
2036
|
-
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
2037
|
-
*
|
|
2038
|
-
* @method ac
|
|
2039
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2040
|
-
* @param order The new order to use.
|
|
2041
|
-
* @returns Whether the order was changed.
|
|
2042
|
-
*/
|
|
2043
|
-
async reorderUsernames(id, order) {
|
|
2044
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
2048
|
-
*
|
|
2049
|
-
* @method ac
|
|
2050
|
-
* @param id A supergroup ID or a channel ID.
|
|
2051
|
-
*/
|
|
2052
|
-
async hideUsernames(id) {
|
|
2053
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
|
|
2054
|
-
}
|
|
2055
|
-
/**
|
|
2056
|
-
* Get inactive chats. User-only.
|
|
2057
|
-
*
|
|
2058
|
-
* @method ch
|
|
2059
|
-
* @retuns A list of inactive chats the current user is member of.
|
|
2060
|
-
*/
|
|
2061
|
-
async getInactiveChats() {
|
|
2062
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
|
|
2063
|
-
}
|
|
2064
|
-
/**
|
|
2065
|
-
* Search the messages of a chat. User-only.
|
|
2066
|
-
*
|
|
2067
|
-
* @method ms
|
|
2068
|
-
* @param chatId The identifier of the chat to search the messages in.
|
|
2069
|
-
* @param query The message search query.
|
|
2070
|
-
*/
|
|
2071
|
-
async searchMessages(chatId, query, params) {
|
|
2072
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
|
|
2073
|
-
}
|
|
2074
|
-
/**
|
|
2075
|
-
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
2076
|
-
*
|
|
2077
|
-
* @method ch
|
|
2078
|
-
* @param chatId The identifier of the chat.
|
|
2079
|
-
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
2080
|
-
*/
|
|
2081
|
-
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
2082
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
2083
|
-
}
|
|
2084
|
-
/**
|
|
2085
|
-
* Create an invite link.
|
|
2086
|
-
*
|
|
2087
|
-
* @method ch
|
|
2088
|
-
* @param chatId The identifier of the chat to create the invite link for.
|
|
2089
|
-
* @returns The newly created invite link.
|
|
2090
|
-
*/
|
|
2091
|
-
async createInviteLink(chatId, params) {
|
|
2092
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
|
|
2093
|
-
}
|
|
2094
|
-
/**
|
|
2095
|
-
* Get the invite links created for a chat. User-only.
|
|
2096
|
-
*
|
|
2097
|
-
* @method ch
|
|
2098
|
-
* @param chatId The identifier of the chat.
|
|
2099
|
-
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
2100
|
-
*/
|
|
2101
|
-
async getCreatedInviteLinks(chatId, params) {
|
|
2102
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
|
|
2103
|
-
}
|
|
2104
|
-
/**
|
|
2105
|
-
* Join a chat. User-only.
|
|
2106
|
-
*
|
|
2107
|
-
* @method ch
|
|
2108
|
-
* @param chatId The identifier of the chat to join.
|
|
2109
|
-
*/
|
|
2110
|
-
async joinChat(chatId) {
|
|
2111
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
|
|
2112
|
-
}
|
|
2113
|
-
/**
|
|
2114
|
-
* Leave a chat.
|
|
2181
|
+
* Get network statistics. This might not always be available.
|
|
2115
2182
|
*
|
|
2116
|
-
* @method
|
|
2117
|
-
* @param chatId The identifier of the chat to leave.
|
|
2183
|
+
* @method mc
|
|
2118
2184
|
*/
|
|
2119
|
-
async
|
|
2120
|
-
await __classPrivateFieldGet(this,
|
|
2185
|
+
async getNetworkStatistics() {
|
|
2186
|
+
return await __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f").getNetworkStatistics();
|
|
2121
2187
|
}
|
|
2122
2188
|
/**
|
|
2123
2189
|
* Block a user. User-only.
|
|
@@ -2137,35 +2203,6 @@ class Client extends Composer {
|
|
|
2137
2203
|
async unblockUser(userId) {
|
|
2138
2204
|
await __classPrivateFieldGet(this, _Client_messageManager, "f").unblockUser(userId);
|
|
2139
2205
|
}
|
|
2140
|
-
/**
|
|
2141
|
-
* Get information on a user's chat membership.
|
|
2142
|
-
*
|
|
2143
|
-
* @method ch
|
|
2144
|
-
* @param chatId The identifier of a chat that includes the user.
|
|
2145
|
-
* @param userId The identifier of the user.
|
|
2146
|
-
*/
|
|
2147
|
-
async getChatMember(chatId, userId) {
|
|
2148
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
|
|
2149
|
-
}
|
|
2150
|
-
/**
|
|
2151
|
-
* Set a chat's sticker set.
|
|
2152
|
-
*
|
|
2153
|
-
* @method ch
|
|
2154
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
2155
|
-
* @param setName The name of the set.
|
|
2156
|
-
*/
|
|
2157
|
-
async setChatStickerSet(chatId, setName) {
|
|
2158
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
|
|
2159
|
-
}
|
|
2160
|
-
/**
|
|
2161
|
-
* Delete a chat's sticker set.
|
|
2162
|
-
*
|
|
2163
|
-
* @method ch
|
|
2164
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
2165
|
-
*/
|
|
2166
|
-
async deleteChatStickerSet(chatId) {
|
|
2167
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
|
|
2168
|
-
}
|
|
2169
2206
|
}
|
|
2170
2207
|
exports.Client = Client;
|
|
2171
2208
|
_Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
@@ -2226,6 +2263,9 @@ _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
|
2226
2263
|
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd));
|
|
2227
2264
|
}
|
|
2228
2265
|
}
|
|
2266
|
+
if (_1_business_connection_manager_js_1.BusinessConnectionManager.canHandleUpdate(update)) {
|
|
2267
|
+
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
|
|
2268
|
+
}
|
|
2229
2269
|
return () => Promise.all(promises);
|
|
2230
2270
|
}, _Client_getMe = async function _Client_getMe() {
|
|
2231
2271
|
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
|