@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,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
|
*
|
|
@@ -93,10 +93,13 @@ export class VideoChatManager {
|
|
|
93
93
|
__classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("getVideoChat");
|
|
94
94
|
return constructVideoChat(await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id));
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
canHandleUpdate(update) {
|
|
97
97
|
return isOneOf(videoChatManagerUpdates, update);
|
|
98
98
|
}
|
|
99
99
|
async handleUpdate(update) {
|
|
100
|
+
if (!update.chat_id) {
|
|
101
|
+
return null; // TODO: handle updates with unspecified chat_id
|
|
102
|
+
}
|
|
100
103
|
let chatId = Number(-update.chat_id);
|
|
101
104
|
const fullChat = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId).then((v) => v == null ? __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId = ZERO_CHANNEL_ID - Number(update.chat_id)) : v);
|
|
102
105
|
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,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
|
*
|
|
@@ -63,7 +63,7 @@ export class CallbackQueryManager {
|
|
|
63
63
|
}
|
|
64
64
|
return constructCallbackQueryAnswer(answer);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
canHandleUpdate(update) {
|
|
67
67
|
return isOneOf(callbackQueryManagerUpdates, update);
|
|
68
68
|
}
|
|
69
69
|
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,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
|
*
|
|
@@ -150,7 +150,7 @@ export class ChatListManager {
|
|
|
150
150
|
chats = chats.slice(0, limit);
|
|
151
151
|
return chats;
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
canHandleUpdate(update) {
|
|
154
154
|
return isOneOf(chatListManagerUpdates, update);
|
|
155
155
|
}
|
|
156
156
|
async handleUpdate(update) {
|
|
@@ -178,6 +178,7 @@ export class ChatListManager {
|
|
|
178
178
|
else {
|
|
179
179
|
unreachable();
|
|
180
180
|
}
|
|
181
|
+
return null;
|
|
181
182
|
}
|
|
182
183
|
async getChat(chatId) {
|
|
183
184
|
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,293 @@
|
|
|
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
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
21
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
22
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
23
|
+
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");
|
|
24
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
25
|
+
};
|
|
26
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
+
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");
|
|
29
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
|
+
};
|
|
31
|
+
var _ChatManager_instances, _ChatManager_c, _ChatManager_toggleJoinRequests;
|
|
32
|
+
import { unreachable } from "../0_deps.js";
|
|
33
|
+
import { InputError } from "../0_errors.js";
|
|
34
|
+
import { toUnixTimestamp } from "../1_utilities.js";
|
|
35
|
+
import { as, is, isOneOf } from "../2_tl.js";
|
|
36
|
+
import { constructChatMemberUpdated, constructFailedInvitation, constructInviteLink, constructJoinRequest } from "../3_types.js";
|
|
37
|
+
import { chatMemberRightsToTlObject, reactionToTlObject } from "../3_types.js";
|
|
38
|
+
import { canBeInputChannel, canBeInputUser, toInputChannel, toInputUser } from "./0_utilities.js";
|
|
39
|
+
const chatManagerUpdates = [
|
|
40
|
+
"updateChannelParticipant",
|
|
41
|
+
"updateChatParticipant",
|
|
42
|
+
"updateBotChatInviteRequester",
|
|
43
|
+
];
|
|
44
|
+
export class ChatManager {
|
|
45
|
+
constructor(c) {
|
|
46
|
+
_ChatManager_instances.add(this);
|
|
47
|
+
_ChatManager_c.set(this, void 0);
|
|
48
|
+
__classPrivateFieldSet(this, _ChatManager_c, c, "f");
|
|
49
|
+
}
|
|
50
|
+
canHandleUpdate(update) {
|
|
51
|
+
return isOneOf(chatManagerUpdates, update);
|
|
52
|
+
}
|
|
53
|
+
async handleUpdate(update) {
|
|
54
|
+
if (is("updateChannelParticipant", update) || is("updateChatParticipant", update)) {
|
|
55
|
+
const chatMember = await constructChatMemberUpdated(update, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
56
|
+
const selfId = await __classPrivateFieldGet(this, _ChatManager_c, "f").getSelfId();
|
|
57
|
+
if (chatMember.oldChatMember.user.id == selfId) {
|
|
58
|
+
return { myChatMember: chatMember };
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return { chatMember };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (is("updateBotChatInviteRequester", update)) {
|
|
65
|
+
const joinRequest = await constructJoinRequest(update, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
66
|
+
return { joinRequest };
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
async approveJoinRequest(chatId, userId) {
|
|
71
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
72
|
+
_: "messages.hideChatJoinRequest",
|
|
73
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
74
|
+
user_id: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId),
|
|
75
|
+
approved: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async declineJoinRequest(chatId, userId) {
|
|
79
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
80
|
+
_: "messages.hideChatJoinRequest",
|
|
81
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
82
|
+
user_id: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async approveJoinRequests(chatId, params) {
|
|
86
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("approveJoinRequests");
|
|
87
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
88
|
+
_: "messages.hideAllChatJoinRequests",
|
|
89
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
90
|
+
approved: true,
|
|
91
|
+
link: params?.inviteLink,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async declineJoinRequests(chatId, params) {
|
|
95
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("declineJoinRequests");
|
|
96
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
97
|
+
_: "messages.hideAllChatJoinRequests",
|
|
98
|
+
peer: await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId),
|
|
99
|
+
link: params?.inviteLink,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// INVITE LINKS //
|
|
103
|
+
async createInviteLink(chatId, params) {
|
|
104
|
+
if (params?.requireApproval && params?.limit) {
|
|
105
|
+
throw new InputError("requireApproval cannot be true while limit is specified.");
|
|
106
|
+
}
|
|
107
|
+
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 ? toUnixTimestamp(params.expireAt) : undefined, request_needed: params?.requireApproval ? true : undefined, usage_limit: params?.limit });
|
|
108
|
+
return await constructInviteLink(as("chatInviteExported", result), __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity);
|
|
109
|
+
}
|
|
110
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
111
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("getCreatedInviteLinks");
|
|
112
|
+
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 ? toUnixTimestamp(params.afterDate) : undefined, offset_link: params?.afterInviteLink });
|
|
113
|
+
return await Promise.all(invites.map((v) => as("chatInviteExported", v)).map((v) => constructInviteLink(v, __classPrivateFieldGet(this, _ChatManager_c, "f").getEntity)));
|
|
114
|
+
}
|
|
115
|
+
// JOINING AND LEAVING CHATS //
|
|
116
|
+
async joinChat(chatId) {
|
|
117
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("joinChat");
|
|
118
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
119
|
+
if (canBeInputUser(peer)) {
|
|
120
|
+
throw new InputError("Cannot join private chats.");
|
|
121
|
+
}
|
|
122
|
+
else if (canBeInputChannel(peer)) {
|
|
123
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.joinChannel", channel: toInputChannel(peer) });
|
|
124
|
+
}
|
|
125
|
+
else if (is("inputPeerChat", peer)) {
|
|
126
|
+
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
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
unreachable();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async leaveChat(chatId) {
|
|
133
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
134
|
+
if (canBeInputUser(peer)) {
|
|
135
|
+
throw new InputError("Cannot leave private chats.");
|
|
136
|
+
}
|
|
137
|
+
else if (canBeInputChannel(peer)) {
|
|
138
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.leaveChannel", channel: toInputChannel(peer) });
|
|
139
|
+
}
|
|
140
|
+
else if (is("inputPeerChat", peer)) {
|
|
141
|
+
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
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
unreachable();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// RESTRICTING, BANNING, AND UNBANNING CHAT MEMBERS //
|
|
148
|
+
async banChatMember(chatId, memberId, params) {
|
|
149
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
150
|
+
if (!(is("inputPeerChannel", chat)) && !(is("inputPeerChat", chat))) {
|
|
151
|
+
throw new InputError("Expected a channel, supergroup, or group ID.");
|
|
152
|
+
}
|
|
153
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
154
|
+
if (is("inputPeerChannel", chat)) {
|
|
155
|
+
if (params?.deleteMessages) {
|
|
156
|
+
try {
|
|
157
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").messageManager.deleteChatMemberMessages(chatId, memberId);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
//
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({
|
|
164
|
+
_: "channels.editBanned",
|
|
165
|
+
channel: { ...chat, _: "inputChannel" },
|
|
166
|
+
participant: member,
|
|
167
|
+
banned_rights: ({
|
|
168
|
+
_: "chatBannedRights",
|
|
169
|
+
until_date: params?.untilDate ? toUnixTimestamp(params.untilDate) : 0,
|
|
170
|
+
view_messages: true,
|
|
171
|
+
send_messages: true,
|
|
172
|
+
send_media: true,
|
|
173
|
+
send_stickers: true,
|
|
174
|
+
send_gifs: true,
|
|
175
|
+
send_games: true,
|
|
176
|
+
send_inline: true,
|
|
177
|
+
embed_links: true,
|
|
178
|
+
}),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
else if (is("inputPeerChat", chat)) {
|
|
182
|
+
if (!canBeInputUser(member)) {
|
|
183
|
+
throw new InputError(`Invalid user ID: ${memberId}`);
|
|
184
|
+
}
|
|
185
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.deleteChatUser", chat_id: chat.chat_id, user_id: toInputUser(member), revoke_history: params?.deleteMessages ? true : undefined });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async unbanChatMember(chatId, memberId) {
|
|
189
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
190
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
191
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: ({ _: "chatBannedRights", until_date: 0 }) });
|
|
192
|
+
}
|
|
193
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
194
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
195
|
+
const member = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(memberId);
|
|
196
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editBanned", channel, participant: member, banned_rights: chatMemberRightsToTlObject(params?.rights, params?.untilDate) });
|
|
197
|
+
}
|
|
198
|
+
// CHAT SETTINGS //
|
|
199
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
200
|
+
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) => reactionToTlObject(v)) }) : unreachable() });
|
|
201
|
+
}
|
|
202
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
203
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("setBoostsRequiredToCircumventRestrictions");
|
|
204
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
205
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setBoostsToUnblockRestrictions", channel, boosts });
|
|
206
|
+
}
|
|
207
|
+
async enableJoinRequests(chatId) {
|
|
208
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("enableJoinRequests");
|
|
209
|
+
await __classPrivateFieldGet(this, _ChatManager_instances, "m", _ChatManager_toggleJoinRequests).call(this, chatId, true);
|
|
210
|
+
}
|
|
211
|
+
async disableJoinRequests(chatId) {
|
|
212
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("disableJoinRequests");
|
|
213
|
+
await __classPrivateFieldGet(this, _ChatManager_instances, "m", _ChatManager_toggleJoinRequests).call(this, chatId, false);
|
|
214
|
+
}
|
|
215
|
+
async setChatStickerSet(chatId, setName) {
|
|
216
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
217
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetShortName", short_name: setName } });
|
|
218
|
+
}
|
|
219
|
+
async deleteChatStickerSet(chatId) {
|
|
220
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
221
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.setStickers", channel, stickerset: { _: "inputStickerSetEmpty" } });
|
|
222
|
+
}
|
|
223
|
+
// CHAT PHOTOS //
|
|
224
|
+
async deleteChatPhoto(chatId) {
|
|
225
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
226
|
+
if (!(canBeInputChannel(peer)) && !(is("inputPeerChat", peer))) {
|
|
227
|
+
unreachable();
|
|
228
|
+
}
|
|
229
|
+
if (canBeInputChannel(peer)) {
|
|
230
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editPhoto", channel: toInputChannel(peer), photo: { _: "inputChatPhotoEmpty" } });
|
|
231
|
+
}
|
|
232
|
+
else if (is("inputPeerChat", peer)) {
|
|
233
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: { _: "inputChatPhotoEmpty" } });
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async setChatPhoto(chatId, photo, params) {
|
|
237
|
+
const peer = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
238
|
+
if (!(canBeInputChannel(peer)) && !(is("inputPeerChat", peer))) {
|
|
239
|
+
unreachable();
|
|
240
|
+
}
|
|
241
|
+
const file = await __classPrivateFieldGet(this, _ChatManager_c, "f").fileManager.upload(photo, params);
|
|
242
|
+
const photo_ = { _: "inputChatUploadedPhoto", file };
|
|
243
|
+
if (canBeInputChannel(peer)) {
|
|
244
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.editPhoto", channel: toInputChannel(peer), photo: photo_ });
|
|
245
|
+
}
|
|
246
|
+
else if (is("inputPeerChat", peer)) {
|
|
247
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.editChatPhoto", chat_id: peer.chat_id, photo: photo_ });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// INVITING MEMBERS //
|
|
251
|
+
async addChatMember(chatId, userId, params) {
|
|
252
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("addChatMember");
|
|
253
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
254
|
+
if (isOneOf(["inputPeerEmpty", "inputPeerSelf", "inputPeerUser", "inputPeerUserFromMessage"], chat)) {
|
|
255
|
+
throw new InputError("Cannot add members to private chats");
|
|
256
|
+
}
|
|
257
|
+
const user = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId);
|
|
258
|
+
if (is("inputPeerChat", chat)) {
|
|
259
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "messages.addChatUser", chat_id: chat.chat_id, user_id: user, fwd_limit: params?.historyLimit ?? 0 });
|
|
260
|
+
return result.missing_invitees.map(constructFailedInvitation);
|
|
261
|
+
}
|
|
262
|
+
else if (is("inputPeerChannel", chat)) {
|
|
263
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.inviteToChannel", channel: { ...chat, _: "inputChannel" }, users: [user] });
|
|
264
|
+
return result.missing_invitees.map(constructFailedInvitation);
|
|
265
|
+
}
|
|
266
|
+
unreachable();
|
|
267
|
+
}
|
|
268
|
+
async addChatMembers(chatId, userIds) {
|
|
269
|
+
__classPrivateFieldGet(this, _ChatManager_c, "f").storage.assertUser("addChatMembers");
|
|
270
|
+
const chat = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputPeer(chatId);
|
|
271
|
+
if (isOneOf(["inputPeerEmpty", "inputPeerSelf", "inputPeerUser", "inputPeerUserFromMessage"], chat)) {
|
|
272
|
+
throw new InputError("Cannot add members to private chats");
|
|
273
|
+
}
|
|
274
|
+
const users = new Array();
|
|
275
|
+
for (const userId of userIds) {
|
|
276
|
+
users.push(await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputUser(userId));
|
|
277
|
+
}
|
|
278
|
+
if (is("inputPeerChat", chat)) {
|
|
279
|
+
throw new InputError("addChatMembers cannot be used with basic groups");
|
|
280
|
+
}
|
|
281
|
+
else if (canBeInputChannel(chat)) {
|
|
282
|
+
const result = await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.inviteToChannel", channel: toInputChannel(chat), users });
|
|
283
|
+
return result.missing_invitees.map(constructFailedInvitation);
|
|
284
|
+
}
|
|
285
|
+
unreachable();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
_ChatManager_c = new WeakMap(), _ChatManager_instances = new WeakSet(), _ChatManager_toggleJoinRequests =
|
|
289
|
+
// JOIN REQUESTS //
|
|
290
|
+
async function _ChatManager_toggleJoinRequests(chatId, enabled) {
|
|
291
|
+
const channel = await __classPrivateFieldGet(this, _ChatManager_c, "f").getInputChannel(chatId);
|
|
292
|
+
await __classPrivateFieldGet(this, _ChatManager_c, "f").invoke({ _: "channels.toggleJoinRequest", channel, enabled });
|
|
293
|
+
};
|
|
@@ -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,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
|
*
|
|
@@ -47,7 +47,7 @@ export class InlineQueryManager {
|
|
|
47
47
|
checkInlineQueryId(id);
|
|
48
48
|
await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.setInlineBotResults", query_id: BigInt(id), results: await Promise.all(results.map((v) => 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 });
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
canHandleUpdate(update) {
|
|
51
51
|
return isOneOf(inlineQueryManagerUpdates, update);
|
|
52
52
|
}
|
|
53
53
|
async handleUpdate(update) {
|