@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
|
@@ -2,9 +2,9 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { enums, functions, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { BotCommand, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
|
|
5
|
+
import { BotCommand, BusinessConnection, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
|
-
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams
|
|
7
|
+
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams } from "./0_params.js";
|
|
8
8
|
import { Api } from "./0_types.js";
|
|
9
9
|
import { ClientPlainParams } from "./1_client_plain.js";
|
|
10
10
|
import { Composer as Composer_, NextFunction } from "./1_composer.js";
|
|
@@ -21,34 +21,35 @@ export interface Context {
|
|
|
21
21
|
from?: User;
|
|
22
22
|
/** Resolves to `msg?.senderChat`. */
|
|
23
23
|
senderChat?: ChatP;
|
|
24
|
+
toJSON: () => Update;
|
|
24
25
|
/** Context-aware alias for `client.sendMessage()`. */
|
|
25
|
-
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<MessageText>;
|
|
26
|
+
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageText>;
|
|
26
27
|
/** Context-aware alias for `client.sendPoll()`. */
|
|
27
|
-
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePoll>;
|
|
28
|
+
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePoll>;
|
|
28
29
|
/** Context-aware alias for `client.sendPhoto()`. */
|
|
29
|
-
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePhoto>;
|
|
30
|
+
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePhoto>;
|
|
30
31
|
/** Context-aware alias for `client.sendDocument()`. */
|
|
31
|
-
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDocument>;
|
|
32
|
+
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDocument>;
|
|
32
33
|
/** Context-aware alias for `client.sendSticker()`. */
|
|
33
|
-
replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId"> & ReplyParams) => Promise<MessageSticker>;
|
|
34
|
+
replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageSticker>;
|
|
34
35
|
/** Context-aware alias for `client.sendLocation()`. */
|
|
35
|
-
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageLocation>;
|
|
36
|
+
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageLocation>;
|
|
36
37
|
/** Context-aware alias for `client.sendDice()`. */
|
|
37
|
-
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDice>;
|
|
38
|
+
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDice>;
|
|
38
39
|
/** Context-aware alias for `client.sendVenue()`. */
|
|
39
|
-
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVenue>;
|
|
40
|
+
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVenue>;
|
|
40
41
|
/** Context-aware alias for `client.sendContact()`. */
|
|
41
|
-
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<MessageContact>;
|
|
42
|
+
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageContact>;
|
|
42
43
|
/** Context-aware alias for `client.sendVideo()`. */
|
|
43
|
-
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideo>;
|
|
44
|
+
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideo>;
|
|
44
45
|
/** Context-aware alias for `client.sendAnimation()`. */
|
|
45
|
-
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAnimation>;
|
|
46
|
+
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAnimation>;
|
|
46
47
|
/** Context-aware alias for `client.sendVoice()`. */
|
|
47
|
-
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVoice>;
|
|
48
|
+
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVoice>;
|
|
48
49
|
/** Context-aware alias for `client.sendAudio()`. */
|
|
49
|
-
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAudio>;
|
|
50
|
+
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAudio>;
|
|
50
51
|
/** Context-aware alias for `client.sendPoll()`. */
|
|
51
|
-
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideoNote>;
|
|
52
|
+
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideoNote>;
|
|
52
53
|
/** Context-aware alias for `client.deleteMessage()`. */
|
|
53
54
|
delete: () => Promise<void>;
|
|
54
55
|
/** Context-aware alias for `client.forwardMessage()`. */
|
|
@@ -147,7 +148,8 @@ export interface Context {
|
|
|
147
148
|
setChatStickerSet: (setName: string) => Promise<void>;
|
|
148
149
|
/** Context-aware alias for `client.deleteChatStickerSet()`. */
|
|
149
150
|
deleteChatStickerSet: () => Promise<void>;
|
|
150
|
-
|
|
151
|
+
/** Context-aware alias for `client.getBusinessConnection()`. */
|
|
152
|
+
getBusinessConnection: () => Promise<BusinessConnection>;
|
|
151
153
|
}
|
|
152
154
|
export declare class Composer<C extends Context = Context> extends Composer_<C> {
|
|
153
155
|
}
|
|
@@ -233,27 +235,24 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
233
235
|
[handleMigrationError](err: Migrate): Promise<void>;
|
|
234
236
|
disconnect(): Promise<void>;
|
|
235
237
|
/**
|
|
236
|
-
*
|
|
238
|
+
* Authorizes the client with one of the following:
|
|
237
239
|
*
|
|
238
240
|
* - Bot token (`string`)
|
|
239
|
-
* - Exported authorization (`types.AuthExportedAuthorization`)
|
|
240
241
|
* - User authorization handlers (`AuthorizeUserParams`)
|
|
241
242
|
*
|
|
242
|
-
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](
|
|
243
|
+
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
|
|
243
244
|
*
|
|
244
245
|
* Notes:
|
|
245
246
|
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
246
247
|
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
247
|
-
* 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
|
|
248
248
|
*
|
|
249
|
-
* [1]: https://core.telegram.org/method/
|
|
250
|
-
* [2]: https://core.telegram.org/method/updates.getState
|
|
249
|
+
* [1]: https://core.telegram.org/method/updates.getState
|
|
251
250
|
*/
|
|
252
|
-
authorize(params?: string |
|
|
251
|
+
authorize(params?: string | AuthorizeUserParams): Promise<void>;
|
|
253
252
|
/**
|
|
254
253
|
* Same as calling `.connect()` followed by `.authorize(params)`.
|
|
255
254
|
*/
|
|
256
|
-
start(params?: string |
|
|
255
|
+
start(params?: string | AuthorizeUserParams): Promise<void>;
|
|
257
256
|
/**
|
|
258
257
|
* Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
|
|
259
258
|
* to be connected.
|
|
@@ -294,6 +293,51 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
294
293
|
private [getEntity];
|
|
295
294
|
private [getEntity];
|
|
296
295
|
private [getEntity];
|
|
296
|
+
/**
|
|
297
|
+
* Get information on the currently authorized user.
|
|
298
|
+
*
|
|
299
|
+
* @method ac
|
|
300
|
+
*/
|
|
301
|
+
getMe(): Promise<User>;
|
|
302
|
+
/**
|
|
303
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
304
|
+
*
|
|
305
|
+
* @method ac
|
|
306
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
307
|
+
* @param username The username to show.
|
|
308
|
+
*/
|
|
309
|
+
showUsername(id: ID, username: string): Promise<void>;
|
|
310
|
+
/**
|
|
311
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
312
|
+
*
|
|
313
|
+
* @method ac
|
|
314
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
315
|
+
* @param username The username to hide.
|
|
316
|
+
*/
|
|
317
|
+
hideUsername(id: ID, username: string): Promise<void>;
|
|
318
|
+
/**
|
|
319
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
320
|
+
*
|
|
321
|
+
* @method ac
|
|
322
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
323
|
+
* @param order The new order to use.
|
|
324
|
+
* @returns Whether the order was changed.
|
|
325
|
+
*/
|
|
326
|
+
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
327
|
+
/**
|
|
328
|
+
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
329
|
+
*
|
|
330
|
+
* @method ac
|
|
331
|
+
* @param id A supergroup ID or a channel ID.
|
|
332
|
+
*/
|
|
333
|
+
hideUsernames(id: ID): Promise<boolean>;
|
|
334
|
+
/**
|
|
335
|
+
* Get a business connection. Bot-only.
|
|
336
|
+
*
|
|
337
|
+
* @method ac
|
|
338
|
+
* @param id The identifier of the business connection.
|
|
339
|
+
*/
|
|
340
|
+
getBusinessConnection(id: string): Promise<BusinessConnection>;
|
|
297
341
|
/**
|
|
298
342
|
* Send a text message.
|
|
299
343
|
*
|
|
@@ -303,6 +347,128 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
303
347
|
* @returns The sent text message.
|
|
304
348
|
*/
|
|
305
349
|
sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
|
|
350
|
+
/**
|
|
351
|
+
* Send a photo.
|
|
352
|
+
*
|
|
353
|
+
* @method ms
|
|
354
|
+
* @param chatId The chat to send the photo to.
|
|
355
|
+
* @param photo The photo to send.
|
|
356
|
+
* @returns The sent photo.
|
|
357
|
+
*/
|
|
358
|
+
sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
|
|
359
|
+
/**
|
|
360
|
+
* Send a document.
|
|
361
|
+
*
|
|
362
|
+
* @method ms
|
|
363
|
+
* @param chatId The chat to send the document to.
|
|
364
|
+
* @param document The document to send.
|
|
365
|
+
* @returns The sent document.
|
|
366
|
+
*/
|
|
367
|
+
sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
|
|
368
|
+
/**
|
|
369
|
+
* Send a sticker.
|
|
370
|
+
*
|
|
371
|
+
* @method ms
|
|
372
|
+
* @param chatId The chat to send the sticker to.
|
|
373
|
+
* @param document The sticker to send.
|
|
374
|
+
* @returns The sent sticker.
|
|
375
|
+
*/
|
|
376
|
+
sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
|
|
377
|
+
/**
|
|
378
|
+
* Send a video.
|
|
379
|
+
*
|
|
380
|
+
* @method ms
|
|
381
|
+
* @param chatId The chat to send the video to.
|
|
382
|
+
* @param video The video to send.
|
|
383
|
+
* @returns The sent video.
|
|
384
|
+
*/
|
|
385
|
+
sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
|
|
386
|
+
/**
|
|
387
|
+
* Send an animation.
|
|
388
|
+
*
|
|
389
|
+
* @method ms
|
|
390
|
+
* @param chatId The chat to send the animation to.
|
|
391
|
+
* @param animation The animation to send.
|
|
392
|
+
* @returns The sent animation.
|
|
393
|
+
*/
|
|
394
|
+
sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
|
|
395
|
+
/**
|
|
396
|
+
* Send a voice message.
|
|
397
|
+
*
|
|
398
|
+
* @method ms
|
|
399
|
+
* @param chatId The chat to send the voice message to.
|
|
400
|
+
* @param voice The voice to send.
|
|
401
|
+
* @returns The sent voice message.
|
|
402
|
+
*/
|
|
403
|
+
sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
|
|
404
|
+
/**
|
|
405
|
+
* Send an audio file.
|
|
406
|
+
*
|
|
407
|
+
* @method ms
|
|
408
|
+
* @param chatId The chat to send the audio file to.
|
|
409
|
+
* @param audio The audio to send.
|
|
410
|
+
* @returns The sent audio filr.
|
|
411
|
+
*/
|
|
412
|
+
sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
|
|
413
|
+
/**
|
|
414
|
+
* Send a video note.
|
|
415
|
+
*
|
|
416
|
+
* @method ms
|
|
417
|
+
* @param chatId The chat to send the video note to.
|
|
418
|
+
* @param videoNote The video note to send.
|
|
419
|
+
* @returns The sent video note.
|
|
420
|
+
*/
|
|
421
|
+
sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
|
|
422
|
+
/**
|
|
423
|
+
* Send a location.
|
|
424
|
+
*
|
|
425
|
+
* @method ms
|
|
426
|
+
* @param chatId The chat to send the location to.
|
|
427
|
+
* @param latitude The location's latitude.
|
|
428
|
+
* @param longitude The location's longitude.
|
|
429
|
+
* @returns The sent location.
|
|
430
|
+
*/
|
|
431
|
+
sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
|
|
432
|
+
/**
|
|
433
|
+
* Send a contact.
|
|
434
|
+
*
|
|
435
|
+
* @method ms
|
|
436
|
+
* @param chatId The chat to send the contact to.
|
|
437
|
+
* @param firstName The contact's first name.
|
|
438
|
+
* @param number The contact's phone number.
|
|
439
|
+
* @returns The sent contact.
|
|
440
|
+
*/
|
|
441
|
+
sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
|
|
442
|
+
/**
|
|
443
|
+
* Send a dice.
|
|
444
|
+
*
|
|
445
|
+
* @method ms
|
|
446
|
+
* @param chatId The chat to send the dice to.
|
|
447
|
+
* @returns The sent dice.
|
|
448
|
+
*/
|
|
449
|
+
sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
|
|
450
|
+
/**
|
|
451
|
+
* Send a venue.
|
|
452
|
+
*
|
|
453
|
+
* @method ms
|
|
454
|
+
* @param chatId The chat to send the venue to.
|
|
455
|
+
* @param latitude The latitude of the venue.
|
|
456
|
+
* @param longitude The longitude of the venue.
|
|
457
|
+
* @param title The title of the venue.
|
|
458
|
+
* @param address The written address of the venue.
|
|
459
|
+
* @returns The sent venue.
|
|
460
|
+
*/
|
|
461
|
+
sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
|
|
462
|
+
/**
|
|
463
|
+
* Send a poll.
|
|
464
|
+
*
|
|
465
|
+
* @method ms
|
|
466
|
+
* @param chatId The chat to send the poll to.
|
|
467
|
+
* @param question The poll's question.
|
|
468
|
+
* @param options The poll's options.
|
|
469
|
+
* @returns The sent poll.
|
|
470
|
+
*/
|
|
471
|
+
sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
|
|
306
472
|
/**
|
|
307
473
|
* Edit a message's text.
|
|
308
474
|
*
|
|
@@ -383,18 +549,52 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
383
549
|
*/
|
|
384
550
|
getMessage(chatId: ID, messageId: number): Promise<Message | null>;
|
|
385
551
|
/**
|
|
386
|
-
*
|
|
552
|
+
* Delete multiple messages.
|
|
387
553
|
*
|
|
388
|
-
* @method
|
|
389
|
-
* @param
|
|
390
|
-
* @
|
|
391
|
-
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
392
|
-
* await outFile.write(chunk);
|
|
393
|
-
* }
|
|
394
|
-
* ```
|
|
395
|
-
* @returns A generator yielding the contents of the file.
|
|
554
|
+
* @method ms
|
|
555
|
+
* @param chatId The identifier of the chat that contains the messages.
|
|
556
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
396
557
|
*/
|
|
397
|
-
|
|
558
|
+
deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
|
|
559
|
+
/**
|
|
560
|
+
* Delete a single message.
|
|
561
|
+
*
|
|
562
|
+
* @method ms
|
|
563
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
564
|
+
* @param messageId The identifier of the message to delete.
|
|
565
|
+
*/
|
|
566
|
+
deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
569
|
+
*
|
|
570
|
+
* @method ms
|
|
571
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
572
|
+
* @param memberId The identifier of the member.
|
|
573
|
+
*/
|
|
574
|
+
deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
|
|
575
|
+
/**
|
|
576
|
+
* Pin a message in a chat.
|
|
577
|
+
*
|
|
578
|
+
* @method ms
|
|
579
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
580
|
+
* @param messageId The message's identifier.
|
|
581
|
+
*/
|
|
582
|
+
pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
|
|
583
|
+
/**
|
|
584
|
+
* Unpin a pinned message.
|
|
585
|
+
*
|
|
586
|
+
* @method ms
|
|
587
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
588
|
+
* @param messageId The message's identifier.
|
|
589
|
+
*/
|
|
590
|
+
unpinMessage(chatId: ID, messageId: number): Promise<void>;
|
|
591
|
+
/**
|
|
592
|
+
* Unpin all pinned messages.
|
|
593
|
+
*
|
|
594
|
+
* @method ms
|
|
595
|
+
* @param chatId The identifier of the chat.
|
|
596
|
+
*/
|
|
597
|
+
unpinMessages(chatId: ID): Promise<void>;
|
|
398
598
|
/**
|
|
399
599
|
* Forward multiple messages.
|
|
400
600
|
*
|
|
@@ -415,29 +615,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
415
615
|
* @returns The forwarded message.
|
|
416
616
|
*/
|
|
417
617
|
forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
|
|
418
|
-
/**
|
|
419
|
-
* Get information on the currently authorized user.
|
|
420
|
-
*
|
|
421
|
-
* @method ac
|
|
422
|
-
*/
|
|
423
|
-
getMe(): Promise<User>;
|
|
424
|
-
/**
|
|
425
|
-
* Answer a callback query. Bot-only.
|
|
426
|
-
*
|
|
427
|
-
* @method cq
|
|
428
|
-
* @param id ID of the callback query to answer.
|
|
429
|
-
*/
|
|
430
|
-
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
431
|
-
/**
|
|
432
|
-
* Send a poll.
|
|
433
|
-
*
|
|
434
|
-
* @method ms
|
|
435
|
-
* @param chatId The chat to send the poll to.
|
|
436
|
-
* @param question The poll's question.
|
|
437
|
-
* @param options The poll's options.
|
|
438
|
-
* @returns The sent poll.
|
|
439
|
-
*/
|
|
440
|
-
sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
|
|
441
618
|
/**
|
|
442
619
|
* Stop a poll.
|
|
443
620
|
*
|
|
@@ -459,258 +636,281 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
459
636
|
messageThreadId?: number;
|
|
460
637
|
}): Promise<void>;
|
|
461
638
|
/**
|
|
462
|
-
*
|
|
639
|
+
* Search the messages of a chat. User-only.
|
|
463
640
|
*
|
|
464
|
-
* @method
|
|
465
|
-
* @param
|
|
466
|
-
* @
|
|
641
|
+
* @method ms
|
|
642
|
+
* @param chatId The identifier of the chat to search the messages in.
|
|
643
|
+
* @param query The message search query.
|
|
467
644
|
*/
|
|
468
|
-
|
|
645
|
+
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
469
646
|
/**
|
|
470
|
-
*
|
|
647
|
+
* Download a file.
|
|
471
648
|
*
|
|
472
|
-
* @method
|
|
473
|
-
* @param
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
*
|
|
649
|
+
* @method fs
|
|
650
|
+
* @param fileId The identifier of the file to download.
|
|
651
|
+
* @example ```ts
|
|
652
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
653
|
+
* await outFile.write(chunk);
|
|
654
|
+
* }
|
|
655
|
+
* ```
|
|
656
|
+
* @returns A generator yielding the contents of the file.
|
|
657
|
+
*/
|
|
658
|
+
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
659
|
+
/**
|
|
660
|
+
* Get custom emoji documents for download.
|
|
478
661
|
*
|
|
479
|
-
* @method
|
|
480
|
-
* @
|
|
662
|
+
* @method fs
|
|
663
|
+
* @param id Identifier of one or more of custom emojis.
|
|
664
|
+
* @returns The custom emoji documents.
|
|
481
665
|
*/
|
|
482
|
-
|
|
666
|
+
getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
|
|
483
667
|
/**
|
|
484
|
-
*
|
|
668
|
+
* Get chats from a chat list. User-only.
|
|
485
669
|
*
|
|
486
|
-
* @method
|
|
487
|
-
* @param id The ID of the inline query to answer.
|
|
488
|
-
* @param results The results to answer with.
|
|
670
|
+
* @method ch
|
|
489
671
|
*/
|
|
490
|
-
|
|
672
|
+
getChats(params?: GetChatsParams): Promise<Chat[]>;
|
|
491
673
|
/**
|
|
492
|
-
*
|
|
674
|
+
* Get a chat.
|
|
493
675
|
*
|
|
494
|
-
* @method
|
|
676
|
+
* @method ch
|
|
495
677
|
*/
|
|
496
|
-
|
|
497
|
-
description?: string;
|
|
498
|
-
languageCode?: string;
|
|
499
|
-
}): Promise<void>;
|
|
678
|
+
getChat(chatId: ID): Promise<Chat>;
|
|
500
679
|
/**
|
|
501
|
-
*
|
|
680
|
+
* Get chat history. User-only.
|
|
502
681
|
*
|
|
503
|
-
* @method
|
|
682
|
+
* @method ch
|
|
683
|
+
* @param chatId The identifier of the chat to get its history.
|
|
504
684
|
*/
|
|
505
|
-
|
|
506
|
-
name?: string;
|
|
507
|
-
languageCode?: string;
|
|
508
|
-
}): Promise<void>;
|
|
685
|
+
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
509
686
|
/**
|
|
510
|
-
* Set
|
|
687
|
+
* Set a chat's available reactions. User-only.
|
|
511
688
|
*
|
|
512
|
-
* @method
|
|
689
|
+
* @method ch
|
|
690
|
+
* @param chatId The identifier of the chat.
|
|
691
|
+
* @param availableReactions The new available reactions.
|
|
513
692
|
*/
|
|
514
|
-
|
|
515
|
-
shortDescription?: string;
|
|
516
|
-
languageCode?: string;
|
|
517
|
-
}): Promise<void>;
|
|
693
|
+
setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
|
|
518
694
|
/**
|
|
519
|
-
*
|
|
695
|
+
* Set a chat's photo.
|
|
520
696
|
*
|
|
521
|
-
* @method
|
|
522
|
-
* @
|
|
697
|
+
* @method ch
|
|
698
|
+
* @param chatId The identifier of the chat.
|
|
699
|
+
* @param photo A photo to set as the chat's photo.
|
|
523
700
|
*/
|
|
524
|
-
|
|
525
|
-
languageCode?: string;
|
|
526
|
-
}): Promise<string>;
|
|
701
|
+
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
527
702
|
/**
|
|
528
|
-
*
|
|
703
|
+
* Delete a chat's photo.
|
|
529
704
|
*
|
|
530
|
-
* @method
|
|
531
|
-
* @
|
|
705
|
+
* @method ch
|
|
706
|
+
* @param chatId The identifier of the chat.
|
|
532
707
|
*/
|
|
533
|
-
|
|
534
|
-
languageCode?: string;
|
|
535
|
-
}): Promise<string>;
|
|
708
|
+
deleteChatPhoto(chatId: number): Promise<void>;
|
|
536
709
|
/**
|
|
537
|
-
*
|
|
710
|
+
* Ban a member from a chat.
|
|
538
711
|
*
|
|
539
|
-
* @method
|
|
540
|
-
* @
|
|
712
|
+
* @method ch
|
|
713
|
+
* @param chatId The identifier of the chat.
|
|
714
|
+
* @param memberId The identifier of the member.
|
|
541
715
|
*/
|
|
542
|
-
|
|
543
|
-
languageCode?: string;
|
|
544
|
-
}): Promise<string>;
|
|
716
|
+
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
545
717
|
/**
|
|
546
|
-
*
|
|
718
|
+
* Unban a member from a chat.
|
|
547
719
|
*
|
|
548
|
-
* @method
|
|
549
|
-
* @param chatId The identifier of the chat
|
|
550
|
-
* @param
|
|
720
|
+
* @method ch
|
|
721
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
722
|
+
* @param memberId The identifier of the member.
|
|
551
723
|
*/
|
|
552
|
-
|
|
724
|
+
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
553
725
|
/**
|
|
554
|
-
*
|
|
726
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
555
727
|
*
|
|
556
|
-
* @method
|
|
557
|
-
* @param chatId The identifier of the chat
|
|
558
|
-
* @param
|
|
728
|
+
* @method ch
|
|
729
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
730
|
+
* @param memberId The identifier of the member.
|
|
559
731
|
*/
|
|
560
|
-
|
|
732
|
+
kickChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
561
733
|
/**
|
|
562
|
-
*
|
|
734
|
+
* Set the rights of a chat member.
|
|
563
735
|
*
|
|
564
|
-
* @method
|
|
565
|
-
* @param chatId The chat
|
|
566
|
-
* @param
|
|
567
|
-
* @returns The sent photo.
|
|
736
|
+
* @method ch
|
|
737
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
738
|
+
* @param memberId The identifier of a member.
|
|
568
739
|
*/
|
|
569
|
-
|
|
740
|
+
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
570
741
|
/**
|
|
571
|
-
*
|
|
742
|
+
* Get the administrators of a chat.
|
|
572
743
|
*
|
|
573
|
-
* @method
|
|
574
|
-
* @param chatId The
|
|
575
|
-
* @
|
|
576
|
-
* @returns The sent document.
|
|
744
|
+
* @method ch
|
|
745
|
+
* @param chatId The identifier of the chat.
|
|
746
|
+
* @returns The chat's administrators.
|
|
577
747
|
*/
|
|
578
|
-
|
|
748
|
+
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
579
749
|
/**
|
|
580
|
-
*
|
|
750
|
+
* Enable join requests in a chat. User-only.
|
|
581
751
|
*
|
|
582
|
-
* @method
|
|
583
|
-
* @param chatId The chat
|
|
584
|
-
* @param document The sticker to send.
|
|
585
|
-
* @returns The sent sticker.
|
|
752
|
+
* @method ch
|
|
753
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
586
754
|
*/
|
|
587
|
-
|
|
755
|
+
enableJoinRequests(chatId: ID): Promise<void>;
|
|
588
756
|
/**
|
|
589
|
-
*
|
|
757
|
+
* Disable join requests in a chat. User-only.
|
|
590
758
|
*
|
|
591
|
-
* @method
|
|
592
|
-
* @param chatId The chat
|
|
593
|
-
* @param video The video to send.
|
|
594
|
-
* @returns The sent video.
|
|
759
|
+
* @method ch
|
|
760
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
595
761
|
*/
|
|
596
|
-
|
|
762
|
+
disableJoinRequests(chatId: ID): Promise<void>;
|
|
597
763
|
/**
|
|
598
|
-
*
|
|
764
|
+
* Get inactive chats. User-only.
|
|
599
765
|
*
|
|
600
|
-
* @method
|
|
601
|
-
* @
|
|
602
|
-
* @param animation The animation to send.
|
|
603
|
-
* @returns The sent animation.
|
|
766
|
+
* @method ch
|
|
767
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
604
768
|
*/
|
|
605
|
-
|
|
769
|
+
getInactiveChats(): Promise<InactiveChat[]>;
|
|
606
770
|
/**
|
|
607
|
-
*
|
|
771
|
+
* Get the invite links created for a chat. User-only.
|
|
608
772
|
*
|
|
609
|
-
* @method
|
|
610
|
-
* @param chatId The
|
|
611
|
-
* @
|
|
612
|
-
* @returns The sent voice message.
|
|
773
|
+
* @method ch
|
|
774
|
+
* @param chatId The identifier of the chat.
|
|
775
|
+
* @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.
|
|
613
776
|
*/
|
|
614
|
-
|
|
777
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
615
778
|
/**
|
|
616
|
-
*
|
|
779
|
+
* Join a chat. User-only.
|
|
617
780
|
*
|
|
618
|
-
* @method
|
|
619
|
-
* @param chatId The
|
|
620
|
-
* @param audio The audio to send.
|
|
621
|
-
* @returns The sent audio filr.
|
|
781
|
+
* @method ch
|
|
782
|
+
* @param chatId The identifier of the chat to join.
|
|
622
783
|
*/
|
|
623
|
-
|
|
784
|
+
joinChat(chatId: ID): Promise<void>;
|
|
624
785
|
/**
|
|
625
|
-
*
|
|
786
|
+
* Leave a chat.
|
|
626
787
|
*
|
|
627
|
-
* @method
|
|
628
|
-
* @param chatId The
|
|
629
|
-
* @param videoNote The video note to send.
|
|
630
|
-
* @returns The sent video note.
|
|
788
|
+
* @method ch
|
|
789
|
+
* @param chatId The identifier of the chat to leave.
|
|
631
790
|
*/
|
|
632
|
-
|
|
791
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
633
792
|
/**
|
|
634
|
-
*
|
|
793
|
+
* Get information on a user's chat membership.
|
|
635
794
|
*
|
|
636
|
-
* @method
|
|
637
|
-
* @param chatId The chat
|
|
638
|
-
* @param
|
|
639
|
-
* @param longitude The location's longitude.
|
|
640
|
-
* @returns The sent location.
|
|
795
|
+
* @method ch
|
|
796
|
+
* @param chatId The identifier of a chat that includes the user.
|
|
797
|
+
* @param userId The identifier of the user.
|
|
641
798
|
*/
|
|
642
|
-
|
|
799
|
+
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
643
800
|
/**
|
|
644
|
-
*
|
|
801
|
+
* Set a chat's sticker set.
|
|
645
802
|
*
|
|
646
|
-
* @method
|
|
647
|
-
* @param chatId The chat
|
|
648
|
-
* @param
|
|
649
|
-
* @param number The contact's phone number.
|
|
650
|
-
* @returns The sent contact.
|
|
803
|
+
* @method ch
|
|
804
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
805
|
+
* @param setName The name of the set.
|
|
651
806
|
*/
|
|
652
|
-
|
|
807
|
+
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
653
808
|
/**
|
|
654
|
-
*
|
|
809
|
+
* Delete a chat's sticker set.
|
|
655
810
|
*
|
|
656
|
-
* @method
|
|
657
|
-
* @param chatId The chat
|
|
658
|
-
* @returns The sent dice.
|
|
811
|
+
* @method ch
|
|
812
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
659
813
|
*/
|
|
660
|
-
|
|
814
|
+
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
661
815
|
/**
|
|
662
|
-
*
|
|
816
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
663
817
|
*
|
|
664
|
-
* @method
|
|
665
|
-
* @param chatId The
|
|
666
|
-
* @param
|
|
667
|
-
* @param longitude The longitude of the venue.
|
|
668
|
-
* @param title The title of the venue.
|
|
669
|
-
* @param address The written address of the venue.
|
|
670
|
-
* @returns The sent venue.
|
|
818
|
+
* @method ch
|
|
819
|
+
* @param chatId The identifier of the chat.
|
|
820
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
671
821
|
*/
|
|
672
|
-
|
|
822
|
+
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
673
823
|
/**
|
|
674
|
-
*
|
|
824
|
+
* Create an invite link.
|
|
675
825
|
*
|
|
676
|
-
* @method
|
|
826
|
+
* @method ch
|
|
827
|
+
* @param chatId The identifier of the chat to create the invite link for.
|
|
828
|
+
* @returns The newly created invite link.
|
|
677
829
|
*/
|
|
678
|
-
|
|
830
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
831
|
+
/**
|
|
832
|
+
* Answer a callback query. Bot-only.
|
|
833
|
+
*
|
|
834
|
+
* @method cq
|
|
835
|
+
* @param id ID of the callback query to answer.
|
|
836
|
+
*/
|
|
837
|
+
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
838
|
+
/**
|
|
839
|
+
* Answer an inline query. Bot-only.
|
|
840
|
+
*
|
|
841
|
+
* @method iq
|
|
842
|
+
* @param id The ID of the inline query to answer.
|
|
843
|
+
* @param results The results to answer with.
|
|
844
|
+
*/
|
|
845
|
+
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
846
|
+
/**
|
|
847
|
+
* Set the bot's description in the given language. Bot-only.
|
|
848
|
+
*
|
|
849
|
+
* @method bs
|
|
850
|
+
*/
|
|
851
|
+
setMyDescription(params?: {
|
|
852
|
+
description?: string;
|
|
853
|
+
languageCode?: string;
|
|
854
|
+
}): Promise<void>;
|
|
855
|
+
/**
|
|
856
|
+
* Set the bot's name in the given language. Bot-only.
|
|
857
|
+
*
|
|
858
|
+
* @method bs
|
|
859
|
+
*/
|
|
860
|
+
setMyName(params?: {
|
|
861
|
+
name?: string;
|
|
862
|
+
languageCode?: string;
|
|
863
|
+
}): Promise<void>;
|
|
864
|
+
/**
|
|
865
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
866
|
+
*
|
|
867
|
+
* @method bs
|
|
868
|
+
*/
|
|
869
|
+
setMyShortDescription(params?: {
|
|
870
|
+
shortDescription?: string;
|
|
871
|
+
languageCode?: string;
|
|
872
|
+
}): Promise<void>;
|
|
679
873
|
/**
|
|
680
|
-
* Get
|
|
874
|
+
* Get the bot's description in the given language. Bot-only.
|
|
681
875
|
*
|
|
682
|
-
* @method
|
|
876
|
+
* @method bs
|
|
877
|
+
* @returns The current bot's description in the specified language.
|
|
683
878
|
*/
|
|
684
|
-
|
|
879
|
+
getMyDescription(params?: {
|
|
880
|
+
languageCode?: string;
|
|
881
|
+
}): Promise<string>;
|
|
685
882
|
/**
|
|
686
|
-
* Get
|
|
883
|
+
* Get the bot's name in the given language. Bot-only.
|
|
687
884
|
*
|
|
688
|
-
* @method
|
|
885
|
+
* @method bs
|
|
886
|
+
* @returns The current bot's name in the specified language.
|
|
689
887
|
*/
|
|
690
|
-
|
|
888
|
+
getMyName(params?: {
|
|
889
|
+
languageCode?: string;
|
|
890
|
+
}): Promise<string>;
|
|
691
891
|
/**
|
|
692
|
-
* Get
|
|
892
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
693
893
|
*
|
|
694
|
-
* @method
|
|
695
|
-
* @
|
|
894
|
+
* @method bs
|
|
895
|
+
* @returns The current bot's short description in the specified language.
|
|
696
896
|
*/
|
|
697
|
-
|
|
897
|
+
getMyShortDescription(params?: {
|
|
898
|
+
languageCode?: string;
|
|
899
|
+
}): Promise<string>;
|
|
698
900
|
/**
|
|
699
|
-
*
|
|
901
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
700
902
|
*
|
|
701
|
-
* @method
|
|
702
|
-
* @param
|
|
703
|
-
* @returns The custom emoji documents.
|
|
903
|
+
* @method bs
|
|
904
|
+
* @param commands The commands to set.
|
|
704
905
|
*/
|
|
705
|
-
|
|
906
|
+
setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
|
|
706
907
|
/**
|
|
707
|
-
*
|
|
908
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
708
909
|
*
|
|
709
|
-
* @method
|
|
710
|
-
* @
|
|
711
|
-
* @param availableReactions The new available reactions.
|
|
910
|
+
* @method bs
|
|
911
|
+
* @returns The current bot's commands in the specified language.
|
|
712
912
|
*/
|
|
713
|
-
|
|
913
|
+
getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
|
|
714
914
|
/**
|
|
715
915
|
* Change reactions made to a message.
|
|
716
916
|
*
|
|
@@ -738,92 +938,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
738
938
|
* @param reaction The reaction to remove.
|
|
739
939
|
*/
|
|
740
940
|
removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
|
|
741
|
-
/**
|
|
742
|
-
* Set a chat's photo.
|
|
743
|
-
*
|
|
744
|
-
* @method ch
|
|
745
|
-
* @param chatId The identifier of the chat.
|
|
746
|
-
* @param photo A photo to set as the chat's photo.
|
|
747
|
-
*/
|
|
748
|
-
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
749
|
-
/**
|
|
750
|
-
* Delete a chat's photo.
|
|
751
|
-
*
|
|
752
|
-
* @method ch
|
|
753
|
-
* @param chatId The identifier of the chat.
|
|
754
|
-
*/
|
|
755
|
-
deleteChatPhoto(chatId: number): Promise<void>;
|
|
756
|
-
/**
|
|
757
|
-
* Delete all messages sent by a specific member of a chat. User-only.
|
|
758
|
-
*
|
|
759
|
-
* @method ms
|
|
760
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
761
|
-
* @param memberId The identifier of the member.
|
|
762
|
-
*/
|
|
763
|
-
deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
|
|
764
|
-
/**
|
|
765
|
-
* Pin a message in a chat.
|
|
766
|
-
*
|
|
767
|
-
* @method ms
|
|
768
|
-
* @param chatId The identifier of the chat that contains the message.
|
|
769
|
-
* @param messageId The message's identifier.
|
|
770
|
-
*/
|
|
771
|
-
pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
|
|
772
|
-
/**
|
|
773
|
-
* Unpin a pinned message.
|
|
774
|
-
*
|
|
775
|
-
* @method ms
|
|
776
|
-
* @param chatId The identifier of the chat that contains the message.
|
|
777
|
-
* @param messageId The message's identifier.
|
|
778
|
-
*/
|
|
779
|
-
unpinMessage(chatId: ID, messageId: number): Promise<void>;
|
|
780
|
-
/**
|
|
781
|
-
* Unpin all pinned messages.
|
|
782
|
-
*
|
|
783
|
-
* @method ms
|
|
784
|
-
* @param chatId The identifier of the chat.
|
|
785
|
-
*/
|
|
786
|
-
unpinMessages(chatId: ID): Promise<void>;
|
|
787
|
-
/**
|
|
788
|
-
* Ban a member from a chat.
|
|
789
|
-
*
|
|
790
|
-
* @method ch
|
|
791
|
-
* @param chatId The identifier of the chat.
|
|
792
|
-
* @param memberId The identifier of the member.
|
|
793
|
-
*/
|
|
794
|
-
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
795
|
-
/**
|
|
796
|
-
* Unban a member from a chat.
|
|
797
|
-
*
|
|
798
|
-
* @method ch
|
|
799
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
800
|
-
* @param memberId The identifier of the member.
|
|
801
|
-
*/
|
|
802
|
-
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
803
|
-
/**
|
|
804
|
-
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
805
|
-
*
|
|
806
|
-
* @method ch
|
|
807
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
808
|
-
* @param memberId The identifier of the member.
|
|
809
|
-
*/
|
|
810
|
-
kickChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
811
|
-
/**
|
|
812
|
-
* Set the rights of a chat member.
|
|
813
|
-
*
|
|
814
|
-
* @method ch
|
|
815
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
816
|
-
* @param memberId The identifier of a member.
|
|
817
|
-
*/
|
|
818
|
-
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
819
|
-
/**
|
|
820
|
-
* Get the administrators of a chat.
|
|
821
|
-
*
|
|
822
|
-
* @method ch
|
|
823
|
-
* @param chatId The identifier of the chat.
|
|
824
|
-
* @returns The chat's administrators.
|
|
825
|
-
*/
|
|
826
|
-
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
827
941
|
/**
|
|
828
942
|
* Create a story. User-only.
|
|
829
943
|
*
|
|
@@ -898,104 +1012,11 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
898
1012
|
*/
|
|
899
1013
|
removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
|
|
900
1014
|
/**
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
* @method ch
|
|
904
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
905
|
-
*/
|
|
906
|
-
enableJoinRequests(chatId: ID): Promise<void>;
|
|
907
|
-
/**
|
|
908
|
-
* Disable join requests in a chat. User-only.
|
|
909
|
-
*
|
|
910
|
-
* @method ch
|
|
911
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
912
|
-
*/
|
|
913
|
-
disableJoinRequests(chatId: ID): Promise<void>;
|
|
914
|
-
/**
|
|
915
|
-
* Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
|
|
916
|
-
*
|
|
917
|
-
* @method ac
|
|
918
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
919
|
-
* @param username The username to show.
|
|
920
|
-
*/
|
|
921
|
-
showUsername(id: ID, username: string): Promise<void>;
|
|
922
|
-
/**
|
|
923
|
-
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
924
|
-
*
|
|
925
|
-
* @method ac
|
|
926
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
927
|
-
* @param username The username to hide.
|
|
928
|
-
*/
|
|
929
|
-
hideUsername(id: ID, username: string): Promise<void>;
|
|
930
|
-
/**
|
|
931
|
-
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
932
|
-
*
|
|
933
|
-
* @method ac
|
|
934
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
935
|
-
* @param order The new order to use.
|
|
936
|
-
* @returns Whether the order was changed.
|
|
937
|
-
*/
|
|
938
|
-
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
939
|
-
/**
|
|
940
|
-
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
941
|
-
*
|
|
942
|
-
* @method ac
|
|
943
|
-
* @param id A supergroup ID or a channel ID.
|
|
944
|
-
*/
|
|
945
|
-
hideUsernames(id: ID): Promise<boolean>;
|
|
946
|
-
/**
|
|
947
|
-
* Get inactive chats. User-only.
|
|
948
|
-
*
|
|
949
|
-
* @method ch
|
|
950
|
-
* @retuns A list of inactive chats the current user is member of.
|
|
951
|
-
*/
|
|
952
|
-
getInactiveChats(): Promise<InactiveChat[]>;
|
|
953
|
-
/**
|
|
954
|
-
* Search the messages of a chat. User-only.
|
|
955
|
-
*
|
|
956
|
-
* @method ms
|
|
957
|
-
* @param chatId The identifier of the chat to search the messages in.
|
|
958
|
-
* @param query The message search query.
|
|
959
|
-
*/
|
|
960
|
-
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
961
|
-
/**
|
|
962
|
-
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
963
|
-
*
|
|
964
|
-
* @method ch
|
|
965
|
-
* @param chatId The identifier of the chat.
|
|
966
|
-
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
967
|
-
*/
|
|
968
|
-
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
969
|
-
/**
|
|
970
|
-
* Create an invite link.
|
|
971
|
-
*
|
|
972
|
-
* @method ch
|
|
973
|
-
* @param chatId The identifier of the chat to create the invite link for.
|
|
974
|
-
* @returns The newly created invite link.
|
|
975
|
-
*/
|
|
976
|
-
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
977
|
-
/**
|
|
978
|
-
* Get the invite links created for a chat. User-only.
|
|
979
|
-
*
|
|
980
|
-
* @method ch
|
|
981
|
-
* @param chatId The identifier of the chat.
|
|
982
|
-
* @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.
|
|
983
|
-
*/
|
|
984
|
-
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
985
|
-
/**
|
|
986
|
-
* Join a chat. User-only.
|
|
987
|
-
*
|
|
988
|
-
* @method ch
|
|
989
|
-
* @param chatId The identifier of the chat to join.
|
|
990
|
-
*/
|
|
991
|
-
joinChat(chatId: ID): Promise<void>;
|
|
992
|
-
/**
|
|
993
|
-
* Leave a chat.
|
|
1015
|
+
* Get network statistics. This might not always be available.
|
|
994
1016
|
*
|
|
995
|
-
* @method
|
|
996
|
-
* @param chatId The identifier of the chat to leave.
|
|
1017
|
+
* @method mc
|
|
997
1018
|
*/
|
|
998
|
-
|
|
1019
|
+
getNetworkStatistics(): Promise<NetworkStatistics>;
|
|
999
1020
|
/**
|
|
1000
1021
|
* Block a user. User-only.
|
|
1001
1022
|
*
|
|
@@ -1010,28 +1031,5 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
1010
1031
|
* @param userId The identifier of the user to unblock.
|
|
1011
1032
|
*/
|
|
1012
1033
|
unblockUser(userId: ID): Promise<void>;
|
|
1013
|
-
/**
|
|
1014
|
-
* Get information on a user's chat membership.
|
|
1015
|
-
*
|
|
1016
|
-
* @method ch
|
|
1017
|
-
* @param chatId The identifier of a chat that includes the user.
|
|
1018
|
-
* @param userId The identifier of the user.
|
|
1019
|
-
*/
|
|
1020
|
-
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
1021
|
-
/**
|
|
1022
|
-
* Set a chat's sticker set.
|
|
1023
|
-
*
|
|
1024
|
-
* @method ch
|
|
1025
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1026
|
-
* @param setName The name of the set.
|
|
1027
|
-
*/
|
|
1028
|
-
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
1029
|
-
/**
|
|
1030
|
-
* Delete a chat's sticker set.
|
|
1031
|
-
*
|
|
1032
|
-
* @method ch
|
|
1033
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1034
|
-
*/
|
|
1035
|
-
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
1036
1034
|
}
|
|
1037
1035
|
export {};
|