@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
package/esm/client/4_client.js
CHANGED
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _Client_instances, _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;
|
|
12
|
+
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;
|
|
13
13
|
import { AccessError, InputError } from "../0_errors.js";
|
|
14
14
|
import { cleanObject, drop, getLogger, getRandomId, mustPrompt, mustPromptOneOf, UNREACHABLE, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
15
15
|
import { as, chatIdToPeerId, functions, getChatIdPeerType, name, peerToChatId, types } from "../2_tl.js";
|
|
@@ -21,6 +21,7 @@ import { checkPassword } from "./0_password.js";
|
|
|
21
21
|
import { getUsername, resolve } from "./0_utilities.js";
|
|
22
22
|
import { AccountManager } from "./1_account_manager.js";
|
|
23
23
|
import { BotInfoManager } from "./1_bot_info_manager.js";
|
|
24
|
+
import { BusinessConnectionManager } from "./1_business_connection_manager.js";
|
|
24
25
|
import { ClientEncrypted } from "./1_client_encrypted.js";
|
|
25
26
|
import { ClientPlain } from "./1_client_plain.js";
|
|
26
27
|
import { Composer as Composer_ } from "./1_composer.js";
|
|
@@ -77,6 +78,7 @@ export class Client extends Composer {
|
|
|
77
78
|
_Client_botInfoManager.set(this, void 0);
|
|
78
79
|
_Client_fileManager.set(this, void 0);
|
|
79
80
|
_Client_reactionManager.set(this, void 0);
|
|
81
|
+
_Client_businessConnectionManager.set(this, void 0);
|
|
80
82
|
_Client_messageManager.set(this, void 0);
|
|
81
83
|
_Client_storyManager.set(this, void 0);
|
|
82
84
|
_Client_callbackQueryManager.set(this, void 0);
|
|
@@ -200,7 +202,7 @@ export class Client extends Composer {
|
|
|
200
202
|
const reactions = "messageInteractions" in update ? update.messageInteractions : undefined;
|
|
201
203
|
const mustGetMsg = () => {
|
|
202
204
|
if (msg !== undefined) {
|
|
203
|
-
return { chatId: msg.chat.id, messageId: msg.id, senderId: (msg.from ?? msg.senderChat)?.id };
|
|
205
|
+
return { chatId: msg.chat.id, messageId: msg.id, businessConnectionId: msg.businessConnectionId, senderId: (msg.from ?? msg.senderChat)?.id };
|
|
204
206
|
}
|
|
205
207
|
else if (reactions !== undefined) {
|
|
206
208
|
return { chatId: reactions.chatId, messageId: reactions.messageId };
|
|
@@ -259,74 +261,74 @@ export class Client extends Composer {
|
|
|
259
261
|
return () => update;
|
|
260
262
|
},
|
|
261
263
|
reply: (text, params) => {
|
|
262
|
-
const { chatId, messageId } = mustGetMsg();
|
|
264
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
263
265
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
264
|
-
return this.sendMessage(chatId, text, { ...params, replyToMessageId });
|
|
266
|
+
return this.sendMessage(chatId, text, { ...params, replyToMessageId, businessConnectionId });
|
|
265
267
|
},
|
|
266
268
|
replyPoll: (question, options, params) => {
|
|
267
|
-
const { chatId, messageId } = mustGetMsg();
|
|
269
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
268
270
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
269
|
-
return this.sendPoll(chatId, question, options, { ...params, replyToMessageId });
|
|
271
|
+
return this.sendPoll(chatId, question, options, { ...params, replyToMessageId, businessConnectionId });
|
|
270
272
|
},
|
|
271
273
|
replyPhoto: (photo, params) => {
|
|
272
|
-
const { chatId, messageId } = mustGetMsg();
|
|
274
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
273
275
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
274
|
-
return this.sendPhoto(chatId, photo, { ...params, replyToMessageId });
|
|
276
|
+
return this.sendPhoto(chatId, photo, { ...params, replyToMessageId, businessConnectionId });
|
|
275
277
|
},
|
|
276
278
|
replyDocument: (document, params) => {
|
|
277
|
-
const { chatId, messageId } = mustGetMsg();
|
|
279
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
278
280
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
279
|
-
return this.sendDocument(chatId, document, { ...params, replyToMessageId });
|
|
281
|
+
return this.sendDocument(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
280
282
|
},
|
|
281
283
|
replySticker: (sticker, params) => {
|
|
282
|
-
const { chatId, messageId } = mustGetMsg();
|
|
284
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
283
285
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
284
|
-
return this.sendSticker(chatId, sticker, { ...params, replyToMessageId });
|
|
286
|
+
return this.sendSticker(chatId, sticker, { ...params, replyToMessageId, businessConnectionId });
|
|
285
287
|
},
|
|
286
288
|
replyContact: (firstName, number, params) => {
|
|
287
|
-
const { chatId, messageId } = mustGetMsg();
|
|
289
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
288
290
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
289
|
-
return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId });
|
|
291
|
+
return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId, businessConnectionId });
|
|
290
292
|
},
|
|
291
293
|
replyLocation: (latitude, longitude, params) => {
|
|
292
|
-
const { chatId, messageId } = mustGetMsg();
|
|
294
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
293
295
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
294
|
-
return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
296
|
+
return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId, businessConnectionId });
|
|
295
297
|
},
|
|
296
298
|
replyDice: (params) => {
|
|
297
|
-
const { chatId, messageId } = mustGetMsg();
|
|
299
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
298
300
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
299
|
-
return this.sendDice(chatId, { ...params, replyToMessageId });
|
|
301
|
+
return this.sendDice(chatId, { ...params, replyToMessageId, businessConnectionId });
|
|
300
302
|
},
|
|
301
303
|
replyVenue: (latitude, longitude, title, address, params) => {
|
|
302
|
-
const { chatId, messageId } = mustGetMsg();
|
|
304
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
303
305
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
304
|
-
return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
306
|
+
return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId, businessConnectionId });
|
|
305
307
|
},
|
|
306
308
|
replyVideo: (video, params) => {
|
|
307
|
-
const { chatId, messageId } = mustGetMsg();
|
|
309
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
308
310
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
309
|
-
return this.sendVideo(chatId, video, { ...params, replyToMessageId });
|
|
311
|
+
return this.sendVideo(chatId, video, { ...params, replyToMessageId, businessConnectionId });
|
|
310
312
|
},
|
|
311
313
|
replyAnimation: (document, params) => {
|
|
312
|
-
const { chatId, messageId } = mustGetMsg();
|
|
314
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
313
315
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
314
|
-
return this.sendAnimation(chatId, document, { ...params, replyToMessageId });
|
|
316
|
+
return this.sendAnimation(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
315
317
|
},
|
|
316
318
|
replyVoice: (document, params) => {
|
|
317
|
-
const { chatId, messageId } = mustGetMsg();
|
|
319
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
318
320
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
319
|
-
return this.sendVoice(chatId, document, { ...params, replyToMessageId });
|
|
321
|
+
return this.sendVoice(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
320
322
|
},
|
|
321
323
|
replyAudio: (document, params) => {
|
|
322
|
-
const { chatId, messageId } = mustGetMsg();
|
|
324
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
323
325
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
324
|
-
return this.sendAudio(chatId, document, { ...params, replyToMessageId });
|
|
326
|
+
return this.sendAudio(chatId, document, { ...params, replyToMessageId, businessConnectionId });
|
|
325
327
|
},
|
|
326
328
|
replyVideoNote: (videoNote, params) => {
|
|
327
|
-
const { chatId, messageId } = mustGetMsg();
|
|
329
|
+
const { chatId, messageId, businessConnectionId } = mustGetMsg();
|
|
328
330
|
const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
|
|
329
|
-
return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId });
|
|
331
|
+
return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId, businessConnectionId });
|
|
330
332
|
},
|
|
331
333
|
delete: () => {
|
|
332
334
|
const { chatId, messageId } = mustGetMsg();
|
|
@@ -531,6 +533,13 @@ export class Client extends Composer {
|
|
|
531
533
|
const { chatId } = mustGetMsg();
|
|
532
534
|
return this.deleteChatStickerSet(chatId);
|
|
533
535
|
},
|
|
536
|
+
getBusinessConnection: () => {
|
|
537
|
+
const { businessConnectionId } = mustGetMsg();
|
|
538
|
+
if (!businessConnectionId) {
|
|
539
|
+
UNREACHABLE();
|
|
540
|
+
}
|
|
541
|
+
return this.getBusinessConnection(businessConnectionId);
|
|
542
|
+
},
|
|
534
543
|
};
|
|
535
544
|
return cleanObject(context);
|
|
536
545
|
});
|
|
@@ -636,6 +645,14 @@ export class Client extends Composer {
|
|
|
636
645
|
const c = {
|
|
637
646
|
id,
|
|
638
647
|
api: this.api,
|
|
648
|
+
invoke: async (function_, businessConnectionId) => {
|
|
649
|
+
if (businessConnectionId) {
|
|
650
|
+
return await this.api.invokeWithBusinessConnection({ connection_id: businessConnectionId, query: function_ });
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
return await this.invoke(function_);
|
|
654
|
+
}
|
|
655
|
+
},
|
|
639
656
|
storage: this.storage,
|
|
640
657
|
messageStorage: this.messageStorage,
|
|
641
658
|
guaranteeUpdateDelivery: __classPrivateFieldGet(this, _Client_guaranteeUpdateDelivery, "f"),
|
|
@@ -664,8 +681,7 @@ export class Client extends Composer {
|
|
|
664
681
|
if (ctx.error instanceof AuthKeyUnregistered && dcId) {
|
|
665
682
|
try {
|
|
666
683
|
const exportedAuth = await this.api.auth.exportAuthorization({ dc_id: dcId });
|
|
667
|
-
await client.
|
|
668
|
-
// throw 1;
|
|
684
|
+
await client.api.auth.importAuthorization(exportedAuth);
|
|
669
685
|
return true;
|
|
670
686
|
}
|
|
671
687
|
catch (err) {
|
|
@@ -700,6 +716,7 @@ export class Client extends Composer {
|
|
|
700
716
|
__classPrivateFieldSet(this, _Client_botInfoManager, new BotInfoManager(c), "f");
|
|
701
717
|
__classPrivateFieldSet(this, _Client_fileManager, new FileManager(c), "f");
|
|
702
718
|
__classPrivateFieldSet(this, _Client_reactionManager, new ReactionManager(c), "f");
|
|
719
|
+
__classPrivateFieldSet(this, _Client_businessConnectionManager, new BusinessConnectionManager(c), "f");
|
|
703
720
|
__classPrivateFieldSet(this, _Client_messageManager, new MessageManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f") }), "f");
|
|
704
721
|
__classPrivateFieldSet(this, _Client_callbackQueryManager, new CallbackQueryManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
705
722
|
__classPrivateFieldSet(this, _Client_storyManager, new StoryManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
|
|
@@ -814,7 +831,7 @@ export class Client extends Composer {
|
|
|
814
831
|
}
|
|
815
832
|
await this.connect();
|
|
816
833
|
}
|
|
817
|
-
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() {
|
|
834
|
+
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() {
|
|
818
835
|
const apiId = this.apiId || await this.storage.getApiId();
|
|
819
836
|
if (!apiId) {
|
|
820
837
|
throw new Error("apiId not set");
|
|
@@ -845,21 +862,18 @@ export class Client extends Composer {
|
|
|
845
862
|
__classPrivateFieldGet(this, _Client_pingLoopAbortController, "f")?.abort();
|
|
846
863
|
}
|
|
847
864
|
/**
|
|
848
|
-
*
|
|
865
|
+
* Authorizes the client with one of the following:
|
|
849
866
|
*
|
|
850
867
|
* - Bot token (`string`)
|
|
851
|
-
* - Exported authorization (`types.AuthExportedAuthorization`)
|
|
852
868
|
* - User authorization handlers (`AuthorizeUserParams`)
|
|
853
869
|
*
|
|
854
|
-
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](
|
|
870
|
+
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
|
|
855
871
|
*
|
|
856
872
|
* Notes:
|
|
857
873
|
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
858
874
|
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
859
|
-
* 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
|
|
860
875
|
*
|
|
861
|
-
* [1]: https://core.telegram.org/method/
|
|
862
|
-
* [2]: https://core.telegram.org/method/updates.getState
|
|
876
|
+
* [1]: https://core.telegram.org/method/updates.getState
|
|
863
877
|
*/
|
|
864
878
|
async authorize(params) {
|
|
865
879
|
try {
|
|
@@ -911,11 +925,6 @@ export class Client extends Composer {
|
|
|
911
925
|
await __classPrivateFieldGet(this, _Client_updateManager, "f").fetchState("authorize");
|
|
912
926
|
return;
|
|
913
927
|
}
|
|
914
|
-
if (params instanceof types.auth.ExportedAuthorization) {
|
|
915
|
-
await this.api.auth.importAuthorization({ id: params.id, bytes: params.bytes });
|
|
916
|
-
__classPrivateFieldGet(this, _Client_Lauthorize, "f").debug("authorization imported");
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
919
928
|
auth: while (true) {
|
|
920
929
|
try {
|
|
921
930
|
let phone;
|
|
@@ -1056,7 +1065,7 @@ export class Client extends Composer {
|
|
|
1056
1065
|
inputPeer.access_hash = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getUserAccessHash).call(this, inputPeer.user_id);
|
|
1057
1066
|
}
|
|
1058
1067
|
}
|
|
1059
|
-
|
|
1068
|
+
if ((inputPeer instanceof types.InputPeerUser || inputPeer instanceof types.InputPeerChannel && inputPeer.access_hash == 0n) && await this.storage.getAccountType() == "user") {
|
|
1060
1069
|
throw new AccessError(`Cannot access the chat ${id} because there is no access hash for it.`);
|
|
1061
1070
|
}
|
|
1062
1071
|
return inputPeer;
|
|
@@ -1249,6 +1258,77 @@ export class Client extends Composer {
|
|
|
1249
1258
|
}
|
|
1250
1259
|
return await this.messageStorage.getEntity(id);
|
|
1251
1260
|
}
|
|
1261
|
+
//
|
|
1262
|
+
// ========================= ACCOUNT ========================= //
|
|
1263
|
+
//
|
|
1264
|
+
/**
|
|
1265
|
+
* Get information on the currently authorized user.
|
|
1266
|
+
*
|
|
1267
|
+
* @method ac
|
|
1268
|
+
*/
|
|
1269
|
+
async getMe() {
|
|
1270
|
+
let user_ = await this[getEntity](new types.PeerUser({ user_id: BigInt(await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getSelfId).call(this)) }));
|
|
1271
|
+
if (user_ == null) {
|
|
1272
|
+
const users = await this.api.users.getUsers({ id: [new types.InputUserSelf()] });
|
|
1273
|
+
user_ = users[0][as](types.User);
|
|
1274
|
+
await this.messageStorage.setEntity(user_);
|
|
1275
|
+
}
|
|
1276
|
+
const user = constructUser(user_);
|
|
1277
|
+
__classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
|
|
1278
|
+
return user;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1282
|
+
*
|
|
1283
|
+
* @method ac
|
|
1284
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1285
|
+
* @param username The username to show.
|
|
1286
|
+
*/
|
|
1287
|
+
async showUsername(id, username) {
|
|
1288
|
+
await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1292
|
+
*
|
|
1293
|
+
* @method ac
|
|
1294
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1295
|
+
* @param username The username to hide.
|
|
1296
|
+
*/
|
|
1297
|
+
async hideUsername(id, username) {
|
|
1298
|
+
await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1302
|
+
*
|
|
1303
|
+
* @method ac
|
|
1304
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1305
|
+
* @param order The new order to use.
|
|
1306
|
+
* @returns Whether the order was changed.
|
|
1307
|
+
*/
|
|
1308
|
+
async reorderUsernames(id, order) {
|
|
1309
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
1313
|
+
*
|
|
1314
|
+
* @method ac
|
|
1315
|
+
* @param id A supergroup ID or a channel ID.
|
|
1316
|
+
*/
|
|
1317
|
+
async hideUsernames(id) {
|
|
1318
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Get a business connection. Bot-only.
|
|
1322
|
+
*
|
|
1323
|
+
* @method ac
|
|
1324
|
+
* @param id The identifier of the business connection.
|
|
1325
|
+
*/
|
|
1326
|
+
async getBusinessConnection(id) {
|
|
1327
|
+
return await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").getBusinessConnection(id);
|
|
1328
|
+
}
|
|
1329
|
+
//
|
|
1330
|
+
// ========================= MESSAGES ========================= //
|
|
1331
|
+
//
|
|
1252
1332
|
/**
|
|
1253
1333
|
* Send a text message.
|
|
1254
1334
|
*
|
|
@@ -1260,6 +1340,154 @@ export class Client extends Composer {
|
|
|
1260
1340
|
async sendMessage(chatId, text, params) {
|
|
1261
1341
|
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendMessage(chatId, text, params);
|
|
1262
1342
|
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Send a photo.
|
|
1345
|
+
*
|
|
1346
|
+
* @method ms
|
|
1347
|
+
* @param chatId The chat to send the photo to.
|
|
1348
|
+
* @param photo The photo to send.
|
|
1349
|
+
* @returns The sent photo.
|
|
1350
|
+
*/
|
|
1351
|
+
async sendPhoto(chatId, photo, params) {
|
|
1352
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPhoto(chatId, photo, params);
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Send a document.
|
|
1356
|
+
*
|
|
1357
|
+
* @method ms
|
|
1358
|
+
* @param chatId The chat to send the document to.
|
|
1359
|
+
* @param document The document to send.
|
|
1360
|
+
* @returns The sent document.
|
|
1361
|
+
*/
|
|
1362
|
+
async sendDocument(chatId, document, params) {
|
|
1363
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDocument(chatId, document, params);
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Send a sticker.
|
|
1367
|
+
*
|
|
1368
|
+
* @method ms
|
|
1369
|
+
* @param chatId The chat to send the sticker to.
|
|
1370
|
+
* @param document The sticker to send.
|
|
1371
|
+
* @returns The sent sticker.
|
|
1372
|
+
*/
|
|
1373
|
+
async sendSticker(chatId, sticker, params) {
|
|
1374
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendSticker(chatId, sticker, params);
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* Send a video.
|
|
1378
|
+
*
|
|
1379
|
+
* @method ms
|
|
1380
|
+
* @param chatId The chat to send the video to.
|
|
1381
|
+
* @param video The video to send.
|
|
1382
|
+
* @returns The sent video.
|
|
1383
|
+
*/
|
|
1384
|
+
async sendVideo(chatId, video, params) {
|
|
1385
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideo(chatId, video, params);
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Send an animation.
|
|
1389
|
+
*
|
|
1390
|
+
* @method ms
|
|
1391
|
+
* @param chatId The chat to send the animation to.
|
|
1392
|
+
* @param animation The animation to send.
|
|
1393
|
+
* @returns The sent animation.
|
|
1394
|
+
*/
|
|
1395
|
+
async sendAnimation(chatId, animation, params) {
|
|
1396
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAnimation(chatId, animation, params);
|
|
1397
|
+
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Send a voice message.
|
|
1400
|
+
*
|
|
1401
|
+
* @method ms
|
|
1402
|
+
* @param chatId The chat to send the voice message to.
|
|
1403
|
+
* @param voice The voice to send.
|
|
1404
|
+
* @returns The sent voice message.
|
|
1405
|
+
*/
|
|
1406
|
+
async sendVoice(chatId, voice, params) {
|
|
1407
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVoice(chatId, voice, params);
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Send an audio file.
|
|
1411
|
+
*
|
|
1412
|
+
* @method ms
|
|
1413
|
+
* @param chatId The chat to send the audio file to.
|
|
1414
|
+
* @param audio The audio to send.
|
|
1415
|
+
* @returns The sent audio filr.
|
|
1416
|
+
*/
|
|
1417
|
+
async sendAudio(chatId, audio, params) {
|
|
1418
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAudio(chatId, audio, params);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Send a video note.
|
|
1422
|
+
*
|
|
1423
|
+
* @method ms
|
|
1424
|
+
* @param chatId The chat to send the video note to.
|
|
1425
|
+
* @param videoNote The video note to send.
|
|
1426
|
+
* @returns The sent video note.
|
|
1427
|
+
*/
|
|
1428
|
+
async sendVideoNote(chatId, videoNote, params) {
|
|
1429
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideoNote(chatId, videoNote, params);
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Send a location.
|
|
1433
|
+
*
|
|
1434
|
+
* @method ms
|
|
1435
|
+
* @param chatId The chat to send the location to.
|
|
1436
|
+
* @param latitude The location's latitude.
|
|
1437
|
+
* @param longitude The location's longitude.
|
|
1438
|
+
* @returns The sent location.
|
|
1439
|
+
*/
|
|
1440
|
+
async sendLocation(chatId, latitude, longitude, params) {
|
|
1441
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendLocation(chatId, latitude, longitude, params);
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Send a contact.
|
|
1445
|
+
*
|
|
1446
|
+
* @method ms
|
|
1447
|
+
* @param chatId The chat to send the contact to.
|
|
1448
|
+
* @param firstName The contact's first name.
|
|
1449
|
+
* @param number The contact's phone number.
|
|
1450
|
+
* @returns The sent contact.
|
|
1451
|
+
*/
|
|
1452
|
+
async sendContact(chatId, firstName, number, params) {
|
|
1453
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendContact(chatId, firstName, number, params);
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Send a dice.
|
|
1457
|
+
*
|
|
1458
|
+
* @method ms
|
|
1459
|
+
* @param chatId The chat to send the dice to.
|
|
1460
|
+
* @returns The sent dice.
|
|
1461
|
+
*/
|
|
1462
|
+
async sendDice(chatId, params) {
|
|
1463
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDice(chatId, params);
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Send a venue.
|
|
1467
|
+
*
|
|
1468
|
+
* @method ms
|
|
1469
|
+
* @param chatId The chat to send the venue to.
|
|
1470
|
+
* @param latitude The latitude of the venue.
|
|
1471
|
+
* @param longitude The longitude of the venue.
|
|
1472
|
+
* @param title The title of the venue.
|
|
1473
|
+
* @param address The written address of the venue.
|
|
1474
|
+
* @returns The sent venue.
|
|
1475
|
+
*/
|
|
1476
|
+
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
1477
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVenue(chatId, latitude, longitude, title, address, params);
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Send a poll.
|
|
1481
|
+
*
|
|
1482
|
+
* @method ms
|
|
1483
|
+
* @param chatId The chat to send the poll to.
|
|
1484
|
+
* @param question The poll's question.
|
|
1485
|
+
* @param options The poll's options.
|
|
1486
|
+
* @returns The sent poll.
|
|
1487
|
+
*/
|
|
1488
|
+
async sendPoll(chatId, question, options, params) {
|
|
1489
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPoll(chatId, question, options, params);
|
|
1490
|
+
}
|
|
1263
1491
|
/**
|
|
1264
1492
|
* Edit a message's text.
|
|
1265
1493
|
*
|
|
@@ -1356,82 +1584,87 @@ export class Client extends Composer {
|
|
|
1356
1584
|
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getMessage(chatId, messageId);
|
|
1357
1585
|
}
|
|
1358
1586
|
/**
|
|
1359
|
-
*
|
|
1587
|
+
* Delete multiple messages.
|
|
1360
1588
|
*
|
|
1361
|
-
* @method
|
|
1362
|
-
* @param
|
|
1363
|
-
* @
|
|
1364
|
-
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
1365
|
-
* await outFile.write(chunk);
|
|
1366
|
-
* }
|
|
1367
|
-
* ```
|
|
1368
|
-
* @returns A generator yielding the contents of the file.
|
|
1589
|
+
* @method ms
|
|
1590
|
+
* @param chatId The identifier of the chat that contains the messages.
|
|
1591
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
1369
1592
|
*/
|
|
1370
|
-
async
|
|
1371
|
-
|
|
1372
|
-
yield chunk;
|
|
1373
|
-
}
|
|
1593
|
+
async deleteMessages(chatId, messageIds, params) {
|
|
1594
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, messageIds, params);
|
|
1374
1595
|
}
|
|
1375
1596
|
/**
|
|
1376
|
-
*
|
|
1597
|
+
* Delete a single message.
|
|
1377
1598
|
*
|
|
1378
1599
|
* @method ms
|
|
1379
|
-
* @param
|
|
1380
|
-
* @param
|
|
1381
|
-
* @param messageIds The identifiers of the messages to forward.
|
|
1382
|
-
* @returns The forwarded messages.
|
|
1600
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1601
|
+
* @param messageId The identifier of the message to delete.
|
|
1383
1602
|
*/
|
|
1384
|
-
async
|
|
1385
|
-
|
|
1603
|
+
async deleteMessage(chatId, messageId, params) {
|
|
1604
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, [messageId], params);
|
|
1386
1605
|
}
|
|
1387
1606
|
/**
|
|
1388
|
-
*
|
|
1607
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
1389
1608
|
*
|
|
1390
1609
|
* @method ms
|
|
1391
|
-
* @param
|
|
1392
|
-
* @param
|
|
1393
|
-
* @param messageId The identifier of the message to forward.
|
|
1394
|
-
* @returns The forwarded message.
|
|
1610
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1611
|
+
* @param memberId The identifier of the member.
|
|
1395
1612
|
*/
|
|
1396
|
-
async
|
|
1397
|
-
|
|
1613
|
+
async deleteChatMemberMessages(chatId, memberId) {
|
|
1614
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatMemberMessages(chatId, memberId);
|
|
1398
1615
|
}
|
|
1399
1616
|
/**
|
|
1400
|
-
*
|
|
1617
|
+
* Pin a message in a chat.
|
|
1401
1618
|
*
|
|
1402
|
-
* @method
|
|
1619
|
+
* @method ms
|
|
1620
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1621
|
+
* @param messageId The message's identifier.
|
|
1403
1622
|
*/
|
|
1404
|
-
async
|
|
1405
|
-
|
|
1406
|
-
if (user_ == null) {
|
|
1407
|
-
const users = await this.api.users.getUsers({ id: [new types.InputUserSelf()] });
|
|
1408
|
-
user_ = users[0][as](types.User);
|
|
1409
|
-
await this.messageStorage.setEntity(user_);
|
|
1410
|
-
}
|
|
1411
|
-
const user = constructUser(user_);
|
|
1412
|
-
__classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
|
|
1413
|
-
return user;
|
|
1623
|
+
async pinMessage(chatId, messageId, params) {
|
|
1624
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").pinMessage(chatId, messageId, params);
|
|
1414
1625
|
}
|
|
1415
1626
|
/**
|
|
1416
|
-
*
|
|
1627
|
+
* Unpin a pinned message.
|
|
1417
1628
|
*
|
|
1418
|
-
* @method
|
|
1419
|
-
* @param
|
|
1629
|
+
* @method ms
|
|
1630
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
1631
|
+
* @param messageId The message's identifier.
|
|
1420
1632
|
*/
|
|
1421
|
-
async
|
|
1422
|
-
await __classPrivateFieldGet(this,
|
|
1633
|
+
async unpinMessage(chatId, messageId) {
|
|
1634
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessage(chatId, messageId);
|
|
1423
1635
|
}
|
|
1424
1636
|
/**
|
|
1425
|
-
*
|
|
1637
|
+
* Unpin all pinned messages.
|
|
1426
1638
|
*
|
|
1427
1639
|
* @method ms
|
|
1428
|
-
* @param chatId The
|
|
1429
|
-
* @param question The poll's question.
|
|
1430
|
-
* @param options The poll's options.
|
|
1431
|
-
* @returns The sent poll.
|
|
1640
|
+
* @param chatId The identifier of the chat.
|
|
1432
1641
|
*/
|
|
1433
|
-
async
|
|
1434
|
-
|
|
1642
|
+
async unpinMessages(chatId) {
|
|
1643
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessages(chatId);
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Forward multiple messages.
|
|
1647
|
+
*
|
|
1648
|
+
* @method ms
|
|
1649
|
+
* @param from The identifier of the chat to forward the messages from.
|
|
1650
|
+
* @param to The identifier of the chat to forward the messages to.
|
|
1651
|
+
* @param messageIds The identifiers of the messages to forward.
|
|
1652
|
+
* @returns The forwarded messages.
|
|
1653
|
+
*/
|
|
1654
|
+
async forwardMessages(from, to, messageIds, params) {
|
|
1655
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").forwardMessages(from, to, messageIds, params);
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Forward a single message.
|
|
1659
|
+
*
|
|
1660
|
+
* @method ms
|
|
1661
|
+
* @param from The identifier of the chat to forward the message from.
|
|
1662
|
+
* @param to The identifier of the chat to forward the message to.
|
|
1663
|
+
* @param messageId The identifier of the message to forward.
|
|
1664
|
+
* @returns The forwarded message.
|
|
1665
|
+
*/
|
|
1666
|
+
async forwardMessage(from, to, messageId, params) {
|
|
1667
|
+
return await this.forwardMessages(from, to, [messageId], params).then((v) => v[0]);
|
|
1435
1668
|
}
|
|
1436
1669
|
/**
|
|
1437
1670
|
* Stop a poll.
|
|
@@ -1456,446 +1689,393 @@ export class Client extends Composer {
|
|
|
1456
1689
|
await __classPrivateFieldGet(this, _Client_messageManager, "f").sendChatAction(chatId, action, params);
|
|
1457
1690
|
}
|
|
1458
1691
|
/**
|
|
1459
|
-
*
|
|
1460
|
-
*
|
|
1461
|
-
* @method fs
|
|
1462
|
-
* @param contents The contents of the file.
|
|
1463
|
-
* @returns The uploaded file.
|
|
1464
|
-
*/
|
|
1465
|
-
// deno-lint-ignore no-explicit-any
|
|
1466
|
-
async upload(contents, params) {
|
|
1467
|
-
return await __classPrivateFieldGet(this, _Client_fileManager, "f").upload(contents, params);
|
|
1468
|
-
}
|
|
1469
|
-
/**
|
|
1470
|
-
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1471
|
-
*
|
|
1472
|
-
* @method bs
|
|
1473
|
-
* @param commands The commands to set.
|
|
1474
|
-
*/
|
|
1475
|
-
async setMyCommands(commands, params) {
|
|
1476
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
|
|
1477
|
-
}
|
|
1478
|
-
/**
|
|
1479
|
-
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1480
|
-
*
|
|
1481
|
-
* @method bs
|
|
1482
|
-
* @returns The current bot's commands in the specified language.
|
|
1483
|
-
*/
|
|
1484
|
-
async getMyCommands(params) {
|
|
1485
|
-
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
|
|
1486
|
-
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Answer an inline query. Bot-only.
|
|
1489
|
-
*
|
|
1490
|
-
* @method iq
|
|
1491
|
-
* @param id The ID of the inline query to answer.
|
|
1492
|
-
* @param results The results to answer with.
|
|
1493
|
-
*/
|
|
1494
|
-
async answerInlineQuery(id, results, params) {
|
|
1495
|
-
await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
|
|
1496
|
-
}
|
|
1497
|
-
/**
|
|
1498
|
-
* Set the bot's description in the given language. Bot-only.
|
|
1499
|
-
*
|
|
1500
|
-
* @method bs
|
|
1501
|
-
*/
|
|
1502
|
-
async setMyDescription(params) {
|
|
1503
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
|
|
1504
|
-
}
|
|
1505
|
-
/**
|
|
1506
|
-
* Set the bot's name in the given language. Bot-only.
|
|
1507
|
-
*
|
|
1508
|
-
* @method bs
|
|
1509
|
-
*/
|
|
1510
|
-
async setMyName(params) {
|
|
1511
|
-
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
|
|
1512
|
-
}
|
|
1513
|
-
/**
|
|
1514
|
-
* Set the bot's short description in the given language. Bot-only.
|
|
1692
|
+
* Search the messages of a chat. User-only.
|
|
1515
1693
|
*
|
|
1516
|
-
* @method
|
|
1694
|
+
* @method ms
|
|
1695
|
+
* @param chatId The identifier of the chat to search the messages in.
|
|
1696
|
+
* @param query The message search query.
|
|
1517
1697
|
*/
|
|
1518
|
-
async
|
|
1519
|
-
await __classPrivateFieldGet(this,
|
|
1698
|
+
async searchMessages(chatId, query, params) {
|
|
1699
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
|
|
1520
1700
|
}
|
|
1701
|
+
//
|
|
1702
|
+
// ========================= FILES ========================= //
|
|
1703
|
+
//
|
|
1521
1704
|
/**
|
|
1522
|
-
*
|
|
1705
|
+
* Download a file.
|
|
1523
1706
|
*
|
|
1524
|
-
* @method
|
|
1525
|
-
* @
|
|
1707
|
+
* @method fs
|
|
1708
|
+
* @param fileId The identifier of the file to download.
|
|
1709
|
+
* @example ```ts
|
|
1710
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
1711
|
+
* await outFile.write(chunk);
|
|
1712
|
+
* }
|
|
1713
|
+
* ```
|
|
1714
|
+
* @returns A generator yielding the contents of the file.
|
|
1526
1715
|
*/
|
|
1527
|
-
async
|
|
1528
|
-
|
|
1716
|
+
async *download(fileId, params) {
|
|
1717
|
+
for await (const chunk of __classPrivateFieldGet(this, _Client_fileManager, "f").download(fileId, params)) {
|
|
1718
|
+
yield chunk;
|
|
1719
|
+
}
|
|
1529
1720
|
}
|
|
1530
1721
|
/**
|
|
1531
|
-
* Get
|
|
1722
|
+
* Get custom emoji documents for download.
|
|
1532
1723
|
*
|
|
1533
|
-
* @method
|
|
1534
|
-
* @
|
|
1724
|
+
* @method fs
|
|
1725
|
+
* @param id Identifier of one or more of custom emojis.
|
|
1726
|
+
* @returns The custom emoji documents.
|
|
1535
1727
|
*/
|
|
1536
|
-
async
|
|
1537
|
-
return await __classPrivateFieldGet(this,
|
|
1728
|
+
async getCustomEmojiStickers(id) {
|
|
1729
|
+
return await __classPrivateFieldGet(this, _Client_fileManager, "f").getCustomEmojiStickers(id);
|
|
1538
1730
|
}
|
|
1731
|
+
//
|
|
1732
|
+
// ========================= CHATS ========================= //
|
|
1733
|
+
//
|
|
1539
1734
|
/**
|
|
1540
|
-
* Get
|
|
1735
|
+
* Get chats from a chat list. User-only.
|
|
1541
1736
|
*
|
|
1542
|
-
* @method
|
|
1543
|
-
* @returns The current bot's short description in the specified language.
|
|
1737
|
+
* @method ch
|
|
1544
1738
|
*/
|
|
1545
|
-
async
|
|
1546
|
-
return await __classPrivateFieldGet(this,
|
|
1739
|
+
async getChats(params) {
|
|
1740
|
+
return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChats(params?.from, params?.after, params?.limit);
|
|
1547
1741
|
}
|
|
1548
1742
|
/**
|
|
1549
|
-
*
|
|
1743
|
+
* Get a chat.
|
|
1550
1744
|
*
|
|
1551
|
-
* @method
|
|
1552
|
-
* @param chatId The identifier of the chat that contains the messages.
|
|
1553
|
-
* @param messageIds The identifiers of the messages to delete.
|
|
1745
|
+
* @method ch
|
|
1554
1746
|
*/
|
|
1555
|
-
async
|
|
1556
|
-
await __classPrivateFieldGet(this,
|
|
1747
|
+
async getChat(chatId) {
|
|
1748
|
+
return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChat(chatId);
|
|
1557
1749
|
}
|
|
1558
1750
|
/**
|
|
1559
|
-
*
|
|
1751
|
+
* Get chat history. User-only.
|
|
1560
1752
|
*
|
|
1561
|
-
* @method
|
|
1562
|
-
* @param chatId The identifier of the chat
|
|
1563
|
-
* @param messageId The identifier of the message to delete.
|
|
1753
|
+
* @method ch
|
|
1754
|
+
* @param chatId The identifier of the chat to get its history.
|
|
1564
1755
|
*/
|
|
1565
|
-
async
|
|
1566
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1756
|
+
async getHistory(chatId, params) {
|
|
1757
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getHistory(chatId, params);
|
|
1567
1758
|
}
|
|
1568
1759
|
/**
|
|
1569
|
-
*
|
|
1760
|
+
* Set a chat's available reactions. User-only.
|
|
1570
1761
|
*
|
|
1571
|
-
* @method
|
|
1572
|
-
* @param chatId The
|
|
1573
|
-
* @param
|
|
1574
|
-
* @returns The sent photo.
|
|
1762
|
+
* @method ch
|
|
1763
|
+
* @param chatId The identifier of the chat.
|
|
1764
|
+
* @param availableReactions The new available reactions.
|
|
1575
1765
|
*/
|
|
1576
|
-
async
|
|
1577
|
-
|
|
1766
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
1767
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setAvailableReactions(chatId, availableReactions);
|
|
1578
1768
|
}
|
|
1579
1769
|
/**
|
|
1580
|
-
*
|
|
1770
|
+
* Set a chat's photo.
|
|
1581
1771
|
*
|
|
1582
|
-
* @method
|
|
1583
|
-
* @param chatId The
|
|
1584
|
-
* @param
|
|
1585
|
-
* @returns The sent document.
|
|
1772
|
+
* @method ch
|
|
1773
|
+
* @param chatId The identifier of the chat.
|
|
1774
|
+
* @param photo A photo to set as the chat's photo.
|
|
1586
1775
|
*/
|
|
1587
|
-
async
|
|
1588
|
-
|
|
1776
|
+
async setChatPhoto(chatId, photo, params) {
|
|
1777
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatPhoto(chatId, photo, params);
|
|
1589
1778
|
}
|
|
1590
1779
|
/**
|
|
1591
|
-
*
|
|
1780
|
+
* Delete a chat's photo.
|
|
1592
1781
|
*
|
|
1593
|
-
* @method
|
|
1594
|
-
* @param chatId The
|
|
1595
|
-
* @param document The sticker to send.
|
|
1596
|
-
* @returns The sent sticker.
|
|
1782
|
+
* @method ch
|
|
1783
|
+
* @param chatId The identifier of the chat.
|
|
1597
1784
|
*/
|
|
1598
|
-
async
|
|
1599
|
-
|
|
1785
|
+
async deleteChatPhoto(chatId) {
|
|
1786
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatPhoto(chatId);
|
|
1600
1787
|
}
|
|
1601
1788
|
/**
|
|
1602
|
-
*
|
|
1789
|
+
* Ban a member from a chat.
|
|
1603
1790
|
*
|
|
1604
|
-
* @method
|
|
1605
|
-
* @param chatId The
|
|
1606
|
-
* @param
|
|
1607
|
-
* @returns The sent video.
|
|
1791
|
+
* @method ch
|
|
1792
|
+
* @param chatId The identifier of the chat.
|
|
1793
|
+
* @param memberId The identifier of the member.
|
|
1608
1794
|
*/
|
|
1609
|
-
async
|
|
1610
|
-
|
|
1795
|
+
async banChatMember(chatId, memberId, params) {
|
|
1796
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId, params);
|
|
1611
1797
|
}
|
|
1612
1798
|
/**
|
|
1613
|
-
*
|
|
1799
|
+
* Unban a member from a chat.
|
|
1614
1800
|
*
|
|
1615
|
-
* @method
|
|
1616
|
-
* @param chatId The chat
|
|
1617
|
-
* @param
|
|
1618
|
-
* @returns The sent animation.
|
|
1801
|
+
* @method ch
|
|
1802
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1803
|
+
* @param memberId The identifier of the member.
|
|
1619
1804
|
*/
|
|
1620
|
-
async
|
|
1621
|
-
|
|
1805
|
+
async unbanChatMember(chatId, memberId) {
|
|
1806
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
1622
1807
|
}
|
|
1623
1808
|
/**
|
|
1624
|
-
*
|
|
1809
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
1625
1810
|
*
|
|
1626
|
-
* @method
|
|
1627
|
-
* @param chatId The
|
|
1628
|
-
* @param
|
|
1629
|
-
* @returns The sent voice message.
|
|
1811
|
+
* @method ch
|
|
1812
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1813
|
+
* @param memberId The identifier of the member.
|
|
1630
1814
|
*/
|
|
1631
|
-
async
|
|
1632
|
-
|
|
1815
|
+
async kickChatMember(chatId, memberId) {
|
|
1816
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId);
|
|
1817
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
1633
1818
|
}
|
|
1634
1819
|
/**
|
|
1635
|
-
*
|
|
1820
|
+
* Set the rights of a chat member.
|
|
1636
1821
|
*
|
|
1637
|
-
* @method
|
|
1638
|
-
* @param chatId The
|
|
1639
|
-
* @param
|
|
1640
|
-
* @returns The sent audio filr.
|
|
1822
|
+
* @method ch
|
|
1823
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1824
|
+
* @param memberId The identifier of a member.
|
|
1641
1825
|
*/
|
|
1642
|
-
async
|
|
1643
|
-
|
|
1826
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
1827
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatMemberRights(chatId, memberId, params);
|
|
1644
1828
|
}
|
|
1645
1829
|
/**
|
|
1646
|
-
*
|
|
1830
|
+
* Get the administrators of a chat.
|
|
1647
1831
|
*
|
|
1648
|
-
* @method
|
|
1649
|
-
* @param chatId The
|
|
1650
|
-
* @
|
|
1651
|
-
* @returns The sent video note.
|
|
1832
|
+
* @method ch
|
|
1833
|
+
* @param chatId The identifier of the chat.
|
|
1834
|
+
* @returns The chat's administrators.
|
|
1652
1835
|
*/
|
|
1653
|
-
async
|
|
1654
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1836
|
+
async getChatAdministrators(chatId) {
|
|
1837
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatAdministrators(chatId);
|
|
1655
1838
|
}
|
|
1656
1839
|
/**
|
|
1657
|
-
*
|
|
1840
|
+
* Enable join requests in a chat. User-only.
|
|
1658
1841
|
*
|
|
1659
|
-
* @method
|
|
1660
|
-
* @param chatId The chat
|
|
1661
|
-
* @param latitude The location's latitude.
|
|
1662
|
-
* @param longitude The location's longitude.
|
|
1663
|
-
* @returns The sent location.
|
|
1842
|
+
* @method ch
|
|
1843
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
1664
1844
|
*/
|
|
1665
|
-
async
|
|
1666
|
-
|
|
1845
|
+
async enableJoinRequests(chatId) {
|
|
1846
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
|
|
1667
1847
|
}
|
|
1668
1848
|
/**
|
|
1669
|
-
*
|
|
1849
|
+
* Disable join requests in a chat. User-only.
|
|
1670
1850
|
*
|
|
1671
|
-
* @method
|
|
1672
|
-
* @param chatId The chat
|
|
1673
|
-
* @param firstName The contact's first name.
|
|
1674
|
-
* @param number The contact's phone number.
|
|
1675
|
-
* @returns The sent contact.
|
|
1851
|
+
* @method ch
|
|
1852
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
1676
1853
|
*/
|
|
1677
|
-
async
|
|
1678
|
-
|
|
1854
|
+
async disableJoinRequests(chatId) {
|
|
1855
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
|
|
1679
1856
|
}
|
|
1680
1857
|
/**
|
|
1681
|
-
*
|
|
1858
|
+
* Get inactive chats. User-only.
|
|
1682
1859
|
*
|
|
1683
|
-
* @method
|
|
1684
|
-
* @
|
|
1685
|
-
* @returns The sent dice.
|
|
1860
|
+
* @method ch
|
|
1861
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
1686
1862
|
*/
|
|
1687
|
-
async
|
|
1688
|
-
return await __classPrivateFieldGet(this,
|
|
1863
|
+
async getInactiveChats() {
|
|
1864
|
+
return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
|
|
1689
1865
|
}
|
|
1690
1866
|
/**
|
|
1691
|
-
*
|
|
1867
|
+
* Get the invite links created for a chat. User-only.
|
|
1692
1868
|
*
|
|
1693
|
-
* @method
|
|
1694
|
-
* @param chatId The
|
|
1695
|
-
* @
|
|
1696
|
-
* @param longitude The longitude of the venue.
|
|
1697
|
-
* @param title The title of the venue.
|
|
1698
|
-
* @param address The written address of the venue.
|
|
1699
|
-
* @returns The sent venue.
|
|
1869
|
+
* @method ch
|
|
1870
|
+
* @param chatId The identifier of the chat.
|
|
1871
|
+
* @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.
|
|
1700
1872
|
*/
|
|
1701
|
-
async
|
|
1702
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1873
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
1874
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
|
|
1703
1875
|
}
|
|
1704
1876
|
/**
|
|
1705
|
-
*
|
|
1877
|
+
* Join a chat. User-only.
|
|
1706
1878
|
*
|
|
1707
|
-
* @method
|
|
1879
|
+
* @method ch
|
|
1880
|
+
* @param chatId The identifier of the chat to join.
|
|
1708
1881
|
*/
|
|
1709
|
-
async
|
|
1710
|
-
|
|
1882
|
+
async joinChat(chatId) {
|
|
1883
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
|
|
1711
1884
|
}
|
|
1712
1885
|
/**
|
|
1713
|
-
*
|
|
1886
|
+
* Leave a chat.
|
|
1714
1887
|
*
|
|
1715
1888
|
* @method ch
|
|
1889
|
+
* @param chatId The identifier of the chat to leave.
|
|
1716
1890
|
*/
|
|
1717
|
-
async
|
|
1718
|
-
|
|
1891
|
+
async leaveChat(chatId) {
|
|
1892
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").leaveChat(chatId);
|
|
1719
1893
|
}
|
|
1720
1894
|
/**
|
|
1721
|
-
* Get a chat.
|
|
1895
|
+
* Get information on a user's chat membership.
|
|
1722
1896
|
*
|
|
1723
1897
|
* @method ch
|
|
1898
|
+
* @param chatId The identifier of a chat that includes the user.
|
|
1899
|
+
* @param userId The identifier of the user.
|
|
1724
1900
|
*/
|
|
1725
|
-
async
|
|
1726
|
-
return await __classPrivateFieldGet(this,
|
|
1901
|
+
async getChatMember(chatId, userId) {
|
|
1902
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
|
|
1727
1903
|
}
|
|
1728
1904
|
/**
|
|
1729
|
-
*
|
|
1905
|
+
* Set a chat's sticker set.
|
|
1730
1906
|
*
|
|
1731
1907
|
* @method ch
|
|
1732
|
-
* @param chatId The identifier of the chat
|
|
1908
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1909
|
+
* @param setName The name of the set.
|
|
1733
1910
|
*/
|
|
1734
|
-
async
|
|
1735
|
-
|
|
1911
|
+
async setChatStickerSet(chatId, setName) {
|
|
1912
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
|
|
1736
1913
|
}
|
|
1737
1914
|
/**
|
|
1738
|
-
*
|
|
1915
|
+
* Delete a chat's sticker set.
|
|
1739
1916
|
*
|
|
1740
|
-
* @method
|
|
1741
|
-
* @param
|
|
1742
|
-
* @returns The custom emoji documents.
|
|
1917
|
+
* @method ch
|
|
1918
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1743
1919
|
*/
|
|
1744
|
-
async
|
|
1745
|
-
|
|
1920
|
+
async deleteChatStickerSet(chatId) {
|
|
1921
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
|
|
1746
1922
|
}
|
|
1747
1923
|
/**
|
|
1748
|
-
* Set a chat's
|
|
1924
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
1749
1925
|
*
|
|
1750
1926
|
* @method ch
|
|
1751
1927
|
* @param chatId The identifier of the chat.
|
|
1752
|
-
* @param
|
|
1928
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
1753
1929
|
*/
|
|
1754
|
-
async
|
|
1755
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1930
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
1931
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
1756
1932
|
}
|
|
1757
1933
|
/**
|
|
1758
|
-
*
|
|
1934
|
+
* Create an invite link.
|
|
1759
1935
|
*
|
|
1760
|
-
* @method
|
|
1761
|
-
* @param chatId The identifier of the chat
|
|
1762
|
-
* @
|
|
1763
|
-
* @param reactions The new reactions.
|
|
1936
|
+
* @method ch
|
|
1937
|
+
* @param chatId The identifier of the chat to create the invite link for.
|
|
1938
|
+
* @returns The newly created invite link.
|
|
1764
1939
|
*/
|
|
1765
|
-
async
|
|
1766
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1940
|
+
async createInviteLink(chatId, params) {
|
|
1941
|
+
return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
|
|
1767
1942
|
}
|
|
1943
|
+
//
|
|
1944
|
+
// ========================= CALLBACK QUERIES ========================= //
|
|
1945
|
+
//
|
|
1768
1946
|
/**
|
|
1769
|
-
*
|
|
1947
|
+
* Answer a callback query. Bot-only.
|
|
1770
1948
|
*
|
|
1771
|
-
* @method
|
|
1772
|
-
* @param
|
|
1773
|
-
* @param messageId The identifier of the message to add the reaction to.
|
|
1774
|
-
* @param reaction The reaction to add.
|
|
1949
|
+
* @method cq
|
|
1950
|
+
* @param id ID of the callback query to answer.
|
|
1775
1951
|
*/
|
|
1776
|
-
async
|
|
1777
|
-
await __classPrivateFieldGet(this,
|
|
1952
|
+
async answerCallbackQuery(id, params) {
|
|
1953
|
+
await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").answerCallbackQuery(id, params);
|
|
1778
1954
|
}
|
|
1955
|
+
//
|
|
1956
|
+
// ========================= INLINE QUERIES ========================= //
|
|
1957
|
+
//
|
|
1779
1958
|
/**
|
|
1780
|
-
*
|
|
1959
|
+
* Answer an inline query. Bot-only.
|
|
1781
1960
|
*
|
|
1782
|
-
* @method
|
|
1783
|
-
* @param
|
|
1784
|
-
* @param
|
|
1785
|
-
* @param reaction The reaction to remove.
|
|
1961
|
+
* @method iq
|
|
1962
|
+
* @param id The ID of the inline query to answer.
|
|
1963
|
+
* @param results The results to answer with.
|
|
1786
1964
|
*/
|
|
1787
|
-
async
|
|
1788
|
-
await __classPrivateFieldGet(this,
|
|
1965
|
+
async answerInlineQuery(id, results, params) {
|
|
1966
|
+
await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
|
|
1789
1967
|
}
|
|
1968
|
+
//
|
|
1969
|
+
// ========================= BOTS ========================= //
|
|
1970
|
+
//
|
|
1790
1971
|
/**
|
|
1791
|
-
* Set
|
|
1972
|
+
* Set the bot's description in the given language. Bot-only.
|
|
1792
1973
|
*
|
|
1793
|
-
* @method
|
|
1794
|
-
* @param chatId The identifier of the chat.
|
|
1795
|
-
* @param photo A photo to set as the chat's photo.
|
|
1974
|
+
* @method bs
|
|
1796
1975
|
*/
|
|
1797
|
-
async
|
|
1798
|
-
await __classPrivateFieldGet(this,
|
|
1976
|
+
async setMyDescription(params) {
|
|
1977
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
|
|
1799
1978
|
}
|
|
1800
1979
|
/**
|
|
1801
|
-
*
|
|
1980
|
+
* Set the bot's name in the given language. Bot-only.
|
|
1802
1981
|
*
|
|
1803
|
-
* @method
|
|
1804
|
-
* @param chatId The identifier of the chat.
|
|
1982
|
+
* @method bs
|
|
1805
1983
|
*/
|
|
1806
|
-
async
|
|
1807
|
-
await __classPrivateFieldGet(this,
|
|
1984
|
+
async setMyName(params) {
|
|
1985
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
|
|
1808
1986
|
}
|
|
1809
1987
|
/**
|
|
1810
|
-
*
|
|
1988
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
1811
1989
|
*
|
|
1812
|
-
* @method
|
|
1813
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1814
|
-
* @param memberId The identifier of the member.
|
|
1990
|
+
* @method bs
|
|
1815
1991
|
*/
|
|
1816
|
-
async
|
|
1817
|
-
await __classPrivateFieldGet(this,
|
|
1992
|
+
async setMyShortDescription(params) {
|
|
1993
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyShortDescription(params);
|
|
1818
1994
|
}
|
|
1819
1995
|
/**
|
|
1820
|
-
*
|
|
1996
|
+
* Get the bot's description in the given language. Bot-only.
|
|
1821
1997
|
*
|
|
1822
|
-
* @method
|
|
1823
|
-
* @
|
|
1824
|
-
* @param messageId The message's identifier.
|
|
1998
|
+
* @method bs
|
|
1999
|
+
* @returns The current bot's description in the specified language.
|
|
1825
2000
|
*/
|
|
1826
|
-
async
|
|
1827
|
-
await __classPrivateFieldGet(this,
|
|
2001
|
+
async getMyDescription(params) {
|
|
2002
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyDescription(params);
|
|
1828
2003
|
}
|
|
1829
2004
|
/**
|
|
1830
|
-
*
|
|
2005
|
+
* Get the bot's name in the given language. Bot-only.
|
|
1831
2006
|
*
|
|
1832
|
-
* @method
|
|
1833
|
-
* @
|
|
1834
|
-
* @param messageId The message's identifier.
|
|
2007
|
+
* @method bs
|
|
2008
|
+
* @returns The current bot's name in the specified language.
|
|
1835
2009
|
*/
|
|
1836
|
-
async
|
|
1837
|
-
await __classPrivateFieldGet(this,
|
|
2010
|
+
async getMyName(params) {
|
|
2011
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyName(params);
|
|
1838
2012
|
}
|
|
1839
2013
|
/**
|
|
1840
|
-
*
|
|
2014
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
1841
2015
|
*
|
|
1842
|
-
* @method
|
|
1843
|
-
* @
|
|
2016
|
+
* @method bs
|
|
2017
|
+
* @returns The current bot's short description in the specified language.
|
|
1844
2018
|
*/
|
|
1845
|
-
async
|
|
1846
|
-
await __classPrivateFieldGet(this,
|
|
2019
|
+
async getMyShortDescription(params) {
|
|
2020
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyShortDescription(params);
|
|
1847
2021
|
}
|
|
1848
2022
|
/**
|
|
1849
|
-
*
|
|
2023
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1850
2024
|
*
|
|
1851
|
-
* @method
|
|
1852
|
-
* @param
|
|
1853
|
-
* @param memberId The identifier of the member.
|
|
2025
|
+
* @method bs
|
|
2026
|
+
* @param commands The commands to set.
|
|
1854
2027
|
*/
|
|
1855
|
-
async
|
|
1856
|
-
await __classPrivateFieldGet(this,
|
|
2028
|
+
async setMyCommands(commands, params) {
|
|
2029
|
+
await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
|
|
1857
2030
|
}
|
|
1858
2031
|
/**
|
|
1859
|
-
*
|
|
2032
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1860
2033
|
*
|
|
1861
|
-
* @method
|
|
1862
|
-
* @
|
|
1863
|
-
* @param memberId The identifier of the member.
|
|
2034
|
+
* @method bs
|
|
2035
|
+
* @returns The current bot's commands in the specified language.
|
|
1864
2036
|
*/
|
|
1865
|
-
async
|
|
1866
|
-
await __classPrivateFieldGet(this,
|
|
2037
|
+
async getMyCommands(params) {
|
|
2038
|
+
return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
|
|
1867
2039
|
}
|
|
2040
|
+
//
|
|
2041
|
+
// ========================= REACTIONS ========================= //
|
|
2042
|
+
//
|
|
1868
2043
|
/**
|
|
1869
|
-
*
|
|
2044
|
+
* Change reactions made to a message.
|
|
1870
2045
|
*
|
|
1871
|
-
* @method
|
|
1872
|
-
* @param chatId The identifier of the chat
|
|
1873
|
-
* @param
|
|
2046
|
+
* @method re
|
|
2047
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2048
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
2049
|
+
* @param reactions The new reactions.
|
|
1874
2050
|
*/
|
|
1875
|
-
async
|
|
1876
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
1877
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
|
|
2051
|
+
async setReactions(chatId, messageId, reactions, params) {
|
|
2052
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").setReactions(chatId, messageId, reactions, params);
|
|
1878
2053
|
}
|
|
1879
2054
|
/**
|
|
1880
|
-
*
|
|
2055
|
+
* Make a reaction to a message.
|
|
1881
2056
|
*
|
|
1882
|
-
* @method
|
|
1883
|
-
* @param chatId The identifier of the chat
|
|
1884
|
-
* @param
|
|
2057
|
+
* @method re
|
|
2058
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2059
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
2060
|
+
* @param reaction The reaction to add.
|
|
1885
2061
|
*/
|
|
1886
|
-
async
|
|
1887
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").
|
|
2062
|
+
async addReaction(chatId, messageId, reaction, params) {
|
|
2063
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").addReaction(chatId, messageId, reaction, params);
|
|
1888
2064
|
}
|
|
1889
2065
|
/**
|
|
1890
|
-
*
|
|
2066
|
+
* Undo a reaction made to a message.
|
|
1891
2067
|
*
|
|
1892
|
-
* @method
|
|
1893
|
-
* @param chatId The identifier of the chat.
|
|
1894
|
-
* @
|
|
2068
|
+
* @method re
|
|
2069
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2070
|
+
* @param messageId The identifier of the message which the reaction was made to.
|
|
2071
|
+
* @param reaction The reaction to remove.
|
|
1895
2072
|
*/
|
|
1896
|
-
async
|
|
1897
|
-
|
|
2073
|
+
async removeReaction(chatId, messageId, reaction) {
|
|
2074
|
+
await __classPrivateFieldGet(this, _Client_messageManager, "f").removeReaction(chatId, messageId, reaction);
|
|
1898
2075
|
}
|
|
2076
|
+
//
|
|
2077
|
+
// ========================= STORIES ========================= //
|
|
2078
|
+
//
|
|
1899
2079
|
/**
|
|
1900
2080
|
* Create a story. User-only.
|
|
1901
2081
|
*
|
|
@@ -1990,130 +2170,16 @@ export class Client extends Composer {
|
|
|
1990
2170
|
async removeStoryFromHighlights(chatId, storyId) {
|
|
1991
2171
|
await __classPrivateFieldGet(this, _Client_storyManager, "f").removeStoryFromHighlights(chatId, storyId);
|
|
1992
2172
|
}
|
|
2173
|
+
//
|
|
2174
|
+
// ========================= MISC ========================= //
|
|
2175
|
+
//
|
|
1993
2176
|
/**
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
1996
|
-
* @method ch
|
|
1997
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
1998
|
-
*/
|
|
1999
|
-
async enableJoinRequests(chatId) {
|
|
2000
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
|
|
2001
|
-
}
|
|
2002
|
-
/**
|
|
2003
|
-
* Disable join requests in a chat. User-only.
|
|
2004
|
-
*
|
|
2005
|
-
* @method ch
|
|
2006
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
2007
|
-
*/
|
|
2008
|
-
async disableJoinRequests(chatId) {
|
|
2009
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
|
|
2010
|
-
}
|
|
2011
|
-
/**
|
|
2012
|
-
* Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
|
|
2013
|
-
*
|
|
2014
|
-
* @method ac
|
|
2015
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2016
|
-
* @param username The username to show.
|
|
2017
|
-
*/
|
|
2018
|
-
async showUsername(id, username) {
|
|
2019
|
-
await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
|
|
2020
|
-
}
|
|
2021
|
-
/**
|
|
2022
|
-
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
2023
|
-
*
|
|
2024
|
-
* @method ac
|
|
2025
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2026
|
-
* @param username The username to hide.
|
|
2027
|
-
*/
|
|
2028
|
-
async hideUsername(id, username) {
|
|
2029
|
-
await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
2033
|
-
*
|
|
2034
|
-
* @method ac
|
|
2035
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
2036
|
-
* @param order The new order to use.
|
|
2037
|
-
* @returns Whether the order was changed.
|
|
2038
|
-
*/
|
|
2039
|
-
async reorderUsernames(id, order) {
|
|
2040
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
|
|
2041
|
-
}
|
|
2042
|
-
/**
|
|
2043
|
-
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
2044
|
-
*
|
|
2045
|
-
* @method ac
|
|
2046
|
-
* @param id A supergroup ID or a channel ID.
|
|
2047
|
-
*/
|
|
2048
|
-
async hideUsernames(id) {
|
|
2049
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
|
|
2050
|
-
}
|
|
2051
|
-
/**
|
|
2052
|
-
* Get inactive chats. User-only.
|
|
2053
|
-
*
|
|
2054
|
-
* @method ch
|
|
2055
|
-
* @retuns A list of inactive chats the current user is member of.
|
|
2056
|
-
*/
|
|
2057
|
-
async getInactiveChats() {
|
|
2058
|
-
return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
|
|
2059
|
-
}
|
|
2060
|
-
/**
|
|
2061
|
-
* Search the messages of a chat. User-only.
|
|
2062
|
-
*
|
|
2063
|
-
* @method ms
|
|
2064
|
-
* @param chatId The identifier of the chat to search the messages in.
|
|
2065
|
-
* @param query The message search query.
|
|
2066
|
-
*/
|
|
2067
|
-
async searchMessages(chatId, query, params) {
|
|
2068
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
|
|
2069
|
-
}
|
|
2070
|
-
/**
|
|
2071
|
-
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
2072
|
-
*
|
|
2073
|
-
* @method ch
|
|
2074
|
-
* @param chatId The identifier of the chat.
|
|
2075
|
-
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
2076
|
-
*/
|
|
2077
|
-
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
2078
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
2079
|
-
}
|
|
2080
|
-
/**
|
|
2081
|
-
* Create an invite link.
|
|
2082
|
-
*
|
|
2083
|
-
* @method ch
|
|
2084
|
-
* @param chatId The identifier of the chat to create the invite link for.
|
|
2085
|
-
* @returns The newly created invite link.
|
|
2086
|
-
*/
|
|
2087
|
-
async createInviteLink(chatId, params) {
|
|
2088
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
|
|
2089
|
-
}
|
|
2090
|
-
/**
|
|
2091
|
-
* Get the invite links created for a chat. User-only.
|
|
2092
|
-
*
|
|
2093
|
-
* @method ch
|
|
2094
|
-
* @param chatId The identifier of the chat.
|
|
2095
|
-
* @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.
|
|
2096
|
-
*/
|
|
2097
|
-
async getCreatedInviteLinks(chatId, params) {
|
|
2098
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
|
|
2099
|
-
}
|
|
2100
|
-
/**
|
|
2101
|
-
* Join a chat. User-only.
|
|
2102
|
-
*
|
|
2103
|
-
* @method ch
|
|
2104
|
-
* @param chatId The identifier of the chat to join.
|
|
2105
|
-
*/
|
|
2106
|
-
async joinChat(chatId) {
|
|
2107
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
|
|
2108
|
-
}
|
|
2109
|
-
/**
|
|
2110
|
-
* Leave a chat.
|
|
2177
|
+
* Get network statistics. This might not always be available.
|
|
2111
2178
|
*
|
|
2112
|
-
* @method
|
|
2113
|
-
* @param chatId The identifier of the chat to leave.
|
|
2179
|
+
* @method mc
|
|
2114
2180
|
*/
|
|
2115
|
-
async
|
|
2116
|
-
await __classPrivateFieldGet(this,
|
|
2181
|
+
async getNetworkStatistics() {
|
|
2182
|
+
return await __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f").getNetworkStatistics();
|
|
2117
2183
|
}
|
|
2118
2184
|
/**
|
|
2119
2185
|
* Block a user. User-only.
|
|
@@ -2133,35 +2199,6 @@ export class Client extends Composer {
|
|
|
2133
2199
|
async unblockUser(userId) {
|
|
2134
2200
|
await __classPrivateFieldGet(this, _Client_messageManager, "f").unblockUser(userId);
|
|
2135
2201
|
}
|
|
2136
|
-
/**
|
|
2137
|
-
* Get information on a user's chat membership.
|
|
2138
|
-
*
|
|
2139
|
-
* @method ch
|
|
2140
|
-
* @param chatId The identifier of a chat that includes the user.
|
|
2141
|
-
* @param userId The identifier of the user.
|
|
2142
|
-
*/
|
|
2143
|
-
async getChatMember(chatId, userId) {
|
|
2144
|
-
return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
|
|
2145
|
-
}
|
|
2146
|
-
/**
|
|
2147
|
-
* Set a chat's sticker set.
|
|
2148
|
-
*
|
|
2149
|
-
* @method ch
|
|
2150
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
2151
|
-
* @param setName The name of the set.
|
|
2152
|
-
*/
|
|
2153
|
-
async setChatStickerSet(chatId, setName) {
|
|
2154
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
|
|
2155
|
-
}
|
|
2156
|
-
/**
|
|
2157
|
-
* Delete a chat's sticker set.
|
|
2158
|
-
*
|
|
2159
|
-
* @method ch
|
|
2160
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
2161
|
-
*/
|
|
2162
|
-
async deleteChatStickerSet(chatId) {
|
|
2163
|
-
await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
|
|
2164
|
-
}
|
|
2165
2202
|
}
|
|
2166
2203
|
_Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
2167
2204
|
await this.middleware()(await __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, update), resolve);
|
|
@@ -2221,6 +2258,9 @@ _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
|
|
|
2221
2258
|
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd));
|
|
2222
2259
|
}
|
|
2223
2260
|
}
|
|
2261
|
+
if (BusinessConnectionManager.canHandleUpdate(update)) {
|
|
2262
|
+
promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
|
|
2263
|
+
}
|
|
2224
2264
|
return () => Promise.all(promises);
|
|
2225
2265
|
}, _Client_getMe = async function _Client_getMe() {
|
|
2226
2266
|
if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {
|