@mtkruto/node 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/0_errors.d.ts +1 -1
- package/esm/0_errors.js +1 -1
- package/esm/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_connection.d.ts +1 -1
- package/esm/2_connection.js +1 -1
- package/esm/2_storage.d.ts +1 -1
- package/esm/2_storage.js +1 -1
- package/esm/2_tl.d.ts +1 -1
- package/esm/2_tl.js +1 -1
- package/esm/3_errors.d.ts +1 -1
- package/esm/3_errors.js +1 -1
- package/esm/3_transport.d.ts +1 -1
- package/esm/3_transport.js +1 -1
- package/esm/3_types.d.ts +5 -1
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +5 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +2 -2
- package/esm/4_errors.d.ts +1 -1
- package/esm/4_errors.js +1 -1
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_client_abstract.js +1 -1
- package/esm/client/0_filters.d.ts +1 -1
- package/esm/client/0_filters.js +1 -1
- package/esm/client/0_html.d.ts +1 -1
- package/esm/client/0_html.js +1 -1
- package/esm/client/0_markdown.d.ts +1 -1
- package/esm/client/0_markdown.js +1 -1
- package/esm/client/0_message.d.ts +1 -1
- package/esm/client/0_message.js +1 -1
- package/esm/client/0_params.d.ts +31 -9
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_params.js +1 -1
- package/esm/client/0_password.js +1 -1
- package/esm/client/0_storage_operations.d.ts +1 -1
- package/esm/client/0_storage_operations.js +1 -1
- package/esm/client/0_update_processor.d.ts +7 -0
- package/esm/client/0_update_processor.d.ts.map +1 -0
- package/esm/client/0_update_processor.js +1 -0
- package/esm/client/0_utilities.d.ts +3 -3
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +1 -1
- package/esm/client/1_client_encrypted.d.ts +1 -1
- package/esm/client/1_client_encrypted.js +1 -1
- package/esm/client/1_client_plain.d.ts +1 -1
- package/esm/client/1_client_plain.js +1 -1
- package/esm/client/1_composer.d.ts +1 -1
- package/esm/client/1_composer.js +1 -1
- package/esm/client/1_types.d.ts +1 -1
- package/esm/client/1_types.js +1 -1
- package/esm/client/2_account_manager.d.ts +1 -1
- package/esm/client/2_account_manager.js +1 -1
- package/esm/client/2_bot_info_manager.d.ts +1 -1
- package/esm/client/2_bot_info_manager.js +1 -1
- package/esm/client/2_business_connection_manager.d.ts +4 -3
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +2 -2
- package/esm/client/2_file_manager.js +1 -1
- package/esm/client/2_gift_manager.d.ts +29 -0
- package/esm/client/2_gift_manager.d.ts.map +1 -0
- package/esm/client/2_gift_manager.js +62 -0
- package/esm/client/2_network_statistics_manager.d.ts +1 -1
- package/esm/client/2_network_statistics_manager.js +1 -1
- package/esm/client/2_payment_manager.d.ts +4 -3
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +2 -2
- package/esm/client/2_reaction_manager.d.ts +4 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +2 -2
- package/esm/client/2_translations_manager.d.ts +3 -2
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +1 -1
- package/esm/client/2_update_manager.d.ts +1 -1
- package/esm/client/2_update_manager.js +1 -1
- package/esm/client/3_message_manager.d.ts +10 -26
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +64 -241
- package/esm/client/3_video_chat_manager.d.ts +5 -4
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +5 -2
- package/esm/client/4_callback_query_manager.d.ts +4 -3
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +2 -2
- package/esm/client/4_chat_list_manager.d.ts +5 -4
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +3 -2
- package/esm/client/4_chat_manager.d.ts +61 -0
- package/esm/client/4_chat_manager.d.ts.map +1 -0
- package/esm/client/4_chat_manager.js +293 -0
- package/esm/client/4_inline_query_manager.d.ts +4 -3
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +2 -2
- package/esm/client/4_poll_manager.d.ts +4 -3
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +2 -2
- package/esm/client/4_story_manager.d.ts +4 -3
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +2 -2
- package/esm/client/5_client.d.ts +44 -7
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +182 -73
- package/esm/connection/0_connection.d.ts +1 -1
- package/esm/connection/0_connection.js +1 -1
- package/esm/connection/1_connection_tcp.node.d.ts +1 -1
- package/esm/connection/1_connection_tcp.node.js +1 -1
- package/esm/connection/1_connection_web_socket.js +1 -1
- package/esm/mod.d.ts +1 -1
- package/esm/mod.js +1 -1
- package/esm/storage/0_storage.d.ts +1 -1
- package/esm/storage/0_storage.js +1 -1
- package/esm/storage/1_utilities.d.ts +1 -1
- package/esm/storage/1_utilities.js +1 -1
- package/esm/storage/2_storage_indexed_db.d.ts +1 -1
- package/esm/storage/2_storage_indexed_db.js +1 -1
- package/esm/storage/2_storage_local_storage.node.d.ts +1 -1
- package/esm/storage/2_storage_local_storage.node.js +1 -1
- package/esm/storage/2_storage_memory.d.ts +1 -1
- package/esm/storage/2_storage_memory.js +1 -1
- package/esm/storage/2_storage_session_storage.d.ts +1 -1
- package/esm/storage/2_storage_session_storage.js +1 -1
- package/esm/tl/0_api.d.ts +218 -79
- package/esm/tl/0_api.d.ts.map +1 -1
- package/esm/tl/0_api.js +362 -159
- package/esm/tl/0_tl_raw_reader.d.ts +1 -1
- package/esm/tl/0_tl_raw_reader.js +1 -1
- package/esm/tl/0_tl_raw_writer.d.ts +1 -1
- package/esm/tl/0_tl_raw_writer.js +1 -1
- package/esm/tl/1_utilities.d.ts +1 -1
- package/esm/tl/1_utilities.js +1 -1
- package/esm/tl/2_deserialize.d.ts +1 -1
- package/esm/tl/2_deserialize.js +1 -1
- package/esm/tl/2_serialize.d.ts +1 -1
- package/esm/tl/2_serialize.js +1 -1
- package/esm/tl/3_tl_reader.d.ts +1 -1
- package/esm/tl/3_tl_reader.js +1 -1
- package/esm/tl/3_utilities.d.ts +1 -1
- package/esm/tl/3_utilities.js +1 -1
- package/esm/tl/4_rpc_result.d.ts +1 -1
- package/esm/tl/4_rpc_result.js +1 -1
- package/esm/tl/4_tl_writer.d.ts +1 -1
- package/esm/tl/4_tl_writer.js +1 -1
- package/esm/tl/5_message.d.ts +1 -1
- package/esm/tl/5_message.js +1 -1
- package/esm/transport/0_obfuscation.js +1 -1
- package/esm/transport/0_transport.d.ts +1 -1
- package/esm/transport/0_transport.js +1 -1
- package/esm/transport/1_transport_abridged.d.ts +1 -1
- package/esm/transport/1_transport_abridged.js +1 -1
- package/esm/transport/1_transport_intermediate.d.ts +1 -1
- package/esm/transport/1_transport_intermediate.js +1 -1
- package/esm/transport/2_transport_provider.d.ts +1 -1
- package/esm/transport/2_transport_provider.js +1 -1
- package/esm/transport/3_transport_provider_tcp.d.ts +1 -1
- package/esm/transport/3_transport_provider_tcp.js +1 -1
- package/esm/transport/3_transport_provider_web_socket.d.ts +1 -1
- package/esm/transport/3_transport_provider_web_socket.js +1 -1
- package/esm/types/0_authorization_state.d.ts +1 -1
- package/esm/types/0_authorization_state.js +1 -1
- package/esm/types/0_birthday.d.ts +1 -1
- package/esm/types/0_birthday.js +1 -1
- package/esm/types/0_bot_command.d.ts +1 -1
- package/esm/types/0_bot_command.js +1 -1
- package/esm/types/0_callback_query_answer.d.ts +1 -1
- package/esm/types/0_callback_query_answer.js +1 -1
- package/esm/types/0_callback_query_question.d.ts +1 -1
- package/esm/types/0_callback_query_question.js +1 -1
- package/esm/types/0_chat_action.d.ts +1 -1
- package/esm/types/0_chat_action.js +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +1 -1
- package/esm/types/0_chat_administrator_rights.js +1 -1
- package/esm/types/0_chat_member_rights.d.ts +1 -1
- package/esm/types/0_chat_member_rights.js +1 -1
- package/esm/types/0_chat_photo.d.ts +1 -1
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_connection_state.d.ts +1 -1
- package/esm/types/0_connection_state.js +1 -1
- package/esm/types/0_contact.d.ts +1 -1
- package/esm/types/0_contact.js +1 -1
- package/esm/types/0_dice.d.ts +1 -1
- package/esm/types/0_dice.js +1 -1
- package/esm/types/0_failed_invitation.d.ts +1 -1
- package/esm/types/0_failed_invitation.js +1 -1
- package/esm/types/0_file_source.d.ts +1 -1
- package/esm/types/0_file_source.js +1 -1
- package/esm/types/0_giveaway_parameters.d.ts +1 -1
- package/esm/types/0_giveaway_parameters.js +1 -1
- package/esm/types/0_id.d.ts +1 -1
- package/esm/types/0_id.js +1 -1
- package/esm/types/0_invoice.d.ts +1 -1
- package/esm/types/0_invoice.js +1 -1
- package/esm/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/esm/types/0_keyboard_button_poll_type.js +1 -1
- package/esm/types/0_link_preview.d.ts +1 -1
- package/esm/types/0_link_preview.js +1 -1
- package/esm/types/0_live_stream_channel.d.ts +1 -1
- package/esm/types/0_live_stream_channel.js +1 -1
- package/esm/types/0_location.d.ts +1 -1
- package/esm/types/0_location.js +1 -1
- package/esm/types/0_login_url.d.ts +1 -1
- package/esm/types/0_login_url.js +1 -1
- package/esm/types/0_mask_position.d.ts +1 -1
- package/esm/types/0_mask_position.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_message_entity.js +1 -1
- package/esm/types/0_message_reference.d.ts +1 -1
- package/esm/types/0_message_reference.js +1 -1
- package/esm/types/0_message_search_filter.d.ts +1 -1
- package/esm/types/0_message_search_filter.js +1 -1
- package/esm/types/0_mini_app_info.d.ts +1 -1
- package/esm/types/0_mini_app_info.js +1 -1
- package/esm/types/0_network_statistics_entry.d.ts +1 -1
- package/esm/types/0_network_statistics_entry.js +1 -1
- package/esm/types/0_opening_hours.d.ts +1 -1
- package/esm/types/0_opening_hours.js +1 -1
- package/esm/types/0_parse_mode.d.ts +1 -1
- package/esm/types/0_parse_mode.js +1 -1
- package/esm/types/0_price_tag.d.ts +1 -1
- package/esm/types/0_price_tag.js +1 -1
- package/esm/types/0_reaction.d.ts +1 -1
- package/esm/types/0_reaction.js +1 -1
- package/esm/types/0_refunded_payment.d.ts +1 -1
- package/esm/types/0_refunded_payment.js +1 -1
- package/esm/types/0_restriction_reason.d.ts +1 -1
- package/esm/types/0_restriction_reason.js +1 -1
- package/esm/types/0_self_destruct_option.d.ts +1 -1
- package/esm/types/0_self_destruct_option.js +1 -1
- package/esm/types/0_shipping_address.d.ts +1 -1
- package/esm/types/0_shipping_address.js +1 -1
- package/esm/types/0_story_reference.d.ts +1 -1
- package/esm/types/0_story_reference.js +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.js +1 -1
- package/esm/types/0_thumbnail.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/0_video_chat.d.ts +1 -1
- package/esm/types/0_video_chat.js +1 -1
- package/esm/types/0_voice.d.ts +1 -1
- package/esm/types/0_voice.js +1 -1
- package/esm/types/1_animation.d.ts +1 -1
- package/esm/types/1_animation.js +1 -1
- package/esm/types/1_audio.d.ts +1 -1
- package/esm/types/1_audio.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_bot_command_scope.js +1 -1
- package/esm/types/1_chat_p.d.ts +1 -1
- package/esm/types/1_chat_p.js +1 -1
- package/esm/types/1_document.d.ts +1 -1
- package/esm/types/1_document.js +1 -1
- package/esm/types/1_giveaway.d.ts +1 -1
- package/esm/types/1_giveaway.js +1 -1
- package/esm/types/1_inline_query_result_button.d.ts +1 -1
- package/esm/types/1_inline_query_result_button.js +1 -1
- package/esm/types/1_input_media.d.ts +1 -1
- package/esm/types/1_input_media.js +1 -1
- package/esm/types/1_input_story_content.d.ts +1 -1
- package/esm/types/1_input_story_content.js +1 -1
- package/esm/types/1_keyboard_button.d.ts +1 -1
- package/esm/types/1_keyboard_button.js +1 -1
- package/esm/types/1_message_content.d.ts +2 -2
- package/esm/types/1_message_content.d.ts.map +1 -1
- package/esm/types/1_message_content.js +1 -1
- package/esm/types/1_message_reaction.d.ts +1 -1
- package/esm/types/1_message_reaction.js +1 -1
- package/esm/types/1_network_statistics.d.ts +1 -1
- package/esm/types/1_network_statistics.js +1 -1
- package/esm/types/1_order_info.d.ts +1 -1
- package/esm/types/1_order_info.js +1 -1
- package/esm/types/1_photo.d.ts +1 -1
- package/esm/types/1_photo.js +1 -1
- package/esm/types/1_poll_option.d.ts +1 -1
- package/esm/types/1_poll_option.js +1 -1
- package/esm/types/1_reaction_count.d.ts +1 -1
- package/esm/types/1_reaction_count.js +1 -1
- package/esm/types/1_reply_quote.d.ts +1 -1
- package/esm/types/1_reply_quote.js +1 -1
- package/esm/types/1_sticker.d.ts +2 -1
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +7 -3
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/1_story_privacy.js +1 -1
- package/esm/types/1_story_reaction.d.ts +1 -1
- package/esm/types/1_story_reaction.js +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/1_venue.d.ts +1 -1
- package/esm/types/1_venue.js +1 -1
- package/esm/types/1_video.d.ts +1 -1
- package/esm/types/1_video.js +1 -1
- package/esm/types/1_video_note.d.ts +1 -1
- package/esm/types/1_video_note.js +1 -1
- package/esm/types/2_business_connection.d.ts +1 -1
- package/esm/types/2_business_connection.js +1 -1
- package/esm/types/2_chat.d.ts +1 -1
- package/esm/types/2_chat.js +1 -1
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chat_member.js +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.js +1 -1
- package/esm/types/2_forward_header.d.ts +1 -1
- package/esm/types/2_forward_header.js +1 -1
- package/esm/types/2_game.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_gift_upgraded_component.d.ts +95 -0
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/esm/types/2_gift_upgraded_component.js +88 -0
- package/esm/types/2_inactive_chat.d.ts +1 -1
- package/esm/types/2_inactive_chat.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_keyboard_button.js +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_inline_query.js +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_invite_link.js +1 -1
- package/esm/types/2_message_interactions.d.ts +1 -1
- package/esm/types/2_message_interactions.js +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reaction_count.js +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_message_reactions.js +1 -1
- package/esm/types/2_poll.d.ts +1 -1
- package/esm/types/2_poll.js +1 -1
- package/esm/types/2_pre_checkout_query.d.ts +1 -1
- package/esm/types/2_pre_checkout_query.js +1 -1
- package/esm/types/2_reply_to.d.ts +1 -1
- package/esm/types/2_reply_to.js +1 -1
- package/esm/types/2_story_content.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/esm/types/2_story_interactions.d.ts +1 -1
- package/esm/types/2_story_interactions.js +1 -1
- package/esm/types/2_story_interactive_area.d.ts +1 -1
- package/esm/types/2_story_interactive_area.js +1 -1
- package/esm/types/2_successful_payment.d.ts +1 -1
- package/esm/types/2_successful_payment.js +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_chat_member_updated.js +1 -1
- package/esm/types/3_gift.d.ts +82 -0
- package/esm/types/3_gift.d.ts.map +1 -0
- package/esm/types/3_gift.js +88 -0
- package/esm/types/3_join_request.d.ts +1 -1
- package/esm/types/3_join_request.js +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_reply_markup.js +1 -1
- package/esm/types/3_story.d.ts +1 -1
- 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 +2 -1
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +9 -3
- package/esm/types/4_user_gift.d.ts +44 -0
- package/esm/types/4_user_gift.d.ts.map +1 -0
- package/esm/types/4_user_gift.js +43 -0
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_callback_query.js +1 -1
- package/esm/types/5_chat_list_item.d.ts +1 -1
- package/esm/types/5_chat_list_item.js +1 -1
- package/esm/types/5_inline_query_answer.d.ts +1 -1
- package/esm/types/5_inline_query_answer.js +1 -1
- package/esm/types/5_user_gifts.d.ts +32 -0
- package/esm/types/5_user_gifts.d.ts.map +1 -0
- package/esm/types/5_user_gifts.js +29 -0
- package/esm/types/6_update.d.ts +1 -1
- package/esm/types/6_update.js +1 -1
- package/esm/types/_file_id.d.ts +1 -1
- package/esm/types/_file_id.js +1 -1
- package/esm/types/_getters.d.ts +1 -1
- package/esm/types/_getters.js +1 -1
- package/esm/utilities/0_bigint.js +1 -1
- package/esm/utilities/0_buffer.d.ts +1 -1
- package/esm/utilities/0_buffer.js +1 -1
- package/esm/utilities/0_cache_map.d.ts +1 -1
- package/esm/utilities/0_cache_map.js +1 -1
- package/esm/utilities/0_color.d.ts +1 -1
- package/esm/utilities/0_color.js +1 -1
- package/esm/utilities/0_env.js +1 -1
- package/esm/utilities/0_gunzip.d.ts +1 -1
- package/esm/utilities/0_gunzip.js +1 -1
- package/esm/utilities/0_hash.js +1 -1
- package/esm/utilities/0_misc.d.ts +1 -1
- package/esm/utilities/0_misc.js +1 -1
- package/esm/utilities/0_mutex.d.ts +1 -1
- package/esm/utilities/0_mutex.js +1 -1
- package/esm/utilities/0_object.d.ts +1 -1
- package/esm/utilities/0_object.js +1 -1
- package/esm/utilities/0_part_stream.d.ts +1 -1
- package/esm/utilities/0_part_stream.js +1 -1
- package/esm/utilities/0_rle.d.ts +1 -1
- package/esm/utilities/0_rle.js +1 -1
- package/esm/utilities/0_types.d.ts +1 -1
- package/esm/utilities/0_types.js +1 -1
- package/esm/utilities/0_units.d.ts +1 -1
- package/esm/utilities/0_units.js +1 -1
- package/esm/utilities/1_auth.js +1 -1
- package/esm/utilities/1_base64.d.ts +1 -1
- package/esm/utilities/1_base64.js +1 -1
- package/esm/utilities/1_crypto.d.ts +1 -1
- package/esm/utilities/1_crypto.js +1 -1
- package/esm/utilities/1_logger.d.ts +1 -1
- package/esm/utilities/1_logger.js +1 -1
- package/esm/utilities/1_math.d.ts +1 -1
- package/esm/utilities/1_math.js +1 -1
- package/esm/utilities/2_queue.d.ts +1 -1
- package/esm/utilities/2_queue.js +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +1 -1
- package/script/0_errors.d.ts +1 -1
- package/script/0_errors.js +1 -1
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_connection.d.ts +1 -1
- package/script/2_connection.js +1 -1
- package/script/2_storage.d.ts +1 -1
- package/script/2_storage.js +1 -1
- package/script/2_tl.d.ts +1 -1
- package/script/2_tl.js +1 -1
- package/script/3_errors.d.ts +1 -1
- package/script/3_errors.js +1 -1
- package/script/3_transport.d.ts +1 -1
- package/script/3_transport.js +1 -1
- package/script/3_types.d.ts +5 -1
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +5 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +2 -2
- package/script/4_errors.d.ts +1 -1
- package/script/4_errors.js +1 -1
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_client_abstract.js +1 -1
- package/script/client/0_filters.d.ts +1 -1
- package/script/client/0_filters.js +1 -1
- package/script/client/0_html.d.ts +1 -1
- package/script/client/0_html.js +1 -1
- package/script/client/0_markdown.d.ts +1 -1
- package/script/client/0_markdown.js +1 -1
- package/script/client/0_message.d.ts +1 -1
- package/script/client/0_message.js +1 -1
- package/script/client/0_params.d.ts +31 -9
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_params.js +1 -1
- package/script/client/0_password.js +1 -1
- package/script/client/0_storage_operations.d.ts +1 -1
- package/script/client/0_storage_operations.js +1 -1
- package/script/client/0_update_processor.d.ts +7 -0
- package/script/client/0_update_processor.d.ts.map +1 -0
- package/script/client/0_update_processor.js +2 -0
- package/script/client/0_utilities.d.ts +3 -3
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +1 -1
- package/script/client/1_client_encrypted.d.ts +1 -1
- package/script/client/1_client_encrypted.js +1 -1
- package/script/client/1_client_plain.d.ts +1 -1
- package/script/client/1_client_plain.js +1 -1
- package/script/client/1_composer.d.ts +1 -1
- package/script/client/1_composer.js +1 -1
- package/script/client/1_types.d.ts +1 -1
- package/script/client/1_types.js +1 -1
- package/script/client/2_account_manager.d.ts +1 -1
- package/script/client/2_account_manager.js +1 -1
- package/script/client/2_bot_info_manager.d.ts +1 -1
- package/script/client/2_bot_info_manager.js +1 -1
- package/script/client/2_business_connection_manager.d.ts +4 -3
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +2 -2
- package/script/client/2_file_manager.js +1 -1
- package/script/client/2_gift_manager.d.ts +29 -0
- package/script/client/2_gift_manager.d.ts.map +1 -0
- package/script/client/2_gift_manager.js +66 -0
- package/script/client/2_network_statistics_manager.d.ts +1 -1
- package/script/client/2_network_statistics_manager.js +1 -1
- package/script/client/2_payment_manager.d.ts +4 -3
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_reaction_manager.d.ts +4 -3
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +2 -2
- package/script/client/2_translations_manager.d.ts +3 -2
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +1 -1
- package/script/client/2_update_manager.d.ts +1 -1
- package/script/client/2_update_manager.js +1 -1
- package/script/client/3_message_manager.d.ts +10 -26
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +61 -238
- package/script/client/3_video_chat_manager.d.ts +5 -4
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +5 -2
- package/script/client/4_callback_query_manager.d.ts +4 -3
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +2 -2
- package/script/client/4_chat_list_manager.d.ts +5 -4
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +3 -2
- package/script/client/4_chat_manager.d.ts +61 -0
- package/script/client/4_chat_manager.d.ts.map +1 -0
- package/script/client/4_chat_manager.js +297 -0
- package/script/client/4_inline_query_manager.d.ts +4 -3
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +2 -2
- package/script/client/4_poll_manager.d.ts +4 -3
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +2 -2
- package/script/client/4_story_manager.d.ts +4 -3
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +2 -2
- package/script/client/5_client.d.ts +44 -7
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +182 -73
- package/script/connection/0_connection.d.ts +1 -1
- package/script/connection/0_connection.js +1 -1
- package/script/connection/1_connection_tcp.node.d.ts +1 -1
- package/script/connection/1_connection_tcp.node.js +1 -1
- package/script/connection/1_connection_web_socket.js +1 -1
- package/script/mod.d.ts +1 -1
- package/script/mod.js +1 -1
- package/script/storage/0_storage.d.ts +1 -1
- package/script/storage/0_storage.js +1 -1
- package/script/storage/1_utilities.d.ts +1 -1
- package/script/storage/1_utilities.js +1 -1
- package/script/storage/2_storage_indexed_db.d.ts +1 -1
- package/script/storage/2_storage_indexed_db.js +1 -1
- package/script/storage/2_storage_local_storage.node.d.ts +1 -1
- package/script/storage/2_storage_local_storage.node.js +1 -1
- package/script/storage/2_storage_memory.d.ts +1 -1
- package/script/storage/2_storage_memory.js +1 -1
- package/script/storage/2_storage_session_storage.d.ts +1 -1
- package/script/storage/2_storage_session_storage.js +1 -1
- package/script/tl/0_api.d.ts +218 -79
- package/script/tl/0_api.d.ts.map +1 -1
- package/script/tl/0_api.js +362 -159
- package/script/tl/0_tl_raw_reader.d.ts +1 -1
- package/script/tl/0_tl_raw_reader.js +1 -1
- package/script/tl/0_tl_raw_writer.d.ts +1 -1
- package/script/tl/0_tl_raw_writer.js +1 -1
- package/script/tl/1_utilities.d.ts +1 -1
- package/script/tl/1_utilities.js +1 -1
- package/script/tl/2_deserialize.d.ts +1 -1
- package/script/tl/2_deserialize.js +1 -1
- package/script/tl/2_serialize.d.ts +1 -1
- package/script/tl/2_serialize.js +1 -1
- package/script/tl/3_tl_reader.d.ts +1 -1
- package/script/tl/3_tl_reader.js +1 -1
- package/script/tl/3_utilities.d.ts +1 -1
- package/script/tl/3_utilities.js +1 -1
- package/script/tl/4_rpc_result.d.ts +1 -1
- package/script/tl/4_rpc_result.js +1 -1
- package/script/tl/4_tl_writer.d.ts +1 -1
- package/script/tl/4_tl_writer.js +1 -1
- package/script/tl/5_message.d.ts +1 -1
- package/script/tl/5_message.js +1 -1
- package/script/transport/0_obfuscation.js +1 -1
- package/script/transport/0_transport.d.ts +1 -1
- package/script/transport/0_transport.js +1 -1
- package/script/transport/1_transport_abridged.d.ts +1 -1
- package/script/transport/1_transport_abridged.js +1 -1
- package/script/transport/1_transport_intermediate.d.ts +1 -1
- package/script/transport/1_transport_intermediate.js +1 -1
- package/script/transport/2_transport_provider.d.ts +1 -1
- package/script/transport/2_transport_provider.js +1 -1
- package/script/transport/3_transport_provider_tcp.d.ts +1 -1
- package/script/transport/3_transport_provider_tcp.js +1 -1
- package/script/transport/3_transport_provider_web_socket.d.ts +1 -1
- package/script/transport/3_transport_provider_web_socket.js +1 -1
- package/script/types/0_authorization_state.d.ts +1 -1
- package/script/types/0_authorization_state.js +1 -1
- package/script/types/0_birthday.d.ts +1 -1
- package/script/types/0_birthday.js +1 -1
- package/script/types/0_bot_command.d.ts +1 -1
- package/script/types/0_bot_command.js +1 -1
- package/script/types/0_callback_query_answer.d.ts +1 -1
- package/script/types/0_callback_query_answer.js +1 -1
- package/script/types/0_callback_query_question.d.ts +1 -1
- package/script/types/0_callback_query_question.js +1 -1
- package/script/types/0_chat_action.d.ts +1 -1
- package/script/types/0_chat_action.js +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +1 -1
- package/script/types/0_chat_administrator_rights.js +1 -1
- package/script/types/0_chat_member_rights.d.ts +1 -1
- package/script/types/0_chat_member_rights.js +1 -1
- package/script/types/0_chat_photo.d.ts +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_connection_state.d.ts +1 -1
- package/script/types/0_connection_state.js +1 -1
- package/script/types/0_contact.d.ts +1 -1
- package/script/types/0_contact.js +1 -1
- package/script/types/0_dice.d.ts +1 -1
- package/script/types/0_dice.js +1 -1
- package/script/types/0_failed_invitation.d.ts +1 -1
- package/script/types/0_failed_invitation.js +1 -1
- package/script/types/0_file_source.d.ts +1 -1
- package/script/types/0_file_source.js +1 -1
- package/script/types/0_giveaway_parameters.d.ts +1 -1
- package/script/types/0_giveaway_parameters.js +1 -1
- package/script/types/0_id.d.ts +1 -1
- package/script/types/0_id.js +1 -1
- package/script/types/0_invoice.d.ts +1 -1
- package/script/types/0_invoice.js +1 -1
- package/script/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/script/types/0_keyboard_button_poll_type.js +1 -1
- package/script/types/0_link_preview.d.ts +1 -1
- package/script/types/0_link_preview.js +1 -1
- package/script/types/0_live_stream_channel.d.ts +1 -1
- package/script/types/0_live_stream_channel.js +1 -1
- package/script/types/0_location.d.ts +1 -1
- package/script/types/0_location.js +1 -1
- package/script/types/0_login_url.d.ts +1 -1
- package/script/types/0_login_url.js +1 -1
- package/script/types/0_mask_position.d.ts +1 -1
- package/script/types/0_mask_position.js +1 -1
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_message_entity.js +1 -1
- package/script/types/0_message_reference.d.ts +1 -1
- package/script/types/0_message_reference.js +1 -1
- package/script/types/0_message_search_filter.d.ts +1 -1
- package/script/types/0_message_search_filter.js +1 -1
- package/script/types/0_mini_app_info.d.ts +1 -1
- package/script/types/0_mini_app_info.js +1 -1
- package/script/types/0_network_statistics_entry.d.ts +1 -1
- package/script/types/0_network_statistics_entry.js +1 -1
- package/script/types/0_opening_hours.d.ts +1 -1
- package/script/types/0_opening_hours.js +1 -1
- package/script/types/0_parse_mode.d.ts +1 -1
- package/script/types/0_parse_mode.js +1 -1
- package/script/types/0_price_tag.d.ts +1 -1
- package/script/types/0_price_tag.js +1 -1
- package/script/types/0_reaction.d.ts +1 -1
- package/script/types/0_reaction.js +1 -1
- package/script/types/0_refunded_payment.d.ts +1 -1
- package/script/types/0_refunded_payment.js +1 -1
- package/script/types/0_restriction_reason.d.ts +1 -1
- package/script/types/0_restriction_reason.js +1 -1
- package/script/types/0_self_destruct_option.d.ts +1 -1
- package/script/types/0_self_destruct_option.js +1 -1
- package/script/types/0_shipping_address.d.ts +1 -1
- package/script/types/0_shipping_address.js +1 -1
- package/script/types/0_story_reference.d.ts +1 -1
- package/script/types/0_story_reference.js +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.d.ts +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.js +1 -1
- package/script/types/0_thumbnail.d.ts +1 -1
- package/script/types/0_thumbnail.js +1 -1
- package/script/types/0_video_chat.d.ts +1 -1
- package/script/types/0_video_chat.js +1 -1
- package/script/types/0_voice.d.ts +1 -1
- package/script/types/0_voice.js +1 -1
- package/script/types/1_animation.d.ts +1 -1
- package/script/types/1_animation.js +1 -1
- package/script/types/1_audio.d.ts +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat_p.d.ts +1 -1
- package/script/types/1_chat_p.js +1 -1
- package/script/types/1_document.d.ts +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_giveaway.d.ts +1 -1
- package/script/types/1_giveaway.js +1 -1
- package/script/types/1_inline_query_result_button.d.ts +1 -1
- package/script/types/1_inline_query_result_button.js +1 -1
- package/script/types/1_input_media.d.ts +1 -1
- package/script/types/1_input_media.js +1 -1
- package/script/types/1_input_story_content.d.ts +1 -1
- package/script/types/1_input_story_content.js +1 -1
- package/script/types/1_keyboard_button.d.ts +1 -1
- package/script/types/1_keyboard_button.js +1 -1
- package/script/types/1_message_content.d.ts +2 -2
- package/script/types/1_message_content.d.ts.map +1 -1
- package/script/types/1_message_content.js +1 -1
- package/script/types/1_message_reaction.d.ts +1 -1
- package/script/types/1_message_reaction.js +1 -1
- package/script/types/1_network_statistics.d.ts +1 -1
- package/script/types/1_network_statistics.js +1 -1
- package/script/types/1_order_info.d.ts +1 -1
- package/script/types/1_order_info.js +1 -1
- package/script/types/1_photo.d.ts +1 -1
- package/script/types/1_photo.js +1 -1
- package/script/types/1_poll_option.d.ts +1 -1
- package/script/types/1_poll_option.js +1 -1
- package/script/types/1_reaction_count.d.ts +1 -1
- package/script/types/1_reaction_count.js +1 -1
- package/script/types/1_reply_quote.d.ts +1 -1
- package/script/types/1_reply_quote.js +1 -1
- package/script/types/1_sticker.d.ts +2 -1
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +8 -3
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/1_story_privacy.js +1 -1
- package/script/types/1_story_reaction.d.ts +1 -1
- package/script/types/1_story_reaction.js +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts +1 -1
- package/script/types/1_venue.js +1 -1
- package/script/types/1_video.d.ts +1 -1
- package/script/types/1_video.js +1 -1
- package/script/types/1_video_note.d.ts +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_business_connection.d.ts +1 -1
- package/script/types/2_business_connection.js +1 -1
- package/script/types/2_chat.d.ts +1 -1
- package/script/types/2_chat.js +1 -1
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chat_member.js +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_chosen_inline_result.js +1 -1
- package/script/types/2_forward_header.d.ts +1 -1
- package/script/types/2_forward_header.js +1 -1
- package/script/types/2_game.d.ts +1 -1
- package/script/types/2_game.js +1 -1
- package/script/types/2_gift_upgraded_component.d.ts +95 -0
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -0
- package/script/types/2_gift_upgraded_component.js +91 -0
- package/script/types/2_inactive_chat.d.ts +1 -1
- package/script/types/2_inactive_chat.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_keyboard_button.js +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_inline_query.js +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_invite_link.js +1 -1
- package/script/types/2_message_interactions.d.ts +1 -1
- package/script/types/2_message_interactions.js +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reaction_count.js +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_message_reactions.js +1 -1
- package/script/types/2_poll.d.ts +1 -1
- package/script/types/2_poll.js +1 -1
- package/script/types/2_pre_checkout_query.d.ts +1 -1
- package/script/types/2_pre_checkout_query.js +1 -1
- package/script/types/2_reply_to.d.ts +1 -1
- package/script/types/2_reply_to.js +1 -1
- package/script/types/2_story_content.d.ts +1 -1
- package/script/types/2_story_content.js +1 -1
- package/script/types/2_story_interactions.d.ts +1 -1
- package/script/types/2_story_interactions.js +1 -1
- package/script/types/2_story_interactive_area.d.ts +1 -1
- package/script/types/2_story_interactive_area.js +1 -1
- package/script/types/2_successful_payment.d.ts +1 -1
- package/script/types/2_successful_payment.js +1 -1
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_chat_member_updated.js +1 -1
- package/script/types/3_gift.d.ts +82 -0
- package/script/types/3_gift.d.ts.map +1 -0
- package/script/types/3_gift.js +93 -0
- package/script/types/3_join_request.d.ts +1 -1
- package/script/types/3_join_request.js +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_reply_markup.js +1 -1
- package/script/types/3_story.d.ts +1 -1
- package/script/types/3_story.js +1 -1
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +1 -1
- package/script/types/4_message.d.ts +2 -1
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +10 -3
- package/script/types/4_user_gift.d.ts +44 -0
- package/script/types/4_user_gift.d.ts.map +1 -0
- package/script/types/4_user_gift.js +46 -0
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_callback_query.js +1 -1
- package/script/types/5_chat_list_item.d.ts +1 -1
- package/script/types/5_chat_list_item.js +1 -1
- package/script/types/5_inline_query_answer.d.ts +1 -1
- package/script/types/5_inline_query_answer.js +1 -1
- package/script/types/5_user_gifts.d.ts +32 -0
- package/script/types/5_user_gifts.d.ts.map +1 -0
- package/script/types/5_user_gifts.js +32 -0
- package/script/types/6_update.d.ts +1 -1
- package/script/types/6_update.js +1 -1
- package/script/types/_file_id.d.ts +1 -1
- package/script/types/_file_id.js +1 -1
- package/script/types/_getters.d.ts +1 -1
- package/script/types/_getters.js +1 -1
- package/script/utilities/0_bigint.js +1 -1
- package/script/utilities/0_buffer.d.ts +1 -1
- package/script/utilities/0_buffer.js +1 -1
- package/script/utilities/0_cache_map.d.ts +1 -1
- package/script/utilities/0_cache_map.js +1 -1
- package/script/utilities/0_color.d.ts +1 -1
- package/script/utilities/0_color.js +1 -1
- package/script/utilities/0_env.js +1 -1
- package/script/utilities/0_gunzip.d.ts +1 -1
- package/script/utilities/0_gunzip.js +1 -1
- package/script/utilities/0_hash.js +1 -1
- package/script/utilities/0_misc.d.ts +1 -1
- package/script/utilities/0_misc.js +1 -1
- package/script/utilities/0_mutex.d.ts +1 -1
- package/script/utilities/0_mutex.js +1 -1
- package/script/utilities/0_object.d.ts +1 -1
- package/script/utilities/0_object.js +1 -1
- package/script/utilities/0_part_stream.d.ts +1 -1
- package/script/utilities/0_part_stream.js +1 -1
- package/script/utilities/0_rle.d.ts +1 -1
- package/script/utilities/0_rle.js +1 -1
- package/script/utilities/0_types.d.ts +1 -1
- package/script/utilities/0_types.js +1 -1
- package/script/utilities/0_units.d.ts +1 -1
- package/script/utilities/0_units.js +1 -1
- package/script/utilities/1_auth.js +1 -1
- package/script/utilities/1_base64.d.ts +1 -1
- package/script/utilities/1_base64.js +1 -1
- package/script/utilities/1_crypto.d.ts +1 -1
- package/script/utilities/1_crypto.js +1 -1
- package/script/utilities/1_logger.d.ts +1 -1
- package/script/utilities/1_logger.js +1 -1
- package/script/utilities/1_math.d.ts +1 -1
- package/script/utilities/1_math.js +1 -1
- package/script/utilities/2_queue.d.ts +1 -1
- package/script/utilities/2_queue.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
4
|
*
|
|
5
5
|
* This file is part of MTKruto.
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { ID, Update, VideoChatActive, VideoChatScheduled } from "../3_types.js";
|
|
22
22
|
import { DownloadLiveStreamChunkParams, JoinVideoChatParams, StartVideoChatParams } from "./0_params.js";
|
|
23
|
+
import { UpdateProcessor } from "./0_update_processor.js";
|
|
23
24
|
import { C as C_ } from "./1_types.js";
|
|
24
25
|
import { FileManager } from "./2_file_manager.js";
|
|
25
26
|
interface C extends C_ {
|
|
@@ -27,7 +28,7 @@ interface C extends C_ {
|
|
|
27
28
|
}
|
|
28
29
|
declare const videoChatManagerUpdates: readonly ["updateGroupCall"];
|
|
29
30
|
type VideoChatManagerUpdate = Api.Types[(typeof videoChatManagerUpdates)[number]];
|
|
30
|
-
export declare class VideoChatManager {
|
|
31
|
+
export declare class VideoChatManager implements UpdateProcessor<VideoChatManagerUpdate> {
|
|
31
32
|
#private;
|
|
32
33
|
constructor(c: C);
|
|
33
34
|
startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise<VideoChatActive>;
|
|
@@ -36,8 +37,8 @@ export declare class VideoChatManager {
|
|
|
36
37
|
leaveVideoChat(id: string): Promise<void>;
|
|
37
38
|
joinLiveStream(id: string): Promise<void>;
|
|
38
39
|
getVideoChat(id: string): Promise<import("../3_types.js").VideoChat>;
|
|
39
|
-
|
|
40
|
-
handleUpdate(update: VideoChatManagerUpdate): Promise<Update>;
|
|
40
|
+
canHandleUpdate(update: Api.Update): update is VideoChatManagerUpdate;
|
|
41
|
+
handleUpdate(update: VideoChatManagerUpdate): Promise<Update | null>;
|
|
41
42
|
getLiveStreamChannels(id: string): Promise<import("../3_types.js").LiveStreamChannel[]>;
|
|
42
43
|
downloadLiveStreamChunk(id: string, channel: number, scale: number, timestamp: number, params?: DownloadLiveStreamChunkParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
43
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAClD,OAAO,EAAkD,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAClD,OAAO,EAAkD,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,UAAU,CAAE,SAAQ,EAAE;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,QAAA,MAAM,uBAAuB,8BAEnB,CAAC;AAEX,KAAK,sBAAsB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAElF,qBAAa,gBAAiB,YAAW,eAAe,CAAC,sBAAsB,CAAC;;gBAGlE,CAAC,EAAE,CAAC;IAkBV,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAKxD,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAc1E,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;IAUvE,cAAc,CAAC,EAAE,EAAE,MAAM;IAKzB,cAAc,CAAC,EAAE,EAAE,MAAM;IA+BzB,YAAY,CAAC,EAAE,EAAE,MAAM;IAK7B,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,sBAAsB;IAI/D,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA8BpE,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAgB/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,6BAA6B;CAmBrI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
5
|
*
|
|
6
6
|
* This file is part of MTKruto.
|
|
7
7
|
*
|
|
@@ -96,10 +96,13 @@ class VideoChatManager {
|
|
|
96
96
|
__classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("getVideoChat");
|
|
97
97
|
return (0, _3_types_js_1.constructVideoChat)(await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id));
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
canHandleUpdate(update) {
|
|
100
100
|
return (0, _2_tl_js_1.isOneOf)(videoChatManagerUpdates, update);
|
|
101
101
|
}
|
|
102
102
|
async handleUpdate(update) {
|
|
103
|
+
if (!update.chat_id) {
|
|
104
|
+
return null; // TODO: handle updates with unspecified chat_id
|
|
105
|
+
}
|
|
103
106
|
let chatId = Number(-update.chat_id);
|
|
104
107
|
const fullChat = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId).then((v) => v == null ? __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId = _1_utilities_js_1.ZERO_CHANNEL_ID - Number(update.chat_id)) : v);
|
|
105
108
|
let updateFullChat = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
4
|
*
|
|
5
5
|
* This file is part of MTKruto.
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { CallbackQueryQuestion, ID, Update } from "../3_types.js";
|
|
22
22
|
import { AnswerCallbackQueryParams } from "./0_params.js";
|
|
23
|
+
import { UpdateProcessor } from "./0_update_processor.js";
|
|
23
24
|
import { C as C_ } from "./1_types.js";
|
|
24
25
|
import { MessageManager } from "./3_message_manager.js";
|
|
25
26
|
type C = C_ & {
|
|
@@ -27,12 +28,12 @@ type C = C_ & {
|
|
|
27
28
|
};
|
|
28
29
|
declare const callbackQueryManagerUpdates: readonly ["updateBotCallbackQuery", "updateInlineBotCallbackQuery"];
|
|
29
30
|
type CallbackQueryManagerUpdate = Api.Types[(typeof callbackQueryManagerUpdates)[number]];
|
|
30
|
-
export declare class CallbackQueryManager {
|
|
31
|
+
export declare class CallbackQueryManager implements UpdateProcessor<CallbackQueryManagerUpdate> {
|
|
31
32
|
#private;
|
|
32
33
|
constructor(c: C);
|
|
33
34
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
34
35
|
sendCallbackQuery(chatId: ID, messageId: number, question: CallbackQueryQuestion): Promise<import("../3_types.js").CallbackQueryAnswer>;
|
|
35
|
-
|
|
36
|
+
canHandleUpdate(update: Api.Update): update is CallbackQueryManagerUpdate;
|
|
36
37
|
handleUpdate(update: CallbackQueryManagerUpdate): Promise<Update>;
|
|
37
38
|
}
|
|
38
39
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAW,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAwD,EAAE,EAAE,MAAM,EAAiC,MAAM,eAAe,CAAC;AACvJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAW,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAwD,EAAE,EAAE,MAAM,EAAiC,MAAM,eAAe,CAAC;AACvJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,QAAA,MAAM,2BAA2B,qEAGvB,CAAC;AAEX,KAAK,0BAA0B,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1F,qBAAa,oBAAqB,YAAW,eAAe,CAAC,0BAA0B,CAAC;;gBAG1E,CAAC,EAAE,CAAC;IAIV,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAOlE,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB;IAyBtF,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,0BAA0B;IAInE,YAAY,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC;CAGxE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
5
|
*
|
|
6
6
|
* This file is part of MTKruto.
|
|
7
7
|
*
|
|
@@ -66,7 +66,7 @@ class CallbackQueryManager {
|
|
|
66
66
|
}
|
|
67
67
|
return (0, _3_types_js_1.constructCallbackQueryAnswer)(answer);
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
canHandleUpdate(update) {
|
|
70
70
|
return (0, _2_tl_js_1.isOneOf)(callbackQueryManagerUpdates, update);
|
|
71
71
|
}
|
|
72
72
|
async handleUpdate(update) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
4
|
*
|
|
5
5
|
* This file is part of MTKruto.
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { ChatListItem, ChatMember, ChatP, type ChatPChannel, type ChatPSupergroup, ID } from "../3_types.js";
|
|
22
22
|
import { type CreateChannelParams, type CreateGroupParams, type CreateSupergroupParams, GetChatMembersParams, GetCommonChatsParams } from "./0_params.js";
|
|
23
|
+
import { UpdateProcessor } from "./0_update_processor.js";
|
|
23
24
|
import { C as C_ } from "./1_types.js";
|
|
24
25
|
import { FileManager } from "./2_file_manager.js";
|
|
25
26
|
import { MessageManager } from "./3_message_manager.js";
|
|
@@ -29,13 +30,13 @@ type C = C_ & {
|
|
|
29
30
|
};
|
|
30
31
|
declare const chatListManagerUpdates: readonly ["updateNewMessage", "updateNewChannelMessage", "updatePinnedDialogs", "updateFolderPeers", "updateChannel", "updateChat", "updateUser", "updateUserName"];
|
|
31
32
|
type ChatListManagerUpdate = Api.Types[(typeof chatListManagerUpdates)[number]];
|
|
32
|
-
export declare class ChatListManager {
|
|
33
|
+
export declare class ChatListManager implements UpdateProcessor<ChatListManagerUpdate> {
|
|
33
34
|
#private;
|
|
34
35
|
constructor(c: C);
|
|
35
36
|
reassignChatLastMessage(chatId: number, add?: boolean, sendUpdate?: boolean): Promise<() => void>;
|
|
36
37
|
getChats(from?: "archived" | "main", after?: ChatListItem, limit?: number): Promise<ChatListItem[]>;
|
|
37
|
-
|
|
38
|
-
handleUpdate(update: ChatListManagerUpdate): Promise<
|
|
38
|
+
canHandleUpdate(update: Api.Update): update is ChatListManagerUpdate;
|
|
39
|
+
handleUpdate(update: ChatListManagerUpdate): Promise<null>;
|
|
39
40
|
getChat(chatId: ID): Promise<import("../3_types.js").Chat>;
|
|
40
41
|
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
41
42
|
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_chat_list_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_list_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAiD,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAmJ,EAAE,EAAE,MAAM,eAAe,CAAC;AAC9P,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"4_chat_list_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_list_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAiD,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAmJ,EAAE,EAAE,MAAM,eAAe,CAAC;AAC9P,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1J,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,QAAA,MAAM,sBAAsB,qKASlB,CAAC;AAEX,KAAK,qBAAqB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhF,qBAAa,eAAgB,YAAW,eAAe,CAAC,qBAAqB,CAAC;;gBAKhE,CAAC,EAAE,CAAC;IAkBV,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAQ,EAAE,UAAU,UAAO;IAwTtE,QAAQ,CAAC,IAAI,GAAE,UAAU,GAAG,MAAe,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA4B9G,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,qBAAqB;IAI9D,YAAY,CAAC,MAAM,EAAE,qBAAqB;IA2C1C,OAAO,CAAC,MAAM,EAAE,EAAE;IAQlB,qBAAqB,CAAC,MAAM,EAAE,EAAE;IA4BhC,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAiBpC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,oBAAoB;IAoCxD,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB;IAwCrD,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB;IAK/D,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB;IAKzD,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM;IAa5C,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;IAK1B,WAAW,CAAC,MAAM,EAAE,EAAE;IAKtB,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE;IAK5B,aAAa,CAAC,MAAM,EAAE,EAAE;IAKxB,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,oBAAoB;CAuB/D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
5
|
*
|
|
6
6
|
* This file is part of MTKruto.
|
|
7
7
|
*
|
|
@@ -153,7 +153,7 @@ class ChatListManager {
|
|
|
153
153
|
chats = chats.slice(0, limit);
|
|
154
154
|
return chats;
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
canHandleUpdate(update) {
|
|
157
157
|
return (0, _2_tl_js_1.isOneOf)(chatListManagerUpdates, update);
|
|
158
158
|
}
|
|
159
159
|
async handleUpdate(update) {
|
|
@@ -181,6 +181,7 @@ class ChatListManager {
|
|
|
181
181
|
else {
|
|
182
182
|
(0, _0_deps_js_1.unreachable)();
|
|
183
183
|
}
|
|
184
|
+
return null;
|
|
184
185
|
}
|
|
185
186
|
async getChat(chatId) {
|
|
186
187
|
const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import { FileSource, ID, Reaction, Update } from "../3_types.js";
|
|
22
|
+
import { AddChatMemberParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, GetCreatedInviteLinksParams, SetChatMemberRightsParams, SetChatPhotoParams } from "./0_params.js";
|
|
23
|
+
import { UpdateProcessor } from "./0_update_processor.js";
|
|
24
|
+
import { C as C_ } from "./1_types.js";
|
|
25
|
+
import { FileManager } from "./2_file_manager.js";
|
|
26
|
+
import { MessageManager } from "./3_message_manager.js";
|
|
27
|
+
interface C extends C_ {
|
|
28
|
+
fileManager: FileManager;
|
|
29
|
+
messageManager: MessageManager;
|
|
30
|
+
}
|
|
31
|
+
declare const chatManagerUpdates: readonly ["updateChannelParticipant", "updateChatParticipant", "updateBotChatInviteRequester"];
|
|
32
|
+
type ChatManagerUpdate = Api.Types[(typeof chatManagerUpdates)[number]];
|
|
33
|
+
export declare class ChatManager implements UpdateProcessor<ChatManagerUpdate> {
|
|
34
|
+
#private;
|
|
35
|
+
constructor(c: C);
|
|
36
|
+
canHandleUpdate(update: Api.Update): update is ChatManagerUpdate;
|
|
37
|
+
handleUpdate(update: ChatManagerUpdate): Promise<Update | null>;
|
|
38
|
+
approveJoinRequest(chatId: ID, userId: ID): Promise<void>;
|
|
39
|
+
declineJoinRequest(chatId: ID, userId: ID): Promise<void>;
|
|
40
|
+
approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise<void>;
|
|
41
|
+
declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise<void>;
|
|
42
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<import("../3_types.js").InviteLink>;
|
|
43
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<import("../3_types.js").InviteLink[]>;
|
|
44
|
+
joinChat(chatId: ID): Promise<void>;
|
|
45
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
46
|
+
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
47
|
+
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
48
|
+
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
49
|
+
setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
|
|
50
|
+
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
51
|
+
enableJoinRequests(chatId: ID): Promise<void>;
|
|
52
|
+
disableJoinRequests(chatId: ID): Promise<void>;
|
|
53
|
+
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
54
|
+
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
55
|
+
deleteChatPhoto(chatId: number): Promise<void>;
|
|
56
|
+
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
57
|
+
addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<import("../3_types.js").FailedInvitation[]>;
|
|
58
|
+
addChatMembers(chatId: ID, userIds: ID[]): Promise<import("../3_types.js").FailedInvitation[]>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=4_chat_manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAElD,OAAO,EAA8B,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAsB,MAAM,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAA8E,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/S,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,UAAU,CAAE,SAAQ,EAAE;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,QAAA,MAAM,kBAAkB,gGAId,CAAC;AAEX,KAAK,iBAAiB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAExE,qBAAa,WAAY,YAAW,eAAe,CAAC,iBAAiB,CAAC;;gBAGxD,CAAC,EAAE,CAAC;IAIhB,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,iBAAiB;IAI1D,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAyB/D,kBAAkB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAQzC,kBAAkB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAQzC,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAUlE,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAUlE,gBAAgB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,sBAAsB;IAQ5D,qBAAqB,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,2BAA2B;IAOtE,QAAQ,CAAC,MAAM,EAAE,EAAE;IAcnB,SAAS,CAAC,MAAM,EAAE,EAAE;IAcpB,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,mBAAmB;IAuCpE,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;IAMxC,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAOhF,qBAAqB,CAAC,MAAM,EAAE,EAAE,EAAE,kBAAkB,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,EAAE;IAIjF,yCAAyC,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;IAMpE,kBAAkB,CAAC,MAAM,EAAE,EAAE;IAK7B,mBAAmB,CAAC,MAAM,EAAE,EAAE;IAK9B,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM;IAK7C,oBAAoB,CAAC,MAAM,EAAE,EAAE;IAM/B,eAAe,CAAC,MAAM,EAAE,MAAM;IAa9B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3F,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,mBAAmB;IAiBlE,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;CAkB/C"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
22
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
23
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
+
};
|
|
27
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
28
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
+
};
|
|
32
|
+
var _ChatManager_instances, _ChatManager_c, _ChatManager_toggleJoinRequests;
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.ChatManager = void 0;
|
|
35
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
36
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
37
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
38
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
39
|
+
const _3_types_js_1 = require("../3_types.js");
|
|
40
|
+
const _3_types_js_2 = require("../3_types.js");
|
|
41
|
+
const _0_utilities_js_1 = require("./0_utilities.js");
|
|
42
|
+
const chatManagerUpdates = [
|
|
43
|
+
"updateChannelParticipant",
|
|
44
|
+
"updateChatParticipant",
|
|
45
|
+
"updateBotChatInviteRequester",
|
|
46
|
+
];
|
|
47
|
+
class ChatManager {
|
|
48
|
+
constructor(c) {
|
|
49
|
+
_ChatManager_instances.add(this);
|
|
50
|
+
_ChatManager_c.set(this, void 0);
|
|
51
|
+
__classPrivateFieldSet(this, _ChatManager_c, c, "f");
|
|
52
|
+
}
|
|
53
|
+
canHandleUpdate(update) {
|
|
54
|
+
return (0, _2_tl_js_1.isOneOf)(chatManagerUpdates, update);
|
|
55
|
+
}
|
|
56
|
+
async handleUpdate(update) {
|
|
57
|
+
if ((0, _2_tl_js_1.is)("updateChannelParticipant", update) || (0, _2_tl_js_1.is)("updateChatParticipant", update)) {
|
|
58
|
+
const chatMember = await (0, _3_types_js_1.constructChatMemberUpdated)(update, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
59
|
+
const selfId = await __classPrivateFieldGet(this, _ChatManager_c, "f").getSelfId();
|
|
60
|
+
if (chatMember.oldChatMember.user.id == selfId) {
|
|
61
|
+
return { myChatMember: chatMember };
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return { chatMember };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if ((0, _2_tl_js_1.is)("updateBotChatInviteRequester", update)) {
|
|
68
|
+
const joinRequest = await (0, _3_types_js_1.constructJoinRequest)(update, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
69
|
+
return { joinRequest };
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
async approveJoinRequest(chatId, userId) {
|
|
74
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
75
|
+
_: "messages.hideChatJoinRequest",
|
|
76
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
77
|
+
user_id: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId),
|
|
78
|
+
approved: true,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
async declineJoinRequest(chatId, userId) {
|
|
82
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
83
|
+
_: "messages.hideChatJoinRequest",
|
|
84
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
85
|
+
user_id: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async approveJoinRequests(chatId, params) {
|
|
89
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("approveJoinRequests");
|
|
90
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
91
|
+
_: "messages.hideAllChatJoinRequests",
|
|
92
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
93
|
+
approved: true,
|
|
94
|
+
link: params?.inviteLink,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async declineJoinRequests(chatId, params) {
|
|
98
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("declineJoinRequests");
|
|
99
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
100
|
+
_: "messages.hideAllChatJoinRequests",
|
|
101
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
102
|
+
link: params?.inviteLink,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// INVITE LINKS //
|
|
106
|
+
async createInviteLink(chatId, params) {
|
|
107
|
+
if (params?.requireApproval && params?.limit) {
|
|
108
|
+
throw new _0_errors_js_1.InputError("requireApproval cannot be true while limit is specified.");
|
|
109
|
+
}
|
|
110
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.exportChatInvite", peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId), title: params?.title, expire_date: params?.expireAt ? (0, _1_utilities_js_1.toUnixTimestamp)(params.expireAt) : undefined, request_needed: params?.requireApproval ? true : undefined, usage_limit: params?.limit });
|
|
111
|
+
return await (0, _3_types_js_1.constructInviteLink)((0, _2_tl_js_1.as)("chatInviteExported", result), __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
112
|
+
}
|
|
113
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
114
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("getCreatedInviteLinks");
|
|
115
|
+
const { invites } = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.getExportedChatInvites", peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId), revoked: params?.revoked ? true : undefined, admin_id: params?.by ? await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(params.by) : { _: "inputUserEmpty" }, limit: params?.limit ?? 100, offset_date: params?.afterDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.afterDate) : undefined, offset_link: params?.afterInviteLink });
|
|
116
|
+
return await Promise.all(invites.map((v) => (0, _2_tl_js_1.as)("chatInviteExported", v)).map((v) => (0, _3_types_js_1.constructInviteLink)(v, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity)));
|
|
117
|
+
}
|
|
118
|
+
// JOINING AND LEAVING CHATS //
|
|
119
|
+
async joinChat(chatId) {
|
|
120
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("joinChat");
|
|
121
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
122
|
+
if ((0, _0_utilities_js_1.canBeInputUser)(peer)) {
|
|
123
|
+
throw new _0_errors_js_1.InputError("Cannot join private chats.");
|
|
124
|
+
}
|
|
125
|
+
else if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
|
|
126
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.joinChannel", channel: (0, _0_utilities_js_1.toInputChannel)(peer) });
|
|
127
|
+
}
|
|
128
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
129
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.addChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" }, fwd_limit: 0 }); // TODO: use potential high-level method for adding participants to chats
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
(0, _0_deps_js_1.unreachable)();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async leaveChat(chatId) {
|
|
136
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
137
|
+
if ((0, _0_utilities_js_1.canBeInputUser)(peer)) {
|
|
138
|
+
throw new _0_errors_js_1.InputError("Cannot leave private chats.");
|
|
139
|
+
}
|
|
140
|
+
else if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
|
|
141
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.leaveChannel", channel: (0, _0_utilities_js_1.toInputChannel)(peer) });
|
|
142
|
+
}
|
|
143
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
144
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: peer.chat_id, user_id: { _: "inputUserSelf" } }); // TODO: use potential high-level method for adding participants to chats
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
(0, _0_deps_js_1.unreachable)();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// RESTRICTING, BANNING, AND UNBANNING CHAT MEMBERS //
|
|
151
|
+
async banChatMember(chatId, memberId, params) {
|
|
152
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
153
|
+
if (!((0, _2_tl_js_1.is)("inputPeerChannel", chat)) && !((0, _2_tl_js_1.is)("inputPeerChat", chat))) {
|
|
154
|
+
throw new _0_errors_js_1.InputError("Expected a channel, supergroup, or group ID.");
|
|
155
|
+
}
|
|
156
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
157
|
+
if ((0, _2_tl_js_1.is)("inputPeerChannel", chat)) {
|
|
158
|
+
if (params?.deleteMessages) {
|
|
159
|
+
try {
|
|
160
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").messageManager.deleteChatMemberMessages(chatId, memberId);
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
//
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
167
|
+
_: "channels.editBanned",
|
|
168
|
+
channel: { ...chat, _: "inputChannel" },
|
|
169
|
+
participant: member,
|
|
170
|
+
banned_rights: ({
|
|
171
|
+
_: "chatBannedRights",
|
|
172
|
+
until_date: params?.untilDate ? (0, _1_utilities_js_1.toUnixTimestamp)(params.untilDate) : 0,
|
|
173
|
+
view_messages: true,
|
|
174
|
+
send_messages: true,
|
|
175
|
+
send_media: true,
|
|
176
|
+
send_stickers: true,
|
|
177
|
+
send_gifs: true,
|
|
178
|
+
send_games: true,
|
|
179
|
+
send_inline: true,
|
|
180
|
+
embed_links: true,
|
|
181
|
+
}),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", chat)) {
|
|
185
|
+
if (!(0, _0_utilities_js_1.canBeInputUser)(member)) {
|
|
186
|
+
throw new _0_errors_js_1.InputError(`Invalid user ID: ${memberId}`);
|
|
187
|
+
}
|
|
188
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: chat.chat_id, user_id: (0, _0_utilities_js_1.toInputUser)(member), revoke_history: params?.deleteMessages ? true : undefined });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async unbanChatMember(chatId, memberId) {
|
|
192
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
193
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
194
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: ({ _: "chatBannedRights", until_date: 0 }) });
|
|
195
|
+
}
|
|
196
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
197
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
198
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
199
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: (0, _3_types_js_2.chatMemberRightsToTlObject)(params?.rights, params?.untilDate) });
|
|
200
|
+
}
|
|
201
|
+
// CHAT SETTINGS //
|
|
202
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
203
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.setChatAvailableReactions", peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId), available_reactions: availableReactions == "none" ? { _: "chatReactionsNone" } : availableReactions == "all" ? { _: "chatReactionsAll" } : Array.isArray(availableReactions) ? ({ _: "chatReactionsSome", reactions: availableReactions.map((v) => (0, _3_types_js_2.reactionToTlObject)(v)) }) : (0, _0_deps_js_1.unreachable)() });
|
|
204
|
+
}
|
|
205
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
206
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("setBoostsRequiredToCircumventRestrictions");
|
|
207
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
208
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setBoostsToUnblockRestrictions", channel, boosts });
|
|
209
|
+
}
|
|
210
|
+
async enableJoinRequests(chatId) {
|
|
211
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("enableJoinRequests");
|
|
212
|
+
await __classPrivateFieldGet(this, _ChatManager_instances, "m", _ChatManager_toggleJoinRequests).call(this, chatId, true);
|
|
213
|
+
}
|
|
214
|
+
async disableJoinRequests(chatId) {
|
|
215
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("disableJoinRequests");
|
|
216
|
+
await __classPrivateFieldGet(this, _ChatManager_instances, "m", _ChatManager_toggleJoinRequests).call(this, chatId, false);
|
|
217
|
+
}
|
|
218
|
+
async setChatStickerSet(chatId, setName) {
|
|
219
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
220
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetShortName", short_name: setName } });
|
|
221
|
+
}
|
|
222
|
+
async deleteChatStickerSet(chatId) {
|
|
223
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
224
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetEmpty" } });
|
|
225
|
+
}
|
|
226
|
+
// CHAT PHOTOS //
|
|
227
|
+
async deleteChatPhoto(chatId) {
|
|
228
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
229
|
+
if (!((0, _0_utilities_js_1.canBeInputChannel)(peer)) && !((0, _2_tl_js_1.is)("inputPeerChat", peer))) {
|
|
230
|
+
(0, _0_deps_js_1.unreachable)();
|
|
231
|
+
}
|
|
232
|
+
if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
|
|
233
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editPhoto", channel: (0, _0_utilities_js_1.toInputChannel)(peer), photo: { _: "inputChatPhotoEmpty" } });
|
|
234
|
+
}
|
|
235
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
236
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: { _: "inputChatPhotoEmpty" } });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async setChatPhoto(chatId, photo, params) {
|
|
240
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
241
|
+
if (!((0, _0_utilities_js_1.canBeInputChannel)(peer)) && !((0, _2_tl_js_1.is)("inputPeerChat", peer))) {
|
|
242
|
+
(0, _0_deps_js_1.unreachable)();
|
|
243
|
+
}
|
|
244
|
+
const file = await __classPrivateFieldGet(this, _ChatManager_c, "f").fileManager.upload(photo, params);
|
|
245
|
+
const photo_ = { _: "inputChatUploadedPhoto", file };
|
|
246
|
+
if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
|
|
247
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editPhoto", channel: (0, _0_utilities_js_1.toInputChannel)(peer), photo: photo_ });
|
|
248
|
+
}
|
|
249
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
|
|
250
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: photo_ });
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// INVITING MEMBERS //
|
|
254
|
+
async addChatMember(chatId, userId, params) {
|
|
255
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("addChatMember");
|
|
256
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
257
|
+
if ((0, _2_tl_js_1.isOneOf)(["inputPeerEmpty", "inputPeerSelf", "inputPeerUser", "inputPeerUserFromMessage"], chat)) {
|
|
258
|
+
throw new _0_errors_js_1.InputError("Cannot add members to private chats");
|
|
259
|
+
}
|
|
260
|
+
const user = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId);
|
|
261
|
+
if ((0, _2_tl_js_1.is)("inputPeerChat", chat)) {
|
|
262
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.addChatUser", chat_id: chat.chat_id, user_id: user, fwd_limit: params?.historyLimit ?? 0 });
|
|
263
|
+
return result.missing_invitees.map(_3_types_js_1.constructFailedInvitation);
|
|
264
|
+
}
|
|
265
|
+
else if ((0, _2_tl_js_1.is)("inputPeerChannel", chat)) {
|
|
266
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.inviteToChannel", channel: { ...chat, _: "inputChannel" }, users: [user] });
|
|
267
|
+
return result.missing_invitees.map(_3_types_js_1.constructFailedInvitation);
|
|
268
|
+
}
|
|
269
|
+
(0, _0_deps_js_1.unreachable)();
|
|
270
|
+
}
|
|
271
|
+
async addChatMembers(chatId, userIds) {
|
|
272
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("addChatMembers");
|
|
273
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
274
|
+
if ((0, _2_tl_js_1.isOneOf)(["inputPeerEmpty", "inputPeerSelf", "inputPeerUser", "inputPeerUserFromMessage"], chat)) {
|
|
275
|
+
throw new _0_errors_js_1.InputError("Cannot add members to private chats");
|
|
276
|
+
}
|
|
277
|
+
const users = new Array();
|
|
278
|
+
for (const userId of userIds) {
|
|
279
|
+
users.push(await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId));
|
|
280
|
+
}
|
|
281
|
+
if ((0, _2_tl_js_1.is)("inputPeerChat", chat)) {
|
|
282
|
+
throw new _0_errors_js_1.InputError("addChatMembers cannot be used with basic groups");
|
|
283
|
+
}
|
|
284
|
+
else if ((0, _0_utilities_js_1.canBeInputChannel)(chat)) {
|
|
285
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.inviteToChannel", channel: (0, _0_utilities_js_1.toInputChannel)(chat), users });
|
|
286
|
+
return result.missing_invitees.map(_3_types_js_1.constructFailedInvitation);
|
|
287
|
+
}
|
|
288
|
+
(0, _0_deps_js_1.unreachable)();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
exports.ChatManager = ChatManager;
|
|
292
|
+
_ChatManager_c = new WeakMap(), _ChatManager_instances = new WeakSet(), _ChatManager_toggleJoinRequests =
|
|
293
|
+
// JOIN REQUESTS //
|
|
294
|
+
async function _ChatManager_toggleJoinRequests(chatId, enabled) {
|
|
295
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
296
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.toggleJoinRequest", channel, enabled });
|
|
297
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-
|
|
3
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
4
4
|
*
|
|
5
5
|
* This file is part of MTKruto.
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { ID, InlineQueryResult, Update } from "../3_types.js";
|
|
22
22
|
import { AnswerInlineQueryParams, SendInlineQueryParams } from "./0_params.js";
|
|
23
|
+
import { UpdateProcessor } from "./0_update_processor.js";
|
|
23
24
|
import { C as C_ } from "./1_types.js";
|
|
24
25
|
import { MessageManager } from "./3_message_manager.js";
|
|
25
26
|
type C = C_ & {
|
|
@@ -27,11 +28,11 @@ type C = C_ & {
|
|
|
27
28
|
};
|
|
28
29
|
declare const inlineQueryManagerUpdates: readonly ["updateBotInlineQuery", "updateBotInlineSend"];
|
|
29
30
|
type InlineQueryManagerUpdate = Api.Types[(typeof inlineQueryManagerUpdates)[number]];
|
|
30
|
-
export declare class InlineQueryManager {
|
|
31
|
+
export declare class InlineQueryManager implements UpdateProcessor<InlineQueryManagerUpdate> {
|
|
31
32
|
#private;
|
|
32
33
|
constructor(c: C);
|
|
33
34
|
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
34
|
-
|
|
35
|
+
canHandleUpdate(update: Api.Update): update is InlineQueryManagerUpdate;
|
|
35
36
|
handleUpdate(update: InlineQueryManagerUpdate): Promise<Update>;
|
|
36
37
|
sendInlineQuery(userId: ID, chatId: ID, params?: SendInlineQueryParams): Promise<import("../3_types.js").InlineQueryAnswer>;
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_inline_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_inline_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAe,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAiF,EAAE,EAAE,iBAAiB,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1K,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"4_inline_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_inline_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAe,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAiF,EAAE,EAAE,iBAAiB,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1K,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,QAAA,MAAM,yBAAyB,0DAGrB,CAAC;AAEX,KAAK,wBAAwB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEtF,qBAAa,kBAAmB,YAAW,eAAe,CAAC,wBAAwB,CAAC;;gBAGtE,CAAC,EAAE,CAAC;IAIV,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,MAAM,CAAC,EAAE,uBAAuB;IAMlG,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,wBAAwB;IAIjE,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAU/D,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,qBAAqB;CAsB7E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-
|
|
4
|
+
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
5
|
*
|
|
6
6
|
* This file is part of MTKruto.
|
|
7
7
|
*
|
|
@@ -50,7 +50,7 @@ class InlineQueryManager {
|
|
|
50
50
|
(0, _0_utilities_js_1.checkInlineQueryId)(id);
|
|
51
51
|
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.setInlineBotResults", query_id: BigInt(id), results: await Promise.all(results.map((v) => (0, _3_types_js_1.inlineQueryResultToTlObject)(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))), cache_time: params?.cacheTime ?? 300, private: params?.isPersonal ? true : undefined, switch_webview: params?.button && params.button.miniApp ? ({ _: "inlineBotWebView", text: params.button.text, url: params.button.miniApp.url }) : undefined, switch_pm: params?.button && params.button.startParameter ? ({ _: "inlineBotSwitchPM", text: params.button.text, start_param: params.button.startParameter }) : undefined, gallery: params?.isGallery ? true : undefined, next_offset: params?.nextOffset });
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
canHandleUpdate(update) {
|
|
54
54
|
return (0, _2_tl_js_1.isOneOf)(inlineQueryManagerUpdates, update);
|
|
55
55
|
}
|
|
56
56
|
async handleUpdate(update) {
|