From ba55b2fd21f6f9473dae9bf8e8ec08da61e51ff3 Mon Sep 17 00:00:00 2001 From: Anastasiya Novikova Date: Thu, 4 Jul 2024 17:35:35 +0400 Subject: [PATCH] run bin/parser --- lib/tdlib/client_methods.rb | 1025 ++++++++++++----- lib/tdlib/types.rb | 134 ++- lib/tdlib/types/account_ttl.rb | 3 +- lib/tdlib/types/animated_emoji.rb | 15 + lib/tdlib/types/audio.rb | 2 +- lib/tdlib/types/authentication_code_info.rb | 8 +- .../authentication_code_type/flash_call.rb | 2 +- lib/tdlib/types/authorization_state/closed.rb | 2 +- lib/tdlib/types/auto_download_settings.rb | 8 +- .../types/auto_download_settings_presets.rb | 2 +- lib/tdlib/types/background_fill.rb | 1 + .../background_fill/freeform_gradient.rb | 8 + lib/tdlib/types/background_fill/gradient.rb | 2 +- lib/tdlib/types/background_type/fill.rb | 2 +- lib/tdlib/types/background_type/pattern.rb | 8 +- lib/tdlib/types/basic_group_full_info.rb | 2 + lib/tdlib/types/bot_command_scope.rb | 16 + .../all_chat_administrators.rb | 5 + .../bot_command_scope/all_group_chats.rb | 5 + .../bot_command_scope/all_private_chats.rb | 5 + lib/tdlib/types/bot_command_scope/chat.rb | 8 + .../bot_command_scope/chat_administrators.rb | 8 + .../types/bot_command_scope/chat_member.rb | 10 + lib/tdlib/types/bot_command_scope/default.rb | 5 + lib/tdlib/types/bot_commands.rb | 10 + lib/tdlib/types/bot_info.rb | 10 - lib/tdlib/types/call_discard_reason/missed.rb | 2 +- lib/tdlib/types/call_state/discarded.rb | 4 +- lib/tdlib/types/callback_query_answer.rb | 2 +- lib/tdlib/types/chat.rb | 15 +- lib/tdlib/types/chat_action.rb | 2 + lib/tdlib/types/chat_action/cancel.rb | 2 +- .../types/chat_action/choosing_sticker.rb | 5 + .../types/chat_action/watching_animations.rb | 8 + lib/tdlib/types/chat_action_bar.rb | 2 +- .../types/chat_action_bar/report_add_block.rb | 3 +- lib/tdlib/types/chat_event_action.rb | 11 +- .../member_joined_by_request.rb | 10 + .../slow_mode_delay_changed.rb | 4 +- .../chat_event_action/video_chat_created.rb | 9 + .../chat_event_action/video_chat_discarded.rb | 9 + ...deo_chat_mute_new_participants_toggled.rb} | 4 +- ...ideo_chat_participant_is_muted_toggled.rb} | 4 +- ..._chat_participant_volume_level_changed.rb} | 4 +- .../chat_event_action/voice_chat_created.rb | 9 - .../chat_event_action/voice_chat_discarded.rb | 9 - lib/tdlib/types/chat_event_log_filters.rb | 26 +- lib/tdlib/types/chat_invite_link.rb | 10 +- lib/tdlib/types/chat_invite_link_info.rb | 6 +- lib/tdlib/types/chat_invite_link_member.rb | 2 + lib/tdlib/types/chat_join_request.rb | 12 + lib/tdlib/types/chat_join_requests.rb | 10 + lib/tdlib/types/chat_join_requests_info.rb | 10 + lib/tdlib/types/chat_member.rb | 5 +- .../types/chat_member_status/administrator.rb | 11 +- lib/tdlib/types/chat_member_status/banned.rb | 2 +- lib/tdlib/types/chat_member_status/creator.rb | 2 +- lib/tdlib/types/chat_member_status/member.rb | 2 +- lib/tdlib/types/chat_notification_settings.rb | 2 +- .../chat_statistics_message_sender_info.rb | 2 +- lib/tdlib/types/chat_theme.rb | 12 + lib/tdlib/types/chat_type/basic_group.rb | 2 +- lib/tdlib/types/chat_type/supergroup.rb | 3 +- .../public_chats_too_much.rb | 2 +- .../types/check_sticker_set_name_result.rb | 12 + .../name_invalid.rb | 5 + .../name_occupied.rb | 5 + .../types/check_sticker_set_name_result/ok.rb | 5 + lib/tdlib/types/color_replacement.rb | 10 + lib/tdlib/types/country_info.rb | 2 +- lib/tdlib/types/deep_link_info.rb | 4 +- .../types/device_token/apple_push_vo_ip.rb | 2 +- .../device_token/firebase_cloud_messaging.rb | 2 +- lib/tdlib/types/dice_stickers.rb | 2 +- lib/tdlib/types/draft_message.rb | 4 +- lib/tdlib/types/file.rb | 5 +- lib/tdlib/types/group_call.rb | 14 +- lib/tdlib/types/group_call_join_response.rb | 11 - .../types/group_call_join_response/stream.rb | 5 - .../types/group_call_join_response/webrtc.rb | 10 - .../group_call_join_response_candidate.rb | 32 - lib/tdlib/types/group_call_participant.rb | 19 +- .../group_call_participant_video_info.rb | 14 + lib/tdlib/types/group_call_payload.rb | 12 - .../types/group_call_payload_fingerprint.rb | 12 - lib/tdlib/types/group_call_video_quality.rb | 12 + .../types/group_call_video_quality/full.rb | 5 + .../types/group_call_video_quality/medium.rb | 5 + .../group_call_video_quality/thumbnail.rb | 5 + .../types/group_call_video_source_group.rb | 10 + lib/tdlib/types/identity_document.rb | 7 +- .../switch_inline.rb | 2 +- lib/tdlib/types/inline_query_results.rb | 4 +- lib/tdlib/types/input_credentials/new.rb | 2 +- lib/tdlib/types/input_file/generated.rb | 4 +- lib/tdlib/types/input_identity_document.rb | 11 +- .../input_inline_query_result/animation.rb | 5 +- .../input_inline_query_result/article.rb | 2 +- .../types/input_inline_query_result/audio.rb | 2 +- .../input_inline_query_result/contact.rb | 2 +- .../input_inline_query_result/document.rb | 2 +- .../types/input_inline_query_result/game.rb | 2 +- .../input_inline_query_result/location.rb | 2 +- .../types/input_inline_query_result/photo.rb | 2 +- .../input_inline_query_result/sticker.rb | 2 +- .../types/input_inline_query_result/venue.rb | 2 +- .../types/input_inline_query_result/video.rb | 2 +- .../input_inline_query_result/voice_note.rb | 2 +- .../types/input_message_content/animation.rb | 7 +- .../types/input_message_content/audio.rb | 8 +- lib/tdlib/types/input_message_content/dice.rb | 2 +- .../types/input_message_content/document.rb | 7 +- .../types/input_message_content/forwarded.rb | 6 +- .../types/input_message_content/location.rb | 4 +- .../types/input_message_content/photo.rb | 7 +- .../types/input_message_content/sticker.rb | 4 +- lib/tdlib/types/input_message_content/text.rb | 4 +- .../types/input_message_content/video.rb | 9 +- .../types/input_message_content/video_note.rb | 4 +- .../types/input_message_content/voice_note.rb | 3 +- lib/tdlib/types/input_sticker/static.rb | 6 +- lib/tdlib/types/internal_link_type.rb | 33 + .../internal_link_type/active_sessions.rb | 6 + .../internal_link_type/authentication_code.rb | 9 + .../types/internal_link_type/background.rb | 9 + .../types/internal_link_type/bot_start.rb | 12 + .../internal_link_type/bot_start_in_group.rb | 14 + .../internal_link_type/change_phone_number.rb | 5 + .../types/internal_link_type/chat_invite.rb | 9 + .../internal_link_type/filter_settings.rb | 5 + lib/tdlib/types/internal_link_type/game.rb | 12 + .../types/internal_link_type/language_pack.rb | 9 + lib/tdlib/types/internal_link_type/message.rb | 9 + .../types/internal_link_type/message_draft.rb | 13 + .../passport_data_request.rb | 21 + .../phone_number_confirmation.rb | 11 + lib/tdlib/types/internal_link_type/proxy.rb | 13 + .../types/internal_link_type/public_chat.rb | 9 + .../qr_code_authentication.rb | 8 + .../types/internal_link_type/settings.rb | 5 + .../types/internal_link_type/sticker_set.rb | 9 + lib/tdlib/types/internal_link_type/theme.rb | 9 + .../internal_link_type/theme_settings.rb | 5 + .../internal_link_type/unknown_deep_link.rb | 9 + .../internal_link_type/unsupported_proxy.rb | 6 + .../types/internal_link_type/video_chat.rb | 16 + lib/tdlib/types/keyboard_button_type/text.rb | 2 +- lib/tdlib/types/language_pack_info.rb | 2 +- lib/tdlib/types/language_pack_string.rb | 3 +- .../language_pack_string_value/deleted.rb | 2 +- lib/tdlib/types/local_file.rb | 6 +- lib/tdlib/types/log_stream/file.rb | 2 +- lib/tdlib/types/mask_point.rb | 2 +- lib/tdlib/types/mask_point/chin.rb | 2 +- lib/tdlib/types/mask_point/eyes.rb | 2 +- lib/tdlib/types/mask_point/forehead.rb | 2 +- lib/tdlib/types/mask_point/mouth.rb | 2 +- lib/tdlib/types/mask_position.rb | 4 +- lib/tdlib/types/message.rb | 16 +- lib/tdlib/types/message_calendar.rb | 10 + lib/tdlib/types/message_calendar_day.rb | 10 + lib/tdlib/types/message_content.rb | 11 +- .../types/message_content/animated_emoji.rb | 10 + .../message_content/chat_join_by_request.rb | 5 + .../types/message_content/chat_set_theme.rb | 9 + .../invite_video_chat_participants.rb | 11 + .../invite_voice_chat_participants.rb | 11 - lib/tdlib/types/message_content/invoice.rb | 2 +- .../types/message_content/video_chat_ended.rb | 8 + ...t_scheduled.rb => video_chat_scheduled.rb} | 8 +- .../message_content/video_chat_started.rb | 9 + .../types/message_content/voice_chat_ended.rb | 8 - .../message_content/voice_chat_started.rb | 9 - lib/tdlib/types/message_copy_options.rb | 10 +- lib/tdlib/types/message_interaction_info.rb | 4 +- lib/tdlib/types/message_link_info.rb | 4 + lib/tdlib/types/message_position.rb | 12 + lib/tdlib/types/message_positions.rb | 10 + lib/tdlib/types/message_send_options.rb | 3 +- lib/tdlib/types/message_thread_info.rb | 4 +- .../types/network_statistics_entry/file.rb | 3 +- .../types/notification_settings_scope.rb | 2 +- lib/tdlib/types/page_block/animation.rb | 2 +- lib/tdlib/types/page_block/chat_link.rb | 2 +- lib/tdlib/types/page_block/embedded.rb | 4 +- lib/tdlib/types/page_block/preformatted.rb | 2 +- lib/tdlib/types/page_block/video.rb | 4 +- .../page_block_horizontal_alignment/center.rb | 2 +- .../page_block_horizontal_alignment/left.rb | 2 +- .../page_block_horizontal_alignment/right.rb | 2 +- lib/tdlib/types/page_block_table_cell.rb | 6 +- .../page_block_vertical_alignment/bottom.rb | 2 +- .../page_block_vertical_alignment/middle.rb | 2 +- .../page_block_vertical_alignment/top.rb | 2 +- .../types/passport_authorization_form.rb | 4 +- lib/tdlib/types/password_state.rb | 3 + lib/tdlib/types/payment_form.rb | 7 +- lib/tdlib/types/payment_form_theme.rb | 2 +- lib/tdlib/types/payment_receipt.rb | 2 +- lib/tdlib/types/payment_result.rb | 4 +- lib/tdlib/types/phone_number_info.rb | 1 + lib/tdlib/types/photo_size.rb | 2 +- lib/tdlib/types/push_message_content.rb | 2 + .../push_message_content/chat_add_members.rb | 2 +- .../chat_delete_member.rb | 2 +- .../chat_join_by_request.rb | 5 + .../push_message_content/chat_set_theme.rb | 9 + lib/tdlib/types/remote_file.rb | 4 +- lib/tdlib/types/reply_markup/force_reply.rb | 3 + lib/tdlib/types/reply_markup/show_keyboard.rb | 3 + lib/tdlib/types/reset_password_result.rb | 12 + .../types/reset_password_result/declined.rb | 8 + lib/tdlib/types/reset_password_result/ok.rb | 5 + .../types/reset_password_result/pending.rb | 9 + lib/tdlib/types/rich_text/anchor_link.rb | 2 +- lib/tdlib/types/rich_text/icon.rb | 4 +- .../types/scope_notification_settings.rb | 2 +- lib/tdlib/types/secret_chat.rb | 3 +- lib/tdlib/types/session.rb | 2 +- lib/tdlib/types/sponsored_message.rb | 16 + lib/tdlib/types/sponsored_messages.rb | 8 + lib/tdlib/types/sticker.rb | 2 +- lib/tdlib/types/sticker_set_info.rb | 5 +- lib/tdlib/types/storage_statistics.rb | 2 +- lib/tdlib/types/storage_statistics_by_chat.rb | 2 +- .../types/storage_statistics_by_file_type.rb | 2 +- lib/tdlib/types/storage_statistics_fast.rb | 2 +- lib/tdlib/types/suggested_action.rb | 1 + .../types/suggested_action/check_password.rb | 5 + .../suggested_action/check_phone_number.rb | 3 +- lib/tdlib/types/supergroup.rb | 2 +- lib/tdlib/types/supergroup_full_info.rb | 2 + lib/tdlib/types/text_entity_type.rb | 1 + .../types/text_entity_type/bot_command.rb | 1 - lib/tdlib/types/text_entity_type/cashtag.rb | 3 +- .../types/text_entity_type/media_timestamp.rb | 11 + lib/tdlib/types/text_parse_mode.rb | 2 +- lib/tdlib/types/theme_settings.rb | 17 + lib/tdlib/types/update.rb | 7 +- .../update/animated_emoji_message_clicked.rb | 14 + lib/tdlib/types/update/chat_draft_message.rb | 2 +- .../update/chat_pending_join_requests.rb | 11 + lib/tdlib/types/update/chat_theme.rb | 11 + lib/tdlib/types/update/chat_themes.rb | 8 + lib/tdlib/types/update/chat_video_chat.rb | 10 + lib/tdlib/types/update/chat_voice_chat.rb | 10 - .../types/update/file_generation_start.rb | 8 +- lib/tdlib/types/update/message_send_failed.rb | 2 +- .../types/update/message_send_succeeded.rb | 2 +- .../types/update/new_chat_join_request.rb | 13 + lib/tdlib/types/update/new_inline_query.rb | 4 +- lib/tdlib/types/update/notification_group.rb | 2 +- .../types/update/service_notification.rb | 4 +- lib/tdlib/types/update/terms_of_service.rb | 2 +- lib/tdlib/types/user_full_info.rb | 9 +- lib/tdlib/types/user_type/bot.rb | 3 +- lib/tdlib/types/video.rb | 2 +- .../types/{voice_chat.rb => video_chat.rb} | 12 +- lib/tdlib/types/web_page_instant_view.rb | 3 + 259 files changed, 1992 insertions(+), 751 deletions(-) create mode 100644 lib/tdlib/types/animated_emoji.rb create mode 100644 lib/tdlib/types/background_fill/freeform_gradient.rb create mode 100644 lib/tdlib/types/bot_command_scope.rb create mode 100644 lib/tdlib/types/bot_command_scope/all_chat_administrators.rb create mode 100644 lib/tdlib/types/bot_command_scope/all_group_chats.rb create mode 100644 lib/tdlib/types/bot_command_scope/all_private_chats.rb create mode 100644 lib/tdlib/types/bot_command_scope/chat.rb create mode 100644 lib/tdlib/types/bot_command_scope/chat_administrators.rb create mode 100644 lib/tdlib/types/bot_command_scope/chat_member.rb create mode 100644 lib/tdlib/types/bot_command_scope/default.rb create mode 100644 lib/tdlib/types/bot_commands.rb delete mode 100644 lib/tdlib/types/bot_info.rb create mode 100644 lib/tdlib/types/chat_action/choosing_sticker.rb create mode 100644 lib/tdlib/types/chat_action/watching_animations.rb create mode 100644 lib/tdlib/types/chat_event_action/member_joined_by_request.rb create mode 100644 lib/tdlib/types/chat_event_action/video_chat_created.rb create mode 100644 lib/tdlib/types/chat_event_action/video_chat_discarded.rb rename lib/tdlib/types/chat_event_action/{voice_chat_mute_new_participants_toggled.rb => video_chat_mute_new_participants_toggled.rb} (60%) rename lib/tdlib/types/chat_event_action/{voice_chat_participant_is_muted_toggled.rb => video_chat_participant_is_muted_toggled.rb} (72%) rename lib/tdlib/types/chat_event_action/{voice_chat_participant_volume_level_changed.rb => video_chat_participant_volume_level_changed.rb} (75%) delete mode 100644 lib/tdlib/types/chat_event_action/voice_chat_created.rb delete mode 100644 lib/tdlib/types/chat_event_action/voice_chat_discarded.rb create mode 100644 lib/tdlib/types/chat_join_request.rb create mode 100644 lib/tdlib/types/chat_join_requests.rb create mode 100644 lib/tdlib/types/chat_join_requests_info.rb create mode 100644 lib/tdlib/types/chat_theme.rb create mode 100644 lib/tdlib/types/check_sticker_set_name_result.rb create mode 100644 lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb create mode 100644 lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb create mode 100644 lib/tdlib/types/check_sticker_set_name_result/ok.rb create mode 100644 lib/tdlib/types/color_replacement.rb delete mode 100644 lib/tdlib/types/group_call_join_response.rb delete mode 100644 lib/tdlib/types/group_call_join_response/stream.rb delete mode 100644 lib/tdlib/types/group_call_join_response/webrtc.rb delete mode 100644 lib/tdlib/types/group_call_join_response_candidate.rb create mode 100644 lib/tdlib/types/group_call_participant_video_info.rb delete mode 100644 lib/tdlib/types/group_call_payload.rb delete mode 100644 lib/tdlib/types/group_call_payload_fingerprint.rb create mode 100644 lib/tdlib/types/group_call_video_quality.rb create mode 100644 lib/tdlib/types/group_call_video_quality/full.rb create mode 100644 lib/tdlib/types/group_call_video_quality/medium.rb create mode 100644 lib/tdlib/types/group_call_video_quality/thumbnail.rb create mode 100644 lib/tdlib/types/group_call_video_source_group.rb create mode 100644 lib/tdlib/types/internal_link_type.rb create mode 100644 lib/tdlib/types/internal_link_type/active_sessions.rb create mode 100644 lib/tdlib/types/internal_link_type/authentication_code.rb create mode 100644 lib/tdlib/types/internal_link_type/background.rb create mode 100644 lib/tdlib/types/internal_link_type/bot_start.rb create mode 100644 lib/tdlib/types/internal_link_type/bot_start_in_group.rb create mode 100644 lib/tdlib/types/internal_link_type/change_phone_number.rb create mode 100644 lib/tdlib/types/internal_link_type/chat_invite.rb create mode 100644 lib/tdlib/types/internal_link_type/filter_settings.rb create mode 100644 lib/tdlib/types/internal_link_type/game.rb create mode 100644 lib/tdlib/types/internal_link_type/language_pack.rb create mode 100644 lib/tdlib/types/internal_link_type/message.rb create mode 100644 lib/tdlib/types/internal_link_type/message_draft.rb create mode 100644 lib/tdlib/types/internal_link_type/passport_data_request.rb create mode 100644 lib/tdlib/types/internal_link_type/phone_number_confirmation.rb create mode 100644 lib/tdlib/types/internal_link_type/proxy.rb create mode 100644 lib/tdlib/types/internal_link_type/public_chat.rb create mode 100644 lib/tdlib/types/internal_link_type/qr_code_authentication.rb create mode 100644 lib/tdlib/types/internal_link_type/settings.rb create mode 100644 lib/tdlib/types/internal_link_type/sticker_set.rb create mode 100644 lib/tdlib/types/internal_link_type/theme.rb create mode 100644 lib/tdlib/types/internal_link_type/theme_settings.rb create mode 100644 lib/tdlib/types/internal_link_type/unknown_deep_link.rb create mode 100644 lib/tdlib/types/internal_link_type/unsupported_proxy.rb create mode 100644 lib/tdlib/types/internal_link_type/video_chat.rb create mode 100644 lib/tdlib/types/message_calendar.rb create mode 100644 lib/tdlib/types/message_calendar_day.rb create mode 100644 lib/tdlib/types/message_content/animated_emoji.rb create mode 100644 lib/tdlib/types/message_content/chat_join_by_request.rb create mode 100644 lib/tdlib/types/message_content/chat_set_theme.rb create mode 100644 lib/tdlib/types/message_content/invite_video_chat_participants.rb delete mode 100644 lib/tdlib/types/message_content/invite_voice_chat_participants.rb create mode 100644 lib/tdlib/types/message_content/video_chat_ended.rb rename lib/tdlib/types/message_content/{voice_chat_scheduled.rb => video_chat_scheduled.rb} (56%) create mode 100644 lib/tdlib/types/message_content/video_chat_started.rb delete mode 100644 lib/tdlib/types/message_content/voice_chat_ended.rb delete mode 100644 lib/tdlib/types/message_content/voice_chat_started.rb create mode 100644 lib/tdlib/types/message_position.rb create mode 100644 lib/tdlib/types/message_positions.rb create mode 100644 lib/tdlib/types/push_message_content/chat_join_by_request.rb create mode 100644 lib/tdlib/types/push_message_content/chat_set_theme.rb create mode 100644 lib/tdlib/types/reset_password_result.rb create mode 100644 lib/tdlib/types/reset_password_result/declined.rb create mode 100644 lib/tdlib/types/reset_password_result/ok.rb create mode 100644 lib/tdlib/types/reset_password_result/pending.rb create mode 100644 lib/tdlib/types/sponsored_message.rb create mode 100644 lib/tdlib/types/sponsored_messages.rb create mode 100644 lib/tdlib/types/suggested_action/check_password.rb create mode 100644 lib/tdlib/types/text_entity_type/media_timestamp.rb create mode 100644 lib/tdlib/types/theme_settings.rb create mode 100644 lib/tdlib/types/update/animated_emoji_message_clicked.rb create mode 100644 lib/tdlib/types/update/chat_pending_join_requests.rb create mode 100644 lib/tdlib/types/update/chat_theme.rb create mode 100644 lib/tdlib/types/update/chat_themes.rb create mode 100644 lib/tdlib/types/update/chat_video_chat.rb delete mode 100644 lib/tdlib/types/update/chat_voice_chat.rb create mode 100644 lib/tdlib/types/update/new_chat_join_request.rb rename lib/tdlib/types/{voice_chat.rb => video_chat.rb} (61%) diff --git a/lib/tdlib/client_methods.rb b/lib/tdlib/client_methods.rb index 0e6c6a6b..1a76eda3 100644 --- a/lib/tdlib/client_methods.rb +++ b/lib/tdlib/client_methods.rb @@ -4,7 +4,7 @@ module TD::ClientMethods # Accepts an incoming call. # # @param call_id [Integer] Call identifier. - # @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the application. + # @param protocol [TD::Types::CallProtocol] The call protocols supported by the application. # @return [TD::Types::Ok] def accept_call(call_id:, protocol:) broadcast('@type' => 'acceptCall', @@ -28,7 +28,7 @@ def accept_terms_of_service(terms_of_service_id:) # @param user_id [Integer] Identifier of the user. # @param forward_limit [Integer] The number of earlier messages from the chat to be forwarded to the new member; up # to 100. - # Ignored for supergroups and channels. + # Ignored for supergroups and channels, or if the added user is a bot. # @return [TD::Types::Ok] def add_chat_member(chat_id:, user_id:, forward_limit:) broadcast('@type' => 'addChatMember', @@ -73,7 +73,7 @@ def add_chat_to_list(chat_id:, chat_list:) # @param share_phone_number [Boolean] True, if the new contact needs to be allowed to see current user's phone # number. # A corresponding rule to {TD::Types::UserPrivacySetting::ShowPhoneNumber} will be added if needed. - # Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be + # Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be # asked to share their phone number. # @return [TD::Types::Ok] def add_contact(contact: nil, share_phone_number:) @@ -110,7 +110,7 @@ def add_favorite_sticker(sticker:) # Returns the added message. # # @param chat_id [Integer] Target chat. - # @param sender [TD::Types::MessageSender] The sender sender of the message. + # @param sender [TD::Types::MessageSender] The sender of the message. # @param reply_to_message_id [Integer] Identifier of the message to reply to or 0. # @param disable_notification [Boolean] Pass true to disable notification for the message. # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be added. @@ -152,7 +152,7 @@ def add_network_statistics(entry:) # # @param server [TD::Types::String] Proxy server IP address. # @param port [Integer] Proxy server port. - # @param enable [Boolean] True, if the proxy should be enabled. + # @param enable [Boolean] True, if the proxy needs to be enabled. # @param type [TD::Types::ProxyType] Proxy type. # @return [TD::Types::Proxy] def add_proxy(server:, port:, enable:, type:) @@ -195,8 +195,7 @@ def add_recently_found_chat(chat_id:) # Only non-secret video animations with MIME type "video/mp4" can be added to the list. # # @param animation [TD::Types::InputFile] The animation file to be added. - # Only animations known to the server (i.e. - # successfully sent via a message) can be added to the list. + # Only animations known to the server (i.e., successfully sent via a message) can be added to the list. # @return [TD::Types::Ok] def add_saved_animation(animation:) broadcast('@type' => 'addSavedAnimation', @@ -221,7 +220,7 @@ def add_sticker_to_set(user_id:, name:, sticker:) # # @param callback_query_id [Integer] Identifier of the callback query. # @param text [TD::Types::String] Text of the answer. - # @param show_alert [Boolean] If true, an alert should be shown to the user instead of a toast notification. + # @param show_alert [Boolean] If true, an alert must be shown to the user instead of a toast notification. # @param url [TD::Types::String] URL to be opened. # @param cache_time [Integer] Time during which the result of the query can be cached, in seconds. # @return [TD::Types::Ok] @@ -253,8 +252,8 @@ def answer_custom_query(custom_query_id:, data:) # @param cache_time [Integer] Allowed time to cache the results of the query, in seconds. # @param next_offset [TD::Types::String] Offset for the next inline query; pass an empty string if there are no more # results. - # @param switch_pm_text [TD::Types::String] If non-empty, this text should be shown on the button that opens a - # private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter. + # @param switch_pm_text [TD::Types::String] If non-empty, this text must be shown on the button that opens a private + # chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter. # @param switch_pm_parameter [TD::Types::String] The parameter for the bot start message. # @return [TD::Types::Ok] def answer_inline_query(inline_query_id:, is_personal:, results:, cache_time:, next_offset:, switch_pm_text:, @@ -293,6 +292,17 @@ def answer_shipping_query(shipping_query_id:, shipping_options:, error_message:) 'error_message' => error_message) end + # Approves pending join request in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param user_id [Integer] Identifier of the user, which request will be approved. + # @return [TD::Types::Ok] + def approve_chat_join_request(chat_id:, user_id:) + broadcast('@type' => 'approveChatJoinRequest', + 'chat_id' => chat_id, + 'user_id' => user_id) + end + # Bans a member in a chat. # Members can't be banned in private or secret chats. # In supergroups and channels, the user will not be able to return to the group on their own using invite links, @@ -304,7 +314,7 @@ def answer_shipping_query(shipping_query_id:, shipping_options:, error_message:) # If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is # considered to be banned forever. # Ignored in basic groups. - # @param revoke_messages [Boolean] Pass true to delete all messages in the chat for the user. + # @param revoke_messages [Boolean] Pass true to delete all messages in the chat for the user that is being removed. # Always true for supergroups and channels. # @return [TD::Types::Ok] def ban_chat_member(chat_id:, member_id:, banned_until_date:, revoke_messages:) @@ -350,6 +360,14 @@ def cancel_download_file(file_id:, only_if_pending:) 'only_if_pending' => only_if_pending) end + # Cancels reset of 2-step verification password. + # The method can be called if passwordState.pending_reset_date > 0. + # + # @return [TD::Types::Ok] + def cancel_password_reset + broadcast('@type' => 'cancelPasswordReset') + end + # Stops the uploading of a file. # Supported only for files uploaded by using uploadFile. # For other files the behavior is undefined. @@ -378,7 +396,7 @@ def change_imported_contacts(contacts:) # # @param phone_number [TD::Types::String] The new phone number of the user in international format. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. # @return [TD::Types::AuthenticationCodeInfo] def change_phone_number(phone_number:, settings:) broadcast('@type' => 'changePhoneNumber', @@ -432,6 +450,16 @@ def check_authentication_password(password:) 'password' => password) end + # Checks whether a password recovery code sent to an email address is valid. + # Works only when the current authorization state is authorizationStateWaitPassword. + # + # @param recovery_code [TD::Types::String] Recovery code to check. + # @return [TD::Types::Ok] + def check_authentication_password_recovery_code(recovery_code:) + broadcast('@type' => 'checkAuthenticationPasswordRecoveryCode', + 'recovery_code' => recovery_code) + end + # Checks the authentication code sent to confirm a new phone number of the user. # # @param code [TD::Types::String] Verification code received by SMS, phone call or flash call. @@ -443,8 +471,7 @@ def check_change_phone_number_code(code:) # Checks the validity of an invite link for a chat and returns information about the corresponding chat. # - # @param invite_link [TD::Types::String] Invite link to be checked; must have URL "t.me", "telegram.me", or - # "telegram.dog" and query beginning with "/joinchat/" or "/+". + # @param invite_link [TD::Types::String] Invite link to be checked. # @return [TD::Types::ChatInviteLinkInfo] def check_chat_invite_link(invite_link:) broadcast('@type' => 'checkChatInviteLink', @@ -453,8 +480,8 @@ def check_chat_invite_link(invite_link:) # Checks whether a username can be set for a chat. # - # @param chat_id [Integer] Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a - # private chat with self, or zero if chat is being created. + # @param chat_id [Integer] Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private + # chat with self, or zero if the chat is being created. # @param username [TD::Types::String] Username to be checked. # @return [TD::Types::CheckChatUsernameResult] def check_chat_username(chat_id:, username:) @@ -492,6 +519,15 @@ def check_email_address_verification_code(code:) 'code' => code) end + # Checks whether a 2-step verification password recovery code sent to an email address is valid. + # + # @param recovery_code [TD::Types::String] Recovery code to check. + # @return [TD::Types::Ok] + def check_password_recovery_code(recovery_code:) + broadcast('@type' => 'checkPasswordRecoveryCode', + 'recovery_code' => recovery_code) + end + # Checks phone number confirmation code. # # @param code [TD::Types::String] The phone number confirmation code. @@ -519,6 +555,15 @@ def check_recovery_email_address_code(code:) 'code' => code) end + # Checks whether a name can be used for a new sticker set. + # + # @param name [TD::Types::String] Name to be checked. + # @return [TD::Types::CheckStickerSetNameResult] + def check_sticker_set_name(name:) + broadcast('@type' => 'checkStickerSetName', + 'name' => name) + end + # Removes potentially dangerous characters from the name of a file. # The encoding of the file name is supposed to be UTF-8. # Returns an empty string on failure. @@ -564,6 +609,18 @@ def clear_recently_found_chats broadcast('@type' => 'clearRecentlyFoundChats') end + # Informs TDLib that a message with an animated emoji was clicked by the user. + # Returns a big animated sticker to be played or a 404 error if usual animation needs to be played. + # + # @param chat_id [Integer] Chat identifier of the message. + # @param message_id [Integer] Identifier of the clicked message. + # @return [TD::Types::Sticker] + def click_animated_emoji_message(chat_id:, message_id:) + broadcast('@type' => 'clickAnimatedEmojiMessage', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + # Closes the TDLib instance. # All databases will be flushed to disk and properly closed. # After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. @@ -619,7 +676,7 @@ def create_basic_group_chat(basic_group_id:, force:) # Creates a new call. # # @param user_id [Integer] Identifier of the user to be called. - # @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the application. + # @param protocol [TD::Types::CallProtocol] The call protocols supported by the application. # @param is_video [Boolean] True, if a video call needs to be created. # @return [TD::Types::CallId] def create_call(user_id:, protocol:, is_video:) @@ -644,15 +701,20 @@ def create_chat_filter(filter:) # Requires administrator privileges and can_invite_users right in the chat. # # @param chat_id [Integer] Chat identifier. + # @param name [TD::Types::String] Invite link name; 0-32 characters. # @param expire_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. # @param member_limit [Integer] The maximum number of chat members that can join the chat by the link simultaneously; # 0-99999; pass 0 if not limited. + # @param creates_join_request [Boolean] True, if the link only creates join request. + # If true, member_limit must not be specified. # @return [TD::Types::ChatInviteLink] - def create_chat_invite_link(chat_id:, expire_date:, member_limit:) - broadcast('@type' => 'createChatInviteLink', - 'chat_id' => chat_id, - 'expire_date' => expire_date, - 'member_limit' => member_limit) + def create_chat_invite_link(chat_id:, name:, expire_date:, member_limit:, creates_join_request:) + broadcast('@type' => 'createChatInviteLink', + 'chat_id' => chat_id, + 'name' => name, + 'expire_date' => expire_date, + 'member_limit' => member_limit, + 'creates_join_request' => creates_join_request) end # Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. @@ -677,26 +739,29 @@ def create_new_secret_chat(user_id:) 'user_id' => user_id) end - # Creates a new sticker set; for bots only. + # Creates a new sticker set. # Returns the newly created sticker set. # - # @param user_id [Integer, nil] Sticker set owner. + # @param user_id [Integer, nil] Sticker set owner; ignored for regular users. # @param title [TD::Types::String, nil] Sticker set title; 1-64 characters. # @param name [TD::Types::String, nil] Sticker set name. # Can contain only English letters, digits and underscores. - # Must end with *"_by_"* (** is case insensitive); 1-64 characters. + # Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters. # @param is_masks [Boolean, nil] True, if stickers are masks. # Animated stickers can't be masks. # @param stickers [Array] List of stickers to be added to the set; must be non-empty. # All stickers must be of the same type. + # For animated stickers, uploadStickerFile must be used before the sticker is shown. + # @param source [TD::Types::String, nil] Source of the sticker set; may be empty if unknown. # @return [TD::Types::StickerSet] - def create_new_sticker_set(user_id: nil, title: nil, name: nil, is_masks: nil, stickers:) + def create_new_sticker_set(user_id: nil, title: nil, name: nil, is_masks: nil, stickers:, source: nil) broadcast('@type' => 'createNewStickerSet', 'user_id' => user_id, 'title' => title, 'name' => name, 'is_masks' => is_masks, - 'stickers' => stickers) + 'stickers' => stickers, + 'source' => source) end # Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. @@ -705,7 +770,8 @@ def create_new_sticker_set(user_id: nil, title: nil, name: nil, is_masks: nil, s # @param title [TD::Types::String] Title of the new chat; 1-128 characters. # @param is_channel [Boolean] True, if a channel chat needs to be created. # @param description [TD::Types::String] Chat description; 0-255 characters. - # @param location [TD::Types::ChatLocation] Chat location if a location-based supergroup is being created. + # @param location [TD::Types::ChatLocation] Chat location if a location-based supergroup is being created; pass null + # to create an ordinary supergroup chat. # @param for_import [Boolean] True, if the supergroup is created for importing messages using importMessage. # @return [TD::Types::Chat] def create_new_supergroup_chat(title:, is_channel:, description:, location:, for_import:) @@ -753,7 +819,7 @@ def create_supergroup_chat(supergroup_id:, force:) # Creates a new temporary password for processing payments. # # @param password [TD::Types::String] Persistent user password. - # @param valid_for [Integer] Time during which the temporary password will be valid, in seconds; should be between 60 + # @param valid_for [Integer] Time during which the temporary password will be valid, in seconds; must be between 60 # and 86400. # @return [TD::Types::TemporaryPasswordState] def create_temporary_password(password:, valid_for:) @@ -762,22 +828,33 @@ def create_temporary_password(password:, valid_for:) 'valid_for' => valid_for) end - # Creates a voice chat (a group call bound to a chat). - # Available only for basic groups, supergroups and channels; requires can_manage_voice_chats rights. + # Creates a video chat (a group call bound to a chat). + # Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights. # - # @param chat_id [Integer] Chat identifier, in which the voice chat will be created. + # @param chat_id [Integer] Chat identifier, in which the video chat will be created. # @param title [TD::Types::String, nil] Group call title; if empty, chat title will be used. # @param start_date [Integer] Point in time (Unix timestamp) when the group call is supposed to be started by an - # administrator; 0 to start the voice chat immediately. + # administrator; 0 to start the video chat immediately. # The date must be at least 10 seconds and at most 8 days in the future. # @return [TD::Types::GroupCallId] - def create_voice_chat(chat_id:, title: nil, start_date:) - broadcast('@type' => 'createVoiceChat', + def create_video_chat(chat_id:, title: nil, start_date:) + broadcast('@type' => 'createVideoChat', 'chat_id' => chat_id, 'title' => title, 'start_date' => start_date) end + # Declines pending join request in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param user_id [Integer] Identifier of the user, which request will be declined. + # @return [TD::Types::Ok] + def decline_chat_join_request(chat_id:, user_id:) + broadcast('@type' => 'declineChatJoinRequest', + 'chat_id' => chat_id, + 'user_id' => user_id) + end + # Deletes the account of the current user, deleting all information associated with the user from the server. # The phone number of the account can be used to create a new account. # Can be called before authorization when the current authorization state is authorizationStateWaitPassword. @@ -833,11 +910,11 @@ def delete_chat_filter(chat_filter_id:) end # Deletes all messages in the chat. - # Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the + # Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the # method can be applied to the chat. # # @param chat_id [Integer] Chat identifier. - # @param remove_from_chat_list [Boolean] Pass true if the chat should be removed from the chat list. + # @param remove_from_chat_list [Boolean] Pass true if the chat needs to be removed from the chat list. # @param revoke [Boolean] Pass true to try to delete chat history for all users. # @return [TD::Types::Ok] def delete_chat_history(chat_id:, remove_from_chat_list:, revoke:) @@ -847,6 +924,23 @@ def delete_chat_history(chat_id:, remove_from_chat_list:, revoke:) 'revoke' => revoke) end + # Deletes all messages between the specified dates in a chat. + # Supported only for private chats and basic groups. + # Messages sent in the last 30 seconds will not be deleted. + # + # @param chat_id [Integer] Chat identifier. + # @param min_date [Integer] The minimum date of the messages to delete. + # @param max_date [Integer] The maximum date of the messages to delete. + # @param revoke [Boolean] Pass true to try to delete chat messages for all users; private chats only. + # @return [TD::Types::Ok] + def delete_chat_messages_by_date(chat_id:, min_date:, max_date:, revoke:) + broadcast('@type' => 'deleteChatMessagesByDate', + 'chat_id' => chat_id, + 'min_date' => min_date, + 'max_date' => max_date, + 'revoke' => revoke) + end + # Deletes all messages sent by the specified user to a chat. # Supported only for supergroups; requires can_delete_messages administrator privileges. # @@ -861,7 +955,7 @@ def delete_chat_messages_from_user(chat_id:, user_id:) # Deletes the default reply markup from a chat. # Must be called after a one-time keyboard or a ForceReply reply markup has been used. - # UpdateChatReplyMarkup will be sent if the reply markup will be changed. + # UpdateChatReplyMarkup will be sent if the reply markup is changed. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] The message identifier of the used keyboard. @@ -872,6 +966,18 @@ def delete_chat_reply_markup(chat_id:, message_id:) 'message_id' => message_id) end + # Deletes commands supported by the bot for the given user scope and language; for bots only. + # + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to delete + # commands in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 country code or an empty string. + # @return [TD::Types::Ok] + def delete_commands(scope:, language_code:) + broadcast('@type' => 'deleteCommands', + 'scope' => scope, + 'language_code' => language_code) + end + # Deletes a file from the TDLib file cache. # # @param file_id [Integer] Identifier of the file to delete. @@ -1022,11 +1128,11 @@ def disconnect_website(website_id:) # The higher the priority, the earlier the file will be downloaded. # If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded # first. - # @param offset [Integer] The starting position from which the file should be downloaded. - # @param limit [Integer] Number of bytes which should be downloaded starting from the "offset" position before the - # download will be automatically cancelled; use 0 to download without a limit. + # @param offset [Integer] The starting position from which the file needs to be downloaded. + # @param limit [Integer] Number of bytes which need to be downloaded starting from the "offset" position before the + # download will be automatically canceled; use 0 to download without a limit. # @param synchronous [Boolean] If false, this request returns file state just after the download has been started. - # If true, this request returns file state only after the download has succeeded, has failed, has been cancelled or + # If true, this request returns file state only after the download has succeeded, has failed, has been canceled or # a new downloadFile request with different offset/limit parameters was sent. # @return [TD::Types::File] def download_file(file_id:, priority:, offset:, limit:, synchronous:) @@ -1057,16 +1163,21 @@ def edit_chat_filter(chat_filter_id:, filter:) # # @param chat_id [Integer] Chat identifier. # @param invite_link [TD::Types::String] Invite link to be edited. + # @param name [TD::Types::String] Invite link name; 0-32 characters. # @param expire_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. # @param member_limit [Integer] The maximum number of chat members that can join the chat by the link simultaneously; # 0-99999; pass 0 if not limited. + # @param creates_join_request [Boolean] True, if the link only creates join request. + # If true, member_limit must not be specified. # @return [TD::Types::ChatInviteLink] - def edit_chat_invite_link(chat_id:, invite_link:, expire_date:, member_limit:) - broadcast('@type' => 'editChatInviteLink', - 'chat_id' => chat_id, - 'invite_link' => invite_link, - 'expire_date' => expire_date, - 'member_limit' => member_limit) + def edit_chat_invite_link(chat_id:, invite_link:, name:, expire_date:, member_limit:, creates_join_request:) + broadcast('@type' => 'editChatInviteLink', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'name' => name, + 'expire_date' => expire_date, + 'member_limit' => member_limit, + 'creates_join_request' => creates_join_request) end # Edits information about a custom local language pack in the current localization target. @@ -1082,9 +1193,9 @@ def edit_custom_language_pack_info(info:) # Edits the caption of an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. - # @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max") - # characters. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param caption [TD::Types::FormattedText] New message content caption; pass null to remove caption; + # 0-GetOption("message_caption_length_max") characters. # @return [TD::Types::Ok] def edit_inline_message_caption(inline_message_id:, reply_markup:, caption:) broadcast('@type' => 'editInlineMessageCaption', @@ -1096,16 +1207,15 @@ def edit_inline_message_caption(inline_message_id:, reply_markup:, caption:) # Edits the content of a live location in an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. - # @param location [TD::Types::Location, nil] New location content of the message; may be null. - # Pass null to stop sharing the live location. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param location [TD::Types::Location] New location content of the message; pass null to stop sharing the live + # location. # @param heading [Integer] The new direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @param proximity_alert_radius [Integer] The new maximum distance for proximity alerts, in meters (0-100000). # Pass 0 if the notification is disabled. # @return [TD::Types::Ok] - def edit_inline_message_live_location(inline_message_id:, reply_markup:, location: nil, heading:, - proximity_alert_radius:) + def edit_inline_message_live_location(inline_message_id:, reply_markup:, location:, heading:, proximity_alert_radius:) broadcast('@type' => 'editInlineMessageLiveLocation', 'inline_message_id' => inline_message_id, 'reply_markup' => reply_markup, @@ -1118,7 +1228,7 @@ def edit_inline_message_live_location(inline_message_id:, reply_markup:, locatio # sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New content of the message. # Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, # {TD::Types::InputMessageContent::Photo} or inputMessageVideo. @@ -1133,7 +1243,7 @@ def edit_inline_message_media(inline_message_id:, reply_markup:, input_message_c # Edits the reply markup of an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @return [TD::Types::Ok] def edit_inline_message_reply_markup(inline_message_id:, reply_markup:) broadcast('@type' => 'editInlineMessageReplyMarkup', @@ -1144,9 +1254,9 @@ def edit_inline_message_reply_markup(inline_message_id:, reply_markup:) # Edits the text of an inline text or game message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @param input_message_content [TD::Types::InputMessageContent] New text content of the message. - # Should be of type inputMessageText. + # Must be of type inputMessageText. # @return [TD::Types::Ok] def edit_inline_message_text(inline_message_id:, reply_markup:, input_message_content:) broadcast('@type' => 'editInlineMessageText', @@ -1160,9 +1270,9 @@ def edit_inline_message_text(inline_message_id:, reply_markup:, input_message_co # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max") - # characters. + # characters; pass null to remove caption. # @return [TD::Types::Message] def edit_message_caption(chat_id:, message_id:, reply_markup:, caption:) broadcast('@type' => 'editMessageCaption', @@ -1178,15 +1288,15 @@ def edit_message_caption(chat_id:, message_id:, reply_markup:, caption:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. - # @param location [TD::Types::Location, nil] New location content of the message; may be null. - # Pass null to stop sharing the live location. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. + # @param location [TD::Types::Location] New location content of the message; pass null to stop sharing the live + # location. # @param heading [Integer] The new direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @param proximity_alert_radius [Integer] The new maximum distance for proximity alerts, in meters (0-100000). # Pass 0 if the notification is disabled. # @return [TD::Types::Message] - def edit_message_live_location(chat_id:, message_id:, reply_markup:, location: nil, heading:, proximity_alert_radius:) + def edit_message_live_location(chat_id:, message_id:, reply_markup:, location:, heading:, proximity_alert_radius:) broadcast('@type' => 'editMessageLiveLocation', 'chat_id' => chat_id, 'message_id' => message_id, @@ -1196,15 +1306,17 @@ def edit_message_live_location(chat_id:, message_id:, reply_markup:, location: n 'proximity_alert_radius' => proximity_alert_radius) end - # Edits the content of a message with an animation, an audio, a document, a photo or a video. - # The media in the message can't be replaced if the message was set to self-destruct. - # Media can't be replaced by self-destructing media. - # Media in an album can be edited only to contain a photo or a video. + # Edits the content of a message with an animation, an audio, a document, a photo or a video, including message + # caption. + # If only the caption needs to be edited, use editMessageCaption instead. + # The media can't be edited if the message was set to self-destruct or to a self-destructing media. + # The type of message content in an album can't be changed with exception of replacing a photo with a video or vice + # versa. # Returns the edited message after the edit is completed on the server side. # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New content of the message. # Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, # {TD::Types::InputMessageContent::Photo} or inputMessageVideo. @@ -1222,7 +1334,7 @@ def edit_message_media(chat_id:, message_id:, reply_markup:, input_message_conte # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @return [TD::Types::Message] def edit_message_reply_markup(chat_id:, message_id:, reply_markup:) broadcast('@type' => 'editMessageReplyMarkup', @@ -1236,8 +1348,8 @@ def edit_message_reply_markup(chat_id:, message_id:, reply_markup:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param scheduling_state [TD::Types::MessageSchedulingState] The new message scheduling state. - # Pass null to send the message immediately. + # @param scheduling_state [TD::Types::MessageSchedulingState] The new message scheduling state; pass null to send the + # message immediately. # @return [TD::Types::Ok] def edit_message_scheduling_state(chat_id:, message_id:, scheduling_state:) broadcast('@type' => 'editMessageSchedulingState', @@ -1251,9 +1363,9 @@ def edit_message_scheduling_state(chat_id:, message_id:, scheduling_state:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New text content of the message. - # Should be of type inputMessageText. + # Must be of type inputMessageText. # @return [TD::Types::Message] def edit_message_text(chat_id:, message_id:, reply_markup:, input_message_content:) broadcast('@type' => 'editMessageText', @@ -1269,7 +1381,7 @@ def edit_message_text(chat_id:, message_id:, reply_markup:, input_message_conten # @param proxy_id [Integer] Proxy identifier. # @param server [TD::Types::String] Proxy server IP address. # @param port [Integer] Proxy server port. - # @param enable [Boolean] True, if the proxy should be enabled. + # @param enable [Boolean] True, if the proxy needs to be enabled. # @param type [TD::Types::ProxyType] Proxy type. # @return [TD::Types::Proxy] def edit_proxy(proxy_id:, server:, port:, enable:, type:) @@ -1302,10 +1414,20 @@ def end_group_call_recording(group_call_id:) 'group_call_id' => group_call_id) end + # Ends screen sharing in a joined group call. + # + # @param group_call_id [Integer] Group call identifier. + # @return [TD::Types::Ok] + def end_group_call_screen_sharing(group_call_id:) + broadcast('@type' => 'endGroupCallScreenSharing', + 'group_call_id' => group_call_id) + end + # Finishes the file generation. # # @param generation_id [Integer] The identifier of the generation process. - # @param error [TD::Types::Error] If set, means that file generation has failed and should be terminated. + # @param error [TD::Types::Error] If passed, the file generation has failed and must be terminated; pass null if the + # file generation succeeded. # @return [TD::Types::Ok] def finish_file_generation(generation_id:, error:) broadcast('@type' => 'finishFileGeneration', @@ -1322,21 +1444,24 @@ def finish_file_generation(generation_id:, error:) # @param message_ids [Array] Identifiers of the messages to forward. # Message identifiers must be in a strictly increasing order. # At most 100 messages can be forwarded simultaneously. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages. - # @param send_copy [Boolean] True, if content of the messages needs to be copied without links to the original - # messages. - # Always true if the messages are forwarded to a secret chat. - # @param remove_caption [Boolean] True, if media caption of message copies needs to be removed. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages; pass null to use default + # options. + # @param send_copy [Boolean] If true, content of the messages will be copied without reference to the original + # sender. + # Always true if the messages are forwarded to a secret chat or are local. + # @param remove_caption [Boolean] If true, media caption of message copies will be removed. # Ignored if send_copy is false. + # @param only_preview [Boolean] If true, messages will not be forwarded and instead fake messages will be returned. # @return [TD::Types::Messages] - def forward_messages(chat_id:, from_chat_id:, message_ids:, options:, send_copy:, remove_caption:) + def forward_messages(chat_id:, from_chat_id:, message_ids:, options:, send_copy:, remove_caption:, only_preview:) broadcast('@type' => 'forwardMessages', 'chat_id' => chat_id, 'from_chat_id' => from_chat_id, 'message_ids' => message_ids, 'options' => options, 'send_copy' => send_copy, - 'remove_caption' => remove_caption) + 'remove_caption' => remove_caption, + 'only_preview' => only_preview) end # Returns the period of inactivity after which the account of the current user will automatically be deleted. @@ -1346,7 +1471,7 @@ def get_account_ttl broadcast('@type' => 'getAccountTtl') end - # Returns all active live locations that should be updated by the application. + # Returns all active live locations that need to be updated by the application. # The list is persistent across application restarts only if the message database is used. # # @return [TD::Types::Messages] @@ -1370,6 +1495,16 @@ def get_all_passport_elements(password:) 'password' => password) end + # Returns an animated emoji corresponding to a given emoji. + # Returns a 404 error if the emoji has no animated emoji. + # + # @param emoji [TD::Types::String] The emoji. + # @return [TD::Types::AnimatedEmoji] + def get_animated_emoji(emoji:) + broadcast('@type' => 'getAnimatedEmoji', + 'emoji' => emoji) + end + # Returns application config, provided by the server. # Can be called before authorization. # @@ -1378,11 +1513,19 @@ def get_application_config broadcast('@type' => 'getApplicationConfig') end + # Returns the link for downloading official Telegram application to be used when the current user invites friends to + # Telegram. + # + # @return [TD::Types::HttpUrl] + def get_application_download_link + broadcast('@type' => 'getApplicationDownloadLink') + end + # Returns a list of archived sticker sets. # # @param is_masks [Boolean] Pass true to return mask stickers sets; pass false to return ordinary sticker sets. # @param offset_sticker_set_id [Integer] Identifier of the sticker set from which to return the result. - # @param limit [Integer] The maximum number of sticker sets to return. + # @param limit [Integer] The maximum number of sticker sets to return; up to 100. # @return [TD::Types::StickerSets] def get_archived_sticker_sets(is_masks:, offset_sticker_set_id:, limit:) broadcast('@type' => 'getArchivedStickerSets', @@ -1533,8 +1676,8 @@ def get_chat_administrators(chat_id:) # @param from_event_id [Integer] Identifier of an event from which to return results. # Use 0 to get results from the latest events. # @param limit [Integer] The maximum number of events to return; up to 100. - # @param filters [TD::Types::ChatEventLogFilters] The types of events to return. - # By default, all types will be returned. + # @param filters [TD::Types::ChatEventLogFilters] The types of events to return; pass null to get chat events of all + # types. # @param user_ids [Array] User identifiers by which to filter events. # By default, events relating to all users will be returned. # @return [TD::Types::ChatEvents] @@ -1569,7 +1712,7 @@ def get_chat_filter_default_icon_name(filter:) # Returns messages in a chat. # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # This is an offline request if only_local is true. # # @param chat_id [Integer] Chat identifier. @@ -1580,8 +1723,8 @@ def get_chat_filter_default_icon_name(filter:) # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than or equal to -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # @param only_local [Boolean] If true, returns only messages that are available locally without sending network # requests. # @return [TD::Types::Messages] @@ -1623,9 +1766,9 @@ def get_chat_invite_link_counts(chat_id:) # # @param chat_id [Integer] Chat identifier. # @param invite_link [TD::Types::String] Invite link for which to return chat members. - # @param offset_member [TD::Types::ChatInviteLinkMember] A chat member from which to return next chat members; use + # @param offset_member [TD::Types::ChatInviteLinkMember] A chat member from which to return next chat members; pass # null to get results from the beginning. - # @param limit [Integer] The maximum number of chat members to return. + # @param limit [Integer] The maximum number of chat members to return; up to 100. # @return [TD::Types::ChatInviteLinkMembers] def get_chat_invite_link_members(chat_id:, invite_link:, offset_member:, limit:) broadcast('@type' => 'getChatInviteLinkMembers', @@ -1647,7 +1790,7 @@ def get_chat_invite_link_members(chat_id:, invite_link:, offset_member:, limit:) # get results from the beginning. # @param offset_invite_link [TD::Types::String] Invite link starting after which to return invite links; use empty # string to get results from the beginning. - # @param limit [Integer] The maximum number of invite links to return. + # @param limit [Integer] The maximum number of invite links to return; up to 100. # @return [TD::Types::ChatInviteLinks] def get_chat_invite_links(chat_id:, creator_user_id:, is_revoked:, offset_date:, offset_invite_link:, limit:) broadcast('@type' => 'getChatInviteLinks', @@ -1659,6 +1802,28 @@ def get_chat_invite_links(chat_id:, creator_user_id:, is_revoked:, offset_date:, 'limit' => limit) end + # Returns pending join requests in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param invite_link [TD::Types::String] Invite link for which to return join requests. + # If empty, all join requests will be returned. + # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for + # other links. + # @param query [TD::Types::String] A query to search for in the first names, last names and usernames of the users to + # return. + # @param offset_request [TD::Types::ChatJoinRequest] A chat join request from which to return next requests; pass + # null to get results from the beginning. + # @param limit [Integer] The maximum number of chat join requests to return. + # @return [TD::Types::ChatJoinRequests] + def get_chat_join_requests(chat_id:, invite_link:, query:, offset_request:, limit:) + broadcast('@type' => 'getChatJoinRequests', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'query' => query, + 'offset_request' => offset_request, + 'limit' => limit) + end + # Returns chat lists to which the chat can be added. # This is an offline request. # @@ -1691,6 +1856,26 @@ def get_chat_message_by_date(chat_id:, date:) 'date' => date) end + # Returns information about the next messages of the specified type in the chat splitted by days. + # Returns the results in reverse chronological order. + # Can return partial result for the last returned day. + # Behavior of this method depends on the value of the option "utc_time_offset". + # + # @param chat_id [Integer] Identifier of the chat in which to return information about messages. + # @param filter [TD::Types::SearchMessagesFilter] Filter for message content. + # Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, + # {TD::Types::SearchMessagesFilter::Mention} and {TD::Types::SearchMessagesFilter::UnreadMention} are unsupported in this + # function. + # @param from_message_id [Integer] The message identifier from which to return information about messages; use 0 to + # get results from the last message. + # @return [TD::Types::MessageCalendar] + def get_chat_message_calendar(chat_id:, filter:, from_message_id:) + broadcast('@type' => 'getChatMessageCalendar', + 'chat_id' => chat_id, + 'filter' => filter, + 'from_message_id' => from_message_id) + end + # Returns approximate number of messages of the specified type in the chat. # # @param chat_id [Integer] Identifier of the chat in which to count messages. @@ -1708,8 +1893,8 @@ def get_chat_message_count(chat_id:, filter:, return_local:) # Returns list of chats with non-default notification settings. # - # @param scope [TD::Types::NotificationSettingsScope] If specified, only chats from the specified scope will be - # returned. + # @param scope [TD::Types::NotificationSettingsScope] If specified, only chats from the scope will be returned; pass + # null to return chats from all scopes. # @param compare_sound [Boolean] If true, also chats with non-default sound will be returned. # @return [TD::Types::Chats] def get_chat_notification_settings_exceptions(scope:, compare_sound:) @@ -1737,9 +1922,40 @@ def get_chat_scheduled_messages(chat_id:) 'chat_id' => chat_id) end + # Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll + # implementation. + # Returns the results in reverse chronological order (i.e., in order of decreasing message_id). + # Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database. + # + # @param chat_id [Integer] Identifier of the chat in which to return information about message positions. + # @param filter [TD::Types::SearchMessagesFilter] Filter for message content. + # Filters searchMessagesFilterEmpty, searchMessagesFilterCall, searchMessagesFilterMissedCall, + # {TD::Types::SearchMessagesFilter::Mention} and {TD::Types::SearchMessagesFilter::UnreadMention} are unsupported in this + # function. + # @param from_message_id [Integer] The message identifier from which to return information about message positions. + # @param limit [Integer] The expected number of message positions to be returned; 50-2000. + # A smaller number of positions can be returned, if there are not enough appropriate messages. + # @return [TD::Types::MessagePositions] + def get_chat_sparse_message_positions(chat_id:, filter:, from_message_id:, limit:) + broadcast('@type' => 'getChatSparseMessagePositions', + 'chat_id' => chat_id, + 'filter' => filter, + 'from_message_id' => from_message_id, + 'limit' => limit) + end + + # Returns sponsored messages to be shown in a chat; for channel chats only. + # + # @param chat_id [Integer] Identifier of the chat. + # @return [TD::Types::SponsoredMessages] + def get_chat_sponsored_messages(chat_id:) + broadcast('@type' => 'getChatSponsoredMessages', + 'chat_id' => chat_id) + end + # Returns detailed statistics about a chat. # Currently this method can be used only for supergroups and channels. - # Can be used only if SupergroupFullInfo.can_get_statistics == true. + # Can be used only if supergroupFullInfo.can_get_statistics == true. # # @param chat_id [Integer] Chat identifier. # @param is_dark [Boolean] Pass true if a dark theme is used by the application. @@ -1750,38 +1966,30 @@ def get_chat_statistics(chat_id:, is_dark:) 'is_dark' => is_dark) end - # Returns an HTTP URL with the chat statistics. - # Currently this method of getting the statistics are disabled and can be deleted in the future. + # Returns an ordered list of chats from the beginning of a chat list. + # For informational purposes only. + # Use loadChats and updates processing instead to maintain chat lists in a consistent state. # - # @param chat_id [Integer] Chat identifier. - # @param parameters [TD::Types::String] Parameters from "tg://statsrefresh?params=******" link. - # @param is_dark [Boolean] Pass true if a URL with the dark theme must be returned. - # @return [TD::Types::HttpUrl] - def get_chat_statistics_url(chat_id:, parameters:, is_dark:) - broadcast('@type' => 'getChatStatisticsUrl', - 'chat_id' => chat_id, - 'parameters' => parameters, - 'is_dark' => is_dark) + # @param chat_list [TD::Types::ChatList] The chat list in which to return chats; pass null to get chats from the main + # chat list. + # @param limit [Integer] The maximum number of chats to be returned. + # @return [TD::Types::Chats] + def get_chats(chat_list:, limit:) + broadcast('@type' => 'getChats', + 'chat_list' => chat_list, + 'limit' => limit) end - # Returns an ordered list of chats in a chat list. - # Chats are sorted by the pair (chat.position.order, chat.id) in descending order. - # (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed - # 64-bit number 9223372036854775807 == 2^63 - 1). - # For optimal performance the number of returned chats is chosen by the library. + # Returns the list of commands supported by the bot for the given user scope and language; for bots only. # - # @param chat_list [TD::Types::ChatList] The chat list in which to return chats. - # @param offset_order [Integer] Chat order to return chats from. - # @param offset_chat_id [Integer] Chat identifier to return chats from. - # @param limit [Integer] The maximum number of chats to be returned. - # It is possible that fewer chats than the limit are returned even if the end of the list is not reached. - # @return [TD::Types::Chats] - def get_chats(chat_list:, offset_order:, offset_chat_id:, limit:) - broadcast('@type' => 'getChats', - 'chat_list' => chat_list, - 'offset_order' => offset_order, - 'offset_chat_id' => offset_chat_id, - 'limit' => limit) + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to get commands + # in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 country code or an empty string. + # @return [TD::Types::BotCommands] + def get_commands(scope:, language_code:) + broadcast('@type' => 'getCommands', + 'scope' => scope, + 'language_code' => language_code) end # Returns all website where the current user used Telegram to log in. @@ -1878,11 +2086,10 @@ def get_external_link(link:, allow_write_access:) 'allow_write_access' => allow_write_access) end - # Returns information about an action to be done when the current user clicks an HTTP link. - # This method can be used to automatically authorize the current user on a website. - # Don't use this method for links from secret chats if link preview is disabled in secret chats. + # Returns information about an action to be done when the current user clicks an external link. + # Don't use this method for links from secret chats if web page preview is disabled in secret chats. # - # @param link [TD::Types::String] The HTTP link. + # @param link [TD::Types::String] The link. # @return [TD::Types::LoginUrlInfo] def get_external_link_info(link:) broadcast('@type' => 'getExternalLinkInfo', @@ -1905,10 +2112,10 @@ def get_file(file_id:) 'file_id' => file_id) end - # Returns file downloaded prefix size from a given offset. + # Returns file downloaded prefix size from a given offset, in bytes. # # @param file_id [Integer] Identifier of the file. - # @param offset [Integer] Offset from which downloaded prefix size should be calculated. + # @param offset [Integer] Offset from which downloaded prefix size needs to be calculated. # @return [TD::Types::Count] def get_file_downloaded_prefix_size(file_id:, offset:) broadcast('@type' => 'getFileDownloadedPrefixSize', @@ -1961,11 +2168,11 @@ def get_group_call(group_call_id:) 'group_call_id' => group_call_id) end - # Returns invite link to a voice chat in a public chat. + # Returns invite link to a video chat in a public chat. # # @param group_call_id [Integer] Group call identifier. - # @param can_self_unmute [Boolean] Pass true if the invite_link should contain an invite hash, passing which to - # joinGroupCall would allow the invited user to unmute themself. + # @param can_self_unmute [Boolean] Pass true if the invite link needs to contain an invite hash, passing which to + # joinGroupCall would allow the invited user to unmute themselves. # Requires groupCall.can_be_managed group call flag. # @return [TD::Types::HttpUrl] def get_group_call_invite_link(group_call_id:, can_self_unmute:) @@ -1974,18 +2181,23 @@ def get_group_call_invite_link(group_call_id:, can_self_unmute:) 'can_self_unmute' => can_self_unmute) end - # Returns a file with a segment of a group call stream in a modified OGG format. + # Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video. # # @param group_call_id [Integer] Group call identifier. # @param time_offset [Integer] Point in time when the stream segment begins; Unix timestamp in milliseconds. # @param scale [Integer] Segment duration scale; 0-1. # Segment's duration is 1000/(2**scale) milliseconds. + # @param channel_id [Integer] Identifier of an audio/video channel to get as received from tgcalls. + # @param video_quality [TD::Types::GroupCallVideoQuality] Video quality as received from tgcalls; pass null to get + # the worst available quality. # @return [TD::Types::FilePart] - def get_group_call_stream_segment(group_call_id:, time_offset:, scale:) + def get_group_call_stream_segment(group_call_id:, time_offset:, scale:, channel_id:, video_quality:) broadcast('@type' => 'getGroupCallStreamSegment', 'group_call_id' => group_call_id, 'time_offset' => time_offset, - 'scale' => scale) + 'scale' => scale, + 'channel_id' => channel_id, + 'video_quality' => video_quality) end # Returns a list of common group chats with a given user. @@ -2034,7 +2246,8 @@ def get_inline_game_high_scores(inline_message_id:, user_id:) # # @param bot_user_id [Integer] The identifier of the target bot. # @param chat_id [Integer] Identifier of the chat where the query was sent. - # @param user_location [TD::Types::Location] Location of the user, only if needed. + # @param user_location [TD::Types::Location] Location of the user; pass null if unknown or the bot doesn't need + # user's location. # @param query [TD::Types::String] Text of the query. # @param offset [TD::Types::String] Offset of the first entry to return. # @return [TD::Types::InlineQueryResults] @@ -2056,12 +2269,15 @@ def get_installed_sticker_sets(is_masks:) 'is_masks' => is_masks) end - # Returns the default text for invitation messages to be used as a placeholder when the current user invites friends - # to Telegram. + # Returns information about the type of an internal link. + # Returns a 404 error if the link is not internal. + # Can be called before authorization. # - # @return [TD::Types::Text] - def get_invite_text - broadcast('@type' => 'getInviteText') + # @param link [TD::Types::String] The link. + # @return [TD::Types::InternalLinkType] + def get_internal_link_type(link:) + broadcast('@type' => 'getInternalLinkType', + 'link' => link) end # Converts a JsonValue object to corresponding JSON-serialized string. @@ -2289,27 +2505,32 @@ def get_message_import_confirmation_text(chat_id:) end # Returns an HTTPS link to a message in a chat. - # Available only for already sent messages in supergroups and channels. + # Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links + # and a media timestamp link is generated. # This is an offline request. # # @param chat_id [Integer] Identifier of the chat to which the message belongs. # @param message_id [Integer] Identifier of the message. + # @param media_timestamp [Integer] If not 0, timestamp from which the video/audio/video note/voice note playing must + # start, in seconds. + # The media can be in the message content or in its web page preview. # @param for_album [Boolean] Pass true to create a link for the whole media album. # @param for_comment [Boolean] Pass true to create a link to the message as a channel post comment, or from a message # thread. # @return [TD::Types::MessageLink] - def get_message_link(chat_id:, message_id:, for_album:, for_comment:) - broadcast('@type' => 'getMessageLink', - 'chat_id' => chat_id, - 'message_id' => message_id, - 'for_album' => for_album, - 'for_comment' => for_comment) + def get_message_link(chat_id:, message_id:, media_timestamp:, for_album:, for_comment:) + broadcast('@type' => 'getMessageLink', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'media_timestamp' => media_timestamp, + 'for_album' => for_album, + 'for_comment' => for_comment) end # Returns information about a public or private message link. + # Can be called for any internal link of the type internalLinkTypeMessage. # - # @param url [TD::Types::String] The message link in the format "https://t.me/c/...", or "tg://privatepost?...", or - # "https://t.me/username/...", or "tg://resolve?...". + # @param url [TD::Types::String] The message link. # @return [TD::Types::MessageLinkInfo] def get_message_link_info(url:) broadcast('@type' => 'getMessageLinkInfo', @@ -2329,7 +2550,7 @@ def get_message_locally(chat_id:, message_id:) end # Returns forwarded copies of a channel message to different public channels. - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param chat_id [Integer] Chat identifier of the message. # @param message_id [Integer] Message identifier. @@ -2337,7 +2558,8 @@ def get_message_locally(chat_id:, message_id:) # empty string to get first chunk of results. # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. - # Fewer messages may be returned than specified by the limit, even if the end of the list has not been reached. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # @return [TD::Types::FoundMessages] def get_message_public_forwards(chat_id:, message_id:, offset:, limit:) broadcast('@type' => 'getMessagePublicForwards', @@ -2348,7 +2570,7 @@ def get_message_public_forwards(chat_id:, message_id:, offset:, limit:) end # Returns detailed statistics about a message. - # Can be used only if Message.can_get_statistics == true. + # Can be used only if message.can_get_statistics == true. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] Message identifier. @@ -2377,7 +2599,7 @@ def get_message_thread(chat_id:, message_id:) # Can be used only if message.can_get_message_thread == true. # Message thread of a channel message is in the channel's linked supergroup. # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] Message identifier, which thread history needs to be returned. @@ -2388,8 +2610,8 @@ def get_message_thread(chat_id:, message_id:) # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than or equal to -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message thread history has not - # been reached. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # @return [TD::Types::Messages] def get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, limit:) broadcast('@type' => 'getMessageThreadHistory', @@ -2400,6 +2622,19 @@ def get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, 'limit' => limit) end + # Returns viewers of a recent outgoing message in a basic group or a supergroup chat. + # For video notes and voice notes only users, opened content of the message, are returned. + # The method can be called if message.can_get_viewers == true. + # + # @param chat_id [Integer] Chat identifier. + # @param message_id [Integer] Identifier of the message. + # @return [TD::Types::Users] + def get_message_viewers(chat_id:, message_id:) + broadcast('@type' => 'getMessageViewers', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + # Returns information about messages. # If a message is not found, returns null on the corresponding position of the result. # @@ -2437,8 +2672,8 @@ def get_option(name:) # # @param bot_user_id [Integer] User identifier of the service's bot. # @param scope [TD::Types::String] Telegram Passport element types requested by the service. - # @param public_key [TD::Types::String] Service's public_key. - # @param nonce [TD::Types::String] Authorization form nonce provided by the service. + # @param public_key [TD::Types::String] Service's public key. + # @param nonce [TD::Types::String] Unique request identifier provided by the service. # @return [TD::Types::PassportAuthorizationForm] def get_passport_authorization_form(bot_user_id:, scope:, public_key:, nonce:) broadcast('@type' => 'getPassportAuthorizationForm', @@ -2480,11 +2715,11 @@ def get_password_state end # Returns an invoice payment form. - # This method should be called when the user presses inlineKeyboardButtonBuy. + # This method must be called when the user presses inlineKeyboardButtonBuy. # # @param chat_id [Integer] Chat identifier of the Invoice message. # @param message_id [Integer] Message identifier. - # @param theme [TD::Types::PaymentFormTheme] Preferred payment form theme. + # @param theme [TD::Types::PaymentFormTheme] Preferred payment form theme; pass null to use the default theme. # @return [TD::Types::PaymentForm] def get_payment_form(chat_id:, message_id:, theme:) broadcast('@type' => 'getPaymentForm', @@ -2514,15 +2749,30 @@ def get_phone_number_info(phone_number_prefix:) 'phone_number_prefix' => phone_number_prefix) end + # Returns information about a phone number by its prefix synchronously. + # getCountries must be called at least once after changing localization to the specified language if properly + # localized country information is expected. + # Can be called synchronously. + # + # @param language_code [TD::Types::String] A two-letter ISO 639-1 country code for country information localization. + # @param phone_number_prefix [TD::Types::String] The phone number prefix. + # @return [TD::Types::PhoneNumberInfo] + def get_phone_number_info_sync(language_code:, phone_number_prefix:) + broadcast('@type' => 'getPhoneNumberInfoSync', + 'language_code' => language_code, + 'phone_number_prefix' => phone_number_prefix) + end + # Returns users voted for the specified option in a non-anonymous polls. - # For the optimal performance the number of returned users is chosen by the library. + # For optimal performance, the number of returned users is chosen by TDLib. # # @param chat_id [Integer] Identifier of the chat to which the poll belongs. # @param message_id [Integer] Identifier of the message containing the poll. # @param option_id [Integer] 0-based identifier of the answer option. # @param offset [Integer] Number of users to skip in the result; must be non-negative. # @param limit [Integer] The maximum number of users to be returned; must be positive and can't be greater than 50. - # Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached. + # For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified + # limit, even if the end of the voter list has not been reached. # @return [TD::Types::Users] def get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:) broadcast('@type' => 'getPollVoters', @@ -2533,8 +2783,8 @@ def get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:) 'limit' => limit) end - # Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields - # in Telegram Passport personal details. + # Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in + # Telegram Passport personal details. # Returns a 404 error if unknown. # # @param country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code. @@ -2591,6 +2841,16 @@ def get_recent_stickers(is_attached:) 'is_attached' => is_attached) end + # Returns recently opened chats, this is an offline request. + # Returns chats in the order of last opening. + # + # @param limit [Integer] The maximum number of chats to be returned. + # @return [TD::Types::Chats] + def get_recently_opened_chats(limit:) + broadcast('@type' => 'getRecentlyOpenedChats', + 'limit' => limit) + end + # Returns t.me URLs recently visited by a newly registered user. # # @param referrer [TD::Types::String] Google Play referrer to identify the user. @@ -2624,7 +2884,7 @@ def get_recovery_email_address(password:) # If the file database is disabled, then the corresponding object with the file must be preloaded by the application. # # @param remote_file_id [TD::Types::String] Remote identifier of the file to get. - # @param file_type [TD::Types::FileType] File type, if known. + # @param file_type [TD::Types::FileType] File type; pass null if unknown. # @return [TD::Types::File] def get_remote_file(remote_file_id:, file_type:) broadcast('@type' => 'getRemoteFile', @@ -2713,7 +2973,7 @@ def get_sticker_set(set_id:) end # Returns stickers from the installed sticker sets that correspond to a given emoji. - # If the emoji is not empty, favorite and recently used stickers may also be returned. + # If the emoji is non-empty, favorite and recently used stickers may also be returned. # # @param emoji [TD::Types::String] String representation of emoji. # If empty, returns all known installed stickers. @@ -2729,7 +2989,7 @@ def get_stickers(emoji:, limit:) # Can be called before authorization. # # @param chat_limit [Integer] The maximum number of chats with the largest storage usage for which separate - # statistics should be returned. + # statistics need to be returned. # All other chats will be grouped in entries with chat_id == 0. # If the chat info database is not used, the chat_limit is ignored and is always set to 0. # @return [TD::Types::StorageStatistics] @@ -2746,6 +3006,26 @@ def get_storage_statistics_fast broadcast('@type' => 'getStorageStatisticsFast') end + # Returns suggested name for saving a file in a given directory. + # + # @param file_id [Integer] Identifier of the file. + # @param directory [TD::Types::String] Directory in which the file is supposed to be saved. + # @return [TD::Types::Text] + def get_suggested_file_name(file_id:, directory:) + broadcast('@type' => 'getSuggestedFileName', + 'file_id' => file_id, + 'directory' => directory) + end + + # Returns a suggested name for a new sticker set with a given title. + # + # @param title [TD::Types::String] Sticker set title; 1-64 characters. + # @return [TD::Types::Text] + def get_suggested_sticker_set_name(title:) + broadcast('@type' => 'getSuggestedStickerSetName', + 'title' => title) + end + # Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. # Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. # To set a returned supergroup as a discussion group, access to its old messages must be enabled using @@ -2776,12 +3056,12 @@ def get_supergroup_full_info(supergroup_id:) end # Returns information about members or banned users in a supergroup or channel. - # Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be + # Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be # required for some filters. # # @param supergroup_id [Integer] Identifier of the supergroup or channel. - # @param filter [TD::Types::SupergroupMembersFilter] The type of users to return. - # By default, supergroupMembersFilterRecent. + # @param filter [TD::Types::SupergroupMembersFilter] The type of users to return; pass null to use + # supergroupMembersFilterRecent. # @param offset [Integer] Number of users to skip. # @param limit [Integer] The maximum number of users be returned; up to 200. # @return [TD::Types::ChatMembers] @@ -2831,11 +3111,12 @@ def get_top_chats(category:, limit:) end # Returns a list of trending sticker sets. - # For the optimal performance the number of returned sticker sets is chosen by the library. + # For optimal performance, the number of returned sticker sets is chosen by TDLib. # # @param offset [Integer] The offset from which to return the sticker sets; must be non-negative. - # @param limit [Integer] The maximum number of sticker sets to be returned; must be non-negative. - # Fewer sticker sets may be returned than specified by the limit, even if the end of the list has not been reached. + # @param limit [Integer] The maximum number of sticker sets to be returned; up to 100. + # For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the + # specified limit, even if the end of the list has not been reached. # @return [TD::Types::StickerSets] def get_trending_sticker_sets(offset:, limit:) broadcast('@type' => 'getTrendingStickerSets', @@ -2885,12 +3166,12 @@ def get_user_profile_photos(user_id:, offset:, limit:) 'limit' => limit) end - # Returns list of participant identifiers, which can be used to join voice chats in a chat. + # Returns list of participant identifiers, which can be used to join video chats in a chat. # # @param chat_id [Integer] Chat identifier. # @return [TD::Types::MessageSenders] - def get_voice_chat_available_participants(chat_id:) - broadcast('@type' => 'getVoiceChatAvailableParticipants', + def get_video_chat_available_participants(chat_id:) + broadcast('@type' => 'getVideoChatAvailableParticipants', 'chat_id' => chat_id) end @@ -2956,7 +3237,7 @@ def import_messages(chat_id:, message_file:, attached_files:) end # Invites users to an active group call. - # Sends a service message of type messageInviteToGroupCall for voice chats. + # Sends a service message of type messageInviteToGroupCall for video chats. # # @param group_call_id [Integer] Group call identifier. # @param user_ids [Array] User identifiers. @@ -2980,8 +3261,7 @@ def join_chat(chat_id:) # Uses an invite link to add the current user to the chat if possible. # - # @param invite_link [TD::Types::String] Invite link to import; must have URL "t.me", "telegram.me", or - # "telegram.dog" and query beginning with "/joinchat/" or "/+". + # @param invite_link [TD::Types::String] Invite link to use. # @return [TD::Types::Chat] def join_chat_by_invite_link(invite_link:) broadcast('@type' => 'joinChatByInviteLink', @@ -2989,24 +3269,28 @@ def join_chat_by_invite_link(invite_link:) end # Joins an active group call. + # Returns join response payload for tgcalls. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Identifier of a group call participant, which will be used to join - # the call; voice chats only. - # @param payload [TD::Types::GroupCallPayload] Group join payload; received from tgcalls. - # @param source [Integer] Caller synchronization source identifier; received from tgcalls. + # the call; pass null to join as self; video chats only. + # @param audio_source_id [Integer] Caller audio channel synchronization source identifier; received from tgcalls. + # @param payload [TD::Types::String] Group call join payload; received from tgcalls. # @param is_muted [Boolean] True, if the user's microphone is muted. + # @param is_my_video_enabled [Boolean] True, if the user's video is enabled. # @param invite_hash [TD::Types::String] If non-empty, invite hash to be used to join the group call without being # muted by administrators. - # @return [TD::Types::GroupCallJoinResponse] - def join_group_call(group_call_id:, participant_id:, payload:, source:, is_muted:, invite_hash:) - broadcast('@type' => 'joinGroupCall', - 'group_call_id' => group_call_id, - 'participant_id' => participant_id, - 'payload' => payload, - 'source' => source, - 'is_muted' => is_muted, - 'invite_hash' => invite_hash) + # @return [TD::Types::Text] + def join_group_call(group_call_id:, participant_id:, audio_source_id:, payload:, is_muted:, is_my_video_enabled:, + invite_hash:) + broadcast('@type' => 'joinGroupCall', + 'group_call_id' => group_call_id, + 'participant_id' => participant_id, + 'audio_source_id' => audio_source_id, + 'payload' => payload, + 'is_muted' => is_muted, + 'is_my_video_enabled' => is_my_video_enabled, + 'invite_hash' => invite_hash) end # Removes the current user from chat members. @@ -3028,13 +3312,30 @@ def leave_group_call(group_call_id:) 'group_call_id' => group_call_id) end + # Loads more chats from a chat list. + # The loaded chats and their positions in the chat list will be sent through updates. + # Chats are sorted by the pair (chat.position.order, chat.id) in descending order. + # Returns a 404 error if all chats has been loaded. + # + # @param chat_list [TD::Types::ChatList] The chat list in which to load chats; pass null to load chats from the main + # chat list. + # @param limit [Integer] The maximum number of chats to be loaded. + # For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified + # limit, even if the end of the list is not reached. + # @return [TD::Types::Ok] + def load_chats(chat_list:, limit:) + broadcast('@type' => 'loadChats', + 'chat_list' => chat_list, + 'limit' => limit) + end + # Loads more participants of a group call. # The loaded participants will be received through updates. # Use the field groupCall.loaded_all_participants to check whether all participants has already been loaded. # # @param group_call_id [Integer] Group call identifier. # The group call must be previously received through getGroupCall and must be joined or being joined. - # @param limit [Integer] The maximum number of participants to load. + # @param limit [Integer] The maximum number of participants to load; up to 100. # @return [TD::Types::Ok] def load_group_call_participants(group_call_id:, limit:) broadcast('@type' => 'loadGroupCallParticipants', @@ -3080,7 +3381,7 @@ def open_message_content(chat_id:, message_id:) # deletes some files and returns new storage usage statistics. # Secret thumbnails can't be deleted. # - # @param size [Integer] Limit on the total size of files after deletion. + # @param size [Integer] Limit on the total size of files after deletion, in bytes. # Pass -1 to use the default limit. # @param ttl [Integer] Limit on the time that has passed since the last time a file was accessed (or creation time # for some filesystems). @@ -3090,11 +3391,11 @@ def open_message_content(chat_id:, message_id:) # @param immunity_delay [Integer] The amount of time after the creation of a file during which it can't be deleted, # in seconds. # Pass -1 to use the default value. - # @param file_types [Array] If not empty, only files with the given type(s) are considered. + # @param file_types [Array] If non-empty, only files with the given types are considered. # By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted. - # @param chat_ids [Array] If not empty, only files from the given chats are considered. + # @param chat_ids [Array] If non-empty, only files from the given chats are considered. # Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos). - # @param exclude_chat_ids [Array] If not empty, files from the given chats are excluded. + # @param exclude_chat_ids [Array] If non-empty, files from the given chats are excluded. # Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos). # @param return_deleted_file_statistics [Boolean] Pass true if statistics about the files that were deleted must be # returned instead of the whole storage usage statistics. @@ -3145,7 +3446,7 @@ def parse_text_entities(text:, parse_mode:) # # @param chat_id [Integer] Identifier of the chat. # @param message_id [Integer] Identifier of the new pinned message. - # @param disable_notification [Boolean] True, if there should be no notification about the pinned message. + # @param disable_notification [Boolean] True, if there must be no notification about the pinned message. # Notifications are always disabled in channels and private chats. # @param only_for_self [Boolean] True, if the message needs to be pinned for one side only; private chats only. # @return [TD::Types::Ok] @@ -3212,19 +3513,28 @@ def read_file_part(file_id:, offset:, count:) # Works only when the current authorization state is authorizationStateWaitPassword. # # @param recovery_code [TD::Types::String] Recovery code to check. + # @param new_password [TD::Types::String, nil] New password of the user; may be empty to remove the password. + # @param new_hint [TD::Types::String, nil] New password hint; may be empty. # @return [TD::Types::Ok] - def recover_authentication_password(recovery_code:) + def recover_authentication_password(recovery_code:, new_password: nil, new_hint: nil) broadcast('@type' => 'recoverAuthenticationPassword', - 'recovery_code' => recovery_code) + 'recovery_code' => recovery_code, + 'new_password' => new_password, + 'new_hint' => new_hint) end - # Recovers the password using a recovery code sent to an email address that was previously set up. + # Recovers the 2-step verification password using a recovery code sent to an email address that was previously set + # up. # # @param recovery_code [TD::Types::String] Recovery code to check. + # @param new_password [TD::Types::String, nil] New password of the user; may be empty to remove the password. + # @param new_hint [TD::Types::String, nil] New password hint; may be empty. # @return [TD::Types::PasswordState] - def recover_password(recovery_code:) + def recover_password(recovery_code:, new_password: nil, new_hint: nil) broadcast('@type' => 'recoverPassword', - 'recovery_code' => recovery_code) + 'recovery_code' => recovery_code, + 'new_password' => new_password, + 'new_hint' => new_hint) end # Registers the currently used device for receiving push notifications. @@ -3471,7 +3781,7 @@ def request_authentication_password_recovery broadcast('@type' => 'requestAuthenticationPasswordRecovery') end - # Requests to send a password recovery code to an email address that was previously set up. + # Requests to send a 2-step verification password recovery code to an email address that was previously set up. # # @return [TD::Types::EmailAddressAuthenticationCodeInfo] def request_password_recovery @@ -3491,16 +3801,17 @@ def request_qr_code_authentication(other_user_ids:) end # Re-sends an authentication code to the user. - # Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result - # is not null. + # Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is + # not null and the server-specified timeout has passed. # # @return [TD::Types::Ok] def resend_authentication_code broadcast('@type' => 'resendAuthenticationCode') end - # Re-sends the authentication code sent to confirm a new phone number for the user. - # Works only if the previously received authenticationCodeInfo next_code_type was not null. + # Re-sends the authentication code sent to confirm a new phone number for the current user. + # Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified + # timeout has passed. # # @return [TD::Types::AuthenticationCodeInfo] def resend_change_phone_number_code @@ -3575,6 +3886,14 @@ def reset_network_statistics broadcast('@type' => 'resetNetworkStatistics') end + # Removes 2-step verification password without previous password and access to recovery email address. + # The password can't be reset immediately and the request needs to be repeated after the specified time. + # + # @return [TD::Types::ResetPasswordResult] + def reset_password + broadcast('@type' => 'resetPassword') + end + # Revokes invite link for a chat. # Available for basic groups, supergroups, and channels. # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for @@ -3626,13 +3945,13 @@ def search_background(name:) # Searches for call messages. # Returns the results in reverse chronological order (i. # e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param from_message_id [Integer] Identifier of the message from which to search; use 0 to get results from the last # message. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # @param only_missed [Boolean] If true, returns only messages with missed calls. # @return [TD::Types::Messages] def search_call_messages(from_message_id:, limit:, only_missed:) @@ -3647,9 +3966,9 @@ def search_call_messages(from_message_id:, limit:, only_missed:) # # @param chat_id [Integer] Chat identifier. # @param query [TD::Types::String] Query to search for. - # @param limit [Integer] The maximum number of users to be returned. - # @param filter [TD::Types::ChatMembersFilter] The type of users to return. - # By default, chatMembersFilterMembers. + # @param limit [Integer] The maximum number of users to be returned; up to 200. + # @param filter [TD::Types::ChatMembersFilter] The type of users to search for; pass null to search among all chat + # members. # @return [TD::Types::ChatMembers] def search_chat_members(chat_id:, query:, limit:, filter:) broadcast('@type' => 'searchChatMembers', @@ -3662,13 +3981,15 @@ def search_chat_members(chat_id:, query:, limit:, filter:) # Searches for messages with given words in the chat. # Returns the results in reverse chronological order, i.e. # in order of decreasing message_id. - # Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an + # Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an # enabled message database. - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # # @param chat_id [Integer] Identifier of the chat in which to search messages. # @param query [TD::Types::String] Query to search for. - # @param sender [TD::Types::MessageSender] If not null, only messages sent by the specified sender will be returned. + # @param sender [TD::Types::MessageSender] Sender of messages to search for; pass null to search for messages from + # any sender. # Not supported in secret chats. # @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to # get results from the last message. @@ -3677,9 +3998,10 @@ def search_chat_members(chat_id:, query:, limit:, filter:) # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] Filter for message content in the search results. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. # @param message_thread_id [Integer] If not 0, only messages in the specified thread will be returned; supergroups # only. # @return [TD::Types::Messages] @@ -3711,7 +4033,7 @@ def search_chat_recent_location_messages(chat_id:, limit:) # Returns chats in the order seen in the main chat list. # # @param query [TD::Types::String] Query to search for. - # If the query is empty, returns up to 20 recently found chats. + # If the query is empty, returns up to 50 recently found chats. # @param limit [Integer] The maximum number of chats to be returned. # @return [TD::Types::Chats] def search_chats(query:, limit:) @@ -3722,7 +4044,7 @@ def search_chats(query:, limit:) # Returns a list of users and location-based supergroups nearby. # The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby. - # The request should be sent again every 25 seconds with adjusted location to not miss new chats. + # The request must be sent again every 25 seconds with adjusted location to not miss new chats. # # @param location [TD::Types::Location] Current user location. # @return [TD::Types::ChatsNearby] @@ -3795,21 +4117,23 @@ def search_installed_sticker_sets(is_masks:, query:, limit:) # Searches for messages in all chats except secret chats. # Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # # @param chat_list [TD::Types::ChatList] Chat list in which to search messages; pass null to search in all chats # regardless of their chat list. # Only Main and Archive chat lists are supported. # @param query [TD::Types::String] Query to search for. - # @param offset_date [Integer] The date of the message starting from which the results should be fetched. + # @param offset_date [Integer] The date of the message starting from which the results need to be fetched. # Use 0 or any date in the future to get results from the last message. # @param offset_chat_id [Integer] The chat identifier of the last found message, or 0 for the first request. # @param offset_message_id [Integer] The message identifier of the last found message, or 0 for the first request. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] Filter for message content in the search results; - # searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. + # Filters searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, # searchMessagesFilterUnreadMention, {TD::Types::SearchMessagesFilter::FailedToSend} and # {TD::Types::SearchMessagesFilter::Pinned} are unsupported in this function. # @param min_date [Integer] If not 0, the minimum date of the messages to return. @@ -3843,7 +4167,6 @@ def search_public_chat(username:) # Searches public chats by looking for specified query in their username and title. # Currently only private chats, supergroups and channels can be public. # Returns a meaningful number of results. - # Returns nothing if the length of the searched username prefix is less than 5. # Excludes private chats with contacts and chats from the chat list from the results. # # @param query [TD::Types::String] Query to search for. @@ -3855,18 +4178,19 @@ def search_public_chats(query:) # Searches for messages in secret chats. # Returns the results in reverse chronological order. - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param chat_id [Integer] Identifier of the chat in which to search. # Specify 0 to search in all secret chats. # @param query [TD::Types::String] Query to search for. - # If empty, searchChatMessages should be used instead. + # If empty, searchChatMessages must be used instead. # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use # empty string to get first chunk of results. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] A filter for message content in the search results. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. # @return [TD::Types::FoundMessages] def search_secret_messages(chat_id:, query:, offset:, limit:, filter:) broadcast('@type' => 'searchSecretMessages', @@ -3966,7 +4290,7 @@ def send_call_signaling_data(call_id:, data:) # # @param chat_id [Integer] Chat identifier. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the action was performed. - # @param action [TD::Types::ChatAction] The action description. + # @param action [TD::Types::ChatAction] The action description; pass null to cancel the currently active action. # @return [TD::Types::Ok] def send_chat_action(chat_id:, message_thread_id:, action:) broadcast('@type' => 'sendChatAction', @@ -4012,7 +4336,8 @@ def send_email_address_verification_code(email_address:) # @param chat_id [Integer] Target chat. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the message will be sent. # @param reply_to_message_id [Integer] Identifier of a message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the message. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the message; pass null to use default + # options. # @param query_id [Integer] Identifier of the inline query. # @param result_id [TD::Types::String] Identifier of the inline result. # @param hide_via_bot [Boolean] If true, there will be no mention of a bot, via which the message is sent. @@ -4037,8 +4362,9 @@ def send_inline_query_result_message(chat_id:, message_thread_id:, reply_to_mess # @param chat_id [Integer] Target chat. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the message will be sent. # @param reply_to_message_id [Integer] Identifier of the message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the message. - # @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; for bots only. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the message; pass null to use default + # options. + # @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # @return [TD::Types::Message] def send_message(chat_id:, message_thread_id:, reply_to_message_id:, options:, reply_markup:, input_message_content:) @@ -4059,7 +4385,8 @@ def send_message(chat_id:, message_thread_id:, reply_to_message_id:, options:, r # @param chat_id [Integer] Target chat. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the messages will be sent. # @param reply_to_message_id [Integer] Identifier of a message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages; pass null to use default + # options. # @param input_message_contents [Array] Contents of messages to be sent. # At most 10 messages can be added to an album. # @return [TD::Types::Messages] @@ -4108,14 +4435,12 @@ def send_payment_form(chat_id:, message_id:, payment_form_id:, order_info_id:, s 'tip_amount' => tip_amount) end - # Sends phone number confirmation code. - # Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or - # "tg://confirmphone?phone=*******&hash=**********" link. + # Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation. # - # @param hash [TD::Types::String] Value of the "hash" parameter from the link. - # @param phone_number [TD::Types::String] Value of the "phone" parameter from the link. + # @param hash [TD::Types::String] Hash value from the link. + # @param phone_number [TD::Types::String] Phone number value from the link. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. # @return [TD::Types::AuthenticationCodeInfo] def send_phone_number_confirmation_code(hash:, phone_number:, settings:) broadcast('@type' => 'sendPhoneNumberConfirmationCode', @@ -4128,7 +4453,7 @@ def send_phone_number_confirmation_code(hash:, phone_number:, settings:) # # @param phone_number [TD::Types::String] The phone number of the user, in international format. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. # @return [TD::Types::AuthenticationCodeInfo] def send_phone_number_verification_code(phone_number:, settings:) broadcast('@type' => 'sendPhoneNumberVerificationCode', @@ -4162,7 +4487,7 @@ def set_alarm(seconds:) # # @param phone_number [TD::Types::String] The phone number of the user, in international format. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. # @return [TD::Types::Ok] def set_authentication_phone_number(phone_number:, settings:) broadcast('@type' => 'setAuthenticationPhoneNumber', @@ -4173,7 +4498,7 @@ def set_authentication_phone_number(phone_number:, settings:) # Sets auto-download settings. # # @param settings [TD::Types::AutoDownloadSettings] New user auto-download settings. - # @param type [TD::Types::NetworkType] Type of the network for which the new settings are applied. + # @param type [TD::Types::NetworkType] Type of the network for which the new settings are relevant. # @return [TD::Types::Ok] def set_auto_download_settings(settings:, type:) broadcast('@type' => 'setAutoDownloadSettings', @@ -4183,9 +4508,10 @@ def set_auto_download_settings(settings:, type:) # Changes the background selected by the user; adds background to the list of installed backgrounds. # - # @param background [TD::Types::InputBackground] The input background to use, null for filled backgrounds. - # @param type [TD::Types::BackgroundType] Background type; null for default background. - # The method will return error 404 if type is null. + # @param background [TD::Types::InputBackground] The input background to use; pass null to create a new filled + # backgrounds or to remove the current background. + # @param type [TD::Types::BackgroundType] Background type; pass null to use the default type of the remote background + # or to remove the current background. # @param for_dark_theme [Boolean] True, if the background is chosen for dark theme. # @return [TD::Types::Background] def set_background(background:, type:, for_dark_theme:) @@ -4263,9 +4589,9 @@ def set_chat_discussion_group(chat_id:, discussion_chat_id:) # # @param chat_id [Integer] Chat identifier. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the draft was changed. - # @param draft_message [TD::Types::DraftMessage, nil] New draft message; may be null. + # @param draft_message [TD::Types::DraftMessage] New draft message; pass null to remove the draft. # @return [TD::Types::Ok] - def set_chat_draft_message(chat_id:, message_thread_id:, draft_message: nil) + def set_chat_draft_message(chat_id:, message_thread_id:, draft_message:) broadcast('@type' => 'setChatDraftMessage', 'chat_id' => chat_id, 'message_thread_id' => message_thread_id, @@ -4286,8 +4612,8 @@ def set_chat_location(chat_id:, location:) end # Changes the status of a chat member, needs appropriate privileges. - # This function is currently not suitable for adding new members to the chat and transferring chat ownership; - # instead, use addChatMember or transferChatOwnership. + # This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. + # Use addChatMember or banChatMember if some additional parameters needs to be passed. # # @param chat_id [Integer] Chat identifier. # @param member_id [TD::Types::MessageSender] Member identifier. @@ -4306,7 +4632,8 @@ def set_chat_member_status(chat_id:, member_id:, status:) # chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed. # # @param chat_id [Integer] Chat identifier. - # @param ttl [Integer] New TTL value, in seconds; must be one of 0, 86400, 604800 unless chat is secret. + # @param ttl [Integer] New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat + # is secret. # @return [TD::Types::Ok] def set_chat_message_ttl_setting(chat_id:, ttl:) broadcast('@type' => 'setChatMessageTtlSetting', @@ -4345,8 +4672,7 @@ def set_chat_permissions(chat_id:, permissions:) # Requires can_change_info administrator right. # # @param chat_id [Integer] Chat identifier. - # @param photo [TD::Types::InputChatPhoto] New chat photo. - # Pass null to delete the chat photo. + # @param photo [TD::Types::InputChatPhoto] New chat photo; pass null to delete the chat photo. # @return [TD::Types::Ok] def set_chat_photo(chat_id:, photo:) broadcast('@type' => 'setChatPhoto', @@ -4358,7 +4684,8 @@ def set_chat_photo(chat_id:, photo:) # Available only for supergroups; requires can_restrict_members rights. # # @param chat_id [Integer] Chat identifier. - # @param slow_mode_delay [Integer] New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600. + # @param slow_mode_delay [Integer] New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, + # 900, 3600. # @return [TD::Types::Ok] def set_chat_slow_mode_delay(chat_id:, slow_mode_delay:) broadcast('@type' => 'setChatSlowModeDelay', @@ -4366,6 +4693,18 @@ def set_chat_slow_mode_delay(chat_id:, slow_mode_delay:) 'slow_mode_delay' => slow_mode_delay) end + # Changes the chat theme. + # Supported only in private and secret chats. + # + # @param chat_id [Integer] Chat identifier. + # @param theme_name [TD::Types::String] Name of the new chat theme; pass an empty string to return the default theme. + # @return [TD::Types::Ok] + def set_chat_theme(chat_id:, theme_name:) + broadcast('@type' => 'setChatTheme', + 'chat_id' => chat_id, + 'theme_name' => theme_name) + end + # Changes the chat title. # Supported only for basic groups, supergroups and channels. # Requires can_change_info administrator right. @@ -4379,13 +4718,20 @@ def set_chat_title(chat_id:, title:) 'title' => title) end - # Sets the list of commands supported by the bot; for bots only. + # Sets the list of commands supported by the bot for the given user scope and language; for bots only. # + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to change + # commands in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 country code. + # If empty, the commands will be applied to all users from the given scope, for which language there are no + # dedicated commands. # @param commands [Array] List of the bot's commands. # @return [TD::Types::Ok] - def set_commands(commands:) - broadcast('@type' => 'setCommands', - 'commands' => commands) + def set_commands(scope:, language_code:, commands:) + broadcast('@type' => 'setCommands', + 'scope' => scope, + 'language_code' => language_code, + 'commands' => commands) end # Adds or changes a custom local language pack to the current localization target. @@ -4442,7 +4788,7 @@ def set_file_generation_progress(generation_id:, expected_size:, local_prefix_si # # @param chat_id [Integer] The chat to which the message with the game belongs. # @param message_id [Integer] Identifier of the message. - # @param edit_message [Boolean] True, if the message should be edited. + # @param edit_message [Boolean] True, if the message needs to be edited. # @param user_id [Integer] User identifier. # @param score [Integer] The new score. # @param force [Boolean] Pass true to update the score even if it decreases. @@ -4458,22 +4804,23 @@ def set_game_score(chat_id:, message_id:, edit_message:, user_id:, score:, force 'force' => force) end - # Informs TDLib that a participant of an active group call speaking state has changed. + # Informs TDLib that speaking state of a participant of an active group has changed. # # @param group_call_id [Integer] Group call identifier. - # @param source [Integer] Group call participant's synchronization source identifier, or 0 for the current user. + # @param audio_source [Integer] Group call participant's synchronization audio source identifier, or 0 for the + # current user. # @param is_speaking [Boolean] True, if the user is speaking. # @return [TD::Types::Ok] - def set_group_call_participant_is_speaking(group_call_id:, source:, is_speaking:) + def set_group_call_participant_is_speaking(group_call_id:, audio_source:, is_speaking:) broadcast('@type' => 'setGroupCallParticipantIsSpeaking', 'group_call_id' => group_call_id, - 'source' => source, + 'audio_source' => audio_source, 'is_speaking' => is_speaking) end # Changes volume level of a participant of an active group call. # If the current user can manage the group call, then the participant's volume level will be changed for all users - # with default volume level. + # with the default volume level. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. @@ -4501,7 +4848,7 @@ def set_group_call_title(group_call_id:, title:) # Updates the game score of the specified user in a game; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param edit_message [Boolean] True, if the message should be edited. + # @param edit_message [Boolean] True, if the message needs to be edited. # @param user_id [Integer] User identifier. # @param score [Integer] The new score. # @param force [Boolean] Pass true to update the score even if it decreases. @@ -4563,8 +4910,8 @@ def set_log_verbosity_level(new_verbosity_level:) # Changes the first and last name of the current user. # - # @param first_name [TD::Types::String] The new value of the first name for the user; 1-64 characters. - # @param last_name [TD::Types::String] The new value of the optional last name for the user; 0-64 characters. + # @param first_name [TD::Types::String] The new value of the first name for the current user; 1-64 characters. + # @param last_name [TD::Types::String] The new value of the optional last name for the current user; 0-64 characters. # @return [TD::Types::Ok] def set_name(first_name:, last_name:) broadcast('@type' => 'setName', @@ -4575,12 +4922,11 @@ def set_name(first_name:, last_name:) # Sets the current network type. # Can be called before authorization. # Calling this method forces all network connections to reopen, mitigating the delay in switching between different - # networks, so it should be called whenever the network is changed, even if the network type remains the same. + # networks, so it must be called whenever the network is changed, even if the network type remains the same. # Network type is used to check whether the library can use the network at all and also for collecting detailed # network data usage statistics. # - # @param type [TD::Types::NetworkType] The new network type. - # By default, networkTypeOther. + # @param type [TD::Types::NetworkType] The new network type; pass null to set network type to networkTypeOther. # @return [TD::Types::Ok] def set_network_type(type:) broadcast('@type' => 'setNetworkType', @@ -4592,7 +4938,8 @@ def set_network_type(type:) # Can be called before authorization. # # @param name [TD::Types::String] The name of the option. - # @param value [TD::Types::OptionValue] The new value of the option. + # @param value [TD::Types::OptionValue] The new value of the option; pass null to reset option value to a default + # value. # @return [TD::Types::Ok] def set_option(name:, value:) broadcast('@type' => 'setOption', @@ -4625,14 +4972,14 @@ def set_passport_element_errors(user_id:, errors:) 'errors' => errors) end - # Changes the password for the user. + # Changes the password for the current user. # If a new recovery email address is specified, then the change will not be applied until the new recovery email # address is confirmed. # # @param old_password [TD::Types::String] Previous password of the user. # @param new_password [TD::Types::String, nil] New password of the user; may be empty to remove the password. # @param new_hint [TD::Types::String, nil] New password hint; may be empty. - # @param set_recovery_email_address [Boolean] Pass true if the recovery email address should be changed. + # @param set_recovery_email_address [Boolean] Pass true if the recovery email address must be changed. # @param new_recovery_email_address [TD::Types::String, nil] New recovery email address; may be empty. # @return [TD::Types::PasswordState] def set_password(old_password:, new_password: nil, new_hint: nil, set_recovery_email_address: false, @@ -4724,9 +5071,9 @@ def set_sticker_position_in_set(sticker:, position:) # # @param user_id [Integer] Sticker set owner. # @param name [TD::Types::String] Sticker set name. - # @param thumbnail [TD::Types::InputFile] Thumbnail to set in PNG or TGS format. + # @param thumbnail [TD::Types::InputFile] Thumbnail to set in PNG or TGS format; pass null to remove the sticker set + # thumbnail. # Animated thumbnail must be set for animated sticker sets and only for them. - # Pass a zero InputFileId to delete the thumbnail. # @return [TD::Types::StickerSet] def set_sticker_set_thumbnail(user_id:, name:, thumbnail:) broadcast('@type' => 'setStickerSetThumbnail', @@ -4762,7 +5109,7 @@ def set_supergroup_username(supergroup_id:, username:) # Sets the parameters for TDLib initialization. # Works only when the current authorization state is authorizationStateWaitTdlibParameters. # - # @param parameters [TD::Types::TdlibParameters] Parameters. + # @param parameters [TD::Types::TdlibParameters] Parameters for TDLib initialization. # @return [TD::Types::Ok] def set_tdlib_parameters(parameters:) broadcast('@type' => 'setTdlibParameters', @@ -4790,14 +5137,14 @@ def set_username(username:) 'username' => username) end - # Changes default participant identifier, which can be used to join voice chats in a chat. + # Changes default participant identifier, which can be used to join video chats in a chat. # # @param chat_id [Integer] Chat identifier. # @param default_participant_id [TD::Types::MessageSender] Default group call participant identifier to join the - # voice chats. + # video chats. # @return [TD::Types::Ok] - def set_voice_chat_default_participant(chat_id:, default_participant_id:) - broadcast('@type' => 'setVoiceChatDefaultParticipant', + def set_video_chat_default_participant(chat_id:, default_participant_id:) + broadcast('@type' => 'setVideoChatDefaultParticipant', 'chat_id' => chat_id, 'default_participant_id' => default_participant_id) end @@ -4818,11 +5165,30 @@ def share_phone_number(user_id:) # # @param group_call_id [Integer] Group call identifier. # @param title [TD::Types::String] Group call recording title; 0-64 characters. + # @param record_video [Boolean] Pass true to record a video file instead of an audio file. + # @param use_portrait_orientation [Boolean] Pass true to use portrait orientation for video instead of landscape one. # @return [TD::Types::Ok] - def start_group_call_recording(group_call_id:, title:) - broadcast('@type' => 'startGroupCallRecording', - 'group_call_id' => group_call_id, - 'title' => title) + def start_group_call_recording(group_call_id:, title:, record_video:, use_portrait_orientation:) + broadcast('@type' => 'startGroupCallRecording', + 'group_call_id' => group_call_id, + 'title' => title, + 'record_video' => record_video, + 'use_portrait_orientation' => use_portrait_orientation) + end + + # Starts screen sharing in a joined group call. + # Returns join response payload for tgcalls. + # + # @param group_call_id [Integer] Group call identifier. + # @param audio_source_id [Integer] Screen sharing audio channel synchronization source identifier; received from + # tgcalls. + # @param payload [TD::Types::String] Group call join payload; received from tgcalls. + # @return [TD::Types::Text] + def start_group_call_screen_sharing(group_call_id:, audio_source_id:, payload:) + broadcast('@type' => 'startGroupCallScreenSharing', + 'group_call_id' => group_call_id, + 'audio_source_id' => audio_source_id, + 'payload' => payload) end # Starts a scheduled group call. @@ -4839,7 +5205,7 @@ def start_scheduled_group_call(group_call_id:) # # @param chat_id [Integer] Identifier of the chat to which the poll belongs. # @param message_id [Integer] Identifier of the message containing the poll. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @return [TD::Types::Ok] def stop_poll(chat_id:, message_id:, reply_markup:) broadcast('@type' => 'stopPoll', @@ -4849,7 +5215,7 @@ def stop_poll(chat_id:, message_id:, reply_markup:) end # Fetches the latest versions of all strings from a language pack in the current localization target from the server. - # This method shouldn't be called explicitly for the current used/base language packs. + # This method doesn't need to be called explicitly for the current used/base language packs. # Can be called before authorization. # # @param language_pack_id [TD::Types::String] Language pack identifier. @@ -4924,8 +5290,30 @@ def toggle_group_call_enabled_start_notification(group_call_id:, enabled_start_n 'enabled_start_notification' => enabled_start_notification) end + # Toggles whether current user's video is enabled. + # + # @param group_call_id [Integer] Group call identifier. + # @param is_my_video_enabled [Boolean] Pass true if the current user's video is enabled. + # @return [TD::Types::Ok] + def toggle_group_call_is_my_video_enabled(group_call_id:, is_my_video_enabled:) + broadcast('@type' => 'toggleGroupCallIsMyVideoEnabled', + 'group_call_id' => group_call_id, + 'is_my_video_enabled' => is_my_video_enabled) + end + + # Toggles whether current user's video is paused. + # + # @param group_call_id [Integer] Group call identifier. + # @param is_my_video_paused [Boolean] Pass true if the current user's video is paused. + # @return [TD::Types::Ok] + def toggle_group_call_is_my_video_paused(group_call_id:, is_my_video_paused:) + broadcast('@type' => 'toggleGroupCallIsMyVideoPaused', + 'group_call_id' => group_call_id, + 'is_my_video_paused' => is_my_video_paused) + end + # Toggles whether new participants of a group call can be unmuted only by administrators of the group call. - # Requires groupCall.can_change_mute_new_participants group call flag. + # Requires groupCall.can_toggle_mute_new_participants group call flag. # # @param group_call_id [Integer] Group call identifier. # @param mute_new_participants [Boolean] New value of the mute_new_participants setting. @@ -4940,7 +5328,7 @@ def toggle_group_call_mute_new_participants(group_call_id:, mute_new_participant # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. - # @param is_hand_raised [Boolean] Pass true if the user's hand should be raised. + # @param is_hand_raised [Boolean] Pass true if the user's hand needs to be raised. # Only self hand can be raised. # Requires groupCall.can_be_managed group call flag to lower other's hand. # @return [TD::Types::Ok] @@ -4951,7 +5339,7 @@ def toggle_group_call_participant_is_hand_raised(group_call_id:, participant_id: 'is_hand_raised' => is_hand_raised) end - # Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themself. + # Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. @@ -4964,6 +5352,17 @@ def toggle_group_call_participant_is_muted(group_call_id:, participant_id:, is_m 'is_muted' => is_muted) end + # Pauses or unpauses screen sharing in a joined group call. + # + # @param group_call_id [Integer] Group call identifier. + # @param is_paused [Boolean] True if screen sharing is paused. + # @return [TD::Types::Ok] + def toggle_group_call_screen_sharing_is_paused(group_call_id:, is_paused:) + broadcast('@type' => 'toggleGroupCallScreenSharingIsPaused', + 'group_call_id' => group_call_id, + 'is_paused' => is_paused) + end + # Changes the block state of a message sender. # Currently, only users and supergroup chats can be blocked. # @@ -5063,7 +5462,7 @@ def upgrade_basic_group_chat_to_supergroup_chat(chat_id:) # The file will not have a persistent remote identifier until it will be sent in a message. # # @param file [TD::Types::InputFile] File to upload. - # @param file_type [TD::Types::FileType] File type. + # @param file_type [TD::Types::FileType] File type; pass null if unknown. # @param priority [Integer] Priority of the upload (1-32). # The higher the priority, the earlier the file will be uploaded. # If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded @@ -5076,16 +5475,15 @@ def upload_file(file:, file_type:, priority:) 'priority' => priority) end - # Uploads a PNG image with a sticker; for bots only; returns the uploaded file. + # Uploads a PNG image with a sticker; returns the uploaded file. # - # @param user_id [Integer] Sticker file owner. - # @param png_sticker [TD::Types::InputFile] PNG image with the sticker; must be up to 512 KB in size and fit in - # 512x512 square. + # @param user_id [Integer] Sticker file owner; ignored for regular users. + # @param sticker [TD::Types::InputSticker] Sticker file to upload. # @return [TD::Types::File] - def upload_sticker_file(user_id:, png_sticker:) - broadcast('@type' => 'uploadStickerFile', - 'user_id' => user_id, - 'png_sticker' => png_sticker) + def upload_sticker_file(user_id:, sticker:) + broadcast('@type' => 'uploadStickerFile', + 'user_id' => user_id, + 'sticker' => sticker) end # Validates the order information provided by a user and returns the available shipping options for a flexible @@ -5093,10 +5491,10 @@ def upload_sticker_file(user_id:, png_sticker:) # # @param chat_id [Integer] Chat identifier of the Invoice message. # @param message_id [Integer] Message identifier. - # @param order_info [TD::Types::OrderInfo] The order information, provided by the user. + # @param order_info [TD::Types::OrderInfo, nil] The order information, provided by the user; pass null if empty. # @param allow_save [Boolean] True, if the order information can be saved. # @return [TD::Types::ValidatedOrderInfo] - def validate_order_info(chat_id:, message_id:, order_info:, allow_save:) + def validate_order_info(chat_id:, message_id:, order_info: nil, allow_save:) broadcast('@type' => 'validateOrderInfo', 'chat_id' => chat_id, 'message_id' => message_id, @@ -5111,7 +5509,7 @@ def validate_order_info(chat_id:, message_id:, order_info:, allow_save:) # @param chat_id [Integer] Chat identifier. # @param message_thread_id [Integer] If not 0, a message thread identifier in which the messages are being viewed. # @param message_ids [Array] The identifiers of the messages being viewed. - # @param force_read [Boolean] True, if messages in closed chats should be marked as read by the request. + # @param force_read [Boolean] True, if messages in closed chats must be marked as read by the request. # @return [TD::Types::Ok] def view_messages(chat_id:, message_thread_id:, message_ids:, force_read:) broadcast('@type' => 'viewMessages', @@ -5121,6 +5519,17 @@ def view_messages(chat_id:, message_thread_id:, message_ids:, force_read:) 'force_read' => force_read) end + # Informs TDLib that a sponsored message was viewed by the user. + # + # @param chat_id [Integer] Identifier of the chat with the sponsored message. + # @param sponsored_message_id [Integer] The identifier of the sponsored message being viewed. + # @return [TD::Types::Ok] + def view_sponsored_message(chat_id:, sponsored_message_id:) + broadcast('@type' => 'viewSponsoredMessage', + 'chat_id' => chat_id, + 'sponsored_message_id' => sponsored_message_id) + end + # Informs the server that some trending sticker sets have been viewed by the user. # # @param sticker_set_ids [Array] Identifiers of viewed trending sticker sets. diff --git a/lib/tdlib/types.rb b/lib/tdlib/types.rb index b5311593..f083bdd4 100644 --- a/lib/tdlib/types.rb +++ b/lib/tdlib/types.rb @@ -58,6 +58,7 @@ module TD::Types 'maskPointMouth' => 'MaskPoint::Mouth', 'maskPointChin' => 'MaskPoint::Chin', 'maskPosition' => 'MaskPosition', + 'colorReplacement' => 'ColorReplacement', 'closedVectorPath' => 'ClosedVectorPath', 'pollOption' => 'PollOption', 'PollType' => 'PollType', @@ -71,6 +72,7 @@ module TD::Types 'video' => 'Video', 'videoNote' => 'VideoNote', 'voiceNote' => 'VoiceNote', + 'animatedEmoji' => 'AnimatedEmoji', 'contact' => 'Contact', 'location' => 'Location', 'venue' => 'Venue', @@ -84,7 +86,7 @@ module TD::Types 'userTypeBot' => 'UserType::Bot', 'userTypeUnknown' => 'UserType::Unknown', 'botCommand' => 'BotCommand', - 'botInfo' => 'BotInfo', + 'botCommands' => 'BotCommands', 'chatLocation' => 'ChatLocation', 'animatedChatPhoto' => 'AnimatedChatPhoto', 'chatPhoto' => 'ChatPhoto', @@ -132,6 +134,9 @@ module TD::Types 'chatInviteLinkMember' => 'ChatInviteLinkMember', 'chatInviteLinkMembers' => 'ChatInviteLinkMembers', 'chatInviteLinkInfo' => 'ChatInviteLinkInfo', + 'chatJoinRequest' => 'ChatJoinRequest', + 'chatJoinRequests' => 'ChatJoinRequests', + 'chatJoinRequestsInfo' => 'ChatJoinRequestsInfo', 'basicGroup' => 'BasicGroup', 'basicGroupFullInfo' => 'BasicGroupFullInfo', 'supergroup' => 'Supergroup', @@ -160,6 +165,12 @@ module TD::Types 'message' => 'Message', 'messages' => 'Messages', 'foundMessages' => 'FoundMessages', + 'messagePosition' => 'MessagePosition', + 'messagePositions' => 'MessagePositions', + 'messageCalendarDay' => 'MessageCalendarDay', + 'messageCalendar' => 'MessageCalendar', + 'sponsoredMessage' => 'SponsoredMessage', + 'sponsoredMessages' => 'SponsoredMessages', 'NotificationSettingsScope' => 'NotificationSettingsScope', 'notificationSettingsScopePrivateChats' => 'NotificationSettingsScope::PrivateChats', 'notificationSettingsScopeGroupChats' => 'NotificationSettingsScope::GroupChats', @@ -185,7 +196,7 @@ module TD::Types 'chatSourceMtprotoProxy' => 'ChatSource::MtprotoProxy', 'chatSourcePublicServiceAnnouncement' => 'ChatSource::PublicServiceAnnouncement', 'chatPosition' => 'ChatPosition', - 'voiceChat' => 'VoiceChat', + 'videoChat' => 'VideoChat', 'chat' => 'Chat', 'chats' => 'Chats', 'chatNearby' => 'ChatNearby', @@ -401,15 +412,16 @@ module TD::Types 'messageLocation' => 'MessageContent::Location', 'messageVenue' => 'MessageContent::Venue', 'messageContact' => 'MessageContent::Contact', + 'messageAnimatedEmoji' => 'MessageContent::AnimatedEmoji', 'messageDice' => 'MessageContent::Dice', 'messageGame' => 'MessageContent::Game', 'messagePoll' => 'MessageContent::Poll', 'messageInvoice' => 'MessageContent::Invoice', 'messageCall' => 'MessageContent::Call', - 'messageVoiceChatScheduled' => 'MessageContent::VoiceChatScheduled', - 'messageVoiceChatStarted' => 'MessageContent::VoiceChatStarted', - 'messageVoiceChatEnded' => 'MessageContent::VoiceChatEnded', - 'messageInviteVoiceChatParticipants' => 'MessageContent::InviteVoiceChatParticipants', + 'messageVideoChatScheduled' => 'MessageContent::VideoChatScheduled', + 'messageVideoChatStarted' => 'MessageContent::VideoChatStarted', + 'messageVideoChatEnded' => 'MessageContent::VideoChatEnded', + 'messageInviteVideoChatParticipants' => 'MessageContent::InviteVideoChatParticipants', 'messageBasicGroupChatCreate' => 'MessageContent::BasicGroupChatCreate', 'messageSupergroupChatCreate' => 'MessageContent::SupergroupChatCreate', 'messageChatChangeTitle' => 'MessageContent::ChatChangeTitle', @@ -417,11 +429,13 @@ module TD::Types 'messageChatDeletePhoto' => 'MessageContent::ChatDeletePhoto', 'messageChatAddMembers' => 'MessageContent::ChatAddMembers', 'messageChatJoinByLink' => 'MessageContent::ChatJoinByLink', + 'messageChatJoinByRequest' => 'MessageContent::ChatJoinByRequest', 'messageChatDeleteMember' => 'MessageContent::ChatDeleteMember', 'messageChatUpgradeTo' => 'MessageContent::ChatUpgradeTo', 'messageChatUpgradeFrom' => 'MessageContent::ChatUpgradeFrom', 'messagePinMessage' => 'MessageContent::PinMessage', 'messageScreenshotTaken' => 'MessageContent::ScreenshotTaken', + 'messageChatSetTheme' => 'MessageContent::ChatSetTheme', 'messageChatSetTtl' => 'MessageContent::ChatSetTtl', 'messageCustomServiceAction' => 'MessageContent::CustomServiceAction', 'messageGameScore' => 'MessageContent::GameScore', @@ -451,6 +465,7 @@ module TD::Types 'textEntityTypePreCode' => 'TextEntityType::PreCode', 'textEntityTypeTextUrl' => 'TextEntityType::TextUrl', 'textEntityTypeMentionName' => 'TextEntityType::MentionName', + 'textEntityTypeMediaTimestamp' => 'TextEntityType::MediaTimestamp', 'inputThumbnail' => 'InputThumbnail', 'MessageSchedulingState' => 'MessageSchedulingState', 'messageSchedulingStateSendAtDate' => 'MessageSchedulingState::SendAtDate', @@ -502,11 +517,13 @@ module TD::Types 'chatActionUploadingVoiceNote' => 'ChatAction::UploadingVoiceNote', 'chatActionUploadingPhoto' => 'ChatAction::UploadingPhoto', 'chatActionUploadingDocument' => 'ChatAction::UploadingDocument', + 'chatActionChoosingSticker' => 'ChatAction::ChoosingSticker', 'chatActionChoosingLocation' => 'ChatAction::ChoosingLocation', 'chatActionChoosingContact' => 'ChatAction::ChoosingContact', 'chatActionStartPlayingGame' => 'ChatAction::StartPlayingGame', 'chatActionRecordingVideoNote' => 'ChatAction::RecordingVideoNote', 'chatActionUploadingVideoNote' => 'ChatAction::UploadingVideoNote', + 'chatActionWatchingAnimations' => 'ChatAction::WatchingAnimations', 'chatActionCancel' => 'ChatAction::Cancel', 'UserStatus' => 'UserStatus', 'userStatusEmpty' => 'UserStatus::Empty', @@ -540,14 +557,14 @@ module TD::Types 'callStateHangingUp' => 'CallState::HangingUp', 'callStateDiscarded' => 'CallState::Discarded', 'callStateError' => 'CallState::Error', + 'GroupCallVideoQuality' => 'GroupCallVideoQuality', + 'groupCallVideoQualityThumbnail' => 'GroupCallVideoQuality::Thumbnail', + 'groupCallVideoQualityMedium' => 'GroupCallVideoQuality::Medium', + 'groupCallVideoQualityFull' => 'GroupCallVideoQuality::Full', 'groupCallRecentSpeaker' => 'GroupCallRecentSpeaker', 'groupCall' => 'GroupCall', - 'groupCallPayloadFingerprint' => 'GroupCallPayloadFingerprint', - 'groupCallPayload' => 'GroupCallPayload', - 'groupCallJoinResponseCandidate' => 'GroupCallJoinResponseCandidate', - 'GroupCallJoinResponse' => 'GroupCallJoinResponse', - 'groupCallJoinResponseWebrtc' => 'GroupCallJoinResponse::Webrtc', - 'groupCallJoinResponseStream' => 'GroupCallJoinResponse::Stream', + 'groupCallVideoSourceGroup' => 'GroupCallVideoSourceGroup', + 'groupCallParticipantVideoInfo' => 'GroupCallParticipantVideoInfo', 'groupCallParticipant' => 'GroupCallParticipant', 'CallProblem' => 'CallProblem', 'callProblemEcho' => 'CallProblem::Echo', @@ -610,6 +627,7 @@ module TD::Types 'chatEventMessageUnpinned' => 'ChatEventAction::MessageUnpinned', 'chatEventMemberJoined' => 'ChatEventAction::MemberJoined', 'chatEventMemberJoinedByInviteLink' => 'ChatEventAction::MemberJoinedByInviteLink', + 'chatEventMemberJoinedByRequest' => 'ChatEventAction::MemberJoinedByRequest', 'chatEventMemberLeft' => 'ChatEventAction::MemberLeft', 'chatEventMemberInvited' => 'ChatEventAction::MemberInvited', 'chatEventMemberPromoted' => 'ChatEventAction::MemberPromoted', @@ -630,11 +648,11 @@ module TD::Types 'chatEventInviteLinkEdited' => 'ChatEventAction::InviteLinkEdited', 'chatEventInviteLinkRevoked' => 'ChatEventAction::InviteLinkRevoked', 'chatEventInviteLinkDeleted' => 'ChatEventAction::InviteLinkDeleted', - 'chatEventVoiceChatCreated' => 'ChatEventAction::VoiceChatCreated', - 'chatEventVoiceChatDiscarded' => 'ChatEventAction::VoiceChatDiscarded', - 'chatEventVoiceChatParticipantIsMutedToggled' => 'ChatEventAction::VoiceChatParticipantIsMutedToggled', - 'chatEventVoiceChatParticipantVolumeLevelChanged' => 'ChatEventAction::VoiceChatParticipantVolumeLevelChanged', - 'chatEventVoiceChatMuteNewParticipantsToggled' => 'ChatEventAction::VoiceChatMuteNewParticipantsToggled', + 'chatEventVideoChatCreated' => 'ChatEventAction::VideoChatCreated', + 'chatEventVideoChatDiscarded' => 'ChatEventAction::VideoChatDiscarded', + 'chatEventVideoChatParticipantIsMutedToggled' => 'ChatEventAction::VideoChatParticipantIsMutedToggled', + 'chatEventVideoChatParticipantVolumeLevelChanged' => 'ChatEventAction::VideoChatParticipantVolumeLevelChanged', + 'chatEventVideoChatMuteNewParticipantsToggled' => 'ChatEventAction::VideoChatMuteNewParticipantsToggled', 'chatEvent' => 'ChatEvent', 'chatEvents' => 'ChatEvents', 'chatEventLogFilters' => 'ChatEventLogFilters', @@ -662,6 +680,7 @@ module TD::Types 'BackgroundFill' => 'BackgroundFill', 'backgroundFillSolid' => 'BackgroundFill::Solid', 'backgroundFillGradient' => 'BackgroundFill::Gradient', + 'backgroundFillFreeformGradient' => 'BackgroundFill::FreeformGradient', 'BackgroundType' => 'BackgroundType', 'backgroundTypeWallpaper' => 'BackgroundType::Wallpaper', 'backgroundTypePattern' => 'BackgroundType::Pattern', @@ -671,6 +690,8 @@ module TD::Types 'InputBackground' => 'InputBackground', 'inputBackgroundLocal' => 'InputBackground::Local', 'inputBackgroundRemote' => 'InputBackground::Remote', + 'themeSettings' => 'ThemeSettings', + 'chatTheme' => 'ChatTheme', 'hashtags' => 'Hashtags', 'CanTransferOwnershipResult' => 'CanTransferOwnershipResult', 'canTransferOwnershipResultOk' => 'CanTransferOwnershipResult::Ok', @@ -683,6 +704,14 @@ module TD::Types 'checkChatUsernameResultUsernameOccupied' => 'CheckChatUsernameResult::UsernameOccupied', 'checkChatUsernameResultPublicChatsTooMuch' => 'CheckChatUsernameResult::PublicChatsTooMuch', 'checkChatUsernameResultPublicGroupsUnavailable' => 'CheckChatUsernameResult::PublicGroupsUnavailable', + 'CheckStickerSetNameResult' => 'CheckStickerSetNameResult', + 'checkStickerSetNameResultOk' => 'CheckStickerSetNameResult::Ok', + 'checkStickerSetNameResultNameInvalid' => 'CheckStickerSetNameResult::NameInvalid', + 'checkStickerSetNameResultNameOccupied' => 'CheckStickerSetNameResult::NameOccupied', + 'ResetPasswordResult' => 'ResetPasswordResult', + 'resetPasswordResultOk' => 'ResetPasswordResult::Ok', + 'resetPasswordResultPending' => 'ResetPasswordResult::Pending', + 'resetPasswordResultDeclined' => 'ResetPasswordResult::Declined', 'MessageFileType' => 'MessageFileType', 'messageFileTypePrivate' => 'MessageFileType::Private', 'messageFileTypeGroup' => 'MessageFileType::Group', @@ -710,8 +739,10 @@ module TD::Types 'pushMessageContentChatAddMembers' => 'PushMessageContent::ChatAddMembers', 'pushMessageContentChatChangePhoto' => 'PushMessageContent::ChatChangePhoto', 'pushMessageContentChatChangeTitle' => 'PushMessageContent::ChatChangeTitle', + 'pushMessageContentChatSetTheme' => 'PushMessageContent::ChatSetTheme', 'pushMessageContentChatDeleteMember' => 'PushMessageContent::ChatDeleteMember', 'pushMessageContentChatJoinByLink' => 'PushMessageContent::ChatJoinByLink', + 'pushMessageContentChatJoinByRequest' => 'PushMessageContent::ChatJoinByRequest', 'pushMessageContentMessageForwards' => 'PushMessageContent::MessageForwards', 'pushMessageContentMediaAlbum' => 'PushMessageContent::MediaAlbum', 'NotificationType' => 'NotificationType', @@ -772,6 +803,31 @@ module TD::Types 'chatReportReasonUnrelatedLocation' => 'ChatReportReason::UnrelatedLocation', 'chatReportReasonFake' => 'ChatReportReason::Fake', 'chatReportReasonCustom' => 'ChatReportReason::Custom', + 'InternalLinkType' => 'InternalLinkType', + 'internalLinkTypeActiveSessions' => 'InternalLinkType::ActiveSessions', + 'internalLinkTypeAuthenticationCode' => 'InternalLinkType::AuthenticationCode', + 'internalLinkTypeBackground' => 'InternalLinkType::Background', + 'internalLinkTypeBotStart' => 'InternalLinkType::BotStart', + 'internalLinkTypeBotStartInGroup' => 'InternalLinkType::BotStartInGroup', + 'internalLinkTypeChangePhoneNumber' => 'InternalLinkType::ChangePhoneNumber', + 'internalLinkTypeChatInvite' => 'InternalLinkType::ChatInvite', + 'internalLinkTypeFilterSettings' => 'InternalLinkType::FilterSettings', + 'internalLinkTypeGame' => 'InternalLinkType::Game', + 'internalLinkTypeLanguagePack' => 'InternalLinkType::LanguagePack', + 'internalLinkTypeMessage' => 'InternalLinkType::Message', + 'internalLinkTypeMessageDraft' => 'InternalLinkType::MessageDraft', + 'internalLinkTypePassportDataRequest' => 'InternalLinkType::PassportDataRequest', + 'internalLinkTypePhoneNumberConfirmation' => 'InternalLinkType::PhoneNumberConfirmation', + 'internalLinkTypeProxy' => 'InternalLinkType::Proxy', + 'internalLinkTypePublicChat' => 'InternalLinkType::PublicChat', + 'internalLinkTypeQrCodeAuthentication' => 'InternalLinkType::QrCodeAuthentication', + 'internalLinkTypeSettings' => 'InternalLinkType::Settings', + 'internalLinkTypeStickerSet' => 'InternalLinkType::StickerSet', + 'internalLinkTypeTheme' => 'InternalLinkType::Theme', + 'internalLinkTypeThemeSettings' => 'InternalLinkType::ThemeSettings', + 'internalLinkTypeUnknownDeepLink' => 'InternalLinkType::UnknownDeepLink', + 'internalLinkTypeUnsupportedProxy' => 'InternalLinkType::UnsupportedProxy', + 'internalLinkTypeVideoChat' => 'InternalLinkType::VideoChat', 'messageLink' => 'MessageLink', 'messageLinkInfo' => 'MessageLinkInfo', 'filePart' => 'FilePart', @@ -832,6 +888,7 @@ module TD::Types 'tMeUrls' => 'TMeUrls', 'SuggestedAction' => 'SuggestedAction', 'suggestedActionEnableArchiveAndMuteNewChats' => 'SuggestedAction::EnableArchiveAndMuteNewChats', + 'suggestedActionCheckPassword' => 'SuggestedAction::CheckPassword', 'suggestedActionCheckPhoneNumber' => 'SuggestedAction::CheckPhoneNumber', 'suggestedActionSeeTicksHint' => 'SuggestedAction::SeeTicksHint', 'suggestedActionConvertToBroadcastGroup' => 'SuggestedAction::ConvertToBroadcastGroup', @@ -869,6 +926,14 @@ module TD::Types 'VectorPathCommand' => 'VectorPathCommand', 'vectorPathCommandLine' => 'VectorPathCommand::Line', 'vectorPathCommandCubicBezierCurve' => 'VectorPathCommand::CubicBezierCurve', + 'BotCommandScope' => 'BotCommandScope', + 'botCommandScopeDefault' => 'BotCommandScope::Default', + 'botCommandScopeAllPrivateChats' => 'BotCommandScope::AllPrivateChats', + 'botCommandScopeAllGroupChats' => 'BotCommandScope::AllGroupChats', + 'botCommandScopeAllChatAdministrators' => 'BotCommandScope::AllChatAdministrators', + 'botCommandScopeChat' => 'BotCommandScope::Chat', + 'botCommandScopeChatAdministrators' => 'BotCommandScope::ChatAdministrators', + 'botCommandScopeChatMember' => 'BotCommandScope::ChatMember', 'Update' => 'Update', 'updateAuthorizationState' => 'Update::AuthorizationState', 'updateNewMessage' => 'Update::NewMessage', @@ -891,7 +956,7 @@ module TD::Types 'updateChatIsMarkedAsUnread' => 'Update::ChatIsMarkedAsUnread', 'updateChatIsBlocked' => 'Update::ChatIsBlocked', 'updateChatHasScheduledMessages' => 'Update::ChatHasScheduledMessages', - 'updateChatVoiceChat' => 'Update::ChatVoiceChat', + 'updateChatVideoChat' => 'Update::ChatVideoChat', 'updateChatDefaultDisableNotification' => 'Update::ChatDefaultDisableNotification', 'updateChatReadInbox' => 'Update::ChatReadInbox', 'updateChatReadOutbox' => 'Update::ChatReadOutbox', @@ -900,6 +965,8 @@ module TD::Types 'updateScopeNotificationSettings' => 'Update::ScopeNotificationSettings', 'updateChatMessageTtlSetting' => 'Update::ChatMessageTtlSetting', 'updateChatActionBar' => 'Update::ChatActionBar', + 'updateChatTheme' => 'Update::ChatTheme', + 'updateChatPendingJoinRequests' => 'Update::ChatPendingJoinRequests', 'updateChatReplyMarkup' => 'Update::ChatReplyMarkup', 'updateChatDraftMessage' => 'Update::ChatDraftMessage', 'updateChatFilters' => 'Update::ChatFilters', @@ -937,11 +1004,13 @@ module TD::Types 'updateFavoriteStickers' => 'Update::FavoriteStickers', 'updateSavedAnimations' => 'Update::SavedAnimations', 'updateSelectedBackground' => 'Update::SelectedBackground', + 'updateChatThemes' => 'Update::ChatThemes', 'updateLanguagePackStrings' => 'Update::LanguagePackStrings', 'updateConnectionState' => 'Update::ConnectionState', 'updateTermsOfService' => 'Update::TermsOfService', 'updateUsersNearby' => 'Update::UsersNearby', 'updateDiceEmojis' => 'Update::DiceEmojis', + 'updateAnimatedEmojiMessageClicked' => 'Update::AnimatedEmojiMessageClicked', 'updateAnimationSearchParameters' => 'Update::AnimationSearchParameters', 'updateSuggestedActions' => 'Update::SuggestedActions', 'updateNewInlineQuery' => 'Update::NewInlineQuery', @@ -955,6 +1024,7 @@ module TD::Types 'updatePoll' => 'Update::Poll', 'updatePollAnswer' => 'Update::PollAnswer', 'updateChatMember' => 'Update::ChatMember', + 'updateNewChatJoinRequest' => 'Update::NewChatJoinRequest', 'updates' => 'Updates', 'LogStream' => 'LogStream', 'logStreamDefault' => 'LogStream::Default', @@ -1003,6 +1073,7 @@ def camelize(str) account_ttl address animated_chat_photo + animated_emoji animation animations audio @@ -1021,7 +1092,8 @@ def camelize(str) basic_group basic_group_full_info bot_command - bot_info + bot_command_scope + bot_commands call call_discard_reason call_id @@ -1051,6 +1123,9 @@ def camelize(str) chat_invite_link_member chat_invite_link_members chat_invite_links + chat_join_request + chat_join_requests + chat_join_requests_info chat_list chat_lists chat_location @@ -1072,11 +1147,14 @@ def camelize(str) chat_statistics_inviter_info chat_statistics_message_interaction_info chat_statistics_message_sender_info + chat_theme chat_type chats chats_nearby check_chat_username_result + check_sticker_set_name_result closed_vector_path + color_replacement connected_website connected_websites connection_state @@ -1109,12 +1187,11 @@ def camelize(str) game_high_scores group_call group_call_id - group_call_join_response - group_call_join_response_candidate group_call_participant - group_call_payload - group_call_payload_fingerprint + group_call_participant_video_info group_call_recent_speaker + group_call_video_quality + group_call_video_source_group hashtags http_url identity_document @@ -1136,6 +1213,7 @@ def camelize(str) input_personal_document input_sticker input_thumbnail + internal_link_type invoice json_object_member json_value @@ -1156,6 +1234,8 @@ def camelize(str) mask_point mask_position message + message_calendar + message_calendar_day message_content message_copy_options message_file_type @@ -1164,6 +1244,8 @@ def camelize(str) message_interaction_info message_link message_link_info + message_position + message_positions message_reply_info message_scheduling_state message_send_options @@ -1229,6 +1311,7 @@ def camelize(str) recovery_email_address remote_file reply_markup + reset_password_result rich_text saved_credentials scope_notification_settings @@ -1239,6 +1322,8 @@ def camelize(str) session sessions shipping_option + sponsored_message + sponsored_messages statistical_graph statistical_value sticker @@ -1265,6 +1350,7 @@ def camelize(str) text_entity text_entity_type text_parse_mode + theme_settings thumbnail thumbnail_format top_chat_category @@ -1282,8 +1368,8 @@ def camelize(str) vector_path_command venue video + video_chat video_note - voice_chat voice_note web_page web_page_instant_view diff --git a/lib/tdlib/types/account_ttl.rb b/lib/tdlib/types/account_ttl.rb index 38402fb6..1851e6d8 100644 --- a/lib/tdlib/types/account_ttl.rb +++ b/lib/tdlib/types/account_ttl.rb @@ -2,8 +2,7 @@ module TD::Types # Contains information about the period of inactivity after which the current user's account will automatically be # deleted. # - # @attr days [Integer] Number of days of inactivity before the account will be flagged for deletion; should range - # from 30-366 days. + # @attr days [Integer] Number of days of inactivity before the account will be flagged for deletion; 30-366 days. class AccountTtl < Base attribute :days, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/animated_emoji.rb b/lib/tdlib/types/animated_emoji.rb new file mode 100644 index 00000000..2abe9a45 --- /dev/null +++ b/lib/tdlib/types/animated_emoji.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes an animated representation of an emoji. + # + # @attr sticker [TD::Types::Sticker] Animated sticker for the emoji. + # @attr color_replacements [Array] List of colors to be replaced while the sticker is + # rendered. + # @attr sound [TD::Types::File, nil] File containing the sound to be played when the animated emoji is clicked if + # any; may be null. + # The sound is encoded with the Opus codec, and stored inside an OGG container. + class AnimatedEmoji < Base + attribute :sticker, TD::Types::Sticker + attribute :color_replacements, TD::Types::Array.of(TD::Types::ColorReplacement) + attribute :sound, TD::Types::File.optional.default(nil) + end +end diff --git a/lib/tdlib/types/audio.rb b/lib/tdlib/types/audio.rb index 23b3b5e1..1b2b60bf 100644 --- a/lib/tdlib/types/audio.rb +++ b/lib/tdlib/types/audio.rb @@ -10,7 +10,7 @@ module TD::Types # @attr album_cover_minithumbnail [TD::Types::Minithumbnail, nil] The minithumbnail of the album cover; may be null. # @attr album_cover_thumbnail [TD::Types::Thumbnail, nil] The thumbnail of the album cover in JPEG format; as defined # by the sender. - # The full size thumbnail should be extracted from the downloaded file; may be null. + # The full size thumbnail is supposed to be extracted from the downloaded file; may be null. # @attr audio [TD::Types::File] File containing the audio. class Audio < Base attribute :duration, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/authentication_code_info.rb b/lib/tdlib/types/authentication_code_info.rb index d795fa09..99dfe2f8 100644 --- a/lib/tdlib/types/authentication_code_info.rb +++ b/lib/tdlib/types/authentication_code_info.rb @@ -2,10 +2,10 @@ module TD::Types # Information about the authentication code that was sent. # # @attr phone_number [TD::Types::String] A phone number that is being authenticated. - # @attr type [TD::Types::AuthenticationCodeType] Describes the way the code was sent to the user. - # @attr next_type [TD::Types::AuthenticationCodeType, nil] Describes the way the next code will be sent to the user; - # may be null. - # @attr timeout [Integer] Timeout before the code should be re-sent, in seconds. + # @attr type [TD::Types::AuthenticationCodeType] The way the code was sent to the user. + # @attr next_type [TD::Types::AuthenticationCodeType, nil] The way the next code will be sent to the user; may be + # null. + # @attr timeout [Integer] Timeout before the code can be re-sent, in seconds. class AuthenticationCodeInfo < Base attribute :phone_number, TD::Types::String attribute :type, TD::Types::AuthenticationCodeType diff --git a/lib/tdlib/types/authentication_code_type/flash_call.rb b/lib/tdlib/types/authentication_code_type/flash_call.rb index 1a4f75b1..69e01583 100644 --- a/lib/tdlib/types/authentication_code_type/flash_call.rb +++ b/lib/tdlib/types/authentication_code_type/flash_call.rb @@ -1,5 +1,5 @@ module TD::Types - # An authentication code is delivered by an immediately cancelled call to the specified phone number. + # An authentication code is delivered by an immediately canceled call to the specified phone number. # The number from which the call was made is the code. # # @attr pattern [TD::Types::String] Pattern of the phone number from which the call will be made. diff --git a/lib/tdlib/types/authorization_state/closed.rb b/lib/tdlib/types/authorization_state/closed.rb index e2f190da..c553e22f 100644 --- a/lib/tdlib/types/authorization_state/closed.rb +++ b/lib/tdlib/types/authorization_state/closed.rb @@ -3,7 +3,7 @@ module TD::Types # All databases are closed and all resources are released. # No other updates will be received after this. # All queries will be responded to with error code 500. - # To continue working, one should create a new instance of the TDLib client. + # To continue working, one must create a new instance of the TDLib client. class AuthorizationState::Closed < AuthorizationState end end diff --git a/lib/tdlib/types/auto_download_settings.rb b/lib/tdlib/types/auto_download_settings.rb index 66d74acf..1b9ec2d0 100644 --- a/lib/tdlib/types/auto_download_settings.rb +++ b/lib/tdlib/types/auto_download_settings.rb @@ -2,10 +2,10 @@ module TD::Types # Contains auto-download settings. # # @attr is_auto_download_enabled [Boolean] True, if the auto-download is enabled. - # @attr max_photo_file_size [Integer] The maximum size of a photo file to be auto-downloaded. - # @attr max_video_file_size [Integer] The maximum size of a video file to be auto-downloaded. - # @attr max_other_file_size [Integer] The maximum size of other file types to be auto-downloaded. - # @attr video_upload_bitrate [Integer] The maximum suggested bitrate for uploaded videos. + # @attr max_photo_file_size [Integer] The maximum size of a photo file to be auto-downloaded, in bytes. + # @attr max_video_file_size [Integer] The maximum size of a video file to be auto-downloaded, in bytes. + # @attr max_other_file_size [Integer] The maximum size of other file types to be auto-downloaded, in bytes. + # @attr video_upload_bitrate [Integer] The maximum suggested bitrate for uploaded videos, in kbit/s. # @attr preload_large_videos [Boolean] True, if the beginning of video files needs to be preloaded for instant # playback. # @attr preload_next_audio [Boolean] True, if the next audio track needs to be preloaded while the user is listening diff --git a/lib/tdlib/types/auto_download_settings_presets.rb b/lib/tdlib/types/auto_download_settings_presets.rb index 99e9ea0e..fda55531 100644 --- a/lib/tdlib/types/auto_download_settings_presets.rb +++ b/lib/tdlib/types/auto_download_settings_presets.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains auto-download settings presets for the user. + # Contains auto-download settings presets for the current user. # # @attr low [TD::Types::AutoDownloadSettings] Preset with lowest settings; supposed to be used by default when # roaming. diff --git a/lib/tdlib/types/background_fill.rb b/lib/tdlib/types/background_fill.rb index 2c47d37b..609ceec7 100644 --- a/lib/tdlib/types/background_fill.rb +++ b/lib/tdlib/types/background_fill.rb @@ -4,6 +4,7 @@ class BackgroundFill < Base %w[ solid gradient + freeform_gradient ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/background_fill/#{type}" end diff --git a/lib/tdlib/types/background_fill/freeform_gradient.rb b/lib/tdlib/types/background_fill/freeform_gradient.rb new file mode 100644 index 00000000..e1dc6c56 --- /dev/null +++ b/lib/tdlib/types/background_fill/freeform_gradient.rb @@ -0,0 +1,8 @@ +module TD::Types + # Describes a freeform gradient fill of a background. + # + # @attr colors [Array] A list of 3 or 4 colors of the freeform gradients in the RGB24 format. + class BackgroundFill::FreeformGradient < BackgroundFill + attribute :colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/background_fill/gradient.rb b/lib/tdlib/types/background_fill/gradient.rb index 52afba3d..2b0c970a 100644 --- a/lib/tdlib/types/background_fill/gradient.rb +++ b/lib/tdlib/types/background_fill/gradient.rb @@ -4,7 +4,7 @@ module TD::Types # @attr top_color [Integer] A top color of the background in the RGB24 format. # @attr bottom_color [Integer] A bottom color of the background in the RGB24 format. # @attr rotation_angle [Integer] Clockwise rotation angle of the gradient, in degrees; 0-359. - # Should be always divisible by 45. + # Must be always divisible by 45. class BackgroundFill::Gradient < BackgroundFill attribute :top_color, TD::Types::Coercible::Integer attribute :bottom_color, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/background_type/fill.rb b/lib/tdlib/types/background_type/fill.rb index 0c0644a8..bdec6928 100644 --- a/lib/tdlib/types/background_type/fill.rb +++ b/lib/tdlib/types/background_type/fill.rb @@ -1,7 +1,7 @@ module TD::Types # A filled background. # - # @attr fill [TD::Types::BackgroundFill] Description of the background fill. + # @attr fill [TD::Types::BackgroundFill] The background fill. class BackgroundType::Fill < BackgroundType attribute :fill, TD::Types::BackgroundFill end diff --git a/lib/tdlib/types/background_type/pattern.rb b/lib/tdlib/types/background_type/pattern.rb index 589e7898..33315ccf 100644 --- a/lib/tdlib/types/background_type/pattern.rb +++ b/lib/tdlib/types/background_type/pattern.rb @@ -2,12 +2,16 @@ module TD::Types # A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the # background fill chosen by the user. # - # @attr fill [TD::Types::BackgroundFill] Description of the background fill. - # @attr intensity [Integer] Intensity of the pattern when it is shown above the filled background; 0-100. + # @attr fill [TD::Types::BackgroundFill] Fill of the background. + # @attr intensity [Integer] Intensity of the pattern when it is shown above the filled background; 0-100.. + # @attr is_inverted [Boolean] True, if the background fill must be applied only to the pattern itself. + # All other pixels are black in this case. + # For dark themes only. # @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is tilted. class BackgroundType::Pattern < BackgroundType attribute :fill, TD::Types::BackgroundFill attribute :intensity, TD::Types::Coercible::Integer + attribute :is_inverted, TD::Types::Bool attribute :is_moving, TD::Types::Bool end end diff --git a/lib/tdlib/types/basic_group_full_info.rb b/lib/tdlib/types/basic_group_full_info.rb index 04a7622f..835b991c 100644 --- a/lib/tdlib/types/basic_group_full_info.rb +++ b/lib/tdlib/types/basic_group_full_info.rb @@ -9,11 +9,13 @@ module TD::Types # @attr invite_link [TD::Types::ChatInviteLink, nil] Primary invite link for this group; may be null. # For chat administrators with can_invite_users right only. # Updated only after the basic group is opened. + # @attr bot_commands [Array] List of commands of bots in the group. class BasicGroupFullInfo < Base attribute :photo, TD::Types::ChatPhoto.optional.default(nil) attribute :description, TD::Types::String attribute :creator_user_id, TD::Types::Coercible::Integer attribute :members, TD::Types::Array.of(TD::Types::ChatMember) attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + attribute :bot_commands, TD::Types::Array.of(TD::Types::BotCommands) end end diff --git a/lib/tdlib/types/bot_command_scope.rb b/lib/tdlib/types/bot_command_scope.rb new file mode 100644 index 00000000..2c8ba72e --- /dev/null +++ b/lib/tdlib/types/bot_command_scope.rb @@ -0,0 +1,16 @@ +module TD::Types + # Represents the scope to which bot commands are relevant. + class BotCommandScope < Base + %w[ + default + all_private_chats + all_group_chats + all_chat_administrators + chat + chat_administrators + chat_member + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/bot_command_scope/#{type}" + end + end +end diff --git a/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb b/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb new file mode 100644 index 00000000..df849722 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all group and supergroup chat administrators. + class BotCommandScope::AllChatAdministrators < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/all_group_chats.rb b/lib/tdlib/types/bot_command_scope/all_group_chats.rb new file mode 100644 index 00000000..f93919f0 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_group_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all group and supergroup chats. + class BotCommandScope::AllGroupChats < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/all_private_chats.rb b/lib/tdlib/types/bot_command_scope/all_private_chats.rb new file mode 100644 index 00000000..dcd226fa --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_private_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all private chats. + class BotCommandScope::AllPrivateChats < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/chat.rb b/lib/tdlib/types/bot_command_scope/chat.rb new file mode 100644 index 00000000..4355c451 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat.rb @@ -0,0 +1,8 @@ +module TD::Types + # A scope covering all members of a chat. + # + # @attr chat_id [Integer] Chat identifier. + class BotCommandScope::Chat < BotCommandScope + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/bot_command_scope/chat_administrators.rb b/lib/tdlib/types/bot_command_scope/chat_administrators.rb new file mode 100644 index 00000000..60807522 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat_administrators.rb @@ -0,0 +1,8 @@ +module TD::Types + # A scope covering all administrators of a chat. + # + # @attr chat_id [Integer] Chat identifier. + class BotCommandScope::ChatAdministrators < BotCommandScope + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/bot_command_scope/chat_member.rb b/lib/tdlib/types/bot_command_scope/chat_member.rb new file mode 100644 index 00000000..f52bac4c --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat_member.rb @@ -0,0 +1,10 @@ +module TD::Types + # A scope covering a member of a chat. + # + # @attr chat_id [Integer] Chat identifier. + # @attr user_id [Integer] User identifier. + class BotCommandScope::ChatMember < BotCommandScope + attribute :chat_id, TD::Types::Coercible::Integer + attribute :user_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/bot_command_scope/default.rb b/lib/tdlib/types/bot_command_scope/default.rb new file mode 100644 index 00000000..a235c604 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/default.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all users. + class BotCommandScope::Default < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_commands.rb b/lib/tdlib/types/bot_commands.rb new file mode 100644 index 00000000..3ec6ec31 --- /dev/null +++ b/lib/tdlib/types/bot_commands.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of bot commands. + # + # @attr bot_user_id [Integer] Bot's user identifier. + # @attr commands [Array] List of bot commands. + class BotCommands < Base + attribute :bot_user_id, TD::Types::Coercible::Integer + attribute :commands, TD::Types::Array.of(TD::Types::BotCommand) + end +end diff --git a/lib/tdlib/types/bot_info.rb b/lib/tdlib/types/bot_info.rb deleted file mode 100644 index 288988b4..00000000 --- a/lib/tdlib/types/bot_info.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # Provides information about a bot and its supported commands. - # - # @attr description [TD::Types::String] Long description shown on the user info page. - # @attr commands [Array] A list of commands supported by the bot. - class BotInfo < Base - attribute :description, TD::Types::String - attribute :commands, TD::Types::Array.of(TD::Types::BotCommand) - end -end diff --git a/lib/tdlib/types/call_discard_reason/missed.rb b/lib/tdlib/types/call_discard_reason/missed.rb index 11743cd4..75555ed1 100644 --- a/lib/tdlib/types/call_discard_reason/missed.rb +++ b/lib/tdlib/types/call_discard_reason/missed.rb @@ -1,6 +1,6 @@ module TD::Types # The call was ended before the conversation started. - # It was cancelled by the caller or missed by the other party. + # It was canceled by the caller or missed by the other party. class CallDiscardReason::Missed < CallDiscardReason end end diff --git a/lib/tdlib/types/call_state/discarded.rb b/lib/tdlib/types/call_state/discarded.rb index d28dac04..13258fe3 100644 --- a/lib/tdlib/types/call_state/discarded.rb +++ b/lib/tdlib/types/call_state/discarded.rb @@ -2,8 +2,8 @@ module TD::Types # The call has ended successfully. # # @attr reason [TD::Types::CallDiscardReason] The reason, why the call has ended. - # @attr need_rating [Boolean] True, if the call rating should be sent to the server. - # @attr need_debug_information [Boolean] True, if the call debug information should be sent to the server. + # @attr need_rating [Boolean] True, if the call rating must be sent to the server. + # @attr need_debug_information [Boolean] True, if the call debug information must be sent to the server. class CallState::Discarded < CallState attribute :reason, TD::Types::CallDiscardReason attribute :need_rating, TD::Types::Bool diff --git a/lib/tdlib/types/callback_query_answer.rb b/lib/tdlib/types/callback_query_answer.rb index b92b90e1..5c9a6c9e 100644 --- a/lib/tdlib/types/callback_query_answer.rb +++ b/lib/tdlib/types/callback_query_answer.rb @@ -2,7 +2,7 @@ module TD::Types # Contains a bot's answer to a callback query. # # @attr text [TD::Types::String] Text of the answer. - # @attr show_alert [Boolean] True, if an alert should be shown to the user instead of a toast notification. + # @attr show_alert [Boolean] True, if an alert must be shown to the user instead of a toast notification. # @attr url [TD::Types::String] URL to be opened. class CallbackQueryAnswer < Base attribute :text, TD::Types::String diff --git a/lib/tdlib/types/chat.rb b/lib/tdlib/types/chat.rb index 596e2fed..5c4b0924 100644 --- a/lib/tdlib/types/chat.rb +++ b/lib/tdlib/types/chat.rb @@ -30,13 +30,16 @@ module TD::Types # not defined. # TTL is counted from the time message or its content is viewed in secret chats and from the send date in other # chats. - # @attr action_bar [TD::Types::ChatActionBar, nil] Describes actions which should be possible to do through a chat - # action bar; may be null. - # @attr voice_chat [TD::Types::VoiceChat] Contains information about voice chat of the chat. + # @attr theme_name [TD::Types::String] If non-empty, name of a theme, set for the chat. + # @attr action_bar [TD::Types::ChatActionBar, nil] Information about actions which must be possible to do through the + # chat action bar; may be null. + # @attr video_chat [TD::Types::VideoChat] Information about video chat of the chat. + # @attr pending_join_requests [TD::Types::ChatJoinRequestsInfo, nil] Information about pending join requests; may be + # null. # @attr reply_markup_message_id [Integer] Identifier of the message from which reply markup needs to be used; 0 if # there is no default custom reply markup in the chat. # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null. - # @attr client_data [TD::Types::String] Contains application-specific data associated with the chat. + # @attr client_data [TD::Types::String] Application-specific data associated with the chat. # (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the # message database is used. class Chat < Base @@ -60,8 +63,10 @@ class Chat < Base attribute :unread_mention_count, TD::Types::Coercible::Integer attribute :notification_settings, TD::Types::ChatNotificationSettings attribute :message_ttl_setting, TD::Types::Coercible::Integer + attribute :theme_name, TD::Types::String attribute :action_bar, TD::Types::ChatActionBar.optional.default(nil) - attribute :voice_chat, TD::Types::VoiceChat + attribute :video_chat, TD::Types::VideoChat + attribute :pending_join_requests, TD::Types::ChatJoinRequestsInfo.optional.default(nil) attribute :reply_markup_message_id, TD::Types::Coercible::Integer attribute :draft_message, TD::Types::DraftMessage.optional.default(nil) attribute :client_data, TD::Types::String diff --git a/lib/tdlib/types/chat_action.rb b/lib/tdlib/types/chat_action.rb index ea0a61f9..16ff174e 100644 --- a/lib/tdlib/types/chat_action.rb +++ b/lib/tdlib/types/chat_action.rb @@ -9,11 +9,13 @@ class ChatAction < Base uploading_voice_note uploading_photo uploading_document + choosing_sticker choosing_location choosing_contact start_playing_game recording_video_note uploading_video_note + watching_animations cancel ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/chat_action/#{type}" diff --git a/lib/tdlib/types/chat_action/cancel.rb b/lib/tdlib/types/chat_action/cancel.rb index 31e4f774..1dcf6c10 100644 --- a/lib/tdlib/types/chat_action/cancel.rb +++ b/lib/tdlib/types/chat_action/cancel.rb @@ -1,5 +1,5 @@ module TD::Types - # The user has cancelled the previous action. + # The user has canceled the previous action. class ChatAction::Cancel < ChatAction end end diff --git a/lib/tdlib/types/chat_action/choosing_sticker.rb b/lib/tdlib/types/chat_action/choosing_sticker.rb new file mode 100644 index 00000000..379366b5 --- /dev/null +++ b/lib/tdlib/types/chat_action/choosing_sticker.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user is picking a sticker to send. + class ChatAction::ChoosingSticker < ChatAction + end +end diff --git a/lib/tdlib/types/chat_action/watching_animations.rb b/lib/tdlib/types/chat_action/watching_animations.rb new file mode 100644 index 00000000..693aef64 --- /dev/null +++ b/lib/tdlib/types/chat_action/watching_animations.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user is watching animations sent by the other party by clicking on an animated emoji. + # + # @attr emoji [TD::Types::String] The animated emoji. + class ChatAction::WatchingAnimations < ChatAction + attribute :emoji, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_action_bar.rb b/lib/tdlib/types/chat_action_bar.rb index 718fc739..e8c3a3c5 100644 --- a/lib/tdlib/types/chat_action_bar.rb +++ b/lib/tdlib/types/chat_action_bar.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes actions which should be possible to do through a chat action bar. + # Describes actions which must be possible to do through a chat action bar. class ChatActionBar < Base %w[ report_spam diff --git a/lib/tdlib/types/chat_action_bar/report_add_block.rb b/lib/tdlib/types/chat_action_bar/report_add_block.rb index c2cb436c..71b0a9d8 100644 --- a/lib/tdlib/types/chat_action_bar/report_add_block.rb +++ b/lib/tdlib/types/chat_action_bar/report_add_block.rb @@ -1,6 +1,7 @@ module TD::Types # The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be - # blocked using the method blockUser, or the other user can be added to the contact list using the method addContact. + # blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the + # method addContact. # # @attr can_unarchive [Boolean] If true, the chat was automatically archived and can be moved back to the main chat # list using addChatToList simultaneously with setting chat notification settings to default using diff --git a/lib/tdlib/types/chat_event_action.rb b/lib/tdlib/types/chat_event_action.rb index b37e629d..fa900220 100644 --- a/lib/tdlib/types/chat_event_action.rb +++ b/lib/tdlib/types/chat_event_action.rb @@ -9,6 +9,7 @@ class ChatEventAction < Base message_unpinned member_joined member_joined_by_invite_link + member_joined_by_request member_left member_invited member_promoted @@ -29,11 +30,11 @@ class ChatEventAction < Base invite_link_edited invite_link_revoked invite_link_deleted - voice_chat_created - voice_chat_discarded - voice_chat_participant_is_muted_toggled - voice_chat_participant_volume_level_changed - voice_chat_mute_new_participants_toggled + video_chat_created + video_chat_discarded + video_chat_participant_is_muted_toggled + video_chat_participant_volume_level_changed + video_chat_mute_new_participants_toggled ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/chat_event_action/#{type}" end diff --git a/lib/tdlib/types/chat_event_action/member_joined_by_request.rb b/lib/tdlib/types/chat_event_action/member_joined_by_request.rb new file mode 100644 index 00000000..6040b764 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/member_joined_by_request.rb @@ -0,0 +1,10 @@ +module TD::Types + # A new member was accepted to the chat by an administrator. + # + # @attr approver_user_id [Integer] User identifier of the chat administrator, approved user join request. + # @attr invite_link [TD::Types::ChatInviteLink, nil] Invite link used to join the chat; may be null. + class ChatEventAction::MemberJoinedByRequest < ChatEventAction + attribute :approver_user_id, TD::Types::Coercible::Integer + attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + end +end diff --git a/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb b/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb index 929d4f53..374a09f5 100644 --- a/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb +++ b/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb @@ -1,8 +1,8 @@ module TD::Types # The slow_mode_delay setting of a supergroup was changed. # - # @attr old_slow_mode_delay [Integer] Previous value of slow_mode_delay. - # @attr new_slow_mode_delay [Integer] New value of slow_mode_delay. + # @attr old_slow_mode_delay [Integer] Previous value of slow_mode_delay, in seconds. + # @attr new_slow_mode_delay [Integer] New value of slow_mode_delay, in seconds. class ChatEventAction::SlowModeDelayChanged < ChatEventAction attribute :old_slow_mode_delay, TD::Types::Coercible::Integer attribute :new_slow_mode_delay, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_event_action/video_chat_created.rb b/lib/tdlib/types/chat_event_action/video_chat_created.rb new file mode 100644 index 00000000..dbdd8866 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/video_chat_created.rb @@ -0,0 +1,9 @@ +module TD::Types + # A video chat was created. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class ChatEventAction::VideoChatCreated < ChatEventAction + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/video_chat_discarded.rb b/lib/tdlib/types/chat_event_action/video_chat_discarded.rb new file mode 100644 index 00000000..46128f40 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/video_chat_discarded.rb @@ -0,0 +1,9 @@ +module TD::Types + # A video chat was discarded. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class ChatEventAction::VideoChatDiscarded < ChatEventAction + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb b/lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb similarity index 60% rename from lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb rename to lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb index f13d09b8..2eccea64 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb @@ -1,8 +1,8 @@ module TD::Types - # The mute_new_participants setting of a voice chat was toggled. + # The mute_new_participants setting of a video chat was toggled. # # @attr mute_new_participants [Boolean] New value of the mute_new_participants setting. - class ChatEventAction::VoiceChatMuteNewParticipantsToggled < ChatEventAction + class ChatEventAction::VideoChatMuteNewParticipantsToggled < ChatEventAction attribute :mute_new_participants, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb b/lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb similarity index 72% rename from lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb rename to lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb index bb34c01f..55badb17 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb @@ -1,9 +1,9 @@ module TD::Types - # A voice chat participant was muted or unmuted. + # A video chat participant was muted or unmuted. # # @attr participant_id [TD::Types::MessageSender] Identifier of the affected group call participant. # @attr is_muted [Boolean] New value of is_muted. - class ChatEventAction::VoiceChatParticipantIsMutedToggled < ChatEventAction + class ChatEventAction::VideoChatParticipantIsMutedToggled < ChatEventAction attribute :participant_id, TD::Types::MessageSender attribute :is_muted, TD::Types::Bool end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb b/lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb similarity index 75% rename from lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb rename to lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb index 2f27f977..21b17509 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb @@ -1,9 +1,9 @@ module TD::Types - # A voice chat participant volume level was changed. + # A video chat participant volume level was changed. # # @attr participant_id [TD::Types::MessageSender] Identifier of the affected group call participant. # @attr volume_level [Integer] New value of volume_level; 1-20000 in hundreds of percents. - class ChatEventAction::VoiceChatParticipantVolumeLevelChanged < ChatEventAction + class ChatEventAction::VideoChatParticipantVolumeLevelChanged < ChatEventAction attribute :participant_id, TD::Types::MessageSender attribute :volume_level, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_created.rb b/lib/tdlib/types/chat_event_action/voice_chat_created.rb deleted file mode 100644 index 08562301..00000000 --- a/lib/tdlib/types/chat_event_action/voice_chat_created.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A voice chat was created. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class ChatEventAction::VoiceChatCreated < ChatEventAction - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb b/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb deleted file mode 100644 index 09f35aa7..00000000 --- a/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A voice chat was discarded. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class ChatEventAction::VoiceChatDiscarded < ChatEventAction - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_event_log_filters.rb b/lib/tdlib/types/chat_event_log_filters.rb index fdae18af..226eada0 100644 --- a/lib/tdlib/types/chat_event_log_filters.rb +++ b/lib/tdlib/types/chat_event_log_filters.rb @@ -1,19 +1,19 @@ module TD::Types # Represents a set of filters used to obtain a chat event log. # - # @attr message_edits [Boolean] True, if message edits should be returned. - # @attr message_deletions [Boolean] True, if message deletions should be returned. - # @attr message_pins [Boolean] True, if pin/unpin events should be returned. - # @attr member_joins [Boolean] True, if members joining events should be returned. - # @attr member_leaves [Boolean] True, if members leaving events should be returned. - # @attr member_invites [Boolean] True, if invited member events should be returned. - # @attr member_promotions [Boolean] True, if member promotion/demotion events should be returned. - # @attr member_restrictions [Boolean] True, if member restricted/unrestricted/banned/unbanned events should be + # @attr message_edits [Boolean] True, if message edits need to be returned. + # @attr message_deletions [Boolean] True, if message deletions need to be returned. + # @attr message_pins [Boolean] True, if pin/unpin events need to be returned. + # @attr member_joins [Boolean] True, if members joining events need to be returned. + # @attr member_leaves [Boolean] True, if members leaving events need to be returned. + # @attr member_invites [Boolean] True, if invited member events need to be returned. + # @attr member_promotions [Boolean] True, if member promotion/demotion events need to be returned. + # @attr member_restrictions [Boolean] True, if member restricted/unrestricted/banned/unbanned events need to be # returned. - # @attr info_changes [Boolean] True, if changes in chat information should be returned. - # @attr setting_changes [Boolean] True, if changes in chat settings should be returned. - # @attr invite_link_changes [Boolean] True, if changes to invite links should be returned. - # @attr voice_chat_changes [Boolean] True, if voice chat actions should be returned. + # @attr info_changes [Boolean] True, if changes in chat information need to be returned. + # @attr setting_changes [Boolean] True, if changes in chat settings need to be returned. + # @attr invite_link_changes [Boolean] True, if changes to invite links need to be returned. + # @attr video_chat_changes [Boolean] True, if video chat actions need to be returned. class ChatEventLogFilters < Base attribute :message_edits, TD::Types::Bool attribute :message_deletions, TD::Types::Bool @@ -26,6 +26,6 @@ class ChatEventLogFilters < Base attribute :info_changes, TD::Types::Bool attribute :setting_changes, TD::Types::Bool attribute :invite_link_changes, TD::Types::Bool - attribute :voice_chat_changes, TD::Types::Bool + attribute :video_chat_changes, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_invite_link.rb b/lib/tdlib/types/chat_invite_link.rb index 85261b06..4f0b3671 100644 --- a/lib/tdlib/types/chat_invite_link.rb +++ b/lib/tdlib/types/chat_invite_link.rb @@ -2,25 +2,33 @@ module TD::Types # Contains a chat invite link. # # @attr invite_link [TD::Types::String] Chat invite link. + # @attr name [TD::Types::String] Name of the link. # @attr creator_user_id [Integer] User identifier of an administrator created the link. # @attr date [Integer] Point in time (Unix timestamp) when the link was created. # @attr edit_date [Integer] Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown. # @attr expire_date [Integer] Point in time (Unix timestamp) when the link will expire; 0 if never. # @attr member_limit [Integer] The maximum number of members, which can join the chat using the link simultaneously; # 0 if not limited. + # Always 0 if the link requires approval. # @attr member_count [Integer] Number of chat members, which joined the chat using the link. + # @attr pending_join_request_count [Integer] Number of pending join requests created using this link. + # @attr creates_join_request [Boolean] True, if the link only creates join request. + # If true, total number of joining members will be unlimited. # @attr is_primary [Boolean] True, if the link is primary. - # Primary invite link can't have expire date or usage limit. + # Primary invite link can't have name, expire date or usage limit. # There is exactly one primary invite link for each administrator with can_invite_users right at a given time. # @attr is_revoked [Boolean] True, if the link was revoked. class ChatInviteLink < Base attribute :invite_link, TD::Types::String + attribute :name, TD::Types::String attribute :creator_user_id, TD::Types::Coercible::Integer attribute :date, TD::Types::Coercible::Integer attribute :edit_date, TD::Types::Coercible::Integer attribute :expire_date, TD::Types::Coercible::Integer attribute :member_limit, TD::Types::Coercible::Integer attribute :member_count, TD::Types::Coercible::Integer + attribute :pending_join_request_count, TD::Types::Coercible::Integer + attribute :creates_join_request, TD::Types::Bool attribute :is_primary, TD::Types::Bool attribute :is_revoked, TD::Types::Bool end diff --git a/lib/tdlib/types/chat_invite_link_info.rb b/lib/tdlib/types/chat_invite_link_info.rb index ce535a84..5e3cd21e 100644 --- a/lib/tdlib/types/chat_invite_link_info.rb +++ b/lib/tdlib/types/chat_invite_link_info.rb @@ -4,11 +4,13 @@ module TD::Types # @attr chat_id [Integer] Chat identifier of the invite link; 0 if the user has no access to the chat before joining. # @attr accessible_for [Integer] If non-zero, the amount of time for which read access to the chat will remain # available, in seconds. - # @attr type [TD::Types::ChatType] Contains information about the type of the chat. + # @attr type [TD::Types::ChatType] Type of the chat. # @attr title [TD::Types::String] Title of the chat. # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null. + # @attr description [TD::Types::String] Chat description. # @attr member_count [Integer] Number of members in the chat. # @attr member_user_ids [Array] User identifiers of some chat members that may be known to the current user. + # @attr creates_join_request [Boolean] True, if the link only creates join request. # @attr is_public [Boolean] True, if the chat is a public supergroup or channel, i.e. # it has a username or it is a location-based supergroup. class ChatInviteLinkInfo < Base @@ -17,8 +19,10 @@ class ChatInviteLinkInfo < Base attribute :type, TD::Types::ChatType attribute :title, TD::Types::String attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil) + attribute :description, TD::Types::String attribute :member_count, TD::Types::Coercible::Integer attribute :member_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :creates_join_request, TD::Types::Bool attribute :is_public, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_invite_link_member.rb b/lib/tdlib/types/chat_invite_link_member.rb index d79dd0aa..1f6b8206 100644 --- a/lib/tdlib/types/chat_invite_link_member.rb +++ b/lib/tdlib/types/chat_invite_link_member.rb @@ -3,8 +3,10 @@ module TD::Types # # @attr user_id [Integer] User identifier. # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined the chat. + # @attr approver_user_id [Integer] User identifier of the chat administrator, approved user join request. class ChatInviteLinkMember < Base attribute :user_id, TD::Types::Coercible::Integer attribute :joined_chat_date, TD::Types::Coercible::Integer + attribute :approver_user_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/chat_join_request.rb b/lib/tdlib/types/chat_join_request.rb new file mode 100644 index 00000000..8a84693d --- /dev/null +++ b/lib/tdlib/types/chat_join_request.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a user that sent a join request and waits for administrator approval. + # + # @attr user_id [Integer] User identifier. + # @attr date [Integer] Point in time (Unix timestamp) when the user sent the join request. + # @attr bio [TD::Types::String] A short bio of the user. + class ChatJoinRequest < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :bio, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_join_requests.rb b/lib/tdlib/types/chat_join_requests.rb new file mode 100644 index 00000000..2e44a9c4 --- /dev/null +++ b/lib/tdlib/types/chat_join_requests.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of chat join requests. + # + # @attr total_count [Integer] Approximate total count of requests found. + # @attr requests [Array] List of the requests. + class ChatJoinRequests < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :requests, TD::Types::Array.of(TD::Types::ChatJoinRequest) + end +end diff --git a/lib/tdlib/types/chat_join_requests_info.rb b/lib/tdlib/types/chat_join_requests_info.rb new file mode 100644 index 00000000..24e00a93 --- /dev/null +++ b/lib/tdlib/types/chat_join_requests_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about pending chat join requests. + # + # @attr total_count [Integer] Total number of pending join requests. + # @attr user_ids [Array] Identifiers of users sent the newest pending join requests. + class ChatJoinRequestsInfo < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/chat_member.rb b/lib/tdlib/types/chat_member.rb index cd39b315..2fd43f3c 100644 --- a/lib/tdlib/types/chat_member.rb +++ b/lib/tdlib/types/chat_member.rb @@ -1,5 +1,5 @@ module TD::Types - # Information about a user or a chat as a member of another chat. + # Describes a user or a chat as a member of another chat. # # @attr member_id [TD::Types::MessageSender] Identifier of the chat member. # Currently, other chats can be only Left or Banned. @@ -9,13 +9,10 @@ module TD::Types # unknown. # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined the chat. # @attr status [TD::Types::ChatMemberStatus] Status of the member in the chat. - # @attr bot_info [TD::Types::BotInfo, nil] If the user is a bot, information about the bot; may be null. - # Can be null even for a bot if the bot is not the chat member. class ChatMember < Base attribute :member_id, TD::Types::MessageSender attribute :inviter_user_id, TD::Types::Coercible::Integer attribute :joined_chat_date, TD::Types::Coercible::Integer attribute :status, TD::Types::ChatMemberStatus - attribute :bot_info, TD::Types::BotInfo.optional.default(nil) end end diff --git a/lib/tdlib/types/chat_member_status/administrator.rb b/lib/tdlib/types/chat_member_status/administrator.rb index f3ec8b7e..b739c7f2 100644 --- a/lib/tdlib/types/chat_member_status/administrator.rb +++ b/lib/tdlib/types/chat_member_status/administrator.rb @@ -1,7 +1,7 @@ module TD::Types - # The user is a member of a chat and has some additional privileges. + # The user is a member of the chat and has some additional privileges. # In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged - # members, and manage voice chats. + # members, and manage video chats. # In supergroups and channels, there are more detailed options for administrator privileges. # # @attr custom_title [TD::Types::String] A custom title of the administrator; 0-16 characters without emojis; @@ -16,12 +16,13 @@ module TD::Types # applicable to channels only. # @attr can_delete_messages [Boolean] True, if the administrator can delete messages of other users. # @attr can_invite_users [Boolean] True, if the administrator can invite new users to the chat. - # @attr can_restrict_members [Boolean] True, if the administrator can restrict, ban, or unban chat members. + # @attr can_restrict_members [Boolean] True, if the administrator can restrict, ban, or unban chat members; always + # true for channels. # @attr can_pin_messages [Boolean] True, if the administrator can pin messages; applicable to basic groups and # supergroups only. # @attr can_promote_members [Boolean] True, if the administrator can add new administrators with a subset of their # own privileges or demote administrators that were directly or indirectly promoted by them. - # @attr can_manage_voice_chats [Boolean] True, if the administrator can manage voice chats. + # @attr can_manage_video_chats [Boolean] True, if the administrator can manage video chats. # @attr is_anonymous [Boolean] True, if the administrator isn't shown in the chat member list and sends messages # anonymously; applicable to supergroups only. class ChatMemberStatus::Administrator < ChatMemberStatus @@ -36,7 +37,7 @@ class ChatMemberStatus::Administrator < ChatMemberStatus attribute :can_restrict_members, TD::Types::Bool attribute :can_pin_messages, TD::Types::Bool attribute :can_promote_members, TD::Types::Bool - attribute :can_manage_voice_chats, TD::Types::Bool + attribute :can_manage_video_chats, TD::Types::Bool attribute :is_anonymous, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_member_status/banned.rb b/lib/tdlib/types/chat_member_status/banned.rb index ce0f6990..af45afc2 100644 --- a/lib/tdlib/types/chat_member_status/banned.rb +++ b/lib/tdlib/types/chat_member_status/banned.rb @@ -1,6 +1,6 @@ module TD::Types # The user or the chat was banned (and hence is not a member of the chat). - # Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a voice + # Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video # chat of the chat. # # @attr banned_until_date [Integer] Point in time (Unix timestamp) when the user will be unbanned; 0 if never. diff --git a/lib/tdlib/types/chat_member_status/creator.rb b/lib/tdlib/types/chat_member_status/creator.rb index c6e55247..a6e22fbe 100644 --- a/lib/tdlib/types/chat_member_status/creator.rb +++ b/lib/tdlib/types/chat_member_status/creator.rb @@ -1,5 +1,5 @@ module TD::Types - # The user is the owner of a chat and has all the administrator privileges. + # The user is the owner of the chat and has all the administrator privileges. # # @attr custom_title [TD::Types::String] A custom title of the owner; 0-16 characters without emojis; applicable to # supergroups only. diff --git a/lib/tdlib/types/chat_member_status/member.rb b/lib/tdlib/types/chat_member_status/member.rb index 98859d82..5127e68c 100644 --- a/lib/tdlib/types/chat_member_status/member.rb +++ b/lib/tdlib/types/chat_member_status/member.rb @@ -1,5 +1,5 @@ module TD::Types - # The user is a member of a chat, without any additional privileges or restrictions. + # The user is a member of the chat, without any additional privileges or restrictions. class ChatMemberStatus::Member < ChatMemberStatus end end diff --git a/lib/tdlib/types/chat_notification_settings.rb b/lib/tdlib/types/chat_notification_settings.rb index 13162562..6ea4a116 100644 --- a/lib/tdlib/types/chat_notification_settings.rb +++ b/lib/tdlib/types/chat_notification_settings.rb @@ -10,7 +10,7 @@ module TD::Types # applications. # @attr use_default_show_preview [Boolean] If true, show_preview is ignored and the value for the relevant type of # chat is used instead. - # @attr show_preview [Boolean] True, if message content should be displayed in notifications. + # @attr show_preview [Boolean] True, if message content must be displayed in notifications. # @attr use_default_disable_pinned_message_notifications [Boolean] If true, disable_pinned_message_notifications is # ignored and the value for the relevant type of chat is used instead. # @attr disable_pinned_message_notifications [Boolean] If true, notifications for incoming pinned messages will be diff --git a/lib/tdlib/types/chat_statistics_message_sender_info.rb b/lib/tdlib/types/chat_statistics_message_sender_info.rb index 41d6c450..640f1f82 100644 --- a/lib/tdlib/types/chat_statistics_message_sender_info.rb +++ b/lib/tdlib/types/chat_statistics_message_sender_info.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr user_id [Integer] User identifier. # @attr sent_message_count [Integer] Number of sent messages. - # @attr average_character_count [Integer] Average number of characters in sent messages. + # @attr average_character_count [Integer] Average number of characters in sent messages; 0 if unknown. class ChatStatisticsMessageSenderInfo < Base attribute :user_id, TD::Types::Coercible::Integer attribute :sent_message_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_theme.rb b/lib/tdlib/types/chat_theme.rb new file mode 100644 index 00000000..d4158091 --- /dev/null +++ b/lib/tdlib/types/chat_theme.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a chat theme. + # + # @attr name [TD::Types::String] Theme name. + # @attr light_settings [TD::Types::ThemeSettings] Theme settings for a light chat theme. + # @attr dark_settings [TD::Types::ThemeSettings] Theme settings for a dark chat theme. + class ChatTheme < Base + attribute :name, TD::Types::String + attribute :light_settings, TD::Types::ThemeSettings + attribute :dark_settings, TD::Types::ThemeSettings + end +end diff --git a/lib/tdlib/types/chat_type/basic_group.rb b/lib/tdlib/types/chat_type/basic_group.rb index dccf043e..98ddc0fb 100644 --- a/lib/tdlib/types/chat_type/basic_group.rb +++ b/lib/tdlib/types/chat_type/basic_group.rb @@ -1,5 +1,5 @@ module TD::Types - # A basic group (i.e., a chat with 0-200 other users). + # A basic group (a chat with 0-200 other users). # # @attr basic_group_id [Integer] Basic group identifier. class ChatType::BasicGroup < ChatType diff --git a/lib/tdlib/types/chat_type/supergroup.rb b/lib/tdlib/types/chat_type/supergroup.rb index 825ad4a7..7c6ebfd3 100644 --- a/lib/tdlib/types/chat_type/supergroup.rb +++ b/lib/tdlib/types/chat_type/supergroup.rb @@ -1,6 +1,5 @@ module TD::Types - # A supergroup (i.e. - # a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members). + # A supergroup or channel (with unlimited members). # # @attr supergroup_id [Integer] Supergroup or channel identifier. # @attr is_channel [Boolean] True, if the supergroup is a channel. diff --git a/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb b/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb index 0c4825fc..4f3185e7 100644 --- a/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb +++ b/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb @@ -1,5 +1,5 @@ module TD::Types - # The user has too much chats with username, one of them should be made private first. + # The user has too much chats with username, one of them must be made private first. class CheckChatUsernameResult::PublicChatsTooMuch < CheckChatUsernameResult end end diff --git a/lib/tdlib/types/check_sticker_set_name_result.rb b/lib/tdlib/types/check_sticker_set_name_result.rb new file mode 100644 index 00000000..e65d322c --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents result of checking whether a name can be used for a new sticker set. + class CheckStickerSetNameResult < Base + %w[ + ok + name_invalid + name_occupied + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/check_sticker_set_name_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb b/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb new file mode 100644 index 00000000..b6d1026b --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name is invalid. + class CheckStickerSetNameResult::NameInvalid < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb b/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb new file mode 100644 index 00000000..4236b9e6 --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name is occupied. + class CheckStickerSetNameResult::NameOccupied < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/ok.rb b/lib/tdlib/types/check_sticker_set_name_result/ok.rb new file mode 100644 index 00000000..49ab1b62 --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name can be set. + class CheckStickerSetNameResult::Ok < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/color_replacement.rb b/lib/tdlib/types/color_replacement.rb new file mode 100644 index 00000000..0b03cc16 --- /dev/null +++ b/lib/tdlib/types/color_replacement.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a color replacement for animated emoji. + # + # @attr old_color [Integer] Original animated emoji color in the RGB24 format. + # @attr new_color [Integer] Replacement animated emoji color in the RGB24 format. + class ColorReplacement < Base + attribute :old_color, TD::Types::Coercible::Integer + attribute :new_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/country_info.rb b/lib/tdlib/types/country_info.rb index f3155619..904d7b6e 100644 --- a/lib/tdlib/types/country_info.rb +++ b/lib/tdlib/types/country_info.rb @@ -4,7 +4,7 @@ module TD::Types # @attr country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code. # @attr name [TD::Types::String] Native name of the country. # @attr english_name [TD::Types::String] English name of the country. - # @attr is_hidden [Boolean] True, if the country should be hidden from the list of all countries. + # @attr is_hidden [Boolean] True, if the country must be hidden from the list of all countries. # @attr calling_codes [Array] List of country calling codes. class CountryInfo < Base attribute :country_code, TD::Types::String diff --git a/lib/tdlib/types/deep_link_info.rb b/lib/tdlib/types/deep_link_info.rb index c4cb9afc..e7f14a65 100644 --- a/lib/tdlib/types/deep_link_info.rb +++ b/lib/tdlib/types/deep_link_info.rb @@ -1,8 +1,8 @@ module TD::Types - # Contains information about a tg:// deep link. + # Contains information about a tg: deep link. # # @attr text [TD::Types::FormattedText] Text to be shown to the user. - # @attr need_update_application [Boolean] True, if user should be asked to update the application. + # @attr need_update_application [Boolean] True, if the user must be asked to update the application. class DeepLinkInfo < Base attribute :text, TD::Types::FormattedText attribute :need_update_application, TD::Types::Bool diff --git a/lib/tdlib/types/device_token/apple_push_vo_ip.rb b/lib/tdlib/types/device_token/apple_push_vo_ip.rb index 87160ad6..75163047 100644 --- a/lib/tdlib/types/device_token/apple_push_vo_ip.rb +++ b/lib/tdlib/types/device_token/apple_push_vo_ip.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr device_token [TD::Types::String, nil] Device token; may be empty to de-register a device. # @attr is_app_sandbox [Boolean] True, if App Sandbox is enabled. - # @attr encrypt [Boolean] True, if push notifications should be additionally encrypted. + # @attr encrypt [Boolean] True, if push notifications must be additionally encrypted. class DeviceToken::ApplePushVoIP < DeviceToken attribute :device_token, TD::Types::String.optional.default(nil) attribute :is_app_sandbox, TD::Types::Bool diff --git a/lib/tdlib/types/device_token/firebase_cloud_messaging.rb b/lib/tdlib/types/device_token/firebase_cloud_messaging.rb index 0749e987..1f902ae3 100644 --- a/lib/tdlib/types/device_token/firebase_cloud_messaging.rb +++ b/lib/tdlib/types/device_token/firebase_cloud_messaging.rb @@ -2,7 +2,7 @@ module TD::Types # A token for Firebase Cloud Messaging. # # @attr token [TD::Types::String, nil] Device registration token; may be empty to de-register a device. - # @attr encrypt [Boolean] True, if push notifications should be additionally encrypted. + # @attr encrypt [Boolean] True, if push notifications must be additionally encrypted. class DeviceToken::FirebaseCloudMessaging < DeviceToken attribute :token, TD::Types::String.optional.default(nil) attribute :encrypt, TD::Types::Bool diff --git a/lib/tdlib/types/dice_stickers.rb b/lib/tdlib/types/dice_stickers.rb index 6f941b62..a863839c 100644 --- a/lib/tdlib/types/dice_stickers.rb +++ b/lib/tdlib/types/dice_stickers.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains animated stickers which should be used for dice animation rendering. + # Contains animated stickers which must be used for dice animation rendering. class DiceStickers < Base %w[ regular diff --git a/lib/tdlib/types/draft_message.rb b/lib/tdlib/types/draft_message.rb index cb441eea..eb4d13ac 100644 --- a/lib/tdlib/types/draft_message.rb +++ b/lib/tdlib/types/draft_message.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr reply_to_message_id [Integer] Identifier of the message to reply to; 0 if none. # @attr date [Integer] Point in time (Unix timestamp) when the draft was created. - # @attr input_message_text [TD::Types::InputMessageContent] Content of the message draft; this should always be of - # type inputMessageText. + # @attr input_message_text [TD::Types::InputMessageContent] Content of the message draft; must be of the type + # inputMessageText. class DraftMessage < Base attribute :reply_to_message_id, TD::Types::Coercible::Integer attribute :date, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/file.rb b/lib/tdlib/types/file.rb index 97b9479d..a30b05c9 100644 --- a/lib/tdlib/types/file.rb +++ b/lib/tdlib/types/file.rb @@ -2,9 +2,8 @@ module TD::Types # Represents a file. # # @attr id [Integer] Unique file identifier. - # @attr size [Integer] File size; 0 if unknown. - # @attr expected_size [Integer] Expected file size in case the exact file size is unknown, but an approximate size is - # known. + # @attr size [Integer] File size, in bytes; 0 if unknown. + # @attr expected_size [Integer] Approximate file size in bytes in case the exact file size is unknown. # Can be used to show download/upload progress. # @attr local [TD::Types::LocalFile] Information about the local copy of the file. # @attr remote [TD::Types::RemoteFile] Information about the remote copy of the file. diff --git a/lib/tdlib/types/group_call.rb b/lib/tdlib/types/group_call.rb index 9fdb5b29..878088a9 100644 --- a/lib/tdlib/types/group_call.rb +++ b/lib/tdlib/types/group_call.rb @@ -15,13 +15,17 @@ module TD::Types # @attr participant_count [Integer] Number of participants in the group call. # @attr loaded_all_participants [Boolean] True, if all group call participants are loaded. # @attr recent_speakers [Array] Recently speaking users in the group call. + # @attr is_my_video_enabled [Boolean] True, if the current user's video is enabled. + # @attr is_my_video_paused [Boolean] True, if the current user's video is paused. + # @attr can_enable_video [Boolean] True, if the current user can broadcast video or share screen. # @attr mute_new_participants [Boolean] True, if only group call administrators can unmute new participants. - # @attr can_change_mute_new_participants [Boolean] True, if the current user can enable or disable + # @attr can_toggle_mute_new_participants [Boolean] True, if the current user can enable or disable # mute_new_participants setting. # @attr record_duration [Integer] Duration of the ongoing group call recording, in seconds; 0 if none. # An {TD::Types::Update::GroupCall} update is not triggered when value of this field changes, but the same # recording goes on. - # @attr duration [Integer] Call duration; for ended calls only. + # @attr is_video_recorded [Boolean] True, if a video file is being recorded for the call. + # @attr duration [Integer] Call duration, in seconds; for ended calls only. class GroupCall < Base attribute :id, TD::Types::Coercible::Integer attribute :title, TD::Types::String @@ -34,9 +38,13 @@ class GroupCall < Base attribute :participant_count, TD::Types::Coercible::Integer attribute :loaded_all_participants, TD::Types::Bool attribute :recent_speakers, TD::Types::Array.of(TD::Types::GroupCallRecentSpeaker) + attribute :is_my_video_enabled, TD::Types::Bool + attribute :is_my_video_paused, TD::Types::Bool + attribute :can_enable_video, TD::Types::Bool attribute :mute_new_participants, TD::Types::Bool - attribute :can_change_mute_new_participants, TD::Types::Bool + attribute :can_toggle_mute_new_participants, TD::Types::Bool attribute :record_duration, TD::Types::Coercible::Integer + attribute :is_video_recorded, TD::Types::Bool attribute :duration, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/group_call_join_response.rb b/lib/tdlib/types/group_call_join_response.rb deleted file mode 100644 index 7ace579e..00000000 --- a/lib/tdlib/types/group_call_join_response.rb +++ /dev/null @@ -1,11 +0,0 @@ -module TD::Types - # Describes a group call join response. - class GroupCallJoinResponse < Base - %w[ - webrtc - stream - ].each do |type| - autoload TD::Types.camelize(type), "tdlib/types/group_call_join_response/#{type}" - end - end -end diff --git a/lib/tdlib/types/group_call_join_response/stream.rb b/lib/tdlib/types/group_call_join_response/stream.rb deleted file mode 100644 index fb8f2c78..00000000 --- a/lib/tdlib/types/group_call_join_response/stream.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # Describes that group call needs to be joined as a stream. - class GroupCallJoinResponse::Stream < GroupCallJoinResponse - end -end diff --git a/lib/tdlib/types/group_call_join_response/webrtc.rb b/lib/tdlib/types/group_call_join_response/webrtc.rb deleted file mode 100644 index 9a17936a..00000000 --- a/lib/tdlib/types/group_call_join_response/webrtc.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # Contains data needed to join the group call with WebRTC. - # - # @attr payload [TD::Types::GroupCallPayload] Group call payload to pass to tgcalls. - # @attr candidates [Array] Join response candidates to pass to tgcalls. - class GroupCallJoinResponse::Webrtc < GroupCallJoinResponse - attribute :payload, TD::Types::GroupCallPayload - attribute :candidates, TD::Types::Array.of(TD::Types::GroupCallJoinResponseCandidate) - end -end diff --git a/lib/tdlib/types/group_call_join_response_candidate.rb b/lib/tdlib/types/group_call_join_response_candidate.rb deleted file mode 100644 index c4e04292..00000000 --- a/lib/tdlib/types/group_call_join_response_candidate.rb +++ /dev/null @@ -1,32 +0,0 @@ -module TD::Types - # Describes a join response candidate for interaction with tgcalls. - # - # @attr port [TD::Types::String] Value of the field port. - # @attr protocol [TD::Types::String] Value of the field protocol. - # @attr network [TD::Types::String] Value of the field network. - # @attr generation [TD::Types::String] Value of the field generation. - # @attr id [TD::Types::String] Value of the field id. - # @attr component [TD::Types::String] Value of the field component. - # @attr foundation [TD::Types::String] Value of the field foundation. - # @attr priority [TD::Types::String] Value of the field priority. - # @attr ip [TD::Types::String] Value of the field ip. - # @attr type [TD::Types::String] Value of the field type. - # @attr tcp_type [TD::Types::String] Value of the field tcp_type. - # @attr rel_addr [TD::Types::String] Value of the field rel_addr. - # @attr rel_port [TD::Types::String] Value of the field rel_port. - class GroupCallJoinResponseCandidate < Base - attribute :port, TD::Types::String - attribute :protocol, TD::Types::String - attribute :network, TD::Types::String - attribute :generation, TD::Types::String - attribute :id, TD::Types::String - attribute :component, TD::Types::String - attribute :foundation, TD::Types::String - attribute :priority, TD::Types::String - attribute :ip, TD::Types::String - attribute :type, TD::Types::String - attribute :tcp_type, TD::Types::String - attribute :rel_addr, TD::Types::String - attribute :rel_port, TD::Types::String - end -end diff --git a/lib/tdlib/types/group_call_participant.rb b/lib/tdlib/types/group_call_participant.rb index b21ad7e3..a4acebc8 100644 --- a/lib/tdlib/types/group_call_participant.rb +++ b/lib/tdlib/types/group_call_participant.rb @@ -2,20 +2,26 @@ module TD::Types # Represents a group call participant. # # @attr participant_id [TD::Types::MessageSender] Identifier of the group call participant. - # @attr source [Integer] User's synchronization source. + # @attr audio_source_id [Integer] User's audio channel synchronization source identifier. + # @attr screen_sharing_audio_source_id [Integer] User's screen sharing audio channel synchronization source + # identifier. + # @attr video_info [TD::Types::GroupCallParticipantVideoInfo, nil] Information about user's video channel; may be + # null if there is no active video. + # @attr screen_sharing_video_info [TD::Types::GroupCallParticipantVideoInfo, nil] Information about user's screen + # sharing video channel; may be null if there is no active screen sharing video. # @attr bio [TD::Types::String] The participant user's bio or the participant chat's description. # @attr is_current_user [Boolean] True, if the participant is the current user. # @attr is_speaking [Boolean] True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking. # @attr is_hand_raised [Boolean] True, if the participant hand is raised. # @attr can_be_muted_for_all_users [Boolean] True, if the current user can mute the participant for all other group # call participants. - # @attr can_be_unmuted_for_all_users [Boolean] True, if the current user can allow the participant to unmute themself - # or unmute the participant (if the participant is the current user). + # @attr can_be_unmuted_for_all_users [Boolean] True, if the current user can allow the participant to unmute + # themselves or unmute the participant (if the participant is the current user). # @attr can_be_muted_for_current_user [Boolean] True, if the current user can mute the participant only for self. # @attr can_be_unmuted_for_current_user [Boolean] True, if the current user can unmute the participant for self. # @attr is_muted_for_all_users [Boolean] True, if the participant is muted for all users. # @attr is_muted_for_current_user [Boolean] True, if the participant is muted for the current user. - # @attr can_unmute_self [Boolean] True, if the participant is muted for all users, but can unmute themself. + # @attr can_unmute_self [Boolean] True, if the participant is muted for all users, but can unmute themselves. # @attr volume_level [Integer] Participant's volume level; 1-20000 in hundreds of percents. # @attr order [TD::Types::String] User's order in the group call participant list. # Orders must be compared lexicographically. @@ -23,7 +29,10 @@ module TD::Types # If order is empty, the user must be removed from the participant list. class GroupCallParticipant < Base attribute :participant_id, TD::Types::MessageSender - attribute :source, TD::Types::Coercible::Integer + attribute :audio_source_id, TD::Types::Coercible::Integer + attribute :screen_sharing_audio_source_id, TD::Types::Coercible::Integer + attribute :video_info, TD::Types::GroupCallParticipantVideoInfo.optional.default(nil) + attribute :screen_sharing_video_info, TD::Types::GroupCallParticipantVideoInfo.optional.default(nil) attribute :bio, TD::Types::String attribute :is_current_user, TD::Types::Bool attribute :is_speaking, TD::Types::Bool diff --git a/lib/tdlib/types/group_call_participant_video_info.rb b/lib/tdlib/types/group_call_participant_video_info.rb new file mode 100644 index 00000000..da50e655 --- /dev/null +++ b/lib/tdlib/types/group_call_participant_video_info.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about a group call participant's video channel. + # + # @attr source_groups [Array] List of synchronization source groups of the + # video. + # @attr endpoint_id [TD::Types::String] Video channel endpoint identifier. + # @attr is_paused [Boolean] True if the video is paused. + # This flag needs to be ignored, if new video frames are received. + class GroupCallParticipantVideoInfo < Base + attribute :source_groups, TD::Types::Array.of(TD::Types::GroupCallVideoSourceGroup) + attribute :endpoint_id, TD::Types::String + attribute :is_paused, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/group_call_payload.rb b/lib/tdlib/types/group_call_payload.rb deleted file mode 100644 index 9ad17f7b..00000000 --- a/lib/tdlib/types/group_call_payload.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # Describes a payload for interaction with tgcalls. - # - # @attr ufrag [TD::Types::String] Value of the field ufrag. - # @attr pwd [TD::Types::String] Value of the field pwd. - # @attr fingerprints [Array] The list of fingerprints. - class GroupCallPayload < Base - attribute :ufrag, TD::Types::String - attribute :pwd, TD::Types::String - attribute :fingerprints, TD::Types::Array.of(TD::Types::GroupCallPayloadFingerprint) - end -end diff --git a/lib/tdlib/types/group_call_payload_fingerprint.rb b/lib/tdlib/types/group_call_payload_fingerprint.rb deleted file mode 100644 index 0ec1a7ff..00000000 --- a/lib/tdlib/types/group_call_payload_fingerprint.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # Describes a payload fingerprint for interaction with tgcalls. - # - # @attr hash [TD::Types::String] Value of the field hash. - # @attr setup [TD::Types::String] Value of the field setup. - # @attr fingerprint [TD::Types::String] Value of the field fingerprint. - class GroupCallPayloadFingerprint < Base - attribute :hash, TD::Types::String - attribute :setup, TD::Types::String - attribute :fingerprint, TD::Types::String - end -end diff --git a/lib/tdlib/types/group_call_video_quality.rb b/lib/tdlib/types/group_call_video_quality.rb new file mode 100644 index 00000000..b63c46d5 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes the quality of a group call video. + class GroupCallVideoQuality < Base + %w[ + thumbnail + medium + full + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/group_call_video_quality/#{type}" + end + end +end diff --git a/lib/tdlib/types/group_call_video_quality/full.rb b/lib/tdlib/types/group_call_video_quality/full.rb new file mode 100644 index 00000000..397de8bd --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/full.rb @@ -0,0 +1,5 @@ +module TD::Types + # The best available video quality. + class GroupCallVideoQuality::Full < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_quality/medium.rb b/lib/tdlib/types/group_call_video_quality/medium.rb new file mode 100644 index 00000000..2a17d040 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/medium.rb @@ -0,0 +1,5 @@ +module TD::Types + # The medium video quality. + class GroupCallVideoQuality::Medium < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_quality/thumbnail.rb b/lib/tdlib/types/group_call_video_quality/thumbnail.rb new file mode 100644 index 00000000..b0c54f60 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/thumbnail.rb @@ -0,0 +1,5 @@ +module TD::Types + # The worst available video quality. + class GroupCallVideoQuality::Thumbnail < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_source_group.rb b/lib/tdlib/types/group_call_video_source_group.rb new file mode 100644 index 00000000..30c7978a --- /dev/null +++ b/lib/tdlib/types/group_call_video_source_group.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a group of video synchronization source identifiers. + # + # @attr semantics [TD::Types::String] The semantics of sources, one of "SIM" or "FID". + # @attr source_ids [Array] The list of synchronization source identifiers. + class GroupCallVideoSourceGroup < Base + attribute :semantics, TD::Types::String + attribute :source_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/identity_document.rb b/lib/tdlib/types/identity_document.rb index 8ac33fc7..270eeb26 100644 --- a/lib/tdlib/types/identity_document.rb +++ b/lib/tdlib/types/identity_document.rb @@ -2,9 +2,10 @@ module TD::Types # An identity document. # # @attr number [TD::Types::String] Document number; 1-24 characters. - # @attr expiry_date [TD::Types::Date, nil] Document expiry date; may be null. + # @attr expiry_date [TD::Types::Date, nil] Document expiry date; may be null if not applicable. # @attr front_side [TD::Types::DatedFile] Front side of the document. - # @attr reverse_side [TD::Types::DatedFile] Reverse side of the document; only for driver license and identity card. + # @attr reverse_side [TD::Types::DatedFile, nil] Reverse side of the document; only for driver license and identity + # card; may be null. # @attr selfie [TD::Types::DatedFile, nil] Selfie with the document; may be null. # @attr translation [Array] List of files containing a certified English translation of the # document. @@ -12,7 +13,7 @@ class IdentityDocument < Base attribute :number, TD::Types::String attribute :expiry_date, TD::Types::Date.optional.default(nil) attribute :front_side, TD::Types::DatedFile - attribute :reverse_side, TD::Types::DatedFile + attribute :reverse_side, TD::Types::DatedFile.optional.default(nil) attribute :selfie, TD::Types::DatedFile.optional.default(nil) attribute :translation, TD::Types::Array.of(TD::Types::DatedFile) end diff --git a/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb b/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb index 8c9889c6..fb7ed938 100644 --- a/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb +++ b/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb @@ -2,7 +2,7 @@ module TD::Types # A button that forces an inline query to the bot to be inserted in the input field. # # @attr query [TD::Types::String] Inline query to be sent to the bot. - # @attr in_current_chat [Boolean] True, if the inline query should be sent from the current chat. + # @attr in_current_chat [Boolean] True, if the inline query must be sent from the current chat. class InlineKeyboardButtonType::SwitchInline < InlineKeyboardButtonType attribute :query, TD::Types::String attribute :in_current_chat, TD::Types::Bool diff --git a/lib/tdlib/types/inline_query_results.rb b/lib/tdlib/types/inline_query_results.rb index bf268e65..39c32975 100644 --- a/lib/tdlib/types/inline_query_results.rb +++ b/lib/tdlib/types/inline_query_results.rb @@ -6,8 +6,8 @@ module TD::Types # @attr next_offset [TD::Types::String] The offset for the next request. # If empty, there are no more results. # @attr results [Array] Results of the query. - # @attr switch_pm_text [TD::Types::String] If non-empty, this text should be shown on the button, which opens a - # private chat with the bot and sends the bot a start message with the switch_pm_parameter. + # @attr switch_pm_text [TD::Types::String] If non-empty, this text must be shown on the button, which opens a private + # chat with the bot and sends the bot a start message with the switch_pm_parameter. # @attr switch_pm_parameter [TD::Types::String] Parameter for the bot start message. class InlineQueryResults < Base attribute :inline_query_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_credentials/new.rb b/lib/tdlib/types/input_credentials/new.rb index cc94fda7..dd32ba9d 100644 --- a/lib/tdlib/types/input_credentials/new.rb +++ b/lib/tdlib/types/input_credentials/new.rb @@ -1,7 +1,7 @@ module TD::Types # Applies if a user enters new credentials on a payment provider website. # - # @attr data [TD::Types::String] Contains JSON-encoded data with a credential identifier from the payment provider. + # @attr data [TD::Types::String] JSON-encoded data with the credential identifier from the payment provider. # @attr allow_save [Boolean] True, if the credential identifier can be saved on the server side. class InputCredentials::New < InputCredentials attribute :data, TD::Types::String diff --git a/lib/tdlib/types/input_file/generated.rb b/lib/tdlib/types/input_file/generated.rb index 73b28e53..0f22aba8 100644 --- a/lib/tdlib/types/input_file/generated.rb +++ b/lib/tdlib/types/input_file/generated.rb @@ -3,10 +3,10 @@ module TD::Types # # @attr original_path [TD::Types::String, nil] Local path to a file from which the file is generated; may be empty if # there is no such file. - # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file; should be + # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file; must be # persistent across application restarts. # Conversions beginning with '#' are reserved for internal TDLib usage. - # @attr expected_size [Integer] Expected size of the generated file; 0 if unknown. + # @attr expected_size [Integer] Expected size of the generated file, in bytes; 0 if unknown. class InputFile::Generated < InputFile attribute :original_path, TD::Types::String.optional.default(nil) attribute :conversion, TD::Types::String diff --git a/lib/tdlib/types/input_identity_document.rb b/lib/tdlib/types/input_identity_document.rb index 63726bea..f708f02a 100644 --- a/lib/tdlib/types/input_identity_document.rb +++ b/lib/tdlib/types/input_identity_document.rb @@ -2,18 +2,19 @@ module TD::Types # An identity document to be saved to Telegram Passport. # # @attr number [TD::Types::String] Document number; 1-24 characters. - # @attr expiry_date [TD::Types::Date, nil] Document expiry date, if available. + # @attr expiry_date [TD::Types::Date] Document expiry date; pass null if not applicable. # @attr front_side [TD::Types::InputFile] Front side of the document. - # @attr reverse_side [TD::Types::InputFile] Reverse side of the document; only for driver license and identity card. - # @attr selfie [TD::Types::InputFile, nil] Selfie with the document, if available. + # @attr reverse_side [TD::Types::InputFile] Reverse side of the document; only for driver license and identity card; + # pass null otherwise. + # @attr selfie [TD::Types::InputFile] Selfie with the document; pass null if unavailable. # @attr translation [Array] List of files containing a certified English translation of the # document. class InputIdentityDocument < Base attribute :number, TD::Types::String - attribute :expiry_date, TD::Types::Date.optional.default(nil) + attribute :expiry_date, TD::Types::Date attribute :front_side, TD::Types::InputFile attribute :reverse_side, TD::Types::InputFile - attribute :selfie, TD::Types::InputFile.optional.default(nil) + attribute :selfie, TD::Types::InputFile attribute :translation, TD::Types::Array.of(TD::Types::InputFile) end end diff --git a/lib/tdlib/types/input_inline_query_result/animation.rb b/lib/tdlib/types/input_inline_query_result/animation.rb index 7642218f..d673089a 100644 --- a/lib/tdlib/types/input_inline_query_result/animation.rb +++ b/lib/tdlib/types/input_inline_query_result/animation.rb @@ -1,6 +1,5 @@ module TD::Types - # Represents a link to an animated GIF or an animated (i.e. - # without sound) H.264/MPEG-4 AVC video. + # Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video. # # @attr id [TD::Types::String] Unique identifier of the query result. # @attr title [TD::Types::String] Title of the query result. @@ -13,7 +12,7 @@ module TD::Types # @attr video_duration [Integer] Duration of the video, in seconds. # @attr video_width [Integer] Width of the video. # @attr video_height [Integer] Height of the video. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/article.rb b/lib/tdlib/types/input_inline_query_result/article.rb index 655e4e32..41226310 100644 --- a/lib/tdlib/types/input_inline_query_result/article.rb +++ b/lib/tdlib/types/input_inline_query_result/article.rb @@ -9,7 +9,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/audio.rb b/lib/tdlib/types/input_inline_query_result/audio.rb index 7b213f28..d18ad68e 100644 --- a/lib/tdlib/types/input_inline_query_result/audio.rb +++ b/lib/tdlib/types/input_inline_query_result/audio.rb @@ -6,7 +6,7 @@ module TD::Types # @attr performer [TD::Types::String] Performer of the audio file. # @attr audio_url [TD::Types::String] The URL of the audio file. # @attr audio_duration [Integer] Audio file duration, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/contact.rb b/lib/tdlib/types/input_inline_query_result/contact.rb index 39243dfd..e58ac656 100644 --- a/lib/tdlib/types/input_inline_query_result/contact.rb +++ b/lib/tdlib/types/input_inline_query_result/contact.rb @@ -6,7 +6,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/document.rb b/lib/tdlib/types/input_inline_query_result/document.rb index 4063ccde..dbec7193 100644 --- a/lib/tdlib/types/input_inline_query_result/document.rb +++ b/lib/tdlib/types/input_inline_query_result/document.rb @@ -10,7 +10,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] The URL of the file thumbnail, if it exists. # @attr thumbnail_width [Integer] Width of the thumbnail. # @attr thumbnail_height [Integer] Height of the thumbnail. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/game.rb b/lib/tdlib/types/input_inline_query_result/game.rb index 956cc609..6d9b4618 100644 --- a/lib/tdlib/types/input_inline_query_result/game.rb +++ b/lib/tdlib/types/input_inline_query_result/game.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr id [TD::Types::String] Unique identifier of the query result. # @attr game_short_name [TD::Types::String] Short name of the game. - # @attr reply_markup [TD::Types::ReplyMarkup] Message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. class InputInlineQueryResult::Game < InputInlineQueryResult attribute :id, TD::Types::String diff --git a/lib/tdlib/types/input_inline_query_result/location.rb b/lib/tdlib/types/input_inline_query_result/location.rb index e38197d7..3dc75fdc 100644 --- a/lib/tdlib/types/input_inline_query_result/location.rb +++ b/lib/tdlib/types/input_inline_query_result/location.rb @@ -9,7 +9,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/photo.rb b/lib/tdlib/types/input_inline_query_result/photo.rb index 03d77bce..45f525aa 100644 --- a/lib/tdlib/types/input_inline_query_result/photo.rb +++ b/lib/tdlib/types/input_inline_query_result/photo.rb @@ -8,7 +8,7 @@ module TD::Types # @attr photo_url [TD::Types::String] The URL of the JPEG photo (photo size must not exceed 5MB). # @attr photo_width [Integer] Width of the photo. # @attr photo_height [Integer] Height of the photo. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/sticker.rb b/lib/tdlib/types/input_inline_query_result/sticker.rb index d9431f06..ecda0899 100644 --- a/lib/tdlib/types/input_inline_query_result/sticker.rb +++ b/lib/tdlib/types/input_inline_query_result/sticker.rb @@ -6,7 +6,7 @@ module TD::Types # @attr sticker_url [TD::Types::String] The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB). # @attr sticker_width [Integer] Width of the sticker. # @attr sticker_height [Integer] Height of the sticker. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/venue.rb b/lib/tdlib/types/input_inline_query_result/venue.rb index 2c1291d3..b658b1b2 100644 --- a/lib/tdlib/types/input_inline_query_result/venue.rb +++ b/lib/tdlib/types/input_inline_query_result/venue.rb @@ -6,7 +6,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/video.rb b/lib/tdlib/types/input_inline_query_result/video.rb index b71e3a1b..54e307b3 100644 --- a/lib/tdlib/types/input_inline_query_result/video.rb +++ b/lib/tdlib/types/input_inline_query_result/video.rb @@ -11,7 +11,7 @@ module TD::Types # @attr video_width [Integer] Width of the video. # @attr video_height [Integer] Height of the video. # @attr video_duration [Integer] Video duration, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/voice_note.rb b/lib/tdlib/types/input_inline_query_result/voice_note.rb index 832b9cff..c4f1513d 100644 --- a/lib/tdlib/types/input_inline_query_result/voice_note.rb +++ b/lib/tdlib/types/input_inline_query_result/voice_note.rb @@ -5,7 +5,7 @@ module TD::Types # @attr title [TD::Types::String] Title of the voice note. # @attr voice_note_url [TD::Types::String] The URL of the voice note file. # @attr voice_note_duration [Integer] Duration of the voice note, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, diff --git a/lib/tdlib/types/input_message_content/animation.rb b/lib/tdlib/types/input_message_content/animation.rb index 7e87fab3..4d084842 100644 --- a/lib/tdlib/types/input_message_content/animation.rb +++ b/lib/tdlib/types/input_message_content/animation.rb @@ -2,16 +2,17 @@ module TD::Types # An animation message (GIF-style).. # # @attr animation [TD::Types::InputFile] Animation file to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Animation thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Animation thumbnail; pass null to skip thumbnail uploading. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the animation, if # applicable. # @attr duration [Integer] Duration of the animation, in seconds. # @attr width [Integer] Width of the animation; may be replaced by the server. # @attr height [Integer] Height of the animation; may be replaced by the server. - # @attr caption [TD::Types::FormattedText] Animation caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Animation caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. class InputMessageContent::Animation < InputMessageContent attribute :animation, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) attribute :duration, TD::Types::Coercible::Integer attribute :width, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_message_content/audio.rb b/lib/tdlib/types/input_message_content/audio.rb index 5cf443a9..331f4eee 100644 --- a/lib/tdlib/types/input_message_content/audio.rb +++ b/lib/tdlib/types/input_message_content/audio.rb @@ -2,14 +2,16 @@ module TD::Types # An audio message. # # @attr audio [TD::Types::InputFile] Audio file to be sent. - # @attr album_cover_thumbnail [TD::Types::InputThumbnail, nil] Thumbnail of the cover for the album, if available. + # @attr album_cover_thumbnail [TD::Types::InputThumbnail] Thumbnail of the cover for the album; pass null to skip + # thumbnail uploading. # @attr duration [Integer] Duration of the audio, in seconds; may be replaced by the server. # @attr title [TD::Types::String] Title of the audio; 0-64 characters; may be replaced by the server. # @attr performer [TD::Types::String] Performer of the audio; 0-64 characters, may be replaced by the server. - # @attr caption [TD::Types::FormattedText] Audio caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Audio caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. class InputMessageContent::Audio < InputMessageContent attribute :audio, TD::Types::InputFile - attribute :album_cover_thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :album_cover_thumbnail, TD::Types::InputThumbnail attribute :duration, TD::Types::Coercible::Integer attribute :title, TD::Types::String attribute :performer, TD::Types::String diff --git a/lib/tdlib/types/input_message_content/dice.rb b/lib/tdlib/types/input_message_content/dice.rb index 32f3a81f..b2457171 100644 --- a/lib/tdlib/types/input_message_content/dice.rb +++ b/lib/tdlib/types/input_message_content/dice.rb @@ -2,7 +2,7 @@ module TD::Types # A dice message. # # @attr emoji [TD::Types::String] Emoji on which the dice throw animation is based. - # @attr clear_draft [Boolean] True, if a chat message draft should be deleted. + # @attr clear_draft [Boolean] True, if the chat message draft must be deleted. class InputMessageContent::Dice < InputMessageContent attribute :emoji, TD::Types::String attribute :clear_draft, TD::Types::Bool diff --git a/lib/tdlib/types/input_message_content/document.rb b/lib/tdlib/types/input_message_content/document.rb index 307a72ce..b3ab5cdb 100644 --- a/lib/tdlib/types/input_message_content/document.rb +++ b/lib/tdlib/types/input_message_content/document.rb @@ -2,14 +2,15 @@ module TD::Types # A document message (general file). # # @attr document [TD::Types::InputFile] Document to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Document thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Document thumbnail; pass null to skip thumbnail uploading. # @attr disable_content_type_detection [Boolean] If true, automatic file type detection will be disabled and the # document will be always sent as file. # Always true for files sent to secret chats. - # @attr caption [TD::Types::FormattedText] Document caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Document caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. class InputMessageContent::Document < InputMessageContent attribute :document, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :disable_content_type_detection, TD::Types::Bool attribute :caption, TD::Types::FormattedText end diff --git a/lib/tdlib/types/input_message_content/forwarded.rb b/lib/tdlib/types/input_message_content/forwarded.rb index 516fbb74..57330fd9 100644 --- a/lib/tdlib/types/input_message_content/forwarded.rb +++ b/lib/tdlib/types/input_message_content/forwarded.rb @@ -3,10 +3,10 @@ module TD::Types # # @attr from_chat_id [Integer] Identifier for the chat this forwarded message came from. # @attr message_id [Integer] Identifier of the message to forward. - # @attr in_game_share [Boolean] True, if a game message should be shared within a launched game; applies only to game + # @attr in_game_share [Boolean] True, if a game message is being shared from a launched game; applies only to game # messages. - # @attr copy_options [TD::Types::MessageCopyOptions] Options to be used to copy content of the message without a link - # to the original message. + # @attr copy_options [TD::Types::MessageCopyOptions] Options to be used to copy content of the message without + # reference to the original sender; pass null to try to forward the message as usual. class InputMessageContent::Forwarded < InputMessageContent attribute :from_chat_id, TD::Types::Coercible::Integer attribute :message_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_message_content/location.rb b/lib/tdlib/types/input_message_content/location.rb index cd204ed8..c510ae0f 100644 --- a/lib/tdlib/types/input_message_content/location.rb +++ b/lib/tdlib/types/input_message_content/location.rb @@ -2,8 +2,8 @@ module TD::Types # A message with a location. # # @attr location [TD::Types::Location] Location to be sent. - # @attr live_period [Integer] Period for which the location can be updated, in seconds; should be between 60 and - # 86400 for a live location and 0 otherwise. + # @attr live_period [Integer] Period for which the location can be updated, in seconds; must be between 60 and 86400 + # for a live location and 0 otherwise. # @attr heading [Integer] For live locations, a direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @attr proximity_alert_radius [Integer] For live locations, a maximum distance to another chat member for proximity diff --git a/lib/tdlib/types/input_message_content/photo.rb b/lib/tdlib/types/input_message_content/photo.rb index 1b05c39f..3f09f8bb 100644 --- a/lib/tdlib/types/input_message_content/photo.rb +++ b/lib/tdlib/types/input_message_content/photo.rb @@ -2,12 +2,13 @@ module TD::Types # A photo message. # # @attr photo [TD::Types::InputFile] Photo to send. - # @attr thumbnail [TD::Types::InputThumbnail] Photo thumbnail to be sent, this is sent to the other party in secret - # chats only. + # @attr thumbnail [TD::Types::InputThumbnail] Photo thumbnail to be sent; pass null to skip thumbnail uploading. + # The thumbnail is sent to the other party only in secret chats. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the photo, if applicable. # @attr width [Integer] Photo width. # @attr height [Integer] Photo height. - # @attr caption [TD::Types::FormattedText] Photo caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Photo caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. # @attr ttl [Integer] Photo TTL (Time To Live), in seconds (0-60). # A non-zero TTL can be specified only in private chats. class InputMessageContent::Photo < InputMessageContent diff --git a/lib/tdlib/types/input_message_content/sticker.rb b/lib/tdlib/types/input_message_content/sticker.rb index cd03881b..810a6968 100644 --- a/lib/tdlib/types/input_message_content/sticker.rb +++ b/lib/tdlib/types/input_message_content/sticker.rb @@ -2,13 +2,13 @@ module TD::Types # A sticker message. # # @attr sticker [TD::Types::InputFile] Sticker to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Sticker thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Sticker thumbnail; pass null to skip thumbnail uploading. # @attr width [Integer] Sticker width. # @attr height [Integer] Sticker height. # @attr emoji [TD::Types::String] Emoji used to choose the sticker. class InputMessageContent::Sticker < InputMessageContent attribute :sticker, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :emoji, TD::Types::String diff --git a/lib/tdlib/types/input_message_content/text.rb b/lib/tdlib/types/input_message_content/text.rb index 6fb1529a..b147dd37 100644 --- a/lib/tdlib/types/input_message_content/text.rb +++ b/lib/tdlib/types/input_message_content/text.rb @@ -4,9 +4,9 @@ module TD::Types # @attr text [TD::Types::FormattedText] Formatted text to be sent; 1-GetOption("message_text_length_max") characters. # Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to # be specified manually. - # @attr disable_web_page_preview [Boolean] True, if rich web page previews for URLs in the message text should be + # @attr disable_web_page_preview [Boolean] True, if rich web page previews for URLs in the message text must be # disabled. - # @attr clear_draft [Boolean] True, if a chat message draft should be deleted. + # @attr clear_draft [Boolean] True, if a chat message draft must be deleted. class InputMessageContent::Text < InputMessageContent attribute :text, TD::Types::FormattedText attribute :disable_web_page_preview, TD::Types::Bool diff --git a/lib/tdlib/types/input_message_content/video.rb b/lib/tdlib/types/input_message_content/video.rb index d6fb847a..e025513b 100644 --- a/lib/tdlib/types/input_message_content/video.rb +++ b/lib/tdlib/types/input_message_content/video.rb @@ -2,18 +2,19 @@ module TD::Types # A video message. # # @attr video [TD::Types::InputFile] Video to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Video thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Video thumbnail; pass null to skip thumbnail uploading. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the video, if applicable. # @attr duration [Integer] Duration of the video, in seconds. # @attr width [Integer] Video width. # @attr height [Integer] Video height. - # @attr supports_streaming [Boolean] True, if the video should be tried to be streamed. - # @attr caption [TD::Types::FormattedText] Video caption; 0-GetOption("message_caption_length_max") characters. + # @attr supports_streaming [Boolean] True, if the video is supposed to be streamed. + # @attr caption [TD::Types::FormattedText] Video caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. # @attr ttl [Integer] Video TTL (Time To Live), in seconds (0-60). # A non-zero TTL can be specified only in private chats. class InputMessageContent::Video < InputMessageContent attribute :video, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) attribute :duration, TD::Types::Coercible::Integer attribute :width, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_message_content/video_note.rb b/lib/tdlib/types/input_message_content/video_note.rb index 95781277..2eca9732 100644 --- a/lib/tdlib/types/input_message_content/video_note.rb +++ b/lib/tdlib/types/input_message_content/video_note.rb @@ -2,12 +2,12 @@ module TD::Types # A video note message. # # @attr video_note [TD::Types::InputFile] Video note to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Video thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Video thumbnail; pass null to skip thumbnail uploading. # @attr duration [Integer] Duration of the video, in seconds. # @attr length [Integer] Video width and height; must be positive and not greater than 640. class InputMessageContent::VideoNote < InputMessageContent attribute :video_note, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :duration, TD::Types::Coercible::Integer attribute :length, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/input_message_content/voice_note.rb b/lib/tdlib/types/input_message_content/voice_note.rb index 0e2e0718..de61ba4f 100644 --- a/lib/tdlib/types/input_message_content/voice_note.rb +++ b/lib/tdlib/types/input_message_content/voice_note.rb @@ -4,7 +4,8 @@ module TD::Types # @attr voice_note [TD::Types::InputFile] Voice note to be sent. # @attr duration [Integer] Duration of the voice note, in seconds. # @attr waveform [String] Waveform representation of the voice note, in 5-bit format. - # @attr caption [TD::Types::FormattedText] Voice note caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Voice note caption; pass null to use an empty caption; + # 0-GetOption("message_caption_length_max") characters. class InputMessageContent::VoiceNote < InputMessageContent attribute :voice_note, TD::Types::InputFile attribute :duration, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_sticker/static.rb b/lib/tdlib/types/input_sticker/static.rb index b5f52c13..062ebd1f 100644 --- a/lib/tdlib/types/input_sticker/static.rb +++ b/lib/tdlib/types/input_sticker/static.rb @@ -4,11 +4,11 @@ module TD::Types # @attr sticker [TD::Types::InputFile] PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 # square. # @attr emojis [TD::Types::String] Emojis corresponding to the sticker. - # @attr mask_position [TD::Types::MaskPosition, nil] For masks, position where the mask should be placed; may be - # null. + # @attr mask_position [TD::Types::MaskPosition] For masks, position where the mask is placed; pass null if + # unspecified. class InputSticker::Static < InputSticker attribute :sticker, TD::Types::InputFile attribute :emojis, TD::Types::String - attribute :mask_position, TD::Types::MaskPosition.optional.default(nil) + attribute :mask_position, TD::Types::MaskPosition end end diff --git a/lib/tdlib/types/internal_link_type.rb b/lib/tdlib/types/internal_link_type.rb new file mode 100644 index 00000000..2d624b80 --- /dev/null +++ b/lib/tdlib/types/internal_link_type.rb @@ -0,0 +1,33 @@ +module TD::Types + # Describes an internal https://t.me or tg: link, which must be processed by the app in a special way. + class InternalLinkType < Base + %w[ + active_sessions + authentication_code + background + bot_start + bot_start_in_group + change_phone_number + chat_invite + filter_settings + game + language_pack + message + message_draft + passport_data_request + phone_number_confirmation + proxy + public_chat + qr_code_authentication + settings + sticker_set + theme + theme_settings + unknown_deep_link + unsupported_proxy + video_chat + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/internal_link_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/internal_link_type/active_sessions.rb b/lib/tdlib/types/internal_link_type/active_sessions.rb new file mode 100644 index 00000000..b64152a8 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/active_sessions.rb @@ -0,0 +1,6 @@ +module TD::Types + # The link is a link to the active sessions section of the app. + # Use getActiveSessions to handle the link. + class InternalLinkType::ActiveSessions < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/authentication_code.rb b/lib/tdlib/types/internal_link_type/authentication_code.rb new file mode 100644 index 00000000..00385859 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/authentication_code.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link contains an authentication code. + # Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode. + # + # @attr code [TD::Types::String] The authentication code. + class InternalLinkType::AuthenticationCode < InternalLinkType + attribute :code, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/background.rb b/lib/tdlib/types/internal_link_type/background.rb new file mode 100644 index 00000000..29d32c77 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/background.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a background. + # Call searchBackground with the given background name to process the link. + # + # @attr background_name [TD::Types::String] Name of the background. + class InternalLinkType::Background < InternalLinkType + attribute :background_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/bot_start.rb b/lib/tdlib/types/internal_link_type/bot_start.rb new file mode 100644 index 00000000..2b9c7513 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/bot_start.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a chat with a Telegram bot. + # Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with + # the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr start_parameter [TD::Types::String] The parameter to be passed to sendBotStartMessage. + class InternalLinkType::BotStart < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :start_parameter, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/bot_start_in_group.rb b/lib/tdlib/types/internal_link_type/bot_start_in_group.rb new file mode 100644 index 00000000..c95b257c --- /dev/null +++ b/lib/tdlib/types/internal_link_type/bot_start_in_group.rb @@ -0,0 +1,14 @@ +module TD::Types + # The link is a link to a Telegram bot, which is supposed to be added to a group chat. + # Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the + # current user to select a group to add the bot to, and then call sendBotStartMessage with the given start parameter and + # the chosen group chat. + # Bots can be added to a public group only by administrators of the group. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr start_parameter [TD::Types::String] The parameter to be passed to sendBotStartMessage. + class InternalLinkType::BotStartInGroup < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :start_parameter, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/change_phone_number.rb b/lib/tdlib/types/internal_link_type/change_phone_number.rb new file mode 100644 index 00000000..458b1b50 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/change_phone_number.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the change phone number section of the app. + class InternalLinkType::ChangePhoneNumber < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/chat_invite.rb b/lib/tdlib/types/internal_link_type/chat_invite.rb new file mode 100644 index 00000000..0e6524ee --- /dev/null +++ b/lib/tdlib/types/internal_link_type/chat_invite.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a chat invite link. + # Call checkChatInviteLink with the given invite link to process the link. + # + # @attr invite_link [TD::Types::String] Internal representation of the invite link. + class InternalLinkType::ChatInvite < InternalLinkType + attribute :invite_link, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/filter_settings.rb b/lib/tdlib/types/internal_link_type/filter_settings.rb new file mode 100644 index 00000000..ab1b744d --- /dev/null +++ b/lib/tdlib/types/internal_link_type/filter_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the filter settings section of the app. + class InternalLinkType::FilterSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/game.rb b/lib/tdlib/types/internal_link_type/game.rb new file mode 100644 index 00000000..eabf0705 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/game.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a game. + # Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a + # chat to send the game, and then call sendMessage with inputMessageGame. + # + # @attr bot_username [TD::Types::String] Username of the bot that owns the game. + # @attr game_short_name [TD::Types::String] Short name of the game. + class InternalLinkType::Game < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :game_short_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/language_pack.rb b/lib/tdlib/types/internal_link_type/language_pack.rb new file mode 100644 index 00000000..3e909807 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/language_pack.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a language pack. + # Call getLanguagePackInfo with the given language pack identifier to process the link. + # + # @attr language_pack_id [TD::Types::String] Language pack identifier. + class InternalLinkType::LanguagePack < InternalLinkType + attribute :language_pack_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/message.rb b/lib/tdlib/types/internal_link_type/message.rb new file mode 100644 index 00000000..72339a84 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/message.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a Telegram message. + # Call getMessageLinkInfo with the given URL to process the link. + # + # @attr url [TD::Types::String] URL to be passed to getMessageLinkInfo. + class InternalLinkType::Message < InternalLinkType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/message_draft.rb b/lib/tdlib/types/internal_link_type/message_draft.rb new file mode 100644 index 00000000..9447933b --- /dev/null +++ b/lib/tdlib/types/internal_link_type/message_draft.rb @@ -0,0 +1,13 @@ +module TD::Types + # The link contains a message draft text. + # A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the + # input field. + # + # @attr text [TD::Types::FormattedText] Message draft text. + # @attr contains_link [Boolean] True, if the first line of the text contains a link. + # If true, the input field needs to be focused and the text after the link must be selected. + class InternalLinkType::MessageDraft < InternalLinkType + attribute :text, TD::Types::FormattedText + attribute :contains_link, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/passport_data_request.rb b/lib/tdlib/types/internal_link_type/passport_data_request.rb new file mode 100644 index 00000000..4f0af540 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/passport_data_request.rb @@ -0,0 +1,21 @@ +module TD::Types + # The link contains a request of Telegram passport data. + # Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from + # outside of the app, otherwise ignore it. + # + # @attr bot_user_id [Integer] User identifier of the service's bot. + # @attr scope [TD::Types::String] Telegram Passport element types requested by the service. + # @attr public_key [TD::Types::String] Service's public key. + # @attr nonce [TD::Types::String] Unique request identifier provided by the service. + # @attr callback_url [TD::Types::String] An HTTP URL to open once the request is finished or canceled with the + # parameter tg_passport=success or tg_passport=cancel respectively. + # If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be + # opened instead. + class InternalLinkType::PassportDataRequest < InternalLinkType + attribute :bot_user_id, TD::Types::Coercible::Integer + attribute :scope, TD::Types::String + attribute :public_key, TD::Types::String + attribute :nonce, TD::Types::String + attribute :callback_url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb b/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb new file mode 100644 index 00000000..c2e84d0d --- /dev/null +++ b/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link can be used to confirm ownership of a phone number to prevent account deletion. + # Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link. + # + # @attr hash [TD::Types::String] Hash value from the link. + # @attr phone_number [TD::Types::String] Phone number value from the link. + class InternalLinkType::PhoneNumberConfirmation < InternalLinkType + attribute :hash, TD::Types::String + attribute :phone_number, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/proxy.rb b/lib/tdlib/types/internal_link_type/proxy.rb new file mode 100644 index 00000000..a8cb4cfd --- /dev/null +++ b/lib/tdlib/types/internal_link_type/proxy.rb @@ -0,0 +1,13 @@ +module TD::Types + # The link is a link to a proxy. + # Call addProxy with the given parameters to process the link and add the proxy. + # + # @attr server [TD::Types::String] Proxy server IP address. + # @attr port [Integer] Proxy server port. + # @attr type [TD::Types::ProxyType] Type of the proxy. + class InternalLinkType::Proxy < InternalLinkType + attribute :server, TD::Types::String + attribute :port, TD::Types::Coercible::Integer + attribute :type, TD::Types::ProxyType + end +end diff --git a/lib/tdlib/types/internal_link_type/public_chat.rb b/lib/tdlib/types/internal_link_type/public_chat.rb new file mode 100644 index 00000000..519d9f74 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/public_chat.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a chat by its username. + # Call searchPublicChat with the given chat username to process the link. + # + # @attr chat_username [TD::Types::String] Username of the chat. + class InternalLinkType::PublicChat < InternalLinkType + attribute :chat_username, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/qr_code_authentication.rb b/lib/tdlib/types/internal_link_type/qr_code_authentication.rb new file mode 100644 index 00000000..d7c42718 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/qr_code_authentication.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app + # camera. + # An alert similar to "This code can be used to allow someone to log in to your Telegram account. + # To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown. + class InternalLinkType::QrCodeAuthentication < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/settings.rb b/lib/tdlib/types/internal_link_type/settings.rb new file mode 100644 index 00000000..8e12f04a --- /dev/null +++ b/lib/tdlib/types/internal_link_type/settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to app settings. + class InternalLinkType::Settings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/sticker_set.rb b/lib/tdlib/types/internal_link_type/sticker_set.rb new file mode 100644 index 00000000..20b7fa16 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/sticker_set.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a sticker set. + # Call searchStickerSet with the given sticker set name to process the link and show the sticker set. + # + # @attr sticker_set_name [TD::Types::String] Name of the sticker set. + class InternalLinkType::StickerSet < InternalLinkType + attribute :sticker_set_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/theme.rb b/lib/tdlib/types/internal_link_type/theme.rb new file mode 100644 index 00000000..38e34707 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a theme. + # TDLib has no theme support yet. + # + # @attr theme_name [TD::Types::String] Name of the theme. + class InternalLinkType::Theme < InternalLinkType + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/theme_settings.rb b/lib/tdlib/types/internal_link_type/theme_settings.rb new file mode 100644 index 00000000..65b0caf9 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/theme_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the theme settings section of the app. + class InternalLinkType::ThemeSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/unknown_deep_link.rb b/lib/tdlib/types/internal_link_type/unknown_deep_link.rb new file mode 100644 index 00000000..ea3f1d1a --- /dev/null +++ b/lib/tdlib/types/internal_link_type/unknown_deep_link.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is an unknown tg: link. + # Call getDeepLinkInfo to process the link. + # + # @attr link [TD::Types::String] Link to be passed to getDeepLinkInfo. + class InternalLinkType::UnknownDeepLink < InternalLinkType + attribute :link, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/unsupported_proxy.rb b/lib/tdlib/types/internal_link_type/unsupported_proxy.rb new file mode 100644 index 00000000..e094d095 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/unsupported_proxy.rb @@ -0,0 +1,6 @@ +module TD::Types + # The link is a link to an unsupported proxy. + # An alert can be shown to the user. + class InternalLinkType::UnsupportedProxy < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/video_chat.rb b/lib/tdlib/types/internal_link_type/video_chat.rb new file mode 100644 index 00000000..fd39b34e --- /dev/null +++ b/lib/tdlib/types/internal_link_type/video_chat.rb @@ -0,0 +1,16 @@ +module TD::Types + # The link is a link to a video chat. + # Call searchPublicChat with the given chat username, and then joinGoupCall with the given invite hash to process the + # link. + # + # @attr chat_username [TD::Types::String] Username of the chat with the video chat. + # @attr invite_hash [TD::Types::String] If non-empty, invite hash to be used to join the video chat without being + # muted by administrators. + # @attr is_live_stream [Boolean] True, if the video chat is expected to be a live stream in a channel or a broadcast + # group. + class InternalLinkType::VideoChat < InternalLinkType + attribute :chat_username, TD::Types::String + attribute :invite_hash, TD::Types::String + attribute :is_live_stream, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/keyboard_button_type/text.rb b/lib/tdlib/types/keyboard_button_type/text.rb index d1a172f1..107f30b2 100644 --- a/lib/tdlib/types/keyboard_button_type/text.rb +++ b/lib/tdlib/types/keyboard_button_type/text.rb @@ -1,5 +1,5 @@ module TD::Types - # A simple button, with text that should be sent when the button is pressed. + # A simple button, with text that must be sent when the button is pressed. class KeyboardButtonType::Text < KeyboardButtonType end end diff --git a/lib/tdlib/types/language_pack_info.rb b/lib/tdlib/types/language_pack_info.rb index d70ac122..29b5ed3e 100644 --- a/lib/tdlib/types/language_pack_info.rb +++ b/lib/tdlib/types/language_pack_info.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr id [TD::Types::String] Unique language pack identifier. # @attr base_language_pack_id [TD::Types::String, nil] Identifier of a base language pack; may be empty. - # If a string is missed in the language pack, then it should be fetched from base language pack. + # If a string is missed in the language pack, then it must be fetched from base language pack. # Unsupported in custom language packs. # @attr name [TD::Types::String] Language name. # @attr native_name [TD::Types::String] Name of the language in that language. diff --git a/lib/tdlib/types/language_pack_string.rb b/lib/tdlib/types/language_pack_string.rb index 99873444..cf5f9dff 100644 --- a/lib/tdlib/types/language_pack_string.rb +++ b/lib/tdlib/types/language_pack_string.rb @@ -2,7 +2,8 @@ module TD::Types # Represents one language pack string. # # @attr key [TD::Types::String] String key. - # @attr value [TD::Types::LanguagePackStringValue] String value. + # @attr value [TD::Types::LanguagePackStringValue] String value; pass null if the string needs to be taken from the + # built-in English language pack. class LanguagePackString < Base attribute :key, TD::Types::String attribute :value, TD::Types::LanguagePackStringValue diff --git a/lib/tdlib/types/language_pack_string_value/deleted.rb b/lib/tdlib/types/language_pack_string_value/deleted.rb index 99a05ea0..6ce65cb0 100644 --- a/lib/tdlib/types/language_pack_string_value/deleted.rb +++ b/lib/tdlib/types/language_pack_string_value/deleted.rb @@ -1,5 +1,5 @@ module TD::Types - # A deleted language pack string, the value should be taken from the built-in english language pack. + # A deleted language pack string, the value must be taken from the built-in English language pack. class LanguagePackStringValue::Deleted < LanguagePackStringValue end end diff --git a/lib/tdlib/types/local_file.rb b/lib/tdlib/types/local_file.rb index 3ccddf4c..c90ae197 100644 --- a/lib/tdlib/types/local_file.rb +++ b/lib/tdlib/types/local_file.rb @@ -11,9 +11,9 @@ module TD::Types # downloaded_prefix_size is calculated from this offset. # @attr downloaded_prefix_size [Integer] If is_downloading_completed is false, then only some prefix of the file # starting from download_offset is ready to be read. - # downloaded_prefix_size is the size of that prefix. - # @attr downloaded_size [Integer] Total downloaded file bytes. - # Should be used only for calculating download progress. + # downloaded_prefix_size is the size of that prefix in bytes. + # @attr downloaded_size [Integer] Total downloaded file size, in bytes. + # Can be used only for calculating download progress. # The actual file size may be bigger, and some parts of it may contain garbage. class LocalFile < Base attribute :path, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/log_stream/file.rb b/lib/tdlib/types/log_stream/file.rb index e819a2d2..9dcf9b0f 100644 --- a/lib/tdlib/types/log_stream/file.rb +++ b/lib/tdlib/types/log_stream/file.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr path [TD::Types::String] Path to the file to where the internal TDLib log will be written. # @attr max_file_size [Integer] The maximum size of the file to where the internal TDLib log is written before the - # file will be auto-rotated. + # file will be auto-rotated, in bytes. # @attr redirect_stderr [Boolean] Pass true to additionally redirect stderr to the log file. # Ignored on Windows. class LogStream::File < LogStream diff --git a/lib/tdlib/types/mask_point.rb b/lib/tdlib/types/mask_point.rb index dc41f195..8fc74ac9 100644 --- a/lib/tdlib/types/mask_point.rb +++ b/lib/tdlib/types/mask_point.rb @@ -1,5 +1,5 @@ module TD::Types - # Part of the face, relative to which a mask should be placed. + # Part of the face, relative to which a mask is placed. class MaskPoint < Base %w[ forehead diff --git a/lib/tdlib/types/mask_point/chin.rb b/lib/tdlib/types/mask_point/chin.rb index b9174d76..e272b9ad 100644 --- a/lib/tdlib/types/mask_point/chin.rb +++ b/lib/tdlib/types/mask_point/chin.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the chin. + # The mask is placed relatively to the chin. class MaskPoint::Chin < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/eyes.rb b/lib/tdlib/types/mask_point/eyes.rb index 90bb21e3..26edf353 100644 --- a/lib/tdlib/types/mask_point/eyes.rb +++ b/lib/tdlib/types/mask_point/eyes.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the eyes. + # The mask is placed relatively to the eyes. class MaskPoint::Eyes < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/forehead.rb b/lib/tdlib/types/mask_point/forehead.rb index 611a1ba7..05f46781 100644 --- a/lib/tdlib/types/mask_point/forehead.rb +++ b/lib/tdlib/types/mask_point/forehead.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the forehead. + # The mask is placed relatively to the forehead. class MaskPoint::Forehead < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/mouth.rb b/lib/tdlib/types/mask_point/mouth.rb index 7f9676d4..d6889511 100644 --- a/lib/tdlib/types/mask_point/mouth.rb +++ b/lib/tdlib/types/mask_point/mouth.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the mouth. + # The mask is placed relatively to the mouth. class MaskPoint::Mouth < MaskPoint end end diff --git a/lib/tdlib/types/mask_position.rb b/lib/tdlib/types/mask_position.rb index 44df2119..ac69daa9 100644 --- a/lib/tdlib/types/mask_position.rb +++ b/lib/tdlib/types/mask_position.rb @@ -1,7 +1,7 @@ module TD::Types - # Position on a photo where a mask should be placed. + # Position on a photo where a mask is placed. # - # @attr point [TD::Types::MaskPoint] Part of the face, relative to which the mask should be placed. + # @attr point [TD::Types::MaskPoint] Part of the face, relative to which the mask is placed. # @attr x_shift [Float] Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. # (For example, -1.0 will place the mask just to the left of the default mask position). # @attr y_shift [Float] Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. diff --git a/lib/tdlib/types/message.rb b/lib/tdlib/types/message.rb index 44a0a8e3..ac4f6a70 100644 --- a/lib/tdlib/types/message.rb +++ b/lib/tdlib/types/message.rb @@ -4,10 +4,8 @@ module TD::Types # @attr id [Integer] Message identifier; unique for the chat to which the message belongs. # @attr sender [TD::Types::MessageSender] The sender of the message. # @attr chat_id [Integer] Chat identifier. - # @attr sending_state [TD::Types::MessageSendingState, nil] Information about the sending state of the message; may - # be null. - # @attr scheduling_state [TD::Types::MessageSchedulingState, nil] Information about the scheduling state of the - # message; may be null. + # @attr sending_state [TD::Types::MessageSendingState, nil] The sending state of the message; may be null. + # @attr scheduling_state [TD::Types::MessageSchedulingState, nil] The scheduling state of the message; may be null. # @attr is_outgoing [Boolean] True, if the message is outgoing. # @attr is_pinned [Boolean] True, if the message is pinned. # @attr can_be_edited [Boolean] True, if the message can be edited. @@ -19,6 +17,12 @@ module TD::Types # @attr can_be_deleted_for_all_users [Boolean] True, if the message can be deleted for all users. # @attr can_get_statistics [Boolean] True, if the message statistics are available. # @attr can_get_message_thread [Boolean] True, if the message thread info is available. + # @attr can_get_viewers [Boolean] True, if chat members already viewed the message can be received through + # getMessageViewers. + # @attr can_get_media_timestamp_links [Boolean] True, if media timestamp links can be generated for media timestamp + # entities in the message text, caption or web page description. + # @attr has_timestamped_media [Boolean] True, if media timestamp entities refers to a media in this message as + # opposed to a media in the replied message. # @attr is_channel_post [Boolean] True, if the message is a channel post. # All messages to channels are channel posts, all other messages are not channel posts. # @attr contains_unread_mention [Boolean] True, if the message contains an unread mention for the current user. @@ -36,6 +40,7 @@ module TD::Types # @attr ttl [Integer] For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. # TDLib will send {TD::Types::Update::DeleteMessages} or {TD::Types::Update::MessageContent} once the TTL expires. # @attr ttl_expires_in [Float] Time left before the message expires, in seconds. + # If the TTL timer isn't started yet, equals to the value of the ttl field. # @attr via_bot_user_id [Integer] If non-zero, the user identifier of the bot through which this message was sent. # @attr author_signature [TD::Types::String, nil] For channel posts and anonymous group messages, optional author # signature. @@ -59,6 +64,9 @@ class Message < Base attribute :can_be_deleted_for_all_users, TD::Types::Bool attribute :can_get_statistics, TD::Types::Bool attribute :can_get_message_thread, TD::Types::Bool + attribute :can_get_viewers, TD::Types::Bool + attribute :can_get_media_timestamp_links, TD::Types::Bool + attribute :has_timestamped_media, TD::Types::Bool attribute :is_channel_post, TD::Types::Bool attribute :contains_unread_mention, TD::Types::Bool attribute :date, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/message_calendar.rb b/lib/tdlib/types/message_calendar.rb new file mode 100644 index 00000000..ca197199 --- /dev/null +++ b/lib/tdlib/types/message_calendar.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about found messages, splitted by days according to the option "utc_time_offset". + # + # @attr total_count [Integer] Total number of found messages. + # @attr days [Array] Information about messages sent. + class MessageCalendar < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :days, TD::Types::Array.of(TD::Types::MessageCalendarDay) + end +end diff --git a/lib/tdlib/types/message_calendar_day.rb b/lib/tdlib/types/message_calendar_day.rb new file mode 100644 index 00000000..9ff5bc96 --- /dev/null +++ b/lib/tdlib/types/message_calendar_day.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about found messages sent in a specific day. + # + # @attr total_count [Integer] Total number of found messages sent in the day. + # @attr message [TD::Types::Message] First message sent in the day. + class MessageCalendarDay < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :message, TD::Types::Message + end +end diff --git a/lib/tdlib/types/message_content.rb b/lib/tdlib/types/message_content.rb index ccc16953..fc6be19b 100644 --- a/lib/tdlib/types/message_content.rb +++ b/lib/tdlib/types/message_content.rb @@ -16,15 +16,16 @@ class MessageContent < Base location venue contact + animated_emoji dice game poll invoice call - voice_chat_scheduled - voice_chat_started - voice_chat_ended - invite_voice_chat_participants + video_chat_scheduled + video_chat_started + video_chat_ended + invite_video_chat_participants basic_group_chat_create supergroup_chat_create chat_change_title @@ -32,11 +33,13 @@ class MessageContent < Base chat_delete_photo chat_add_members chat_join_by_link + chat_join_by_request chat_delete_member chat_upgrade_to chat_upgrade_from pin_message screenshot_taken + chat_set_theme chat_set_ttl custom_service_action game_score diff --git a/lib/tdlib/types/message_content/animated_emoji.rb b/lib/tdlib/types/message_content/animated_emoji.rb new file mode 100644 index 00000000..4120e8ff --- /dev/null +++ b/lib/tdlib/types/message_content/animated_emoji.rb @@ -0,0 +1,10 @@ +module TD::Types + # A message with an animated emoji. + # + # @attr animated_emoji [TD::Types::AnimatedEmoji] The animated emoji. + # @attr emoji [TD::Types::String] The corresponding emoji. + class MessageContent::AnimatedEmoji < MessageContent + attribute :animated_emoji, TD::Types::AnimatedEmoji + attribute :emoji, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/chat_join_by_request.rb b/lib/tdlib/types/message_content/chat_join_by_request.rb new file mode 100644 index 00000000..accaad6c --- /dev/null +++ b/lib/tdlib/types/message_content/chat_join_by_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # A new member was accepted to the chat by an administrator. + class MessageContent::ChatJoinByRequest < MessageContent + end +end diff --git a/lib/tdlib/types/message_content/chat_set_theme.rb b/lib/tdlib/types/message_content/chat_set_theme.rb new file mode 100644 index 00000000..8ac32d33 --- /dev/null +++ b/lib/tdlib/types/message_content/chat_set_theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # A theme in the chat has been changed. + # + # @attr theme_name [TD::Types::String] If non-empty, name of a new theme, set for the chat. + # Otherwise chat theme was reset to the default one. + class MessageContent::ChatSetTheme < MessageContent + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/invite_video_chat_participants.rb b/lib/tdlib/types/message_content/invite_video_chat_participants.rb new file mode 100644 index 00000000..a4b84ffa --- /dev/null +++ b/lib/tdlib/types/message_content/invite_video_chat_participants.rb @@ -0,0 +1,11 @@ +module TD::Types + # A message with information about an invite to a video chat. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + # @attr user_ids [Array] Invited user identifiers. + class MessageContent::InviteVideoChatParticipants < MessageContent + attribute :group_call_id, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/message_content/invite_voice_chat_participants.rb b/lib/tdlib/types/message_content/invite_voice_chat_participants.rb deleted file mode 100644 index 348e6e46..00000000 --- a/lib/tdlib/types/message_content/invite_voice_chat_participants.rb +++ /dev/null @@ -1,11 +0,0 @@ -module TD::Types - # A message with information about an invite to a voice chat. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - # @attr user_ids [Array] Invited user identifiers. - class MessageContent::InviteVoiceChatParticipants < MessageContent - attribute :group_call_id, TD::Types::Coercible::Integer - attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) - end -end diff --git a/lib/tdlib/types/message_content/invoice.rb b/lib/tdlib/types/message_content/invoice.rb index 24032bfb..993bd7f3 100644 --- a/lib/tdlib/types/message_content/invoice.rb +++ b/lib/tdlib/types/message_content/invoice.rb @@ -9,7 +9,7 @@ module TD::Types # @attr start_parameter [TD::Types::String] Unique invoice bot start_parameter. # To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}. # @attr is_test [Boolean] True, if the invoice is a test invoice. - # @attr need_shipping_address [Boolean] True, if the shipping address should be specified. + # @attr need_shipping_address [Boolean] True, if the shipping address must be specified. # @attr receipt_message_id [Integer] The identifier of the message with the receipt, after the product has been # purchased. class MessageContent::Invoice < MessageContent diff --git a/lib/tdlib/types/message_content/video_chat_ended.rb b/lib/tdlib/types/message_content/video_chat_ended.rb new file mode 100644 index 00000000..0356dbd9 --- /dev/null +++ b/lib/tdlib/types/message_content/video_chat_ended.rb @@ -0,0 +1,8 @@ +module TD::Types + # A message with information about an ended video chat. + # + # @attr duration [Integer] Call duration, in seconds. + class MessageContent::VideoChatEnded < MessageContent + attribute :duration, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/voice_chat_scheduled.rb b/lib/tdlib/types/message_content/video_chat_scheduled.rb similarity index 56% rename from lib/tdlib/types/message_content/voice_chat_scheduled.rb rename to lib/tdlib/types/message_content/video_chat_scheduled.rb index e876918b..56bef5ef 100644 --- a/lib/tdlib/types/message_content/voice_chat_scheduled.rb +++ b/lib/tdlib/types/message_content/video_chat_scheduled.rb @@ -1,11 +1,11 @@ module TD::Types - # A new voice chat was scheduled. + # A new video chat was scheduled. # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. # @attr start_date [Integer] Point in time (Unix timestamp) when the group call is supposed to be started by an # administrator. - class MessageContent::VoiceChatScheduled < MessageContent + class MessageContent::VideoChatScheduled < MessageContent attribute :group_call_id, TD::Types::Coercible::Integer attribute :start_date, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/message_content/video_chat_started.rb b/lib/tdlib/types/message_content/video_chat_started.rb new file mode 100644 index 00000000..9e2b18f9 --- /dev/null +++ b/lib/tdlib/types/message_content/video_chat_started.rb @@ -0,0 +1,9 @@ +module TD::Types + # A newly created video chat. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class MessageContent::VideoChatStarted < MessageContent + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/voice_chat_ended.rb b/lib/tdlib/types/message_content/voice_chat_ended.rb deleted file mode 100644 index 57193d03..00000000 --- a/lib/tdlib/types/message_content/voice_chat_ended.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # A message with information about an ended voice chat. - # - # @attr duration [Integer] Call duration. - class MessageContent::VoiceChatEnded < MessageContent - attribute :duration, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/message_content/voice_chat_started.rb b/lib/tdlib/types/message_content/voice_chat_started.rb deleted file mode 100644 index 732a2783..00000000 --- a/lib/tdlib/types/message_content/voice_chat_started.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A newly created voice chat. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class MessageContent::VoiceChatStarted < MessageContent - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/message_copy_options.rb b/lib/tdlib/types/message_copy_options.rb index 73d16222..9f4cd92f 100644 --- a/lib/tdlib/types/message_copy_options.rb +++ b/lib/tdlib/types/message_copy_options.rb @@ -1,13 +1,13 @@ module TD::Types - # Options to be used when a message content is copied without a link to the original message. + # Options to be used when a message content is copied without reference to the original sender. # Service messages and messageInvoice can't be copied. # - # @attr send_copy [Boolean] True, if content of the message needs to be copied without a link to the original - # message. - # Always true if the message is forwarded to a secret chat. + # @attr send_copy [Boolean] True, if content of the message needs to be copied without reference to the original + # sender. + # Always true if the message is forwarded to a secret chat or is local. # @attr replace_caption [Boolean] True, if media caption of the message copy needs to be replaced. # Ignored if send_copy is false. - # @attr new_caption [TD::Types::FormattedText] New message caption. + # @attr new_caption [TD::Types::FormattedText] New message caption; pass null to copy message without caption. # Ignored if replace_caption is false. class MessageCopyOptions < Base attribute :send_copy, TD::Types::Bool diff --git a/lib/tdlib/types/message_interaction_info.rb b/lib/tdlib/types/message_interaction_info.rb index 3a2691d4..c54ad1a4 100644 --- a/lib/tdlib/types/message_interaction_info.rb +++ b/lib/tdlib/types/message_interaction_info.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr view_count [Integer] Number of times the message was viewed. # @attr forward_count [Integer] Number of times the message was forwarded. - # @attr reply_info [TD::Types::MessageReplyInfo, nil] Contains information about direct or indirect replies to the - # message; may be null. + # @attr reply_info [TD::Types::MessageReplyInfo, nil] Information about direct or indirect replies to the message; + # may be null. # Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which # are not replies itself. class MessageInteractionInfo < Base diff --git a/lib/tdlib/types/message_link_info.rb b/lib/tdlib/types/message_link_info.rb index 839932d9..548bc541 100644 --- a/lib/tdlib/types/message_link_info.rb +++ b/lib/tdlib/types/message_link_info.rb @@ -4,12 +4,16 @@ module TD::Types # @attr is_public [Boolean] True, if the link is a public link for a message in a chat. # @attr chat_id [Integer] If found, identifier of the chat to which the message belongs, 0 otherwise. # @attr message [TD::Types::Message, nil] If found, the linked message; may be null. + # @attr media_timestamp [Integer] Timestamp from which the video/audio/video note/voice note playing must start, in + # seconds; 0 if not specified. + # The media can be in the message content or in its web page preview. # @attr for_album [Boolean] True, if the whole media album to which the message belongs is linked. # @attr for_comment [Boolean] True, if the message is linked as a channel post comment or from a message thread. class MessageLinkInfo < Base attribute :is_public, TD::Types::Bool attribute :chat_id, TD::Types::Coercible::Integer attribute :message, TD::Types::Message.optional.default(nil) + attribute :media_timestamp, TD::Types::Coercible::Integer attribute :for_album, TD::Types::Bool attribute :for_comment, TD::Types::Bool end diff --git a/lib/tdlib/types/message_position.rb b/lib/tdlib/types/message_position.rb new file mode 100644 index 00000000..c4e96283 --- /dev/null +++ b/lib/tdlib/types/message_position.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about a message in a specific position. + # + # @attr position [Integer] 0-based message position in the full list of suitable messages. + # @attr message_id [Integer] Message identifier. + # @attr date [Integer] Point in time (Unix timestamp) when the message was sent. + class MessagePosition < Base + attribute :position, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_positions.rb b/lib/tdlib/types/message_positions.rb new file mode 100644 index 00000000..ac7fae1e --- /dev/null +++ b/lib/tdlib/types/message_positions.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of message positions. + # + # @attr total_count [Integer] Total count of messages found. + # @attr positions [Array] List of message positions. + class MessagePositions < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :positions, TD::Types::Array.of(TD::Types::MessagePosition) + end +end diff --git a/lib/tdlib/types/message_send_options.rb b/lib/tdlib/types/message_send_options.rb index 21b56893..c42255a8 100644 --- a/lib/tdlib/types/message_send_options.rb +++ b/lib/tdlib/types/message_send_options.rb @@ -3,7 +3,8 @@ module TD::Types # # @attr disable_notification [Boolean] Pass true to disable notification for the message. # @attr from_background [Boolean] Pass true if the message is sent from the background. - # @attr scheduling_state [TD::Types::MessageSchedulingState] Message scheduling state. + # @attr scheduling_state [TD::Types::MessageSchedulingState] Message scheduling state; pass null to send message + # immediately. # Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled. class MessageSendOptions < Base attribute :disable_notification, TD::Types::Bool diff --git a/lib/tdlib/types/message_thread_info.rb b/lib/tdlib/types/message_thread_info.rb index b70b9fe1..f92ef7cd 100644 --- a/lib/tdlib/types/message_thread_info.rb +++ b/lib/tdlib/types/message_thread_info.rb @@ -3,7 +3,8 @@ module TD::Types # # @attr chat_id [Integer] Identifier of the chat to which the message thread belongs. # @attr message_thread_id [Integer] Message thread identifier, unique within the chat. - # @attr reply_info [TD::Types::MessageReplyInfo] Contains information about the message thread. + # @attr reply_info [TD::Types::MessageReplyInfo] Information about the message thread. + # @attr unread_message_count [Integer] Approximate number of unread messages in the message thread. # @attr messages [Array] The messages from which the thread starts. # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the message thread; may be null. @@ -11,6 +12,7 @@ class MessageThreadInfo < Base attribute :chat_id, TD::Types::Coercible::Integer attribute :message_thread_id, TD::Types::Coercible::Integer attribute :reply_info, TD::Types::MessageReplyInfo + attribute :unread_message_count, TD::Types::Coercible::Integer attribute :messages, TD::Types::Array.of(TD::Types::Message) attribute :draft_message, TD::Types::DraftMessage.optional.default(nil) end diff --git a/lib/tdlib/types/network_statistics_entry/file.rb b/lib/tdlib/types/network_statistics_entry/file.rb index 479cacef..8502b14b 100644 --- a/lib/tdlib/types/network_statistics_entry/file.rb +++ b/lib/tdlib/types/network_statistics_entry/file.rb @@ -1,7 +1,8 @@ module TD::Types # Contains information about the total amount of data that was used to send and receive files. # - # @attr file_type [TD::Types::FileType] Type of the file the data is part of. + # @attr file_type [TD::Types::FileType] Type of the file the data is part of; pass null if the data isn't related to + # files. # @attr network_type [TD::Types::NetworkType] Type of the network the data was sent through. # Call setNetworkType to maintain the actual network type. # @attr sent_bytes [Integer] Total number of bytes sent. diff --git a/lib/tdlib/types/notification_settings_scope.rb b/lib/tdlib/types/notification_settings_scope.rb index 6b0f98e7..09e34746 100644 --- a/lib/tdlib/types/notification_settings_scope.rb +++ b/lib/tdlib/types/notification_settings_scope.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the types of chats to which notification settings are applied. + # Describes the types of chats to which notification settings are relevant. class NotificationSettingsScope < Base %w[ private_chats diff --git a/lib/tdlib/types/page_block/animation.rb b/lib/tdlib/types/page_block/animation.rb index ed0b0b21..57513050 100644 --- a/lib/tdlib/types/page_block/animation.rb +++ b/lib/tdlib/types/page_block/animation.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr animation [TD::Types::Animation, nil] Animation file; may be null. # @attr caption [TD::Types::PageBlockCaption] Animation caption. - # @attr need_autoplay [Boolean] True, if the animation should be played automatically. + # @attr need_autoplay [Boolean] True, if the animation must be played automatically. class PageBlock::Animation < PageBlock attribute :animation, TD::Types::Animation.optional.default(nil) attribute :caption, TD::Types::PageBlockCaption diff --git a/lib/tdlib/types/page_block/chat_link.rb b/lib/tdlib/types/page_block/chat_link.rb index 1d0e7fdc..82575f64 100644 --- a/lib/tdlib/types/page_block/chat_link.rb +++ b/lib/tdlib/types/page_block/chat_link.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr title [TD::Types::String] Chat title. # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null. - # @attr username [TD::Types::String] Chat username, by which all other information about the chat should be resolved. + # @attr username [TD::Types::String] Chat username, by which all other information about the chat can be resolved. class PageBlock::ChatLink < PageBlock attribute :title, TD::Types::String attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil) diff --git a/lib/tdlib/types/page_block/embedded.rb b/lib/tdlib/types/page_block/embedded.rb index e1e8e1f2..73da2c5a 100644 --- a/lib/tdlib/types/page_block/embedded.rb +++ b/lib/tdlib/types/page_block/embedded.rb @@ -7,8 +7,8 @@ module TD::Types # @attr width [Integer] Block width; 0 if unknown. # @attr height [Integer] Block height; 0 if unknown. # @attr caption [TD::Types::PageBlockCaption] Block caption. - # @attr is_full_width [Boolean] True, if the block should be full width. - # @attr allow_scrolling [Boolean] True, if scrolling should be allowed. + # @attr is_full_width [Boolean] True, if the block must be full width. + # @attr allow_scrolling [Boolean] True, if scrolling needs to be allowed. class PageBlock::Embedded < PageBlock attribute :url, TD::Types::String.optional.default(nil) attribute :html, TD::Types::String diff --git a/lib/tdlib/types/page_block/preformatted.rb b/lib/tdlib/types/page_block/preformatted.rb index 8901a09d..ce9ff6aa 100644 --- a/lib/tdlib/types/page_block/preformatted.rb +++ b/lib/tdlib/types/page_block/preformatted.rb @@ -2,7 +2,7 @@ module TD::Types # A preformatted text paragraph. # # @attr text [TD::Types::RichText] Paragraph text. - # @attr language [TD::Types::String] Programming language for which the text should be formatted. + # @attr language [TD::Types::String] Programming language for which the text needs to be formatted. class PageBlock::Preformatted < PageBlock attribute :text, TD::Types::RichText attribute :language, TD::Types::String diff --git a/lib/tdlib/types/page_block/video.rb b/lib/tdlib/types/page_block/video.rb index a0f26134..cced2f2d 100644 --- a/lib/tdlib/types/page_block/video.rb +++ b/lib/tdlib/types/page_block/video.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr video [TD::Types::Video, nil] Video file; may be null. # @attr caption [TD::Types::PageBlockCaption] Video caption. - # @attr need_autoplay [Boolean] True, if the video should be played automatically. - # @attr is_looped [Boolean] True, if the video should be looped. + # @attr need_autoplay [Boolean] True, if the video must be played automatically. + # @attr is_looped [Boolean] True, if the video must be looped. class PageBlock::Video < PageBlock attribute :video, TD::Types::Video.optional.default(nil) attribute :caption, TD::Types::PageBlockCaption diff --git a/lib/tdlib/types/page_block_horizontal_alignment/center.rb b/lib/tdlib/types/page_block_horizontal_alignment/center.rb index 46daf4e4..abbf0a78 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/center.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/center.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be center-aligned. + # The content must be center-aligned. class PageBlockHorizontalAlignment::Center < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_horizontal_alignment/left.rb b/lib/tdlib/types/page_block_horizontal_alignment/left.rb index 6d51f052..be0a6bed 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/left.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/left.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be left-aligned. + # The content must be left-aligned. class PageBlockHorizontalAlignment::Left < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_horizontal_alignment/right.rb b/lib/tdlib/types/page_block_horizontal_alignment/right.rb index 542bc55c..53c46dee 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/right.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/right.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be right-aligned. + # The content must be right-aligned. class PageBlockHorizontalAlignment::Right < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_table_cell.rb b/lib/tdlib/types/page_block_table_cell.rb index 442a23b7..19fa78bb 100644 --- a/lib/tdlib/types/page_block_table_cell.rb +++ b/lib/tdlib/types/page_block_table_cell.rb @@ -2,10 +2,10 @@ module TD::Types # Represents a cell of a table. # # @attr text [TD::Types::RichText, nil] Cell text; may be null. - # If the text is null, then the cell should be invisible. + # If the text is null, then the cell must be invisible. # @attr is_header [Boolean] True, if it is a header cell. - # @attr colspan [Integer] The number of columns the cell should span. - # @attr rowspan [Integer] The number of rows the cell should span. + # @attr colspan [Integer] The number of columns the cell spans. + # @attr rowspan [Integer] The number of rows the cell spans. # @attr align [TD::Types::PageBlockHorizontalAlignment] Horizontal cell content alignment. # @attr valign [TD::Types::PageBlockVerticalAlignment] Vertical cell content alignment. class PageBlockTableCell < Base diff --git a/lib/tdlib/types/page_block_vertical_alignment/bottom.rb b/lib/tdlib/types/page_block_vertical_alignment/bottom.rb index 6a0b6952..110873ba 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/bottom.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/bottom.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be bottom-aligned. + # The content must be bottom-aligned. class PageBlockVerticalAlignment::Bottom < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/page_block_vertical_alignment/middle.rb b/lib/tdlib/types/page_block_vertical_alignment/middle.rb index 13b9a5dd..8361eb95 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/middle.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/middle.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be middle-aligned. + # The content must be middle-aligned. class PageBlockVerticalAlignment::Middle < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/page_block_vertical_alignment/top.rb b/lib/tdlib/types/page_block_vertical_alignment/top.rb index 5a662b75..118d938c 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/top.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/top.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be top-aligned. + # The content must be top-aligned. class PageBlockVerticalAlignment::Top < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/passport_authorization_form.rb b/lib/tdlib/types/passport_authorization_form.rb index b880128b..0c1fb627 100644 --- a/lib/tdlib/types/passport_authorization_form.rb +++ b/lib/tdlib/types/passport_authorization_form.rb @@ -2,8 +2,8 @@ module TD::Types # Contains information about a Telegram Passport authorization form that was requested. # # @attr id [Integer] Unique identifier of the authorization form. - # @attr required_elements [Array] Information about the Telegram Passport - # elements that must be provided to complete the form. + # @attr required_elements [Array] Telegram Passport elements that must be + # provided to complete the form. # @attr privacy_policy_url [TD::Types::String, nil] URL for the privacy policy of the service; may be empty. class PassportAuthorizationForm < Base attribute :id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/password_state.rb b/lib/tdlib/types/password_state.rb index 6e975f1f..34f16a3e 100644 --- a/lib/tdlib/types/password_state.rb +++ b/lib/tdlib/types/password_state.rb @@ -7,11 +7,14 @@ module TD::Types # @attr has_passport_data [Boolean] True, if some Telegram Passport elements were saved. # @attr recovery_email_address_code_info [TD::Types::EmailAddressAuthenticationCodeInfo, nil] Information about the # recovery email address to which the confirmation email was sent; may be null. + # @attr pending_reset_date [Integer] If not 0, point in time (Unix timestamp) after which the password can be reset + # immediately using resetPassword. class PasswordState < Base attribute :has_password, TD::Types::Bool attribute :password_hint, TD::Types::String.optional.default(nil) attribute :has_recovery_email_address, TD::Types::Bool attribute :has_passport_data, TD::Types::Bool attribute :recovery_email_address_code_info, TD::Types::EmailAddressAuthenticationCodeInfo.optional.default(nil) + attribute :pending_reset_date, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/payment_form.rb b/lib/tdlib/types/payment_form.rb index 486fb86e..e8c0d55a 100644 --- a/lib/tdlib/types/payment_form.rb +++ b/lib/tdlib/types/payment_form.rb @@ -6,11 +6,10 @@ module TD::Types # @attr url [TD::Types::String] Payment form URL. # @attr seller_bot_user_id [Integer] User identifier of the seller bot. # @attr payments_provider_user_id [Integer] User identifier of the payment provider bot. - # @attr payments_provider [TD::Types::PaymentsProviderStripe, nil] Contains information about the payment provider, - # if available, to support it natively without the need for opening the URL; may be null. + # @attr payments_provider [TD::Types::PaymentsProviderStripe, nil] Information about the payment provider, if + # available, to support it natively without the need for opening the URL; may be null. # @attr saved_order_info [TD::Types::OrderInfo, nil] Saved server-side order information; may be null. - # @attr saved_credentials [TD::Types::SavedCredentials, nil] Contains information about saved card credentials; may - # be null. + # @attr saved_credentials [TD::Types::SavedCredentials, nil] Information about saved card credentials; may be null. # @attr can_save_credentials [Boolean] True, if the user can choose to save credentials. # @attr need_password [Boolean] True, if the user will be able to save credentials protected by a password they set # up. diff --git a/lib/tdlib/types/payment_form_theme.rb b/lib/tdlib/types/payment_form_theme.rb index 0fc53d3a..490d93b2 100644 --- a/lib/tdlib/types/payment_form_theme.rb +++ b/lib/tdlib/types/payment_form_theme.rb @@ -5,7 +5,7 @@ module TD::Types # @attr text_color [Integer] A color of text in the RGB24 format. # @attr hint_color [Integer] A color of hints in the RGB24 format. # @attr link_color [Integer] A color of links in the RGB24 format. - # @attr button_color [Integer] A color of thebuttons in the RGB24 format. + # @attr button_color [Integer] A color of the buttons in the RGB24 format. # @attr button_text_color [Integer] A color of text on the buttons in the RGB24 format. class PaymentFormTheme < Base attribute :background_color, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/payment_receipt.rb b/lib/tdlib/types/payment_receipt.rb index 128c6f26..6d634efc 100644 --- a/lib/tdlib/types/payment_receipt.rb +++ b/lib/tdlib/types/payment_receipt.rb @@ -7,7 +7,7 @@ module TD::Types # @attr date [Integer] Point in time (Unix timestamp) when the payment was made. # @attr seller_bot_user_id [Integer] User identifier of the seller bot. # @attr payments_provider_user_id [Integer] User identifier of the payment provider bot. - # @attr invoice [TD::Types::Invoice] Contains information about the invoice. + # @attr invoice [TD::Types::Invoice] Information about the invoice. # @attr order_info [TD::Types::OrderInfo, nil] Order information; may be null. # @attr shipping_option [TD::Types::ShippingOption, nil] Chosen shipping option; may be null. # @attr credentials_title [TD::Types::String] Title of the saved credentials chosen by the buyer. diff --git a/lib/tdlib/types/payment_result.rb b/lib/tdlib/types/payment_result.rb index 48556488..a32a3739 100644 --- a/lib/tdlib/types/payment_result.rb +++ b/lib/tdlib/types/payment_result.rb @@ -1,8 +1,8 @@ module TD::Types # Contains the result of a payment request. # - # @attr success [Boolean] True, if the payment request was successful; otherwise the verification_url will be not - # empty. + # @attr success [Boolean] True, if the payment request was successful; otherwise the verification_url will be + # non-empty. # @attr verification_url [TD::Types::String] URL for additional payment credentials verification. class PaymentResult < Base attribute :success, TD::Types::Bool diff --git a/lib/tdlib/types/phone_number_info.rb b/lib/tdlib/types/phone_number_info.rb index 12bd84fa..a134a7f2 100644 --- a/lib/tdlib/types/phone_number_info.rb +++ b/lib/tdlib/types/phone_number_info.rb @@ -7,6 +7,7 @@ module TD::Types # part. # @attr formatted_phone_number [TD::Types::String] The phone number without country calling code formatted # accordingly to local rules. + # Expected digits are returned as '-', but even more digits might be entered by the user. class PhoneNumberInfo < Base attribute :country, TD::Types::CountryInfo.optional.default(nil) attribute :country_calling_code, TD::Types::String diff --git a/lib/tdlib/types/photo_size.rb b/lib/tdlib/types/photo_size.rb index c9e3bdac..c5332ee4 100644 --- a/lib/tdlib/types/photo_size.rb +++ b/lib/tdlib/types/photo_size.rb @@ -6,7 +6,7 @@ module TD::Types # @attr width [Integer] Image width. # @attr height [Integer] Image height. # @attr progressive_sizes [Array] Sizes of progressive JPEG file prefixes, which can be used to - # preliminarily show the image. + # preliminarily show the image; in bytes. class PhotoSize < Base attribute :type, TD::Types::String attribute :photo, TD::Types::File diff --git a/lib/tdlib/types/push_message_content.rb b/lib/tdlib/types/push_message_content.rb index d2e5dd29..1198bdef 100644 --- a/lib/tdlib/types/push_message_content.rb +++ b/lib/tdlib/types/push_message_content.rb @@ -24,8 +24,10 @@ class PushMessageContent < Base chat_add_members chat_change_photo chat_change_title + chat_set_theme chat_delete_member chat_join_by_link + chat_join_by_request message_forwards media_album ].each do |type| diff --git a/lib/tdlib/types/push_message_content/chat_add_members.rb b/lib/tdlib/types/push_message_content/chat_add_members.rb index 6de8218e..cc9a2496 100644 --- a/lib/tdlib/types/push_message_content/chat_add_members.rb +++ b/lib/tdlib/types/push_message_content/chat_add_members.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr member_name [TD::Types::String] Name of the added member. # @attr is_current_user [Boolean] True, if the current user was added to the group. - # @attr is_returned [Boolean] True, if the user has returned to the group themself. + # @attr is_returned [Boolean] True, if the user has returned to the group themselves. class PushMessageContent::ChatAddMembers < PushMessageContent attribute :member_name, TD::Types::String attribute :is_current_user, TD::Types::Bool diff --git a/lib/tdlib/types/push_message_content/chat_delete_member.rb b/lib/tdlib/types/push_message_content/chat_delete_member.rb index 28e01d98..ee9272e7 100644 --- a/lib/tdlib/types/push_message_content/chat_delete_member.rb +++ b/lib/tdlib/types/push_message_content/chat_delete_member.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr member_name [TD::Types::String] Name of the deleted member. # @attr is_current_user [Boolean] True, if the current user was deleted from the group. - # @attr is_left [Boolean] True, if the user has left the group themself. + # @attr is_left [Boolean] True, if the user has left the group themselves. class PushMessageContent::ChatDeleteMember < PushMessageContent attribute :member_name, TD::Types::String attribute :is_current_user, TD::Types::Bool diff --git a/lib/tdlib/types/push_message_content/chat_join_by_request.rb b/lib/tdlib/types/push_message_content/chat_join_by_request.rb new file mode 100644 index 00000000..f4555dd3 --- /dev/null +++ b/lib/tdlib/types/push_message_content/chat_join_by_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # A new member was accepted to the chat by an administrator. + class PushMessageContent::ChatJoinByRequest < PushMessageContent + end +end diff --git a/lib/tdlib/types/push_message_content/chat_set_theme.rb b/lib/tdlib/types/push_message_content/chat_set_theme.rb new file mode 100644 index 00000000..3c12fa8a --- /dev/null +++ b/lib/tdlib/types/push_message_content/chat_set_theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # A chat theme was edited. + # + # @attr theme_name [TD::Types::String] If non-empty, name of a new theme, set for the chat. + # Otherwise chat theme was reset to the default one. + class PushMessageContent::ChatSetTheme < PushMessageContent + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/remote_file.rb b/lib/tdlib/types/remote_file.rb index 1c88f205..44104e63 100644 --- a/lib/tdlib/types/remote_file.rb +++ b/lib/tdlib/types/remote_file.rb @@ -9,14 +9,14 @@ module TD::Types # If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation # process by sending {TD::Types::Update::FileGenerationStart} to the application with the HTTP URL in the original_path # and "#url#" as the conversion string. - # Application should generate the file by downloading it to the specified location. + # Application must generate the file by downloading it to the specified location. # @attr unique_id [TD::Types::String, nil] Unique file identifier; may be empty if unknown. # The unique file identifier which is the same for the same file even for different users and is persistent over # time. # @attr is_uploading_active [Boolean] True, if the file is currently being uploaded (or a remote copy is being # generated by some other means). # @attr is_uploading_completed [Boolean] True, if a remote copy is fully available. - # @attr uploaded_size [Integer] Size of the remote available part of the file; 0 if unknown. + # @attr uploaded_size [Integer] Size of the remote available part of the file, in bytes; 0 if unknown. class RemoteFile < Base attribute :id, TD::Types::String.optional.default(nil) attribute :unique_id, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/reply_markup/force_reply.rb b/lib/tdlib/types/reply_markup/force_reply.rb index 0defae60..5affd811 100644 --- a/lib/tdlib/types/reply_markup/force_reply.rb +++ b/lib/tdlib/types/reply_markup/force_reply.rb @@ -4,7 +4,10 @@ module TD::Types # @attr is_personal [Boolean] True, if a forced reply must automatically be shown to the current user. # For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user # of a reply. + # @attr input_field_placeholder [TD::Types::String] If non-empty, the placeholder to be shown in the input field when + # the reply is active; 0-64 characters. class ReplyMarkup::ForceReply < ReplyMarkup attribute :is_personal, TD::Types::Bool + attribute :input_field_placeholder, TD::Types::String end end diff --git a/lib/tdlib/types/reply_markup/show_keyboard.rb b/lib/tdlib/types/reply_markup/show_keyboard.rb index 30f97c49..81724d37 100644 --- a/lib/tdlib/types/reply_markup/show_keyboard.rb +++ b/lib/tdlib/types/reply_markup/show_keyboard.rb @@ -7,10 +7,13 @@ module TD::Types # @attr is_personal [Boolean] True, if the keyboard must automatically be shown to the current user. # For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of # a reply. + # @attr input_field_placeholder [TD::Types::String] If non-empty, the placeholder to be shown in the input field when + # the keyboard is active; 0-64 characters. class ReplyMarkup::ShowKeyboard < ReplyMarkup attribute :rows, TD::Types::Array.of(TD::Types::Array.of(TD::Types::KeyboardButton)) attribute :resize_keyboard, TD::Types::Bool attribute :one_time, TD::Types::Bool attribute :is_personal, TD::Types::Bool + attribute :input_field_placeholder, TD::Types::String end end diff --git a/lib/tdlib/types/reset_password_result.rb b/lib/tdlib/types/reset_password_result.rb new file mode 100644 index 00000000..c37ecf4d --- /dev/null +++ b/lib/tdlib/types/reset_password_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents result of 2-step verification password reset. + class ResetPasswordResult < Base + %w[ + ok + pending + declined + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/reset_password_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/reset_password_result/declined.rb b/lib/tdlib/types/reset_password_result/declined.rb new file mode 100644 index 00000000..e35da9ac --- /dev/null +++ b/lib/tdlib/types/reset_password_result/declined.rb @@ -0,0 +1,8 @@ +module TD::Types + # The password reset request was declined. + # + # @attr retry_date [Integer] Point in time (Unix timestamp) when the password reset can be retried. + class ResetPasswordResult::Declined < ResetPasswordResult + attribute :retry_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/reset_password_result/ok.rb b/lib/tdlib/types/reset_password_result/ok.rb new file mode 100644 index 00000000..d444d35f --- /dev/null +++ b/lib/tdlib/types/reset_password_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The password was reset. + class ResetPasswordResult::Ok < ResetPasswordResult + end +end diff --git a/lib/tdlib/types/reset_password_result/pending.rb b/lib/tdlib/types/reset_password_result/pending.rb new file mode 100644 index 00000000..ae447581 --- /dev/null +++ b/lib/tdlib/types/reset_password_result/pending.rb @@ -0,0 +1,9 @@ +module TD::Types + # The password reset request is pending. + # + # @attr pending_reset_date [Integer] Point in time (Unix timestamp) after which the password can be reset immediately + # using resetPassword. + class ResetPasswordResult::Pending < ResetPasswordResult + attribute :pending_reset_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/rich_text/anchor_link.rb b/lib/tdlib/types/rich_text/anchor_link.rb index 9bcb1219..50f67ff3 100644 --- a/lib/tdlib/types/rich_text/anchor_link.rb +++ b/lib/tdlib/types/rich_text/anchor_link.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr text [TD::Types::RichText] The link text. # @attr anchor_name [TD::Types::String] The anchor name. - # If the name is empty, the link should bring back to top. + # If the name is empty, the link must bring back to top. # @attr url [TD::Types::String] An HTTP URL, opening the anchor. class RichText::AnchorLink < RichText attribute :text, TD::Types::RichText diff --git a/lib/tdlib/types/rich_text/icon.rb b/lib/tdlib/types/rich_text/icon.rb index 2654de93..6b36dedd 100644 --- a/lib/tdlib/types/rich_text/icon.rb +++ b/lib/tdlib/types/rich_text/icon.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr document [TD::Types::Document] The image represented as a document. # The image can be in GIF, JPEG or PNG format. - # @attr width [Integer] Width of a bounding box in which the image should be shown; 0 if unknown. - # @attr height [Integer] Height of a bounding box in which the image should be shown; 0 if unknown. + # @attr width [Integer] Width of a bounding box in which the image must be shown; 0 if unknown. + # @attr height [Integer] Height of a bounding box in which the image must be shown; 0 if unknown. class RichText::Icon < RichText attribute :document, TD::Types::Document attribute :width, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/scope_notification_settings.rb b/lib/tdlib/types/scope_notification_settings.rb index afd3a6dd..d47133b2 100644 --- a/lib/tdlib/types/scope_notification_settings.rb +++ b/lib/tdlib/types/scope_notification_settings.rb @@ -4,7 +4,7 @@ module TD::Types # @attr mute_for [Integer] Time left before notifications will be unmuted, in seconds. # @attr sound [TD::Types::String] The name of an audio file to be used for notification sounds; only applies to iOS # applications. - # @attr show_preview [Boolean] True, if message content should be displayed in notifications. + # @attr show_preview [Boolean] True, if message content must be displayed in notifications. # @attr disable_pinned_message_notifications [Boolean] True, if notifications for incoming pinned messages will be # created as for an ordinary unread message. # @attr disable_mention_notifications [Boolean] True, if notifications for messages with mentions will be created as diff --git a/lib/tdlib/types/secret_chat.rb b/lib/tdlib/types/secret_chat.rb index 6db11956..a6d3e175 100644 --- a/lib/tdlib/types/secret_chat.rb +++ b/lib/tdlib/types/secret_chat.rb @@ -12,8 +12,7 @@ module TD::Types # Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 # 2-digit hex numbers. # @attr layer [Integer] Secret chat layer; determines features supported by the chat partner's application. - # Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are - # supported if the layer >= 101. + # Nested text entities and underline and strikethrough entities are supported if the layer >= 101. class SecretChat < Base attribute :id, TD::Types::Coercible::Integer attribute :user_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/session.rb b/lib/tdlib/types/session.rb index 40037349..bae43546 100644 --- a/lib/tdlib/types/session.rb +++ b/lib/tdlib/types/session.rb @@ -1,6 +1,6 @@ module TD::Types # Contains information about one session in a Telegram application used by the current user. - # Sessions should be shown to the user in the returned order. + # Sessions must be shown to the user in the returned order. # # @attr id [Integer] Session identifier. # @attr is_current [Boolean] True, if this session is the current session. diff --git a/lib/tdlib/types/sponsored_message.rb b/lib/tdlib/types/sponsored_message.rb new file mode 100644 index 00000000..afb51eaa --- /dev/null +++ b/lib/tdlib/types/sponsored_message.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes a sponsored message. + # + # @attr id [Integer] Unique sponsored message identifier. + # @attr sponsor_chat_id [Integer] Chat identifier. + # @attr link [TD::Types::InternalLinkType, nil] An internal link to be opened when the sponsored message is clicked; + # may be null. + # If null, the sponsor chat needs to be opened instead. + # @attr content [TD::Types::MessageContent] Content of the message. + class SponsoredMessage < Base + attribute :id, TD::Types::Coercible::Integer + attribute :sponsor_chat_id, TD::Types::Coercible::Integer + attribute :link, TD::Types::InternalLinkType.optional.default(nil) + attribute :content, TD::Types::MessageContent + end +end diff --git a/lib/tdlib/types/sponsored_messages.rb b/lib/tdlib/types/sponsored_messages.rb new file mode 100644 index 00000000..798d23e6 --- /dev/null +++ b/lib/tdlib/types/sponsored_messages.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of sponsored messages. + # + # @attr messages [Array] List of sponsored messages. + class SponsoredMessages < Base + attribute :messages, TD::Types::Array.of(TD::Types::SponsoredMessage) + end +end diff --git a/lib/tdlib/types/sticker.rb b/lib/tdlib/types/sticker.rb index 52a48f35..683cb429 100644 --- a/lib/tdlib/types/sticker.rb +++ b/lib/tdlib/types/sticker.rb @@ -7,7 +7,7 @@ module TD::Types # @attr emoji [TD::Types::String] Emoji corresponding to the sticker. # @attr is_animated [Boolean] True, if the sticker is an animated sticker in TGS format. # @attr is_mask [Boolean] True, if the sticker is a mask. - # @attr mask_position [TD::Types::MaskPosition, nil] Position where the mask should be placed; may be null. + # @attr mask_position [TD::Types::MaskPosition, nil] Position where the mask is placed; may be null. # @attr outline [Array, nil] Sticker's outline represented as a list of closed vector # paths; may be empty. # The coordinate system origin is in the upper-left corner. diff --git a/lib/tdlib/types/sticker_set_info.rb b/lib/tdlib/types/sticker_set_info.rb index 33c4415e..b1547ada 100644 --- a/lib/tdlib/types/sticker_set_info.rb +++ b/lib/tdlib/types/sticker_set_info.rb @@ -17,9 +17,8 @@ module TD::Types # @attr is_masks [Boolean] True, if the stickers in the set are masks. # @attr is_viewed [Boolean] True for already viewed trending sticker sets. # @attr size [Integer] Total number of stickers in the set. - # @attr covers [Array] Contains up to the first 5 stickers from the set, depending on the - # context. - # If the application needs more stickers the full set should be requested. + # @attr covers [Array] Up to the first 5 stickers from the set, depending on the context. + # If the application needs more stickers the full sticker set needs to be requested. class StickerSetInfo < Base attribute :id, TD::Types::Coercible::Integer attribute :title, TD::Types::String diff --git a/lib/tdlib/types/storage_statistics.rb b/lib/tdlib/types/storage_statistics.rb index c7d9a0f5..21c62595 100644 --- a/lib/tdlib/types/storage_statistics.rb +++ b/lib/tdlib/types/storage_statistics.rb @@ -1,7 +1,7 @@ module TD::Types # Contains the exact storage usage statistics split by chats and file type. # - # @attr size [Integer] Total size of files. + # @attr size [Integer] Total size of files, in bytes. # @attr count [Integer] Total number of files. # @attr by_chat [Array] Statistics split by chats. class StorageStatistics < Base diff --git a/lib/tdlib/types/storage_statistics_by_chat.rb b/lib/tdlib/types/storage_statistics_by_chat.rb index 59316056..0223fa3e 100644 --- a/lib/tdlib/types/storage_statistics_by_chat.rb +++ b/lib/tdlib/types/storage_statistics_by_chat.rb @@ -2,7 +2,7 @@ module TD::Types # Contains the storage usage statistics for a specific chat. # # @attr chat_id [Integer] Chat identifier; 0 if none. - # @attr size [Integer] Total size of the files in the chat. + # @attr size [Integer] Total size of the files in the chat, in bytes. # @attr count [Integer] Total number of files in the chat. # @attr by_file_type [Array] Statistics split by file types. class StorageStatisticsByChat < Base diff --git a/lib/tdlib/types/storage_statistics_by_file_type.rb b/lib/tdlib/types/storage_statistics_by_file_type.rb index 9a0fd805..c80d37ee 100644 --- a/lib/tdlib/types/storage_statistics_by_file_type.rb +++ b/lib/tdlib/types/storage_statistics_by_file_type.rb @@ -2,7 +2,7 @@ module TD::Types # Contains the storage usage statistics for a specific file type. # # @attr file_type [TD::Types::FileType] File type. - # @attr size [Integer] Total size of the files. + # @attr size [Integer] Total size of the files, in bytes. # @attr count [Integer] Total number of files. class StorageStatisticsByFileType < Base attribute :file_type, TD::Types::FileType diff --git a/lib/tdlib/types/storage_statistics_fast.rb b/lib/tdlib/types/storage_statistics_fast.rb index 11d3dbb7..ff2eb42d 100644 --- a/lib/tdlib/types/storage_statistics_fast.rb +++ b/lib/tdlib/types/storage_statistics_fast.rb @@ -1,7 +1,7 @@ module TD::Types # Contains approximate storage usage statistics, excluding files of unknown file type. # - # @attr files_size [Integer] Approximate total size of files. + # @attr files_size [Integer] Approximate total size of files, in bytes. # @attr file_count [Integer] Approximate number of files. # @attr database_size [Integer] Size of the database. # @attr language_pack_database_size [Integer] Size of the language pack database. diff --git a/lib/tdlib/types/suggested_action.rb b/lib/tdlib/types/suggested_action.rb index 33de1f3e..8b130df0 100644 --- a/lib/tdlib/types/suggested_action.rb +++ b/lib/tdlib/types/suggested_action.rb @@ -3,6 +3,7 @@ module TD::Types class SuggestedAction < Base %w[ enable_archive_and_mute_new_chats + check_password check_phone_number see_ticks_hint convert_to_broadcast_group diff --git a/lib/tdlib/types/suggested_action/check_password.rb b/lib/tdlib/types/suggested_action/check_password.rb new file mode 100644 index 00000000..238bd97a --- /dev/null +++ b/lib/tdlib/types/suggested_action/check_password.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to check whether 2-step verification password is still remembered. + class SuggestedAction::CheckPassword < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/check_phone_number.rb b/lib/tdlib/types/suggested_action/check_phone_number.rb index 620ff46e..ec8308d3 100644 --- a/lib/tdlib/types/suggested_action/check_phone_number.rb +++ b/lib/tdlib/types/suggested_action/check_phone_number.rb @@ -1,5 +1,6 @@ module TD::Types - # Suggests the user to check authorization phone number and change the phone number if it is inaccessible. + # Suggests the user to check whether authorization phone number is correct and change the phone number if it is + # inaccessible. class SuggestedAction::CheckPhoneNumber < SuggestedAction end end diff --git a/lib/tdlib/types/supergroup.rb b/lib/tdlib/types/supergroup.rb index 185133c3..519a7d4c 100644 --- a/lib/tdlib/types/supergroup.rb +++ b/lib/tdlib/types/supergroup.rb @@ -20,7 +20,7 @@ module TD::Types # discussion group for a channel. # @attr has_location [Boolean] True, if the supergroup is connected to a location, i.e. # the supergroup is a location-based supergroup. - # @attr sign_messages [Boolean] True, if messages sent to the channel should contain information about the sender. + # @attr sign_messages [Boolean] True, if messages sent to the channel need to contain information about the sender. # This field is only applicable to channels. # @attr is_slow_mode_enabled [Boolean] True, if the slow mode is enabled in the supergroup. # @attr is_channel [Boolean] True, if the supergroup is a channel. diff --git a/lib/tdlib/types/supergroup_full_info.rb b/lib/tdlib/types/supergroup_full_info.rb index 51f9ea6e..b085c677 100644 --- a/lib/tdlib/types/supergroup_full_info.rb +++ b/lib/tdlib/types/supergroup_full_info.rb @@ -27,6 +27,7 @@ module TD::Types # @attr location [TD::Types::ChatLocation, nil] Location to which the supergroup is connected; may be null. # @attr invite_link [TD::Types::ChatInviteLink, nil] Primary invite link for this chat; may be null. # For chat administrators with can_invite_users right only. + # @attr bot_commands [Array] List of commands of bots in the group. # @attr upgraded_from_basic_group_id [Integer] Identifier of the basic group from which supergroup was upgraded; 0 if # none. # @attr upgraded_from_max_message_id [Integer] Identifier of the last message in the basic group from which @@ -50,6 +51,7 @@ class SupergroupFullInfo < Base attribute :sticker_set_id, TD::Types::Coercible::Integer attribute :location, TD::Types::ChatLocation.optional.default(nil) attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + attribute :bot_commands, TD::Types::Array.of(TD::Types::BotCommands) attribute :upgraded_from_basic_group_id, TD::Types::Coercible::Integer attribute :upgraded_from_max_message_id, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/text_entity_type.rb b/lib/tdlib/types/text_entity_type.rb index 2a2c92c1..37e14a3f 100644 --- a/lib/tdlib/types/text_entity_type.rb +++ b/lib/tdlib/types/text_entity_type.rb @@ -19,6 +19,7 @@ class TextEntityType < Base pre_code text_url mention_name + media_timestamp ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/text_entity_type/#{type}" end diff --git a/lib/tdlib/types/text_entity_type/bot_command.rb b/lib/tdlib/types/text_entity_type/bot_command.rb index 1ed6727e..c372704a 100644 --- a/lib/tdlib/types/text_entity_type/bot_command.rb +++ b/lib/tdlib/types/text_entity_type/bot_command.rb @@ -1,6 +1,5 @@ module TD::Types # A bot command, beginning with "/". - # This shouldn't be highlighted if there are no bots in the chat. class TextEntityType::BotCommand < TextEntityType end end diff --git a/lib/tdlib/types/text_entity_type/cashtag.rb b/lib/tdlib/types/text_entity_type/cashtag.rb index 66d09ac0..38a4f732 100644 --- a/lib/tdlib/types/text_entity_type/cashtag.rb +++ b/lib/tdlib/types/text_entity_type/cashtag.rb @@ -1,6 +1,5 @@ module TD::Types - # A cashtag text, beginning with "$" and consisting of capital english letters (i.e. - # "$USD"). + # A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD"). class TextEntityType::Cashtag < TextEntityType end end diff --git a/lib/tdlib/types/text_entity_type/media_timestamp.rb b/lib/tdlib/types/text_entity_type/media_timestamp.rb new file mode 100644 index 00000000..b94e9feb --- /dev/null +++ b/lib/tdlib/types/text_entity_type/media_timestamp.rb @@ -0,0 +1,11 @@ +module TD::Types + # A media timestamp. + # + # @attr media_timestamp [Integer] Timestamp from which a video/audio/video note/voice note playing must start, in + # seconds. + # The media can be in the content or the web page preview of the current message, or in the same places in the + # replied message. + class TextEntityType::MediaTimestamp < TextEntityType + attribute :media_timestamp, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/text_parse_mode.rb b/lib/tdlib/types/text_parse_mode.rb index 52c45298..bf92cbe7 100644 --- a/lib/tdlib/types/text_parse_mode.rb +++ b/lib/tdlib/types/text_parse_mode.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the way the text should be parsed for TextEntities. + # Describes the way the text needs to be parsed for TextEntities. class TextParseMode < Base %w[ markdown diff --git a/lib/tdlib/types/theme_settings.rb b/lib/tdlib/types/theme_settings.rb new file mode 100644 index 00000000..1b221cb9 --- /dev/null +++ b/lib/tdlib/types/theme_settings.rb @@ -0,0 +1,17 @@ +module TD::Types + # Describes theme settings. + # + # @attr accent_color [Integer] Theme accent color in ARGB format. + # @attr background [TD::Types::Background, nil] The background to be used in chats; may be null. + # @attr outgoing_message_fill [TD::Types::BackgroundFill] The fill to be used as a background for outgoing messages. + # @attr animate_outgoing_message_fill [Boolean] If true, the freeform gradient fill needs to be animated on every + # sent message. + # @attr outgoing_message_accent_color [Integer] Accent color of outgoing messages in ARGB format. + class ThemeSettings < Base + attribute :accent_color, TD::Types::Coercible::Integer + attribute :background, TD::Types::Background.optional.default(nil) + attribute :outgoing_message_fill, TD::Types::BackgroundFill + attribute :animate_outgoing_message_fill, TD::Types::Bool + attribute :outgoing_message_accent_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update.rb b/lib/tdlib/types/update.rb index a3832b14..05661f72 100644 --- a/lib/tdlib/types/update.rb +++ b/lib/tdlib/types/update.rb @@ -23,7 +23,7 @@ class Update < Base chat_is_marked_as_unread chat_is_blocked chat_has_scheduled_messages - chat_voice_chat + chat_video_chat chat_default_disable_notification chat_read_inbox chat_read_outbox @@ -32,6 +32,8 @@ class Update < Base scope_notification_settings chat_message_ttl_setting chat_action_bar + chat_theme + chat_pending_join_requests chat_reply_markup chat_draft_message chat_filters @@ -69,11 +71,13 @@ class Update < Base favorite_stickers saved_animations selected_background + chat_themes language_pack_strings connection_state terms_of_service users_nearby dice_emojis + animated_emoji_message_clicked animation_search_parameters suggested_actions new_inline_query @@ -87,6 +91,7 @@ class Update < Base poll poll_answer chat_member + new_chat_join_request ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/update/#{type}" end diff --git a/lib/tdlib/types/update/animated_emoji_message_clicked.rb b/lib/tdlib/types/update/animated_emoji_message_clicked.rb new file mode 100644 index 00000000..ddce24ab --- /dev/null +++ b/lib/tdlib/types/update/animated_emoji_message_clicked.rb @@ -0,0 +1,14 @@ +module TD::Types + # Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the + # screen. + # chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr sticker [TD::Types::Sticker] The animated sticker to be played. + class Update::AnimatedEmojiMessageClicked < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker + end +end diff --git a/lib/tdlib/types/update/chat_draft_message.rb b/lib/tdlib/types/update/chat_draft_message.rb index 98c78d57..74e73f4e 100644 --- a/lib/tdlib/types/update/chat_draft_message.rb +++ b/lib/tdlib/types/update/chat_draft_message.rb @@ -1,7 +1,7 @@ module TD::Types # A chat draft has changed. # Be aware that the update may come in the currently opened chat but with old content of the draft. - # If the user has changed the content of the draft, this update shouldn't be applied. + # If the user has changed the content of the draft, this update mustn't be applied. # # @attr chat_id [Integer] Chat identifier. # @attr draft_message [TD::Types::DraftMessage, nil] The new draft message; may be null. diff --git a/lib/tdlib/types/update/chat_pending_join_requests.rb b/lib/tdlib/types/update/chat_pending_join_requests.rb new file mode 100644 index 00000000..95827b0f --- /dev/null +++ b/lib/tdlib/types/update/chat_pending_join_requests.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat pending join requests were changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr pending_join_requests [TD::Types::ChatJoinRequestsInfo, nil] The new data about pending join requests; may be + # null. + class Update::ChatPendingJoinRequests < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :pending_join_requests, TD::Types::ChatJoinRequestsInfo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_theme.rb b/lib/tdlib/types/update/chat_theme.rb new file mode 100644 index 00000000..b4311c50 --- /dev/null +++ b/lib/tdlib/types/update/chat_theme.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat theme was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr theme_name [TD::Types::String, nil] The new name of the chat theme; may be empty if theme was reset to + # default. + class Update::ChatTheme < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :theme_name, TD::Types::String.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_themes.rb b/lib/tdlib/types/update/chat_themes.rb new file mode 100644 index 00000000..375b0416 --- /dev/null +++ b/lib/tdlib/types/update/chat_themes.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of available chat themes has changed. + # + # @attr chat_themes [Array] The new list of chat themes. + class Update::ChatThemes < Update + attribute :chat_themes, TD::Types::Array.of(TD::Types::ChatTheme) + end +end diff --git a/lib/tdlib/types/update/chat_video_chat.rb b/lib/tdlib/types/update/chat_video_chat.rb new file mode 100644 index 00000000..b75c7427 --- /dev/null +++ b/lib/tdlib/types/update/chat_video_chat.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat video chat state has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr video_chat [TD::Types::VideoChat] New value of video_chat. + class Update::ChatVideoChat < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :video_chat, TD::Types::VideoChat + end +end diff --git a/lib/tdlib/types/update/chat_voice_chat.rb b/lib/tdlib/types/update/chat_voice_chat.rb deleted file mode 100644 index da215829..00000000 --- a/lib/tdlib/types/update/chat_voice_chat.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # A chat voice chat state has changed. - # - # @attr chat_id [Integer] Chat identifier. - # @attr voice_chat [TD::Types::VoiceChat] New value of voice_chat. - class Update::ChatVoiceChat < Update - attribute :chat_id, TD::Types::Coercible::Integer - attribute :voice_chat, TD::Types::VoiceChat - end -end diff --git a/lib/tdlib/types/update/file_generation_start.rb b/lib/tdlib/types/update/file_generation_start.rb index 50f71ab9..9affc844 100644 --- a/lib/tdlib/types/update/file_generation_start.rb +++ b/lib/tdlib/types/update/file_generation_start.rb @@ -3,11 +3,11 @@ module TD::Types # # @attr generation_id [Integer] Unique identifier for the generation process. # @attr original_path [TD::Types::String, nil] The path to a file from which a new file is generated; may be empty. - # @attr destination_path [TD::Types::String] The path to a file that should be created and where the new file should - # be generated. + # @attr destination_path [TD::Types::String] The path to a file that must be created and where the new file is + # generated. # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file. - # If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by - # the application. + # If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the + # application. class Update::FileGenerationStart < Update attribute :generation_id, TD::Types::Coercible::Integer attribute :original_path, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/update/message_send_failed.rb b/lib/tdlib/types/update/message_send_failed.rb index 12617abd..dc542f22 100644 --- a/lib/tdlib/types/update/message_send_failed.rb +++ b/lib/tdlib/types/update/message_send_failed.rb @@ -3,7 +3,7 @@ module TD::Types # Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be # received instead of this update. # - # @attr message [TD::Types::Message] Contains information about the message which failed to send. + # @attr message [TD::Types::Message] The failed to send message. # @attr old_message_id [Integer] The previous temporary message identifier. # @attr error_code [Integer] An error code. # @attr error_message [TD::Types::String] Error message. diff --git a/lib/tdlib/types/update/message_send_succeeded.rb b/lib/tdlib/types/update/message_send_succeeded.rb index 0e323731..3c681e3f 100644 --- a/lib/tdlib/types/update/message_send_succeeded.rb +++ b/lib/tdlib/types/update/message_send_succeeded.rb @@ -1,7 +1,7 @@ module TD::Types # A message has been successfully sent. # - # @attr message [TD::Types::Message] Information about the sent message. + # @attr message [TD::Types::Message] The sent message. # Usually only the message identifier, date, and content are changed, but almost all other fields can also change. # @attr old_message_id [Integer] The previous temporary message identifier. class Update::MessageSendSucceeded < Update diff --git a/lib/tdlib/types/update/new_chat_join_request.rb b/lib/tdlib/types/update/new_chat_join_request.rb new file mode 100644 index 00000000..c920a120 --- /dev/null +++ b/lib/tdlib/types/update/new_chat_join_request.rb @@ -0,0 +1,13 @@ +module TD::Types + # A user sent a join request to a chat; for bots only. + # + # @attr chat_id [Integer] Chat identifier. + # @attr request [TD::Types::ChatJoinRequest] Join request. + # @attr invite_link [TD::Types::ChatInviteLink, nil] The invite link, which was used to send join request; may be + # null. + class Update::NewChatJoinRequest < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :request, TD::Types::ChatJoinRequest + attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/new_inline_query.rb b/lib/tdlib/types/update/new_inline_query.rb index 29a580cb..a7921a3a 100644 --- a/lib/tdlib/types/update/new_inline_query.rb +++ b/lib/tdlib/types/update/new_inline_query.rb @@ -4,8 +4,8 @@ module TD::Types # @attr id [Integer] Unique query identifier. # @attr sender_user_id [Integer] Identifier of the user who sent the query. # @attr user_location [TD::Types::Location, nil] User location; may be null. - # @attr chat_type [TD::Types::ChatType, nil] Contains information about the type of the chat, from which the query - # originated; may be null if unknown. + # @attr chat_type [TD::Types::ChatType, nil] The type of the chat, from which the query originated; may be null if + # unknown. # @attr query [TD::Types::String] Text of the query. # @attr offset [TD::Types::String] Offset of the first entry to return. class Update::NewInlineQuery < Update diff --git a/lib/tdlib/types/update/notification_group.rb b/lib/tdlib/types/update/notification_group.rb index 3a70431a..c1ceb09e 100644 --- a/lib/tdlib/types/update/notification_group.rb +++ b/lib/tdlib/types/update/notification_group.rb @@ -6,7 +6,7 @@ module TD::Types # @attr chat_id [Integer] Identifier of a chat to which all notifications in the group belong. # @attr notification_settings_chat_id [Integer] Chat identifier, which notification settings must be applied to the # added notifications. - # @attr is_silent [Boolean] True, if the notifications should be shown without sound. + # @attr is_silent [Boolean] True, if the notifications must be shown without sound. # @attr total_count [Integer] Total number of unread notifications in the group, can be bigger than number of active # notifications. # @attr added_notifications [Array] List of added group notifications, sorted by diff --git a/lib/tdlib/types/update/service_notification.rb b/lib/tdlib/types/update/service_notification.rb index f9ba714b..48eefd31 100644 --- a/lib/tdlib/types/update/service_notification.rb +++ b/lib/tdlib/types/update/service_notification.rb @@ -3,8 +3,8 @@ module TD::Types # Upon receiving this the application must show a popup with the content of the notification. # # @attr type [TD::Types::String] Notification type. - # If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; - # if user presses the second, all local data should be destroyed using Destroy method. + # If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; + # if user presses the second, all local data must be destroyed using Destroy method. # @attr content [TD::Types::MessageContent] Notification content. class Update::ServiceNotification < Update attribute :type, TD::Types::String diff --git a/lib/tdlib/types/update/terms_of_service.rb b/lib/tdlib/types/update/terms_of_service.rb index 9d6fd5de..845fb8ed 100644 --- a/lib/tdlib/types/update/terms_of_service.rb +++ b/lib/tdlib/types/update/terms_of_service.rb @@ -1,6 +1,6 @@ module TD::Types # New terms of service must be accepted by the user. - # If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS + # If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS # update". # # @attr terms_of_service_id [TD::Types::String] Identifier of the terms of service. diff --git a/lib/tdlib/types/user_full_info.rb b/lib/tdlib/types/user_full_info.rb index b0092683..08971ade 100644 --- a/lib/tdlib/types/user_full_info.rb +++ b/lib/tdlib/types/user_full_info.rb @@ -9,10 +9,12 @@ module TD::Types # @attr need_phone_number_privacy_exception [Boolean] True, if the current user needs to explicitly allow to share # their phone number with the user when the method addContact is used. # @attr bio [TD::Types::String] A short user bio. - # @attr share_text [TD::Types::String] For bots, the text that is included with the link when users share the bot. + # @attr share_text [TD::Types::String] For bots, the text that is shown on the bot's profile page and is sent + # together with the link when users share the bot. + # @attr description [TD::Types::String] For bots, the text shown in the chat with the bot if the chat is empty. # @attr group_in_common_count [Integer] Number of group chats where both the other user and the current user are a # member; 0 for the current user. - # @attr bot_info [TD::Types::BotInfo, nil] If the user is a bot, information about the bot; may be null. + # @attr commands [Array] For bots, list of the bot commands. class UserFullInfo < Base attribute :photo, TD::Types::ChatPhoto.optional.default(nil) attribute :is_blocked, TD::Types::Bool @@ -22,7 +24,8 @@ class UserFullInfo < Base attribute :need_phone_number_privacy_exception, TD::Types::Bool attribute :bio, TD::Types::String attribute :share_text, TD::Types::String + attribute :description, TD::Types::String attribute :group_in_common_count, TD::Types::Coercible::Integer - attribute :bot_info, TD::Types::BotInfo.optional.default(nil) + attribute :commands, TD::Types::Array.of(TD::Types::BotCommand) end end diff --git a/lib/tdlib/types/user_type/bot.rb b/lib/tdlib/types/user_type/bot.rb index 6a900a71..8dd0fe90 100644 --- a/lib/tdlib/types/user_type/bot.rb +++ b/lib/tdlib/types/user_type/bot.rb @@ -8,7 +8,8 @@ module TD::Types # @attr is_inline [Boolean] True, if the bot supports inline queries. # @attr inline_query_placeholder [TD::Types::String] Placeholder for inline queries (displayed on the application # input field). - # @attr need_location [Boolean] True, if the location of the user should be sent with every inline query to this bot. + # @attr need_location [Boolean] True, if the location of the user is expected to be sent with every inline query to + # this bot. class UserType::Bot < UserType attribute :can_join_groups, TD::Types::Bool attribute :can_read_all_group_messages, TD::Types::Bool diff --git a/lib/tdlib/types/video.rb b/lib/tdlib/types/video.rb index 407455cf..0ea7b2cb 100644 --- a/lib/tdlib/types/video.rb +++ b/lib/tdlib/types/video.rb @@ -8,7 +8,7 @@ module TD::Types # @attr mime_type [TD::Types::String] MIME type of the file; as defined by the sender. # @attr has_stickers [Boolean] True, if stickers were added to the video. # The list of corresponding sticker sets can be received using getAttachedStickerSets. - # @attr supports_streaming [Boolean] True, if the video should be tried to be streamed. + # @attr supports_streaming [Boolean] True, if the video is supposed to be streamed. # @attr minithumbnail [TD::Types::Minithumbnail, nil] Video minithumbnail; may be null. # @attr thumbnail [TD::Types::Thumbnail, nil] Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may # be null. diff --git a/lib/tdlib/types/voice_chat.rb b/lib/tdlib/types/video_chat.rb similarity index 61% rename from lib/tdlib/types/voice_chat.rb rename to lib/tdlib/types/video_chat.rb index 72994363..4df51129 100644 --- a/lib/tdlib/types/voice_chat.rb +++ b/lib/tdlib/types/video_chat.rb @@ -1,12 +1,12 @@ module TD::Types - # Describes a voice chat. + # Describes a video chat. # - # @attr group_call_id [Integer] Group call identifier of an active voice chat; 0 if none. - # Full informationa about the voice chat can be received through the method getGroupCall. - # @attr has_participants [Boolean] True, if the voice chat has participants. + # @attr group_call_id [Integer] Group call identifier of an active video chat; 0 if none. + # Full information about the video chat can be received through the method getGroupCall. + # @attr has_participants [Boolean] True, if the video chat has participants. # @attr default_participant_id [TD::Types::MessageSender, nil] Default group call participant identifier to join the - # voice chat; may be null. - class VoiceChat < Base + # video chat; may be null. + class VideoChat < Base attribute :group_call_id, TD::Types::Coercible::Integer attribute :has_participants, TD::Types::Bool attribute :default_participant_id, TD::Types::MessageSender.optional.default(nil) diff --git a/lib/tdlib/types/web_page_instant_view.rb b/lib/tdlib/types/web_page_instant_view.rb index 05d07558..bb4b2090 100644 --- a/lib/tdlib/types/web_page_instant_view.rb +++ b/lib/tdlib/types/web_page_instant_view.rb @@ -7,11 +7,14 @@ module TD::Types # @attr is_rtl [Boolean] True, if the instant view must be shown from right to left. # @attr is_full [Boolean] True, if the instant view contains the full page. # A network request might be needed to get the full web page instant view. + # @attr feedback_link [TD::Types::InternalLinkType] An internal link to be opened to leave feedback about the instant + # view. class WebPageInstantView < Base attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock) attribute :view_count, TD::Types::Coercible::Integer attribute :version, TD::Types::Coercible::Integer attribute :is_rtl, TD::Types::Bool attribute :is_full, TD::Types::Bool + attribute :feedback_link, TD::Types::InternalLinkType end end