@mtkruto/node 0.1.139 → 0.1.140
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/3_types.d.ts +10 -36
- package/esm/3_types.js +10 -36
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/client/0_filters.d.ts +60 -0
- package/esm/client/0_filters.js +27 -0
- package/esm/client/0_message.js +2 -2
- package/esm/client/{3_params.d.ts → 0_params.d.ts} +30 -33
- package/esm/client/0_types.d.ts +39 -0
- package/esm/client/0_types.js +2 -0
- package/esm/client/0_utilities.d.ts +1 -47
- package/esm/client/0_utilities.js +0 -27
- package/esm/client/1_composer.d.ts +1 -1
- package/esm/client/1_composer.js +1 -1
- package/esm/client/1_file_manager.d.ts +10 -0
- package/esm/client/1_file_manager.js +241 -0
- package/esm/client/1_update_manager.d.ts +18 -0
- package/esm/client/1_update_manager.js +553 -0
- package/esm/client/2_message_manager.d.ts +40 -0
- package/esm/client/2_message_manager.js +621 -0
- package/esm/client/3_chat_list_manager.d.ts +21 -0
- package/esm/client/3_chat_list_manager.js +353 -0
- package/esm/client/3_reaction_manager.d.ts +16 -0
- package/esm/client/3_reaction_manager.js +61 -0
- package/esm/client/4_client.d.ts +187 -60
- package/esm/client/4_client.js +492 -1698
- package/esm/connection/1_connection_web_socket.js +6 -6
- package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +1 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +524 -0
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- package/esm/storage/0_storage.d.ts +5 -3
- package/esm/storage/0_storage.js +14 -4
- package/esm/tl/1_tl_object.d.ts +1 -0
- package/esm/tl/1_tl_object.js +24 -0
- package/esm/types/0_bot_command.d.ts +1 -0
- package/esm/types/0_chat_member_rights.d.ts +37 -0
- package/esm/types/0_chat_photo.d.ts +4 -4
- package/esm/types/0_file_source.d.ts +5 -0
- package/esm/types/0_giveaway_parameters.js +2 -1
- package/esm/types/0_id.d.ts +4 -0
- package/esm/types/0_message_entity.d.ts +20 -20
- package/esm/types/1__getters.d.ts +2 -2
- package/esm/types/1_animation.d.ts +1 -1
- package/esm/types/1_bot_command_scope.d.ts +5 -4
- package/esm/types/1_chat_p.d.ts +5 -6
- package/esm/types/1_document.d.ts +1 -0
- package/esm/types/1_input_message_content.d.ts +88 -0
- package/esm/types/1_photo.d.ts +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_video.d.ts +1 -1
- package/esm/types/1_video_note.d.ts +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +10 -10
- package/esm/types/2_message_reaction_count.d.ts +3 -0
- package/esm/types/2_message_reaction_count.js +17 -1
- package/esm/types/2_message_reactions.d.ts +15 -0
- package/esm/types/2_message_reactions.js +37 -0
- package/esm/types/3_reply_markup.d.ts +42 -0
- package/esm/types/3_reply_markup.js +117 -0
- package/esm/types/4_inline_query_result.d.ts +193 -0
- package/esm/types/{5_inline_query_result.js → 4_inline_query_result.js} +2 -2
- package/esm/types/4_message.d.ts +36 -39
- package/esm/types/4_message.js +7 -24
- package/esm/types/5_callback_query.d.ts +2 -1
- package/esm/types/5_chat.d.ts +8 -5
- package/esm/types/6_update.d.ts +12 -2
- package/esm/utilities/0_buffer.js +9 -6
- package/esm/utilities/0_object.d.ts +1 -1
- package/esm/utilities/0_object.js +1 -6
- package/esm/utilities/1_misc.d.ts +2 -0
- package/esm/utilities/1_misc.js +6 -0
- package/package.json +1 -2
- package/script/3_types.d.ts +10 -36
- package/script/3_types.js +10 -36
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/_dnt.polyfills.d.ts +6 -0
- package/script/client/0_filters.d.ts +60 -0
- package/script/client/0_filters.js +31 -0
- package/script/client/0_message.js +1 -1
- package/script/client/{3_params.d.ts → 0_params.d.ts} +30 -33
- package/script/client/0_types.d.ts +39 -0
- package/script/client/0_types.js +6 -0
- package/script/client/0_utilities.d.ts +1 -47
- package/script/client/0_utilities.js +1 -29
- package/script/client/1_composer.d.ts +1 -1
- package/script/client/1_composer.js +2 -2
- package/script/client/1_file_manager.d.ts +10 -0
- package/script/client/1_file_manager.js +245 -0
- package/script/client/1_update_manager.d.ts +18 -0
- package/script/client/1_update_manager.js +557 -0
- package/script/client/2_message_manager.d.ts +40 -0
- package/script/client/2_message_manager.js +625 -0
- package/script/client/3_chat_list_manager.d.ts +21 -0
- package/script/client/3_chat_list_manager.js +357 -0
- package/script/client/3_reaction_manager.d.ts +16 -0
- package/script/client/3_reaction_manager.js +65 -0
- package/script/client/4_client.d.ts +187 -60
- package/script/client/4_client.js +491 -1698
- package/script/connection/1_connection_web_socket.js +5 -5
- package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +2 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +550 -0
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- package/script/storage/0_storage.d.ts +5 -3
- package/script/storage/0_storage.js +14 -4
- package/script/tl/1_tl_object.d.ts +1 -0
- package/script/tl/1_tl_object.js +24 -0
- package/script/types/0_bot_command.d.ts +1 -0
- package/script/types/0_chat_member_rights.d.ts +37 -0
- package/script/types/0_chat_photo.d.ts +4 -4
- package/script/types/0_file_source.d.ts +5 -0
- package/script/types/0_giveaway_parameters.js +2 -1
- package/script/types/0_id.d.ts +4 -0
- package/script/types/0_message_entity.d.ts +20 -20
- package/script/types/1__getters.d.ts +2 -2
- package/script/types/1_animation.d.ts +1 -1
- package/script/types/1_bot_command_scope.d.ts +5 -4
- package/script/types/1_chat_p.d.ts +5 -6
- package/script/types/1_document.d.ts +1 -0
- package/script/types/1_input_message_content.d.ts +88 -0
- package/script/types/1_photo.d.ts +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_video.d.ts +1 -1
- package/script/types/1_video_note.d.ts +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +10 -10
- package/script/types/2_message_reaction_count.d.ts +3 -0
- package/script/types/2_message_reaction_count.js +19 -0
- package/script/types/2_message_reactions.d.ts +15 -0
- package/script/types/2_message_reactions.js +41 -0
- package/script/types/3_reply_markup.d.ts +42 -0
- package/script/types/3_reply_markup.js +122 -0
- package/script/types/4_inline_query_result.d.ts +193 -0
- package/script/types/{5_inline_query_result.js → 4_inline_query_result.js} +3 -3
- package/script/types/4_message.d.ts +36 -39
- package/script/types/4_message.js +6 -23
- package/script/types/5_callback_query.d.ts +2 -1
- package/script/types/5_chat.d.ts +8 -5
- package/script/types/6_update.d.ts +12 -2
- package/script/utilities/0_buffer.js +9 -6
- package/script/utilities/0_object.d.ts +1 -1
- package/script/utilities/0_object.js +1 -6
- package/script/utilities/1_misc.d.ts +2 -0
- package/script/utilities/1_misc.js +9 -1
- package/esm/types/0_chat_id.d.ts +0 -4
- package/esm/types/0_force_reply.d.ts +0 -12
- package/esm/types/0_force_reply.js +0 -17
- package/esm/types/0_input_contact_message_content.d.ts +0 -11
- package/esm/types/0_input_location_message_content.d.ts +0 -15
- package/esm/types/0_input_venue_message_content.d.ts +0 -19
- package/esm/types/0_reply_keyboard_remove.d.ts +0 -10
- package/esm/types/0_reply_keyboard_remove.js +0 -8
- package/esm/types/1_input_invoice_message_content.d.ts +0 -23
- package/esm/types/1_input_text_message_content.d.ts +0 -8
- package/esm/types/1_input_text_message_content.js +0 -1
- package/esm/types/2_input_message_content.d.ts +0 -6
- package/esm/types/2_input_message_content.js +0 -1
- package/esm/types/2_reply_keyboard_markup.d.ts +0 -12
- package/esm/types/2_reply_keyboard_markup.js +0 -37
- package/esm/types/3_inline_keyboard_markup.d.ts +0 -8
- package/esm/types/3_inline_keyboard_markup.js +0 -24
- package/esm/types/4_inline_query_result_article.d.ts +0 -15
- package/esm/types/4_inline_query_result_article.js +0 -1
- package/esm/types/4_inline_query_result_audio.d.ts +0 -17
- package/esm/types/4_inline_query_result_audio.js +0 -1
- package/esm/types/4_inline_query_result_cached_audio.d.ts +0 -14
- package/esm/types/4_inline_query_result_cached_audio.js +0 -1
- package/esm/types/4_inline_query_result_cached_document.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_document.js +0 -1
- package/esm/types/4_inline_query_result_cached_gif.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_gif.js +0 -1
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +0 -1
- package/esm/types/4_inline_query_result_cached_photo.d.ts +0 -16
- package/esm/types/4_inline_query_result_cached_photo.js +0 -1
- package/esm/types/4_inline_query_result_cached_sticker.d.ts +0 -9
- package/esm/types/4_inline_query_result_cached_sticker.js +0 -1
- package/esm/types/4_inline_query_result_cached_video.d.ts +0 -16
- package/esm/types/4_inline_query_result_cached_video.js +0 -1
- package/esm/types/4_inline_query_result_cached_voice.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_voice.js +0 -1
- package/esm/types/4_inline_query_result_contact.d.ts +0 -15
- package/esm/types/4_inline_query_result_contact.js +0 -1
- package/esm/types/4_inline_query_result_document.d.ts +0 -18
- package/esm/types/4_inline_query_result_document.js +0 -1
- package/esm/types/4_inline_query_result_game.d.ts +0 -7
- package/esm/types/4_inline_query_result_game.js +0 -1
- package/esm/types/4_inline_query_result_gif.d.ts +0 -20
- package/esm/types/4_inline_query_result_gif.js +0 -1
- package/esm/types/4_inline_query_result_location.d.ts +0 -18
- package/esm/types/4_inline_query_result_location.js +0 -1
- package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
- package/esm/types/4_inline_query_result_mpeg4_gif.js +0 -1
- package/esm/types/4_inline_query_result_photo.d.ts +0 -19
- package/esm/types/4_inline_query_result_photo.js +0 -1
- package/esm/types/4_inline_query_result_venue.d.ts +0 -19
- package/esm/types/4_inline_query_result_venue.js +0 -1
- package/esm/types/4_inline_query_result_video.d.ts +0 -21
- package/esm/types/4_inline_query_result_video.js +0 -1
- package/esm/types/4_inline_query_result_voice.d.ts +0 -16
- package/esm/types/4_inline_query_result_voice.js +0 -1
- package/esm/types/4_reply_markup.d.ts +0 -7
- package/esm/types/4_reply_markup.js +0 -22
- package/esm/types/5_inline_query_result.d.ts +0 -28
- package/script/types/0_chat_id.d.ts +0 -4
- package/script/types/0_force_reply.d.ts +0 -12
- package/script/types/0_force_reply.js +0 -22
- package/script/types/0_input_contact_message_content.d.ts +0 -11
- package/script/types/0_input_location_message_content.d.ts +0 -15
- package/script/types/0_input_venue_message_content.d.ts +0 -19
- package/script/types/0_reply_keyboard_remove.d.ts +0 -10
- package/script/types/0_reply_keyboard_remove.js +0 -13
- package/script/types/1_input_invoice_message_content.d.ts +0 -23
- package/script/types/1_input_text_message_content.d.ts +0 -8
- package/script/types/1_input_text_message_content.js +0 -2
- package/script/types/2_input_message_content.d.ts +0 -6
- package/script/types/2_input_message_content.js +0 -2
- package/script/types/2_reply_keyboard_markup.d.ts +0 -12
- package/script/types/2_reply_keyboard_markup.js +0 -42
- package/script/types/3_inline_keyboard_markup.d.ts +0 -8
- package/script/types/3_inline_keyboard_markup.js +0 -29
- package/script/types/4_inline_query_result_article.d.ts +0 -15
- package/script/types/4_inline_query_result_article.js +0 -2
- package/script/types/4_inline_query_result_audio.d.ts +0 -17
- package/script/types/4_inline_query_result_audio.js +0 -2
- package/script/types/4_inline_query_result_cached_audio.d.ts +0 -14
- package/script/types/4_inline_query_result_cached_audio.js +0 -2
- package/script/types/4_inline_query_result_cached_document.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_document.js +0 -2
- package/script/types/4_inline_query_result_cached_gif.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_gif.js +0 -2
- package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_mpeg4_gif.js +0 -2
- package/script/types/4_inline_query_result_cached_photo.d.ts +0 -16
- package/script/types/4_inline_query_result_cached_photo.js +0 -2
- package/script/types/4_inline_query_result_cached_sticker.d.ts +0 -9
- package/script/types/4_inline_query_result_cached_sticker.js +0 -2
- package/script/types/4_inline_query_result_cached_video.d.ts +0 -16
- package/script/types/4_inline_query_result_cached_video.js +0 -2
- package/script/types/4_inline_query_result_cached_voice.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_voice.js +0 -2
- package/script/types/4_inline_query_result_contact.d.ts +0 -15
- package/script/types/4_inline_query_result_contact.js +0 -2
- package/script/types/4_inline_query_result_document.d.ts +0 -18
- package/script/types/4_inline_query_result_document.js +0 -2
- package/script/types/4_inline_query_result_game.d.ts +0 -7
- package/script/types/4_inline_query_result_game.js +0 -2
- package/script/types/4_inline_query_result_gif.d.ts +0 -20
- package/script/types/4_inline_query_result_gif.js +0 -2
- package/script/types/4_inline_query_result_location.d.ts +0 -18
- package/script/types/4_inline_query_result_location.js +0 -2
- package/script/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
- package/script/types/4_inline_query_result_mpeg4_gif.js +0 -2
- package/script/types/4_inline_query_result_photo.d.ts +0 -19
- package/script/types/4_inline_query_result_photo.js +0 -2
- package/script/types/4_inline_query_result_venue.d.ts +0 -19
- package/script/types/4_inline_query_result_venue.js +0 -2
- package/script/types/4_inline_query_result_video.d.ts +0 -21
- package/script/types/4_inline_query_result_video.js +0 -2
- package/script/types/4_inline_query_result_voice.d.ts +0 -16
- package/script/types/4_inline_query_result_voice.js +0 -2
- package/script/types/4_reply_markup.d.ts +0 -7
- package/script/types/4_reply_markup.js +0 -26
- package/script/types/5_inline_query_result.d.ts +0 -28
- /package/esm/{client/3_params.js → _dnt.polyfills.js} +0 -0
- /package/esm/{types/0_chat_id.js → client/0_params.js} +0 -0
- /package/esm/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
- /package/esm/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
- /package/esm/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
- /package/esm/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
- /package/script/{client/3_params.js → _dnt.polyfills.js} +0 -0
- /package/script/{types/0_chat_id.js → client/0_params.js} +0 -0
- /package/script/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
- /package/script/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
- /package/script/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
- /package/script/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
package/esm/3_types.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
export * from "./types/0__file_id.js";
|
|
2
1
|
export * from "./types/0_authorization_state.js";
|
|
3
2
|
export * from "./types/0_bot_command.js";
|
|
4
3
|
export * from "./types/0_chat_action.js";
|
|
5
4
|
export * from "./types/0_chat_administrator_rights.js";
|
|
6
|
-
export * from "./types/
|
|
5
|
+
export * from "./types/0_chat_member_rights.js";
|
|
7
6
|
export * from "./types/0_chat_photo.js";
|
|
8
7
|
export * from "./types/0_connection_state.js";
|
|
9
8
|
export * from "./types/0_contact.js";
|
|
10
9
|
export * from "./types/0_dice.js";
|
|
11
|
-
export * from "./types/
|
|
10
|
+
export * from "./types/0__file_id.js";
|
|
11
|
+
export * from "./types/0_file_source.js";
|
|
12
12
|
export * from "./types/0_giveaway_parameters.js";
|
|
13
|
-
export * from "./types/
|
|
14
|
-
export * from "./types/0_input_location_message_content.js";
|
|
15
|
-
export * from "./types/0_input_venue_message_content.js";
|
|
13
|
+
export * from "./types/0_id.js";
|
|
16
14
|
export * from "./types/0_keyboard_button_poll_type.js";
|
|
17
15
|
export * from "./types/0_labeled_price.js";
|
|
18
16
|
export * from "./types/0_location.js";
|
|
@@ -24,22 +22,20 @@ export * from "./types/0_network_statistics_entry.js";
|
|
|
24
22
|
export * from "./types/0_parse_mode.js";
|
|
25
23
|
export * from "./types/0_poll_option.js";
|
|
26
24
|
export * from "./types/0_reaction.js";
|
|
27
|
-
export * from "./types/0_reply_keyboard_remove.js";
|
|
28
25
|
export * from "./types/0_restriction_reason.js";
|
|
29
26
|
export * from "./types/0_thumbnail.js";
|
|
30
27
|
export * from "./types/0_venue.js";
|
|
31
28
|
export * from "./types/0_voice.js";
|
|
32
29
|
export * from "./types/0_web_app_info.js";
|
|
33
|
-
export * from "./types/1__getters.js";
|
|
34
30
|
export * from "./types/1_animation.js";
|
|
35
31
|
export * from "./types/1_audio.js";
|
|
36
32
|
export * from "./types/1_bot_command_scope.js";
|
|
37
33
|
export * from "./types/1_chat_p.js";
|
|
38
34
|
export * from "./types/1_document.js";
|
|
35
|
+
export * from "./types/1__getters.js";
|
|
39
36
|
export * from "./types/1_giveaway.js";
|
|
40
37
|
export * from "./types/1_inline_query_result_button.js";
|
|
41
|
-
export * from "./types/
|
|
42
|
-
export * from "./types/1_input_text_message_content.js";
|
|
38
|
+
export * from "./types/1_input_message_content.js";
|
|
43
39
|
export * from "./types/1_keyboard_button.js";
|
|
44
40
|
export * from "./types/1_message_reaction.js";
|
|
45
41
|
export * from "./types/1_network_statistics.js";
|
|
@@ -49,40 +45,18 @@ export * from "./types/1_reaction_count.js";
|
|
|
49
45
|
export * from "./types/1_reply_quote.js";
|
|
50
46
|
export * from "./types/1_sticker.js";
|
|
51
47
|
export * from "./types/1_user.js";
|
|
52
|
-
export * from "./types/1_video.js";
|
|
53
48
|
export * from "./types/1_video_note.js";
|
|
49
|
+
export * from "./types/1_video.js";
|
|
54
50
|
export * from "./types/2_chosen_inline_result.js";
|
|
55
51
|
export * from "./types/2_game.js";
|
|
56
52
|
export * from "./types/2_inline_keyboard_button.js";
|
|
57
53
|
export * from "./types/2_inline_query.js";
|
|
58
|
-
export * from "./types/2_input_message_content.js";
|
|
59
54
|
export * from "./types/2_message_interactions.js";
|
|
60
55
|
export * from "./types/2_message_reaction_count.js";
|
|
61
|
-
export * from "./types/
|
|
62
|
-
export * from "./types/
|
|
63
|
-
export * from "./types/
|
|
64
|
-
export * from "./types/4_inline_query_result_audio.js";
|
|
65
|
-
export * from "./types/4_inline_query_result_cached_audio.js";
|
|
66
|
-
export * from "./types/4_inline_query_result_cached_document.js";
|
|
67
|
-
export * from "./types/4_inline_query_result_cached_gif.js";
|
|
68
|
-
export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
|
|
69
|
-
export * from "./types/4_inline_query_result_cached_photo.js";
|
|
70
|
-
export * from "./types/4_inline_query_result_cached_sticker.js";
|
|
71
|
-
export * from "./types/4_inline_query_result_cached_video.js";
|
|
72
|
-
export * from "./types/4_inline_query_result_cached_voice.js";
|
|
73
|
-
export * from "./types/4_inline_query_result_contact.js";
|
|
74
|
-
export * from "./types/4_inline_query_result_document.js";
|
|
75
|
-
export * from "./types/4_inline_query_result_game.js";
|
|
76
|
-
export * from "./types/4_inline_query_result_gif.js";
|
|
77
|
-
export * from "./types/4_inline_query_result_location.js";
|
|
78
|
-
export * from "./types/4_inline_query_result_mpeg4_gif.js";
|
|
79
|
-
export * from "./types/4_inline_query_result_photo.js";
|
|
80
|
-
export * from "./types/4_inline_query_result_venue.js";
|
|
81
|
-
export * from "./types/4_inline_query_result_video.js";
|
|
82
|
-
export * from "./types/4_inline_query_result_voice.js";
|
|
56
|
+
export * from "./types/2_message_reactions.js";
|
|
57
|
+
export * from "./types/3_reply_markup.js";
|
|
58
|
+
export * from "./types/4_inline_query_result.js";
|
|
83
59
|
export * from "./types/4_message.js";
|
|
84
|
-
export * from "./types/4_reply_markup.js";
|
|
85
60
|
export * from "./types/5_callback_query.js";
|
|
86
61
|
export * from "./types/5_chat.js";
|
|
87
|
-
export * from "./types/5_inline_query_result.js";
|
|
88
62
|
export * from "./types/6_update.js";
|
package/esm/3_types.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
export * from "./types/0__file_id.js";
|
|
2
1
|
export * from "./types/0_authorization_state.js";
|
|
3
2
|
export * from "./types/0_bot_command.js";
|
|
4
3
|
export * from "./types/0_chat_action.js";
|
|
5
4
|
export * from "./types/0_chat_administrator_rights.js";
|
|
6
|
-
export * from "./types/
|
|
5
|
+
export * from "./types/0_chat_member_rights.js";
|
|
7
6
|
export * from "./types/0_chat_photo.js";
|
|
8
7
|
export * from "./types/0_connection_state.js";
|
|
9
8
|
export * from "./types/0_contact.js";
|
|
10
9
|
export * from "./types/0_dice.js";
|
|
11
|
-
export * from "./types/
|
|
10
|
+
export * from "./types/0__file_id.js";
|
|
11
|
+
export * from "./types/0_file_source.js";
|
|
12
12
|
export * from "./types/0_giveaway_parameters.js";
|
|
13
|
-
export * from "./types/
|
|
14
|
-
export * from "./types/0_input_location_message_content.js";
|
|
15
|
-
export * from "./types/0_input_venue_message_content.js";
|
|
13
|
+
export * from "./types/0_id.js";
|
|
16
14
|
export * from "./types/0_keyboard_button_poll_type.js";
|
|
17
15
|
export * from "./types/0_labeled_price.js";
|
|
18
16
|
export * from "./types/0_location.js";
|
|
@@ -24,22 +22,20 @@ export * from "./types/0_network_statistics_entry.js";
|
|
|
24
22
|
export * from "./types/0_parse_mode.js";
|
|
25
23
|
export * from "./types/0_poll_option.js";
|
|
26
24
|
export * from "./types/0_reaction.js";
|
|
27
|
-
export * from "./types/0_reply_keyboard_remove.js";
|
|
28
25
|
export * from "./types/0_restriction_reason.js";
|
|
29
26
|
export * from "./types/0_thumbnail.js";
|
|
30
27
|
export * from "./types/0_venue.js";
|
|
31
28
|
export * from "./types/0_voice.js";
|
|
32
29
|
export * from "./types/0_web_app_info.js";
|
|
33
|
-
export * from "./types/1__getters.js";
|
|
34
30
|
export * from "./types/1_animation.js";
|
|
35
31
|
export * from "./types/1_audio.js";
|
|
36
32
|
export * from "./types/1_bot_command_scope.js";
|
|
37
33
|
export * from "./types/1_chat_p.js";
|
|
38
34
|
export * from "./types/1_document.js";
|
|
35
|
+
export * from "./types/1__getters.js";
|
|
39
36
|
export * from "./types/1_giveaway.js";
|
|
40
37
|
export * from "./types/1_inline_query_result_button.js";
|
|
41
|
-
export * from "./types/
|
|
42
|
-
export * from "./types/1_input_text_message_content.js";
|
|
38
|
+
export * from "./types/1_input_message_content.js";
|
|
43
39
|
export * from "./types/1_keyboard_button.js";
|
|
44
40
|
export * from "./types/1_message_reaction.js";
|
|
45
41
|
export * from "./types/1_network_statistics.js";
|
|
@@ -49,40 +45,18 @@ export * from "./types/1_reaction_count.js";
|
|
|
49
45
|
export * from "./types/1_reply_quote.js";
|
|
50
46
|
export * from "./types/1_sticker.js";
|
|
51
47
|
export * from "./types/1_user.js";
|
|
52
|
-
export * from "./types/1_video.js";
|
|
53
48
|
export * from "./types/1_video_note.js";
|
|
49
|
+
export * from "./types/1_video.js";
|
|
54
50
|
export * from "./types/2_chosen_inline_result.js";
|
|
55
51
|
export * from "./types/2_game.js";
|
|
56
52
|
export * from "./types/2_inline_keyboard_button.js";
|
|
57
53
|
export * from "./types/2_inline_query.js";
|
|
58
|
-
export * from "./types/2_input_message_content.js";
|
|
59
54
|
export * from "./types/2_message_interactions.js";
|
|
60
55
|
export * from "./types/2_message_reaction_count.js";
|
|
61
|
-
export * from "./types/
|
|
62
|
-
export * from "./types/
|
|
63
|
-
export * from "./types/
|
|
64
|
-
export * from "./types/4_inline_query_result_audio.js";
|
|
65
|
-
export * from "./types/4_inline_query_result_cached_audio.js";
|
|
66
|
-
export * from "./types/4_inline_query_result_cached_document.js";
|
|
67
|
-
export * from "./types/4_inline_query_result_cached_gif.js";
|
|
68
|
-
export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
|
|
69
|
-
export * from "./types/4_inline_query_result_cached_photo.js";
|
|
70
|
-
export * from "./types/4_inline_query_result_cached_sticker.js";
|
|
71
|
-
export * from "./types/4_inline_query_result_cached_video.js";
|
|
72
|
-
export * from "./types/4_inline_query_result_cached_voice.js";
|
|
73
|
-
export * from "./types/4_inline_query_result_contact.js";
|
|
74
|
-
export * from "./types/4_inline_query_result_document.js";
|
|
75
|
-
export * from "./types/4_inline_query_result_game.js";
|
|
76
|
-
export * from "./types/4_inline_query_result_gif.js";
|
|
77
|
-
export * from "./types/4_inline_query_result_location.js";
|
|
78
|
-
export * from "./types/4_inline_query_result_mpeg4_gif.js";
|
|
79
|
-
export * from "./types/4_inline_query_result_photo.js";
|
|
80
|
-
export * from "./types/4_inline_query_result_venue.js";
|
|
81
|
-
export * from "./types/4_inline_query_result_video.js";
|
|
82
|
-
export * from "./types/4_inline_query_result_voice.js";
|
|
56
|
+
export * from "./types/2_message_reactions.js";
|
|
57
|
+
export * from "./types/3_reply_markup.js";
|
|
58
|
+
export * from "./types/4_inline_query_result.js";
|
|
83
59
|
export * from "./types/4_message.js";
|
|
84
|
-
export * from "./types/4_reply_markup.js";
|
|
85
60
|
export * from "./types/5_callback_query.js";
|
|
86
61
|
export * from "./types/5_chat.js";
|
|
87
|
-
export * from "./types/5_inline_query_result.js";
|
|
88
62
|
export * from "./types/6_update.js";
|
package/esm/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 169;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.140";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -53,7 +53,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
53
53
|
]);
|
|
54
54
|
export const INITIAL_DC = "2";
|
|
55
55
|
export const LAYER = 169;
|
|
56
|
-
export const APP_VERSION = "MTKruto 0.1.
|
|
56
|
+
export const APP_VERSION = "MTKruto 0.1.140";
|
|
57
57
|
// @ts-ignore: lib
|
|
58
58
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
59
59
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/esm/5_client.d.ts
CHANGED
package/esm/5_client.js
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CallbackQuery, ChatP, ChosenInlineResult, MessageTypes, UpdateMap, User } from "../3_types.js";
|
|
2
|
+
type AnyLevel1 = keyof UpdateMap;
|
|
3
|
+
type GetLevel1Type<L1 extends AnyLevel1> = UpdateMap[L1];
|
|
4
|
+
interface Level2Map {
|
|
5
|
+
"message": keyof MessageTypes;
|
|
6
|
+
"editedMessage": keyof MessageTypes;
|
|
7
|
+
"callbackQuery": "message" | "inlineMessageId" | "data" | "gameShortName";
|
|
8
|
+
"chosenInlineResult": "inlineMessageId";
|
|
9
|
+
}
|
|
10
|
+
interface Level2TypeMap {
|
|
11
|
+
"callbackQuery": CallbackQuery;
|
|
12
|
+
"chosenInlineResult": ChosenInlineResult;
|
|
13
|
+
}
|
|
14
|
+
type GetAnyLevel2<L1 extends AnyLevel1> = L1 extends keyof Level2Map ? Level2Map[L1] : never;
|
|
15
|
+
type AnyLevel2<L1 extends AnyLevel1 = AnyLevel1> = L1 extends unknown ? `${L1 extends "message" | "editedMessage" ? L1 | "" : L1}:${GetAnyLevel2<L1>}` : never;
|
|
16
|
+
type GetLevel2Type<L1 extends string, L2 extends string> = L2 extends keyof MessageTypes ? L1 extends "" ? {
|
|
17
|
+
[P in "message" | "editedMessage"]?: MessageTypes[L2];
|
|
18
|
+
} : L1 extends "message" | "editedMessage" ? {
|
|
19
|
+
[P in L1]: MessageTypes[L2];
|
|
20
|
+
} : never : L1 extends keyof Level2TypeMap ? L2 extends Level2Map[L1] ? {
|
|
21
|
+
[P in L1]: Level2TypeMap[P] & {
|
|
22
|
+
[P in L2]-?: P extends keyof Level2TypeMap[L1] ? NonNullable<Level2TypeMap[L1][P]> : never;
|
|
23
|
+
};
|
|
24
|
+
} : never : never;
|
|
25
|
+
type AnyLevelX = AnyLevel1 | AnyLevel2;
|
|
26
|
+
type FilterCore<Q extends AnyLevelX = AnyLevelX> = Q extends AnyLevel1 ? GetLevel1Type<Q> : Q extends `${infer L1}:${infer L2}` ? GetLevel2Type<L1, L2> : 1;
|
|
27
|
+
type Chat<T> = "msg" extends keyof T ? T & {
|
|
28
|
+
chat: ChatP;
|
|
29
|
+
} : "messageReactions" extends keyof T ? T & {
|
|
30
|
+
chat: ChatP;
|
|
31
|
+
} : "messageReactionCount" extends keyof T ? T & {
|
|
32
|
+
chat: ChatP;
|
|
33
|
+
} : T;
|
|
34
|
+
type Msg<T> = "message" extends keyof T ? T & {
|
|
35
|
+
msg: NonNullable<T["message"]>;
|
|
36
|
+
} : "editedMessage" extends keyof T ? T & {
|
|
37
|
+
msg: NonNullable<T["editedMessage"]>;
|
|
38
|
+
} : "callbackQuery" extends keyof T ? "message" extends keyof T["callbackQuery"] ? T & {
|
|
39
|
+
msg: T["callbackQuery"]["message"];
|
|
40
|
+
} : T : T;
|
|
41
|
+
type From<T> = "callbackQuery" extends keyof T ? T & {
|
|
42
|
+
from: User;
|
|
43
|
+
} : "inlineQuery" extends keyof T ? T & {
|
|
44
|
+
from: User;
|
|
45
|
+
} : "message" extends keyof T ? T & {
|
|
46
|
+
from?: User;
|
|
47
|
+
} : "editedMessage" extends keyof T ? T & {
|
|
48
|
+
from?: User;
|
|
49
|
+
} : T;
|
|
50
|
+
type SenderChat<T> = "message" extends keyof T ? T & {
|
|
51
|
+
senderChat?: ChatP;
|
|
52
|
+
} : "editedMessage" extends keyof T ? T & {
|
|
53
|
+
senderChat?: ChatP;
|
|
54
|
+
} : T;
|
|
55
|
+
type Shortcuts<T> = SenderChat<From<Chat<Msg<T>>>>;
|
|
56
|
+
type Filter<Q extends AnyLevelX> = Shortcuts<FilterCore<Q>>;
|
|
57
|
+
export type FilterQuery = AnyLevelX;
|
|
58
|
+
export type WithFilter<T, Q extends FilterQuery> = T & Filter<Q>;
|
|
59
|
+
export declare function match<Q extends FilterQuery, T extends object>(filter: Q, value: T): boolean;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function match(filter, value) {
|
|
2
|
+
let [type, ...other] = filter.split(":");
|
|
3
|
+
if (type != "" && !(type in value)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
if (type == "") {
|
|
7
|
+
if (other.length != 1) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if ("message" in value) {
|
|
11
|
+
type = "message";
|
|
12
|
+
}
|
|
13
|
+
else if ("editedMessage" in value) {
|
|
14
|
+
type = "editedMessage";
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const field = other[0];
|
|
21
|
+
if (field) {
|
|
22
|
+
if (!(field in value[type])) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
package/esm/client/0_message.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { assertEquals, ige256Decrypt, ige256Encrypt } from "../0_deps.js";
|
|
2
|
-
import { bufferFromBigInt, concat, mod, sha256 } from "../1_utilities.js";
|
|
2
|
+
import { bufferFromBigInt, concat, mod, sha256, toUnixTimestamp } from "../1_utilities.js";
|
|
3
3
|
import { id, Message_, MessageContainer, RPCResult, serialize, TLReader, TLWriter } from "../2_tl.js";
|
|
4
4
|
export function getMessageId(lastMsgId) {
|
|
5
|
-
const now = new Date()
|
|
5
|
+
const now = toUnixTimestamp(new Date()) + 0;
|
|
6
6
|
const nanoseconds = Math.floor((now - Math.floor(now)) * 1e9);
|
|
7
7
|
let newMsgId = (BigInt(Math.floor(now)) <<
|
|
8
8
|
32n) ||
|
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
-
import { BotCommandScope, Chat,
|
|
3
|
-
import { ParseMode } from "../3_types.js";
|
|
4
|
-
import { FileSource } from "./0_utilities.js";
|
|
5
|
-
import { ClientPlainParams } from "./2_client_plain.js";
|
|
6
|
-
export interface ClientParams extends ClientPlainParams {
|
|
7
|
-
/** A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defauls to `ParseMode.None`. */
|
|
8
|
-
parseMode?: ParseMode;
|
|
9
|
-
/** The app_version parameter to be passed to initConnection when calling `authorize`. It is recommended that this parameter is changed if users are authorized. Defaults to "MTKruto" followed by this version of MTKruto. */
|
|
10
|
-
appVersion?: string;
|
|
11
|
-
/** The device_version parameter to be passed to initConnection when calling `authorize`. The default varies by the current runtime. */
|
|
12
|
-
deviceModel?: string;
|
|
13
|
-
/** The lang_code parameter to be passed to initConnection when calling `authorize`. Defaults to the runtime's language or `"en"`. */
|
|
14
|
-
langCode?: string;
|
|
15
|
-
/** The lang_pack parameter to be passed to initConnection when calling `authorize`. Defaults to an empty string. */
|
|
16
|
-
langPack?: string;
|
|
17
|
-
/** The system_lang_cde parameter to be passed to initConnection when calling `authorize`. Defaults to the runtime's language or `"en"`. */
|
|
18
|
-
systemLangCode?: string;
|
|
19
|
-
/** The system_version parameter to be passed to initConnection when calling `authorize`. The default varies by the current runtime. */
|
|
20
|
-
systemVersion?: string;
|
|
21
|
-
/** Whether to automatically call `start` with no parameters in the first `invoke` call. Defaults to `true`. */
|
|
22
|
-
autoStart?: boolean;
|
|
23
|
-
/** Whether to use default handlers. Defaults to `true`. */
|
|
24
|
-
defaultHandlers?: boolean;
|
|
25
|
-
/** Whether to ignore outgoing messages. Defaults to `true` for bots, and `false` for users. */
|
|
26
|
-
ignoreOutgoing?: boolean;
|
|
27
|
-
/** Default command prefixes. Defaults to `"/"` for bots and `"\"` for users. This option must be set separately for nested composers. */
|
|
28
|
-
prefixes?: string | string[];
|
|
29
|
-
/** Whether to guarantee that order-sensitive updates are delivered at least once before delivering next ones. Useful mainly for clients providing a user interface à la Telegram Desktop. Defaults to `false`. */
|
|
30
|
-
guaranteeUpdateDelivery?: boolean;
|
|
31
|
-
}
|
|
2
|
+
import { BotCommandScope, Chat, ChatMemberRights, FileSource, ID, InlineQueryResultButton, Message, MessageEntity, ParseMode, ReplyMarkup, ReplyQuote } from "../3_types.js";
|
|
32
3
|
export interface AnswerCallbackQueryParams {
|
|
33
4
|
/** A text to be shown to the user. */
|
|
34
5
|
text?: string;
|
|
@@ -56,9 +27,9 @@ export interface _SendCommon {
|
|
|
56
27
|
/** The identifier of a thread to send the message to. */
|
|
57
28
|
messageThreadId?: number;
|
|
58
29
|
/** The identifier of the chat to send the message on behalf of. User-only. */
|
|
59
|
-
sendAs?:
|
|
30
|
+
sendAs?: ID;
|
|
60
31
|
/** The reply markup of the message. Bot-only. */
|
|
61
|
-
replyMarkup?:
|
|
32
|
+
replyMarkup?: ReplyMarkup;
|
|
62
33
|
}
|
|
63
34
|
export interface SendMessageParams extends _SendCommon {
|
|
64
35
|
/** The parse mode to use. If not provided, the default parse mode will be used. */
|
|
@@ -76,7 +47,11 @@ export interface EditMessageParams {
|
|
|
76
47
|
/** Whether to disable web page previews in the message that is to be edited. */
|
|
77
48
|
disableWebPagePreview?: boolean;
|
|
78
49
|
/** The reply markup of the message. Bot-only. */
|
|
79
|
-
replyMarkup?:
|
|
50
|
+
replyMarkup?: ReplyMarkup;
|
|
51
|
+
}
|
|
52
|
+
export interface EditMessageReplyMarkupParams {
|
|
53
|
+
/** The reply markup of the message. Bot-only. */
|
|
54
|
+
replyMarkup?: ReplyMarkup;
|
|
80
55
|
}
|
|
81
56
|
export interface ForwardMessagesParams extends Omit<_SendCommon, "replyToMessageId" | "replyMarkup"> {
|
|
82
57
|
/** Whether to not include the original sender of the message that is going to be forwarded. */
|
|
@@ -109,6 +84,8 @@ export interface SendPollParams extends _SendCommon {
|
|
|
109
84
|
export interface DownloadParams {
|
|
110
85
|
/** Size of each download chunk in bytes. */
|
|
111
86
|
chunkSize?: number;
|
|
87
|
+
/** Download offset in bytes. */
|
|
88
|
+
offset?: number;
|
|
112
89
|
}
|
|
113
90
|
export interface _UploadCommon {
|
|
114
91
|
/** The file name to assign if applicable. */
|
|
@@ -168,6 +145,8 @@ export interface _SpoilCommon {
|
|
|
168
145
|
}
|
|
169
146
|
export interface SendPhotoParams extends _CaptionCommon, _SpoilCommon, _UploadCommon, _SendCommon {
|
|
170
147
|
}
|
|
148
|
+
export interface SetChatPhotoParams extends _UploadCommon {
|
|
149
|
+
}
|
|
171
150
|
export interface _ThumbnailCommon {
|
|
172
151
|
/** A thumbnail to assign. Cannot be a URL. */
|
|
173
152
|
thumbnail?: FileSource;
|
|
@@ -263,3 +242,21 @@ export interface GetChatsParams {
|
|
|
263
242
|
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
|
|
264
243
|
limit?: number;
|
|
265
244
|
}
|
|
245
|
+
export interface PinMessageParams {
|
|
246
|
+
/** Whether to pin the message for both sides. For private chats only. */
|
|
247
|
+
bothSides?: boolean;
|
|
248
|
+
/** Whether to silently pin the message. */
|
|
249
|
+
disableNotification?: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface BanChatMemberParams {
|
|
252
|
+
/** A point of time in the future to automatically withdraw the ban. */
|
|
253
|
+
untilDate?: Date;
|
|
254
|
+
/** Whether to delete all of the user's messages. */
|
|
255
|
+
deleteMessages?: boolean;
|
|
256
|
+
}
|
|
257
|
+
export interface SetChatMemberRightsParams {
|
|
258
|
+
/** The member's new rights. All fields default to `true` if the chat's default member rights allow. This means that this method is the same as unbanChatMember if this parameter is not provided or all of its fields are `true`. */
|
|
259
|
+
rights?: ChatMemberRights;
|
|
260
|
+
/** A point of time in the future to automatically withdraw the restrictions. */
|
|
261
|
+
untilDate?: Date;
|
|
262
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { functions, types } from "../2_tl.js";
|
|
2
|
+
import { Storage } from "../3_storage.js";
|
|
3
|
+
import { ConnectionState, EntityGetter, ID, ParseMode, Update } from "../3_types.js";
|
|
4
|
+
type Functions = typeof functions;
|
|
5
|
+
type Keys = keyof Functions;
|
|
6
|
+
type AnyFunc = (...args: any) => any;
|
|
7
|
+
type Promisify<T extends AnyFunc> = (...args: Parameters<T>) => Promise<ReturnType<T>>;
|
|
8
|
+
export type Api = {
|
|
9
|
+
[K in Keys]: Functions[K] extends {
|
|
10
|
+
__F: AnyFunc;
|
|
11
|
+
} ? Promisify<Functions[K]["__F"]> : {
|
|
12
|
+
[K_ in keyof Functions[K]]: Functions[K][K_] extends {
|
|
13
|
+
__F: AnyFunc;
|
|
14
|
+
} ? Promisify<Functions[K][K_]["__F"]> : Functions[K][K_];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
interface ApiFactory {
|
|
18
|
+
(dcId?: number): {
|
|
19
|
+
api: Api;
|
|
20
|
+
connect: () => Promise<void>;
|
|
21
|
+
disconnect: () => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface C {
|
|
25
|
+
api: Api;
|
|
26
|
+
storage: Storage;
|
|
27
|
+
guaranteeUpdateDelivery: boolean;
|
|
28
|
+
setConnectionState: (connectionState: ConnectionState) => void;
|
|
29
|
+
resetConnectionState: () => void;
|
|
30
|
+
getSelfId: () => Promise<number>;
|
|
31
|
+
getInputPeer: (id: ID) => Promise<types.InputPeerChat | types.InputPeerUser | types.InputPeerChannel>;
|
|
32
|
+
getEntity: EntityGetter;
|
|
33
|
+
handleUpdate: (update: Update) => void;
|
|
34
|
+
parseMode: ParseMode;
|
|
35
|
+
apiFactory: ApiFactory;
|
|
36
|
+
}
|
|
37
|
+
export declare class ConnectionError extends Error {
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -1,55 +1,9 @@
|
|
|
1
1
|
import { enums, types } from "../2_tl.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FileSource } from "../3_types.js";
|
|
3
3
|
export declare const resolve: () => Promise<void>;
|
|
4
|
-
export type With<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
5
4
|
export declare function isPtsUpdate(v: enums.Update): v is types.UpdateNewMessage | types.UpdateDeleteMessages | types.UpdateReadHistoryInbox | types.UpdateReadHistoryOutbox | types.UpdatePinnedChannelMessages | types.UpdatePinnedMessages | types.UpdateFolderPeers | types.UpdateChannelWebPage | types.UpdateEditMessage | types.UpdateReadMessagesContents | types.UpdateWebPage;
|
|
6
5
|
export declare function isChannelPtsUpdate(v: enums.Update | enums.Updates): v is types.UpdateNewChannelMessage | types.UpdateEditChannelMessage | types.UpdateDeleteChannelMessages | types.UpdateChannelTooLong;
|
|
7
|
-
/**
|
|
8
|
-
* Source to a file. Can be a file ID, a file path, URL, or a `Uint8Array`, unless otherwise noted.
|
|
9
|
-
*/
|
|
10
|
-
export type FileSource = string | URL | Uint8Array;
|
|
11
6
|
export declare function getFileContents(source: FileSource, fileName?: string): Promise<readonly [Uint8Array, string]>;
|
|
12
7
|
export declare function isHttpUrl(string: string): boolean;
|
|
13
8
|
export declare function getUsername(string: string): string;
|
|
14
9
|
export declare function getChatListId(chatList: string): 0 | 1;
|
|
15
|
-
type AnyLevel1 = keyof UpdateMap;
|
|
16
|
-
type GetLevel1Type<L1 extends AnyLevel1> = UpdateMap[L1];
|
|
17
|
-
type GetAnyLevel2<L1 extends AnyLevel1> = L1 extends "message" | "editedMessage" ? keyof MessageTypes : never;
|
|
18
|
-
type AnyLevel2<L1 extends AnyLevel1 = AnyLevel1> = L1 extends unknown ? `${L1 extends "message" | "editedMessage" ? L1 | "" : L1}:${GetAnyLevel2<L1>}` : never;
|
|
19
|
-
type GetLevel2Type<L1 extends string, L2 extends string> = L2 extends keyof MessageTypes ? L1 extends "" ? {
|
|
20
|
-
[P in "message" | "editedMessage"]?: MessageTypes[L2];
|
|
21
|
-
} : L1 extends "message" | "editedMessage" ? {
|
|
22
|
-
[P in L1]: MessageTypes[L2];
|
|
23
|
-
} : never : never;
|
|
24
|
-
type AnyLevelX = AnyLevel1 | AnyLevel2;
|
|
25
|
-
type FilterCore<Q extends AnyLevelX = AnyLevelX> = Q extends AnyLevel1 ? GetLevel1Type<Q> : Q extends `${infer L1}:${infer L2}` ? GetLevel2Type<L1, L2> : 1;
|
|
26
|
-
type Chat<T> = "msg" extends keyof T ? T & {
|
|
27
|
-
chat: ChatP;
|
|
28
|
-
} : T;
|
|
29
|
-
type Msg<T> = "message" extends keyof T ? T & {
|
|
30
|
-
msg: NonNullable<T["message"]>;
|
|
31
|
-
} : "editedMessage" extends keyof T ? T & {
|
|
32
|
-
msg: NonNullable<T["editedMessage"]>;
|
|
33
|
-
} : "callbackQuery" extends keyof T ? "message" extends keyof T["callbackQuery"] ? T & {
|
|
34
|
-
msg: T["callbackQuery"]["message"];
|
|
35
|
-
} : T : T;
|
|
36
|
-
type From<T> = "callbackQuery" extends keyof T ? T & {
|
|
37
|
-
from: User;
|
|
38
|
-
} : "inlineQuery" extends keyof T ? T & {
|
|
39
|
-
from: User;
|
|
40
|
-
} : "message" extends keyof T ? T & {
|
|
41
|
-
from?: User;
|
|
42
|
-
} : "editedMessage" extends keyof T ? T & {
|
|
43
|
-
from?: User;
|
|
44
|
-
} : T;
|
|
45
|
-
type SenderChat<T> = "message" extends keyof T ? T & {
|
|
46
|
-
senderChat?: ChatP;
|
|
47
|
-
} : "editedMessage" extends keyof T ? T & {
|
|
48
|
-
senderChat?: ChatP;
|
|
49
|
-
} : T;
|
|
50
|
-
type Shortcuts<T> = SenderChat<From<Chat<Msg<T>>>>;
|
|
51
|
-
type Filter<Q extends AnyLevelX> = Shortcuts<FilterCore<Q>>;
|
|
52
|
-
export type FilterQuery = AnyLevelX;
|
|
53
|
-
export type WithFilter<T, Q extends FilterQuery> = T & Filter<Q>;
|
|
54
|
-
export declare function match<Q extends FilterQuery, T extends object>(filter: Q, value: T): boolean;
|
|
55
|
-
export {};
|
|
@@ -145,30 +145,3 @@ export function getChatListId(chatList) {
|
|
|
145
145
|
UNREACHABLE();
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
export function match(filter, value) {
|
|
149
|
-
let [type, ...other] = filter.split(":");
|
|
150
|
-
if (type != "" && !(type in value)) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
if (type == "") {
|
|
154
|
-
if (other.length != 1) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
if ("message" in value) {
|
|
158
|
-
type = "message";
|
|
159
|
-
}
|
|
160
|
-
else if ("editedMessage" in value) {
|
|
161
|
-
type = "editedMessage";
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
const field = other[0];
|
|
168
|
-
if (field) {
|
|
169
|
-
if (!(field in value[type])) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Update, UpdateIntersection, User } from "../3_types.js";
|
|
2
|
-
import { FilterQuery, WithFilter } from "./
|
|
2
|
+
import { FilterQuery, WithFilter } from "./0_filters.js";
|
|
3
3
|
type MaybePromise<T> = T | Promise<T>;
|
|
4
4
|
export type NextFunction = () => Promise<void>;
|
|
5
5
|
export type MiddlewareFn<C> = (ctx: C, next: NextFunction) => MaybePromise<unknown>;
|
package/esm/client/1_composer.js
CHANGED
|
@@ -10,7 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
12
|
var _Composer_handle, _Composer_prefixes;
|
|
13
|
-
import { match } from "./
|
|
13
|
+
import { match } from "./0_filters.js";
|
|
14
14
|
export function flatten(mw) {
|
|
15
15
|
return typeof mw === "function" ? mw : (ctx, next) => mw.middleware()(ctx, next);
|
|
16
16
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Document } from "../3_types.js";
|
|
2
|
+
import { DownloadParams, UploadParams } from "./0_params.js";
|
|
3
|
+
import { C } from "./0_types.js";
|
|
4
|
+
export declare class FileManager {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(c: C);
|
|
7
|
+
upload(contents: Uint8Array, params?: UploadParams): Promise<import("../tl/2_types.js").InputFile_ | import("../tl/2_types.js").InputFileBig_>;
|
|
8
|
+
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
9
|
+
getCustomEmojiDocuments(id: string | string[]): Promise<Document[]>;
|
|
10
|
+
}
|