tdlib-ruby 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitmodules +0 -3
- data/.travis.yml +5 -2
- data/bin/build +2 -2
- data/lib/tdlib-ruby.rb +3 -3
- data/lib/tdlib/client.rb +2 -2
- data/lib/tdlib/update_handler.rb +3 -0
- data/lib/tdlib/version.rb +1 -1
- data/spec/integration/tdlib_spec.rb +1 -1
- data/tdlib-ruby.gemspec +1 -3
- metadata +17 -875
- data/bin/parser +0 -467
- data/lib/tdlib/client_methods.rb +0 -4244
- data/lib/tdlib/types.rb +0 -1109
- data/lib/tdlib/types/account_ttl.rb +0 -10
- data/lib/tdlib/types/address.rb +0 -18
- data/lib/tdlib/types/animation.rb +0 -23
- data/lib/tdlib/types/animations.rb +0 -8
- data/lib/tdlib/types/audio.rb +0 -24
- data/lib/tdlib/types/authentication_code_info.rb +0 -15
- data/lib/tdlib/types/authentication_code_type.rb +0 -13
- data/lib/tdlib/types/authentication_code_type/call.rb +0 -8
- data/lib/tdlib/types/authentication_code_type/flash_call.rb +0 -9
- data/lib/tdlib/types/authentication_code_type/sms.rb +0 -8
- data/lib/tdlib/types/authentication_code_type/telegram_message.rb +0 -8
- data/lib/tdlib/types/authorization_state.rb +0 -20
- data/lib/tdlib/types/authorization_state/closed.rb +0 -9
- data/lib/tdlib/types/authorization_state/closing.rb +0 -7
- data/lib/tdlib/types/authorization_state/logging_out.rb +0 -5
- data/lib/tdlib/types/authorization_state/ready.rb +0 -6
- data/lib/tdlib/types/authorization_state/wait_code.rb +0 -8
- data/lib/tdlib/types/authorization_state/wait_encryption_key.rb +0 -8
- data/lib/tdlib/types/authorization_state/wait_other_device_confirmation.rb +0 -9
- data/lib/tdlib/types/authorization_state/wait_password.rb +0 -13
- data/lib/tdlib/types/authorization_state/wait_phone_number.rb +0 -7
- data/lib/tdlib/types/authorization_state/wait_registration.rb +0 -9
- data/lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb +0 -5
- data/lib/tdlib/types/auto_download_settings.rb +0 -23
- data/lib/tdlib/types/auto_download_settings_presets.rb +0 -15
- data/lib/tdlib/types/background.rb +0 -19
- data/lib/tdlib/types/background_fill.rb +0 -11
- data/lib/tdlib/types/background_fill/gradient.rb +0 -13
- data/lib/tdlib/types/background_fill/solid.rb +0 -8
- data/lib/tdlib/types/background_type.rb +0 -12
- data/lib/tdlib/types/background_type/fill.rb +0 -8
- data/lib/tdlib/types/background_type/pattern.rb +0 -13
- data/lib/tdlib/types/background_type/wallpaper.rb +0 -11
- data/lib/tdlib/types/backgrounds.rb +0 -8
- data/lib/tdlib/types/base.rb +0 -29
- data/lib/tdlib/types/basic_group.rb +0 -16
- data/lib/tdlib/types/basic_group_full_info.rb +0 -15
- data/lib/tdlib/types/bot_command.rb +0 -10
- data/lib/tdlib/types/bot_info.rb +0 -10
- data/lib/tdlib/types/call.rb +0 -14
- data/lib/tdlib/types/call_connection.rb +0 -16
- data/lib/tdlib/types/call_discard_reason.rb +0 -14
- data/lib/tdlib/types/call_discard_reason/declined.rb +0 -6
- data/lib/tdlib/types/call_discard_reason/disconnected.rb +0 -5
- data/lib/tdlib/types/call_discard_reason/empty.rb +0 -5
- data/lib/tdlib/types/call_discard_reason/hung_up.rb +0 -5
- data/lib/tdlib/types/call_discard_reason/missed.rb +0 -6
- data/lib/tdlib/types/call_id.rb +0 -8
- data/lib/tdlib/types/call_problem.rb +0 -16
- data/lib/tdlib/types/call_problem/distorted_speech.rb +0 -5
- data/lib/tdlib/types/call_problem/dropped.rb +0 -5
- data/lib/tdlib/types/call_problem/echo.rb +0 -5
- data/lib/tdlib/types/call_problem/interruptions.rb +0 -5
- data/lib/tdlib/types/call_problem/noise.rb +0 -5
- data/lib/tdlib/types/call_problem/silent_local.rb +0 -5
- data/lib/tdlib/types/call_problem/silent_remote.rb +0 -5
- data/lib/tdlib/types/call_protocol.rb +0 -14
- data/lib/tdlib/types/call_state.rb +0 -15
- data/lib/tdlib/types/call_state/discarded.rb +0 -12
- data/lib/tdlib/types/call_state/error.rb +0 -9
- data/lib/tdlib/types/call_state/exchanging_keys.rb +0 -5
- data/lib/tdlib/types/call_state/hanging_up.rb +0 -5
- data/lib/tdlib/types/call_state/pending.rb +0 -10
- data/lib/tdlib/types/call_state/ready.rb +0 -18
- data/lib/tdlib/types/callback_query_answer.rb +0 -12
- data/lib/tdlib/types/callback_query_payload.rb +0 -11
- data/lib/tdlib/types/callback_query_payload/data.rb +0 -8
- data/lib/tdlib/types/callback_query_payload/game.rb +0 -8
- data/lib/tdlib/types/can_transfer_ownership_result.rb +0 -13
- data/lib/tdlib/types/can_transfer_ownership_result/ok.rb +0 -5
- data/lib/tdlib/types/can_transfer_ownership_result/password_needed.rb +0 -5
- data/lib/tdlib/types/can_transfer_ownership_result/password_too_fresh.rb +0 -8
- data/lib/tdlib/types/can_transfer_ownership_result/session_too_fresh.rb +0 -8
- data/lib/tdlib/types/chat.rb +0 -68
- data/lib/tdlib/types/chat_action.rb +0 -22
- data/lib/tdlib/types/chat_action/cancel.rb +0 -5
- data/lib/tdlib/types/chat_action/choosing_contact.rb +0 -5
- data/lib/tdlib/types/chat_action/choosing_location.rb +0 -5
- data/lib/tdlib/types/chat_action/recording_video.rb +0 -5
- data/lib/tdlib/types/chat_action/recording_video_note.rb +0 -5
- data/lib/tdlib/types/chat_action/recording_voice_note.rb +0 -5
- data/lib/tdlib/types/chat_action/start_playing_game.rb +0 -5
- data/lib/tdlib/types/chat_action/typing.rb +0 -5
- data/lib/tdlib/types/chat_action/uploading_document.rb +0 -8
- data/lib/tdlib/types/chat_action/uploading_photo.rb +0 -8
- data/lib/tdlib/types/chat_action/uploading_video.rb +0 -8
- data/lib/tdlib/types/chat_action/uploading_video_note.rb +0 -8
- data/lib/tdlib/types/chat_action/uploading_voice_note.rb +0 -8
- data/lib/tdlib/types/chat_action_bar.rb +0 -14
- data/lib/tdlib/types/chat_action_bar/add_contact.rb +0 -6
- data/lib/tdlib/types/chat_action_bar/report_add_block.rb +0 -6
- data/lib/tdlib/types/chat_action_bar/report_spam.rb +0 -5
- data/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb +0 -6
- data/lib/tdlib/types/chat_action_bar/share_phone_number.rb +0 -6
- data/lib/tdlib/types/chat_administrator.rb +0 -12
- data/lib/tdlib/types/chat_administrators.rb +0 -8
- data/lib/tdlib/types/chat_event.rb +0 -14
- data/lib/tdlib/types/chat_event_action.rb +0 -31
- data/lib/tdlib/types/chat_event_action/description_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/invites_toggled.rb +0 -8
- data/lib/tdlib/types/chat_event_action/is_all_history_available_toggled.rb +0 -8
- data/lib/tdlib/types/chat_event_action/linked_chat_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/location_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/member_invited.rb +0 -10
- data/lib/tdlib/types/chat_event_action/member_joined.rb +0 -5
- data/lib/tdlib/types/chat_event_action/member_left.rb +0 -5
- data/lib/tdlib/types/chat_event_action/member_promoted.rb +0 -12
- data/lib/tdlib/types/chat_event_action/member_restricted.rb +0 -12
- data/lib/tdlib/types/chat_event_action/message_deleted.rb +0 -8
- data/lib/tdlib/types/chat_event_action/message_edited.rb +0 -10
- data/lib/tdlib/types/chat_event_action/message_pinned.rb +0 -8
- data/lib/tdlib/types/chat_event_action/message_unpinned.rb +0 -5
- data/lib/tdlib/types/chat_event_action/permissions_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/photo_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/poll_stopped.rb +0 -8
- data/lib/tdlib/types/chat_event_action/sign_messages_toggled.rb +0 -8
- data/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/sticker_set_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/title_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_action/username_changed.rb +0 -10
- data/lib/tdlib/types/chat_event_log_filters.rb +0 -27
- data/lib/tdlib/types/chat_events.rb +0 -8
- data/lib/tdlib/types/chat_invite_link.rb +0 -8
- data/lib/tdlib/types/chat_invite_link_info.rb +0 -21
- data/lib/tdlib/types/chat_list.rb +0 -11
- data/lib/tdlib/types/chat_list/archive.rb +0 -6
- data/lib/tdlib/types/chat_list/main.rb +0 -5
- data/lib/tdlib/types/chat_location.rb +0 -10
- data/lib/tdlib/types/chat_member.rb +0 -18
- data/lib/tdlib/types/chat_member_status.rb +0 -15
- data/lib/tdlib/types/chat_member_status/administrator.rb +0 -32
- data/lib/tdlib/types/chat_member_status/banned.rb +0 -11
- data/lib/tdlib/types/chat_member_status/creator.rb +0 -11
- data/lib/tdlib/types/chat_member_status/left.rb +0 -5
- data/lib/tdlib/types/chat_member_status/member.rb +0 -5
- data/lib/tdlib/types/chat_member_status/restricted.rb +0 -16
- data/lib/tdlib/types/chat_members.rb +0 -10
- data/lib/tdlib/types/chat_members_filter.rb +0 -15
- data/lib/tdlib/types/chat_members_filter/administrators.rb +0 -5
- data/lib/tdlib/types/chat_members_filter/banned.rb +0 -5
- data/lib/tdlib/types/chat_members_filter/bots.rb +0 -5
- data/lib/tdlib/types/chat_members_filter/contacts.rb +0 -5
- data/lib/tdlib/types/chat_members_filter/members.rb +0 -5
- data/lib/tdlib/types/chat_members_filter/restricted.rb +0 -5
- data/lib/tdlib/types/chat_nearby.rb +0 -10
- data/lib/tdlib/types/chat_notification_settings.rb +0 -34
- data/lib/tdlib/types/chat_permissions.rb +0 -28
- data/lib/tdlib/types/chat_photo.rb +0 -12
- data/lib/tdlib/types/chat_report_reason.rb +0 -16
- data/lib/tdlib/types/chat_report_reason/child_abuse.rb +0 -5
- data/lib/tdlib/types/chat_report_reason/copyright.rb +0 -5
- data/lib/tdlib/types/chat_report_reason/custom.rb +0 -8
- data/lib/tdlib/types/chat_report_reason/pornography.rb +0 -5
- data/lib/tdlib/types/chat_report_reason/spam.rb +0 -5
- data/lib/tdlib/types/chat_report_reason/unrelated_location.rb +0 -5
- data/lib/tdlib/types/chat_report_reason/violence.rb +0 -5
- data/lib/tdlib/types/chat_type.rb +0 -13
- data/lib/tdlib/types/chat_type/basic_group.rb +0 -8
- data/lib/tdlib/types/chat_type/private.rb +0 -8
- data/lib/tdlib/types/chat_type/secret.rb +0 -10
- data/lib/tdlib/types/chat_type/supergroup.rb +0 -11
- data/lib/tdlib/types/chats.rb +0 -8
- data/lib/tdlib/types/chats_nearby.rb +0 -10
- data/lib/tdlib/types/check_chat_username_result.rb +0 -14
- data/lib/tdlib/types/check_chat_username_result/ok.rb +0 -5
- data/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb +0 -5
- data/lib/tdlib/types/check_chat_username_result/public_groups_unavailable.rb +0 -5
- data/lib/tdlib/types/check_chat_username_result/username_invalid.rb +0 -5
- data/lib/tdlib/types/check_chat_username_result/username_occupied.rb +0 -5
- data/lib/tdlib/types/connected_website.rb +0 -25
- data/lib/tdlib/types/connected_websites.rb +0 -8
- data/lib/tdlib/types/connection_state.rb +0 -14
- data/lib/tdlib/types/connection_state/connecting.rb +0 -5
- data/lib/tdlib/types/connection_state/connecting_to_proxy.rb +0 -5
- data/lib/tdlib/types/connection_state/ready.rb +0 -5
- data/lib/tdlib/types/connection_state/updating.rb +0 -5
- data/lib/tdlib/types/connection_state/waiting_for_network.rb +0 -6
- data/lib/tdlib/types/contact.rb +0 -16
- data/lib/tdlib/types/count.rb +0 -8
- data/lib/tdlib/types/custom_request_result.rb +0 -8
- data/lib/tdlib/types/database_statistics.rb +0 -8
- data/lib/tdlib/types/date.rb +0 -12
- data/lib/tdlib/types/dated_file.rb +0 -10
- data/lib/tdlib/types/deep_link_info.rb +0 -10
- data/lib/tdlib/types/device_token.rb +0 -22
- data/lib/tdlib/types/device_token/apple_push.rb +0 -10
- data/lib/tdlib/types/device_token/apple_push_vo_ip.rb +0 -12
- data/lib/tdlib/types/device_token/black_berry_push.rb +0 -8
- data/lib/tdlib/types/device_token/firebase_cloud_messaging.rb +0 -10
- data/lib/tdlib/types/device_token/microsoft_push.rb +0 -8
- data/lib/tdlib/types/device_token/microsoft_push_vo_ip.rb +0 -8
- data/lib/tdlib/types/device_token/simple_push.rb +0 -9
- data/lib/tdlib/types/device_token/tizen_push.rb +0 -8
- data/lib/tdlib/types/device_token/ubuntu_push.rb +0 -8
- data/lib/tdlib/types/device_token/web_push.rb +0 -13
- data/lib/tdlib/types/device_token/windows_push.rb +0 -9
- data/lib/tdlib/types/document.rb +0 -17
- data/lib/tdlib/types/draft_message.rb +0 -11
- data/lib/tdlib/types/email_address_authentication_code_info.rb +0 -10
- data/lib/tdlib/types/emojis.rb +0 -8
- data/lib/tdlib/types/encrypted_credentials.rb +0 -12
- data/lib/tdlib/types/encrypted_passport_element.rb +0 -25
- data/lib/tdlib/types/error.rb +0 -12
- data/lib/tdlib/types/file.rb +0 -18
- data/lib/tdlib/types/file_part.rb +0 -8
- data/lib/tdlib/types/file_type.rb +0 -25
- data/lib/tdlib/types/file_type/animation.rb +0 -5
- data/lib/tdlib/types/file_type/audio.rb +0 -5
- data/lib/tdlib/types/file_type/document.rb +0 -5
- data/lib/tdlib/types/file_type/none.rb +0 -5
- data/lib/tdlib/types/file_type/photo.rb +0 -5
- data/lib/tdlib/types/file_type/profile_photo.rb +0 -5
- data/lib/tdlib/types/file_type/secret.rb +0 -5
- data/lib/tdlib/types/file_type/secret_thumbnail.rb +0 -5
- data/lib/tdlib/types/file_type/secure.rb +0 -5
- data/lib/tdlib/types/file_type/sticker.rb +0 -5
- data/lib/tdlib/types/file_type/thumbnail.rb +0 -5
- data/lib/tdlib/types/file_type/unknown.rb +0 -5
- data/lib/tdlib/types/file_type/video.rb +0 -5
- data/lib/tdlib/types/file_type/video_note.rb +0 -5
- data/lib/tdlib/types/file_type/voice_note.rb +0 -5
- data/lib/tdlib/types/file_type/wallpaper.rb +0 -5
- data/lib/tdlib/types/formatted_text.rb +0 -14
- data/lib/tdlib/types/found_messages.rb +0 -10
- data/lib/tdlib/types/game.rb +0 -21
- data/lib/tdlib/types/game_high_score.rb +0 -12
- data/lib/tdlib/types/game_high_scores.rb +0 -8
- data/lib/tdlib/types/hashtags.rb +0 -8
- data/lib/tdlib/types/http_url.rb +0 -8
- data/lib/tdlib/types/identity_document.rb +0 -19
- data/lib/tdlib/types/imported_contacts.rb +0 -12
- data/lib/tdlib/types/inline_keyboard_button.rb +0 -10
- data/lib/tdlib/types/inline_keyboard_button_type.rb +0 -15
- data/lib/tdlib/types/inline_keyboard_button_type/buy.rb +0 -7
- data/lib/tdlib/types/inline_keyboard_button_type/callback.rb +0 -8
- data/lib/tdlib/types/inline_keyboard_button_type/callback_game.rb +0 -7
- data/lib/tdlib/types/inline_keyboard_button_type/login_url.rb +0 -12
- data/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb +0 -10
- data/lib/tdlib/types/inline_keyboard_button_type/url.rb +0 -8
- data/lib/tdlib/types/inline_query_result.rb +0 -21
- data/lib/tdlib/types/inline_query_result/animation.rb +0 -12
- data/lib/tdlib/types/inline_query_result/article.rb +0 -18
- data/lib/tdlib/types/inline_query_result/audio.rb +0 -10
- data/lib/tdlib/types/inline_query_result/contact.rb +0 -12
- data/lib/tdlib/types/inline_query_result/document.rb +0 -14
- data/lib/tdlib/types/inline_query_result/game.rb +0 -10
- data/lib/tdlib/types/inline_query_result/location.rb +0 -14
- data/lib/tdlib/types/inline_query_result/photo.rb +0 -14
- data/lib/tdlib/types/inline_query_result/sticker.rb +0 -10
- data/lib/tdlib/types/inline_query_result/venue.rb +0 -12
- data/lib/tdlib/types/inline_query_result/video.rb +0 -14
- data/lib/tdlib/types/inline_query_result/voice_note.rb +0 -12
- data/lib/tdlib/types/inline_query_results.rb +0 -19
- data/lib/tdlib/types/input_background.rb +0 -11
- data/lib/tdlib/types/input_background/local.rb +0 -10
- data/lib/tdlib/types/input_background/remote.rb +0 -8
- data/lib/tdlib/types/input_credentials.rb +0 -13
- data/lib/tdlib/types/input_credentials/android_pay.rb +0 -8
- data/lib/tdlib/types/input_credentials/apple_pay.rb +0 -8
- data/lib/tdlib/types/input_credentials/new.rb +0 -10
- data/lib/tdlib/types/input_credentials/saved.rb +0 -9
- data/lib/tdlib/types/input_file.rb +0 -13
- data/lib/tdlib/types/input_file/generated.rb +0 -15
- data/lib/tdlib/types/input_file/id.rb +0 -8
- data/lib/tdlib/types/input_file/local.rb +0 -8
- data/lib/tdlib/types/input_file/remote.rb +0 -12
- data/lib/tdlib/types/input_identity_document.rb +0 -19
- data/lib/tdlib/types/input_inline_query_result.rb +0 -22
- data/lib/tdlib/types/input_inline_query_result/animated_gif.rb +0 -27
- data/lib/tdlib/types/input_inline_query_result/animated_mpeg4.rb +0 -28
- data/lib/tdlib/types/input_inline_query_result/article.rb +0 -29
- data/lib/tdlib/types/input_inline_query_result/audio.rb +0 -23
- data/lib/tdlib/types/input_inline_query_result/contact.rb +0 -23
- data/lib/tdlib/types/input_inline_query_result/document.rb +0 -30
- data/lib/tdlib/types/input_inline_query_result/game.rb +0 -13
- data/lib/tdlib/types/input_inline_query_result/location.rb +0 -28
- data/lib/tdlib/types/input_inline_query_result/photo.rb +0 -27
- data/lib/tdlib/types/input_inline_query_result/sticker.rb +0 -23
- data/lib/tdlib/types/input_inline_query_result/venue.rb +0 -23
- data/lib/tdlib/types/input_inline_query_result/video.rb +0 -32
- data/lib/tdlib/types/input_inline_query_result/voice_note.rb +0 -21
- data/lib/tdlib/types/input_message_content.rb +0 -25
- data/lib/tdlib/types/input_message_content/animation.rb +0 -18
- data/lib/tdlib/types/input_message_content/audio.rb +0 -18
- data/lib/tdlib/types/input_message_content/contact.rb +0 -8
- data/lib/tdlib/types/input_message_content/document.rb +0 -12
- data/lib/tdlib/types/input_message_content/forwarded.rb +0 -20
- data/lib/tdlib/types/input_message_content/game.rb +0 -10
- data/lib/tdlib/types/input_message_content/invoice.rb +0 -28
- data/lib/tdlib/types/input_message_content/location.rb +0 -11
- data/lib/tdlib/types/input_message_content/photo.rb +0 -22
- data/lib/tdlib/types/input_message_content/poll.rb +0 -11
- data/lib/tdlib/types/input_message_content/sticker.rb +0 -14
- data/lib/tdlib/types/input_message_content/text.rb +0 -15
- data/lib/tdlib/types/input_message_content/venue.rb +0 -8
- data/lib/tdlib/types/input_message_content/video.rb +0 -25
- data/lib/tdlib/types/input_message_content/video_note.rb +0 -14
- data/lib/tdlib/types/input_message_content/voice_note.rb +0 -14
- data/lib/tdlib/types/input_passport_element.rb +0 -22
- data/lib/tdlib/types/input_passport_element/address.rb +0 -8
- data/lib/tdlib/types/input_passport_element/bank_statement.rb +0 -8
- data/lib/tdlib/types/input_passport_element/driver_license.rb +0 -8
- data/lib/tdlib/types/input_passport_element/email_address.rb +0 -8
- data/lib/tdlib/types/input_passport_element/identity_card.rb +0 -8
- data/lib/tdlib/types/input_passport_element/internal_passport.rb +0 -8
- data/lib/tdlib/types/input_passport_element/passport.rb +0 -8
- data/lib/tdlib/types/input_passport_element/passport_registration.rb +0 -8
- data/lib/tdlib/types/input_passport_element/personal_details.rb +0 -8
- data/lib/tdlib/types/input_passport_element/phone_number.rb +0 -8
- data/lib/tdlib/types/input_passport_element/rental_agreement.rb +0 -8
- data/lib/tdlib/types/input_passport_element/temporary_registration.rb +0 -8
- data/lib/tdlib/types/input_passport_element/utility_bill.rb +0 -8
- data/lib/tdlib/types/input_passport_element_error.rb +0 -12
- data/lib/tdlib/types/input_passport_element_error_source.rb +0 -18
- data/lib/tdlib/types/input_passport_element_error_source/data_field.rb +0 -11
- data/lib/tdlib/types/input_passport_element_error_source/file.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/files.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/front_side.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/reverse_side.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/selfie.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/translation_file.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/translation_files.rb +0 -9
- data/lib/tdlib/types/input_passport_element_error_source/unspecified.rb +0 -9
- data/lib/tdlib/types/input_personal_document.rb +0 -11
- data/lib/tdlib/types/input_sticker.rb +0 -14
- data/lib/tdlib/types/input_thumbnail.rb +0 -16
- data/lib/tdlib/types/invoice.rb +0 -27
- data/lib/tdlib/types/json_object_member.rb +0 -10
- data/lib/tdlib/types/json_value.rb +0 -15
- data/lib/tdlib/types/json_value/array.rb +0 -8
- data/lib/tdlib/types/json_value/boolean.rb +0 -8
- data/lib/tdlib/types/json_value/null.rb +0 -5
- data/lib/tdlib/types/json_value/number.rb +0 -8
- data/lib/tdlib/types/json_value/object.rb +0 -8
- data/lib/tdlib/types/json_value/string.rb +0 -8
- data/lib/tdlib/types/keyboard_button.rb +0 -10
- data/lib/tdlib/types/keyboard_button_type.rb +0 -12
- data/lib/tdlib/types/keyboard_button_type/request_location.rb +0 -5
- data/lib/tdlib/types/keyboard_button_type/request_phone_number.rb +0 -5
- data/lib/tdlib/types/keyboard_button_type/text.rb +0 -5
- data/lib/tdlib/types/labeled_price_part.rb +0 -10
- data/lib/tdlib/types/language_pack_info.rb +0 -35
- data/lib/tdlib/types/language_pack_string.rb +0 -10
- data/lib/tdlib/types/language_pack_string_value.rb +0 -12
- data/lib/tdlib/types/language_pack_string_value/deleted.rb +0 -5
- data/lib/tdlib/types/language_pack_string_value/ordinary.rb +0 -8
- data/lib/tdlib/types/language_pack_string_value/pluralized.rb +0 -19
- data/lib/tdlib/types/language_pack_strings.rb +0 -8
- data/lib/tdlib/types/local_file.rb +0 -28
- data/lib/tdlib/types/localization_target_info.rb +0 -8
- data/lib/tdlib/types/location.rb +0 -10
- data/lib/tdlib/types/log_stream.rb +0 -12
- data/lib/tdlib/types/log_stream/default.rb +0 -5
- data/lib/tdlib/types/log_stream/empty.rb +0 -5
- data/lib/tdlib/types/log_stream/file.rb +0 -11
- data/lib/tdlib/types/log_tags.rb +0 -8
- data/lib/tdlib/types/log_verbosity_level.rb +0 -8
- data/lib/tdlib/types/login_url_info.rb +0 -11
- data/lib/tdlib/types/login_url_info/open.rb +0 -10
- data/lib/tdlib/types/login_url_info/request_confirmation.rb +0 -15
- data/lib/tdlib/types/mask_point.rb +0 -13
- data/lib/tdlib/types/mask_point/chin.rb +0 -5
- data/lib/tdlib/types/mask_point/eyes.rb +0 -5
- data/lib/tdlib/types/mask_point/forehead.rb +0 -5
- data/lib/tdlib/types/mask_point/mouth.rb +0 -5
- data/lib/tdlib/types/mask_position.rb +0 -17
- data/lib/tdlib/types/message.rb +0 -67
- data/lib/tdlib/types/message_content.rb +0 -49
- data/lib/tdlib/types/message_content/animation.rb +0 -13
- data/lib/tdlib/types/message_content/audio.rb +0 -10
- data/lib/tdlib/types/message_content/basic_group_chat_create.rb +0 -10
- data/lib/tdlib/types/message_content/call.rb +0 -10
- data/lib/tdlib/types/message_content/chat_add_members.rb +0 -8
- data/lib/tdlib/types/message_content/chat_change_photo.rb +0 -8
- data/lib/tdlib/types/message_content/chat_change_title.rb +0 -8
- data/lib/tdlib/types/message_content/chat_delete_member.rb +0 -8
- data/lib/tdlib/types/message_content/chat_delete_photo.rb +0 -5
- data/lib/tdlib/types/message_content/chat_join_by_link.rb +0 -5
- data/lib/tdlib/types/message_content/chat_set_ttl.rb +0 -8
- data/lib/tdlib/types/message_content/chat_upgrade_from.rb +0 -10
- data/lib/tdlib/types/message_content/chat_upgrade_to.rb +0 -8
- data/lib/tdlib/types/message_content/contact.rb +0 -8
- data/lib/tdlib/types/message_content/contact_registered.rb +0 -5
- data/lib/tdlib/types/message_content/custom_service_action.rb +0 -8
- data/lib/tdlib/types/message_content/document.rb +0 -10
- data/lib/tdlib/types/message_content/expired_photo.rb +0 -5
- data/lib/tdlib/types/message_content/expired_video.rb +0 -5
- data/lib/tdlib/types/message_content/game.rb +0 -8
- data/lib/tdlib/types/message_content/game_score.rb +0 -13
- data/lib/tdlib/types/message_content/invoice.rb +0 -26
- data/lib/tdlib/types/message_content/location.rb +0 -14
- data/lib/tdlib/types/message_content/passport_data_received.rb +0 -10
- data/lib/tdlib/types/message_content/passport_data_sent.rb +0 -8
- data/lib/tdlib/types/message_content/payment_successful.rb +0 -13
- data/lib/tdlib/types/message_content/payment_successful_bot.rb +0 -24
- data/lib/tdlib/types/message_content/photo.rb +0 -12
- data/lib/tdlib/types/message_content/pin_message.rb +0 -8
- data/lib/tdlib/types/message_content/poll.rb +0 -8
- data/lib/tdlib/types/message_content/screenshot_taken.rb +0 -5
- data/lib/tdlib/types/message_content/sticker.rb +0 -8
- data/lib/tdlib/types/message_content/supergroup_chat_create.rb +0 -8
- data/lib/tdlib/types/message_content/text.rb +0 -10
- data/lib/tdlib/types/message_content/unsupported.rb +0 -5
- data/lib/tdlib/types/message_content/venue.rb +0 -8
- data/lib/tdlib/types/message_content/video.rb +0 -13
- data/lib/tdlib/types/message_content/video_note.rb +0 -13
- data/lib/tdlib/types/message_content/voice_note.rb +0 -12
- data/lib/tdlib/types/message_content/website_connected.rb +0 -8
- data/lib/tdlib/types/message_forward_info.rb +0 -17
- data/lib/tdlib/types/message_forward_origin.rb +0 -12
- data/lib/tdlib/types/message_forward_origin/channel.rb +0 -12
- data/lib/tdlib/types/message_forward_origin/hidden_user.rb +0 -8
- data/lib/tdlib/types/message_forward_origin/user.rb +0 -8
- data/lib/tdlib/types/message_link_info.rb +0 -14
- data/lib/tdlib/types/message_scheduling_state.rb +0 -11
- data/lib/tdlib/types/message_scheduling_state/send_at_date.rb +0 -9
- data/lib/tdlib/types/message_scheduling_state/send_when_online.rb +0 -6
- data/lib/tdlib/types/message_sending_state.rb +0 -11
- data/lib/tdlib/types/message_sending_state/failed.rb +0 -15
- data/lib/tdlib/types/message_sending_state/pending.rb +0 -5
- data/lib/tdlib/types/messages.rb +0 -10
- data/lib/tdlib/types/minithumbnail.rb +0 -12
- data/lib/tdlib/types/network_statistics.rb +0 -10
- data/lib/tdlib/types/network_statistics_entry.rb +0 -11
- data/lib/tdlib/types/network_statistics_entry/call.rb +0 -15
- data/lib/tdlib/types/network_statistics_entry/file.rb +0 -15
- data/lib/tdlib/types/network_type.rb +0 -14
- data/lib/tdlib/types/network_type/mobile.rb +0 -5
- data/lib/tdlib/types/network_type/mobile_roaming.rb +0 -5
- data/lib/tdlib/types/network_type/none.rb +0 -5
- data/lib/tdlib/types/network_type/other.rb +0 -5
- data/lib/tdlib/types/network_type/wi_fi.rb +0 -5
- data/lib/tdlib/types/notification.rb +0 -14
- data/lib/tdlib/types/notification_group.rb +0 -16
- data/lib/tdlib/types/notification_group_type.rb +0 -13
- data/lib/tdlib/types/notification_group_type/calls.rb +0 -5
- data/lib/tdlib/types/notification_group_type/mentions.rb +0 -6
- data/lib/tdlib/types/notification_group_type/messages.rb +0 -6
- data/lib/tdlib/types/notification_group_type/secret_chat.rb +0 -5
- data/lib/tdlib/types/notification_settings_scope.rb +0 -12
- data/lib/tdlib/types/notification_settings_scope/channel_chats.rb +0 -5
- data/lib/tdlib/types/notification_settings_scope/group_chats.rb +0 -6
- data/lib/tdlib/types/notification_settings_scope/private_chats.rb +0 -6
- data/lib/tdlib/types/notification_type.rb +0 -13
- data/lib/tdlib/types/notification_type/new_call.rb +0 -8
- data/lib/tdlib/types/notification_type/new_message.rb +0 -8
- data/lib/tdlib/types/notification_type/new_push_message.rb +0 -15
- data/lib/tdlib/types/notification_type/new_secret_chat.rb +0 -5
- data/lib/tdlib/types/ok.rb +0 -5
- data/lib/tdlib/types/option_value.rb +0 -13
- data/lib/tdlib/types/option_value/boolean.rb +0 -8
- data/lib/tdlib/types/option_value/empty.rb +0 -5
- data/lib/tdlib/types/option_value/integer.rb +0 -8
- data/lib/tdlib/types/option_value/string.rb +0 -8
- data/lib/tdlib/types/order_info.rb +0 -14
- data/lib/tdlib/types/page_block.rb +0 -38
- data/lib/tdlib/types/page_block/anchor.rb +0 -8
- data/lib/tdlib/types/page_block/animation.rb +0 -12
- data/lib/tdlib/types/page_block/audio.rb +0 -10
- data/lib/tdlib/types/page_block/author_date.rb +0 -10
- data/lib/tdlib/types/page_block/block_quote.rb +0 -10
- data/lib/tdlib/types/page_block/chat_link.rb +0 -12
- data/lib/tdlib/types/page_block/collage.rb +0 -10
- data/lib/tdlib/types/page_block/cover.rb +0 -8
- data/lib/tdlib/types/page_block/details.rb +0 -12
- data/lib/tdlib/types/page_block/divider.rb +0 -5
- data/lib/tdlib/types/page_block/embedded.rb +0 -22
- data/lib/tdlib/types/page_block/embedded_post.rb +0 -18
- data/lib/tdlib/types/page_block/footer.rb +0 -8
- data/lib/tdlib/types/page_block/header.rb +0 -8
- data/lib/tdlib/types/page_block/kicker.rb +0 -8
- data/lib/tdlib/types/page_block/list.rb +0 -8
- data/lib/tdlib/types/page_block/map.rb +0 -16
- data/lib/tdlib/types/page_block/paragraph.rb +0 -8
- data/lib/tdlib/types/page_block/photo.rb +0 -12
- data/lib/tdlib/types/page_block/preformatted.rb +0 -10
- data/lib/tdlib/types/page_block/pull_quote.rb +0 -10
- data/lib/tdlib/types/page_block/related_articles.rb +0 -10
- data/lib/tdlib/types/page_block/slideshow.rb +0 -10
- data/lib/tdlib/types/page_block/subheader.rb +0 -8
- data/lib/tdlib/types/page_block/subtitle.rb +0 -8
- data/lib/tdlib/types/page_block/table.rb +0 -14
- data/lib/tdlib/types/page_block/title.rb +0 -8
- data/lib/tdlib/types/page_block/video.rb +0 -14
- data/lib/tdlib/types/page_block/voice_note.rb +0 -10
- data/lib/tdlib/types/page_block_caption.rb +0 -10
- data/lib/tdlib/types/page_block_horizontal_alignment.rb +0 -12
- data/lib/tdlib/types/page_block_horizontal_alignment/center.rb +0 -5
- data/lib/tdlib/types/page_block_horizontal_alignment/left.rb +0 -5
- data/lib/tdlib/types/page_block_horizontal_alignment/right.rb +0 -5
- data/lib/tdlib/types/page_block_list_item.rb +0 -10
- data/lib/tdlib/types/page_block_related_article.rb +0 -18
- data/lib/tdlib/types/page_block_table_cell.rb +0 -19
- data/lib/tdlib/types/page_block_vertical_alignment.rb +0 -12
- data/lib/tdlib/types/page_block_vertical_alignment/bottom.rb +0 -5
- data/lib/tdlib/types/page_block_vertical_alignment/middle.rb +0 -5
- data/lib/tdlib/types/page_block_vertical_alignment/top.rb +0 -5
- data/lib/tdlib/types/passport_authorization_form.rb +0 -13
- data/lib/tdlib/types/passport_element.rb +0 -22
- data/lib/tdlib/types/passport_element/address.rb +0 -8
- data/lib/tdlib/types/passport_element/bank_statement.rb +0 -8
- data/lib/tdlib/types/passport_element/driver_license.rb +0 -8
- data/lib/tdlib/types/passport_element/email_address.rb +0 -8
- data/lib/tdlib/types/passport_element/identity_card.rb +0 -8
- data/lib/tdlib/types/passport_element/internal_passport.rb +0 -8
- data/lib/tdlib/types/passport_element/passport.rb +0 -8
- data/lib/tdlib/types/passport_element/passport_registration.rb +0 -8
- data/lib/tdlib/types/passport_element/personal_details.rb +0 -8
- data/lib/tdlib/types/passport_element/phone_number.rb +0 -8
- data/lib/tdlib/types/passport_element/rental_agreement.rb +0 -8
- data/lib/tdlib/types/passport_element/temporary_registration.rb +0 -8
- data/lib/tdlib/types/passport_element/utility_bill.rb +0 -8
- data/lib/tdlib/types/passport_element_error.rb +0 -12
- data/lib/tdlib/types/passport_element_error_source.rb +0 -18
- data/lib/tdlib/types/passport_element_error_source/data_field.rb +0 -9
- data/lib/tdlib/types/passport_element_error_source/file.rb +0 -9
- data/lib/tdlib/types/passport_element_error_source/files.rb +0 -6
- data/lib/tdlib/types/passport_element_error_source/front_side.rb +0 -6
- data/lib/tdlib/types/passport_element_error_source/reverse_side.rb +0 -6
- data/lib/tdlib/types/passport_element_error_source/selfie.rb +0 -6
- data/lib/tdlib/types/passport_element_error_source/translation_file.rb +0 -9
- data/lib/tdlib/types/passport_element_error_source/translation_files.rb +0 -6
- data/lib/tdlib/types/passport_element_error_source/unspecified.rb +0 -6
- data/lib/tdlib/types/passport_element_type.rb +0 -22
- data/lib/tdlib/types/passport_element_type/address.rb +0 -5
- data/lib/tdlib/types/passport_element_type/bank_statement.rb +0 -5
- data/lib/tdlib/types/passport_element_type/driver_license.rb +0 -5
- data/lib/tdlib/types/passport_element_type/email_address.rb +0 -5
- data/lib/tdlib/types/passport_element_type/identity_card.rb +0 -5
- data/lib/tdlib/types/passport_element_type/internal_passport.rb +0 -5
- data/lib/tdlib/types/passport_element_type/passport.rb +0 -5
- data/lib/tdlib/types/passport_element_type/passport_registration.rb +0 -5
- data/lib/tdlib/types/passport_element_type/personal_details.rb +0 -5
- data/lib/tdlib/types/passport_element_type/phone_number.rb +0 -5
- data/lib/tdlib/types/passport_element_type/rental_agreement.rb +0 -5
- data/lib/tdlib/types/passport_element_type/temporary_registration.rb +0 -5
- data/lib/tdlib/types/passport_element_type/utility_bill.rb +0 -5
- data/lib/tdlib/types/passport_elements.rb +0 -8
- data/lib/tdlib/types/passport_elements_with_errors.rb +0 -10
- data/lib/tdlib/types/passport_required_element.rb +0 -9
- data/lib/tdlib/types/passport_suitable_element.rb +0 -15
- data/lib/tdlib/types/password_state.rb +0 -17
- data/lib/tdlib/types/payment_form.rb +0 -23
- data/lib/tdlib/types/payment_receipt.rb +0 -18
- data/lib/tdlib/types/payment_result.rb +0 -11
- data/lib/tdlib/types/payments_provider_stripe.rb +0 -14
- data/lib/tdlib/types/personal_details.rb +0 -26
- data/lib/tdlib/types/personal_document.rb +0 -11
- data/lib/tdlib/types/phone_number_authentication_settings.rb +0 -16
- data/lib/tdlib/types/photo.rb +0 -12
- data/lib/tdlib/types/photo_size.rb +0 -14
- data/lib/tdlib/types/poll.rb +0 -16
- data/lib/tdlib/types/poll_option.rb +0 -16
- data/lib/tdlib/types/profile_photo.rb +0 -15
- data/lib/tdlib/types/proxies.rb +0 -8
- data/lib/tdlib/types/proxy.rb +0 -18
- data/lib/tdlib/types/proxy_type.rb +0 -12
- data/lib/tdlib/types/proxy_type/http.rb +0 -13
- data/lib/tdlib/types/proxy_type/mtproto.rb +0 -8
- data/lib/tdlib/types/proxy_type/socks5.rb +0 -10
- data/lib/tdlib/types/public_chat_type.rb +0 -11
- data/lib/tdlib/types/public_chat_type/has_username.rb +0 -5
- data/lib/tdlib/types/public_chat_type/is_location_based.rb +0 -5
- data/lib/tdlib/types/public_message_link.rb +0 -10
- data/lib/tdlib/types/push_message_content.rb +0 -35
- data/lib/tdlib/types/push_message_content/animation.rb +0 -12
- data/lib/tdlib/types/push_message_content/audio.rb +0 -10
- data/lib/tdlib/types/push_message_content/basic_group_chat_create.rb +0 -5
- data/lib/tdlib/types/push_message_content/chat_add_members.rb +0 -12
- data/lib/tdlib/types/push_message_content/chat_change_photo.rb +0 -5
- data/lib/tdlib/types/push_message_content/chat_change_title.rb +0 -8
- data/lib/tdlib/types/push_message_content/chat_delete_member.rb +0 -12
- data/lib/tdlib/types/push_message_content/chat_join_by_link.rb +0 -5
- data/lib/tdlib/types/push_message_content/contact.rb +0 -10
- data/lib/tdlib/types/push_message_content/contact_registered.rb +0 -5
- data/lib/tdlib/types/push_message_content/document.rb +0 -10
- data/lib/tdlib/types/push_message_content/game.rb +0 -10
- data/lib/tdlib/types/push_message_content/game_score.rb +0 -12
- data/lib/tdlib/types/push_message_content/hidden.rb +0 -8
- data/lib/tdlib/types/push_message_content/invoice.rb +0 -10
- data/lib/tdlib/types/push_message_content/location.rb +0 -10
- data/lib/tdlib/types/push_message_content/media_album.rb +0 -12
- data/lib/tdlib/types/push_message_content/message_forwards.rb +0 -8
- data/lib/tdlib/types/push_message_content/photo.rb +0 -14
- data/lib/tdlib/types/push_message_content/poll.rb +0 -10
- data/lib/tdlib/types/push_message_content/screenshot_taken.rb +0 -5
- data/lib/tdlib/types/push_message_content/sticker.rb +0 -12
- data/lib/tdlib/types/push_message_content/text.rb +0 -10
- data/lib/tdlib/types/push_message_content/video.rb +0 -14
- data/lib/tdlib/types/push_message_content/video_note.rb +0 -10
- data/lib/tdlib/types/push_message_content/voice_note.rb +0 -10
- data/lib/tdlib/types/push_receiver_id.rb +0 -9
- data/lib/tdlib/types/recovery_email_address.rb +0 -8
- data/lib/tdlib/types/remote_file.rb +0 -27
- data/lib/tdlib/types/reply_markup.rb +0 -13
- data/lib/tdlib/types/reply_markup/force_reply.rb +0 -10
- data/lib/tdlib/types/reply_markup/inline_keyboard.rb +0 -8
- data/lib/tdlib/types/reply_markup/remove_keyboard.rb +0 -11
- data/lib/tdlib/types/reply_markup/show_keyboard.rb +0 -16
- data/lib/tdlib/types/rich_text.rb +0 -24
- data/lib/tdlib/types/rich_text/anchor.rb +0 -10
- data/lib/tdlib/types/rich_text/bold.rb +0 -8
- data/lib/tdlib/types/rich_text/email_address.rb +0 -10
- data/lib/tdlib/types/rich_text/fixed.rb +0 -8
- data/lib/tdlib/types/rich_text/icon.rb +0 -13
- data/lib/tdlib/types/rich_text/italic.rb +0 -8
- data/lib/tdlib/types/rich_text/marked.rb +0 -8
- data/lib/tdlib/types/rich_text/phone_number.rb +0 -10
- data/lib/tdlib/types/rich_text/plain.rb +0 -8
- data/lib/tdlib/types/rich_text/s.rb +0 -8
- data/lib/tdlib/types/rich_text/strikethrough.rb +0 -8
- data/lib/tdlib/types/rich_text/subscript.rb +0 -8
- data/lib/tdlib/types/rich_text/superscript.rb +0 -8
- data/lib/tdlib/types/rich_text/underline.rb +0 -8
- data/lib/tdlib/types/rich_text/url.rb +0 -12
- data/lib/tdlib/types/saved_credentials.rb +0 -10
- data/lib/tdlib/types/scope_notification_settings.rb +0 -19
- data/lib/tdlib/types/search_messages_filter.rb +0 -25
- data/lib/tdlib/types/search_messages_filter/animation.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/audio.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/call.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/chat_photo.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/document.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/empty.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/mention.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/missed_call.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/photo.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/photo_and_video.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/unread_mention.rb +0 -6
- data/lib/tdlib/types/search_messages_filter/url.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/video.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/video_note.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/voice_and_video_note.rb +0 -5
- data/lib/tdlib/types/search_messages_filter/voice_note.rb +0 -5
- data/lib/tdlib/types/seconds.rb +0 -8
- data/lib/tdlib/types/secret_chat.rb +0 -27
- data/lib/tdlib/types/secret_chat_state.rb +0 -12
- data/lib/tdlib/types/secret_chat_state/closed.rb +0 -5
- data/lib/tdlib/types/secret_chat_state/pending.rb +0 -5
- data/lib/tdlib/types/secret_chat_state/ready.rb +0 -5
- data/lib/tdlib/types/send_message_options.rb +0 -14
- data/lib/tdlib/types/session.rb +0 -42
- data/lib/tdlib/types/sessions.rb +0 -8
- data/lib/tdlib/types/shipping_option.rb +0 -13
- data/lib/tdlib/types/sticker.rb +0 -24
- data/lib/tdlib/types/sticker_set.rb +0 -35
- data/lib/tdlib/types/sticker_set_info.rb +0 -34
- data/lib/tdlib/types/sticker_sets.rb +0 -10
- data/lib/tdlib/types/stickers.rb +0 -8
- data/lib/tdlib/types/storage_statistics.rb +0 -12
- data/lib/tdlib/types/storage_statistics_by_chat.rb +0 -14
- data/lib/tdlib/types/storage_statistics_by_file_type.rb +0 -12
- data/lib/tdlib/types/storage_statistics_fast.rb +0 -16
- data/lib/tdlib/types/supergroup.rb +0 -43
- data/lib/tdlib/types/supergroup_full_info.rb +0 -53
- data/lib/tdlib/types/supergroup_members_filter.rb +0 -16
- data/lib/tdlib/types/supergroup_members_filter/administrators.rb +0 -5
- data/lib/tdlib/types/supergroup_members_filter/banned.rb +0 -8
- data/lib/tdlib/types/supergroup_members_filter/bots.rb +0 -5
- data/lib/tdlib/types/supergroup_members_filter/contacts.rb +0 -8
- data/lib/tdlib/types/supergroup_members_filter/recent.rb +0 -5
- data/lib/tdlib/types/supergroup_members_filter/restricted.rb +0 -8
- data/lib/tdlib/types/supergroup_members_filter/search.rb +0 -8
- data/lib/tdlib/types/t_me_url.rb +0 -10
- data/lib/tdlib/types/t_me_url_type.rb +0 -13
- data/lib/tdlib/types/t_me_url_type/chat_invite.rb +0 -8
- data/lib/tdlib/types/t_me_url_type/sticker_set.rb +0 -8
- data/lib/tdlib/types/t_me_url_type/supergroup.rb +0 -8
- data/lib/tdlib/types/t_me_url_type/user.rb +0 -8
- data/lib/tdlib/types/t_me_urls.rb +0 -8
- data/lib/tdlib/types/tdlib_parameters.rb +0 -46
- data/lib/tdlib/types/temporary_password_state.rb +0 -10
- data/lib/tdlib/types/terms_of_service.rb +0 -12
- data/lib/tdlib/types/text.rb +0 -8
- data/lib/tdlib/types/text_entities.rb +0 -8
- data/lib/tdlib/types/text_entity.rb +0 -12
- data/lib/tdlib/types/text_entity_type.rb +0 -25
- data/lib/tdlib/types/text_entity_type/bold.rb +0 -5
- data/lib/tdlib/types/text_entity_type/bot_command.rb +0 -6
- data/lib/tdlib/types/text_entity_type/cashtag.rb +0 -6
- data/lib/tdlib/types/text_entity_type/code.rb +0 -5
- data/lib/tdlib/types/text_entity_type/email_address.rb +0 -5
- data/lib/tdlib/types/text_entity_type/hashtag.rb +0 -5
- data/lib/tdlib/types/text_entity_type/italic.rb +0 -5
- data/lib/tdlib/types/text_entity_type/mention.rb +0 -5
- data/lib/tdlib/types/text_entity_type/mention_name.rb +0 -8
- data/lib/tdlib/types/text_entity_type/phone_number.rb +0 -5
- data/lib/tdlib/types/text_entity_type/pre.rb +0 -5
- data/lib/tdlib/types/text_entity_type/pre_code.rb +0 -8
- data/lib/tdlib/types/text_entity_type/strikethrough.rb +0 -5
- data/lib/tdlib/types/text_entity_type/text_url.rb +0 -8
- data/lib/tdlib/types/text_entity_type/underline.rb +0 -5
- data/lib/tdlib/types/text_entity_type/url.rb +0 -5
- data/lib/tdlib/types/text_parse_mode.rb +0 -11
- data/lib/tdlib/types/text_parse_mode/html.rb +0 -5
- data/lib/tdlib/types/text_parse_mode/markdown.rb +0 -9
- data/lib/tdlib/types/ton_lite_server_response.rb +0 -8
- data/lib/tdlib/types/ton_wallet_password_salt.rb +0 -8
- data/lib/tdlib/types/top_chat_category.rb +0 -16
- data/lib/tdlib/types/top_chat_category/bots.rb +0 -5
- data/lib/tdlib/types/top_chat_category/calls.rb +0 -5
- data/lib/tdlib/types/top_chat_category/channels.rb +0 -5
- data/lib/tdlib/types/top_chat_category/forward_chats.rb +0 -5
- data/lib/tdlib/types/top_chat_category/groups.rb +0 -5
- data/lib/tdlib/types/top_chat_category/inline_bots.rb +0 -5
- data/lib/tdlib/types/top_chat_category/users.rb +0 -5
- data/lib/tdlib/types/update.rb +0 -84
- data/lib/tdlib/types/update/active_notifications.rb +0 -10
- data/lib/tdlib/types/update/authorization_state.rb +0 -8
- data/lib/tdlib/types/update/basic_group.rb +0 -9
- data/lib/tdlib/types/update/basic_group_full_info.rb +0 -10
- data/lib/tdlib/types/update/call.rb +0 -8
- data/lib/tdlib/types/update/chat_action_bar.rb +0 -10
- data/lib/tdlib/types/update/chat_chat_list.rb +0 -11
- data/lib/tdlib/types/update/chat_default_disable_notification.rb +0 -10
- data/lib/tdlib/types/update/chat_draft_message.rb +0 -14
- data/lib/tdlib/types/update/chat_has_scheduled_messages.rb +0 -10
- data/lib/tdlib/types/update/chat_is_marked_as_unread.rb +0 -10
- data/lib/tdlib/types/update/chat_is_pinned.rb +0 -12
- data/lib/tdlib/types/update/chat_is_sponsored.rb +0 -12
- data/lib/tdlib/types/update/chat_last_message.rb +0 -14
- data/lib/tdlib/types/update/chat_notification_settings.rb +0 -10
- data/lib/tdlib/types/update/chat_online_member_count.rb +0 -12
- data/lib/tdlib/types/update/chat_order.rb +0 -12
- data/lib/tdlib/types/update/chat_permissions.rb +0 -10
- data/lib/tdlib/types/update/chat_photo.rb +0 -10
- data/lib/tdlib/types/update/chat_pinned_message.rb +0 -11
- data/lib/tdlib/types/update/chat_read_inbox.rb +0 -12
- data/lib/tdlib/types/update/chat_read_outbox.rb +0 -10
- data/lib/tdlib/types/update/chat_reply_markup.rb +0 -13
- data/lib/tdlib/types/update/chat_title.rb +0 -10
- data/lib/tdlib/types/update/chat_unread_mention_count.rb +0 -10
- data/lib/tdlib/types/update/connection_state.rb +0 -8
- data/lib/tdlib/types/update/delete_messages.rb +0 -16
- data/lib/tdlib/types/update/favorite_stickers.rb +0 -8
- data/lib/tdlib/types/update/file.rb +0 -8
- data/lib/tdlib/types/update/file_generation_start.rb +0 -17
- data/lib/tdlib/types/update/file_generation_stop.rb +0 -8
- data/lib/tdlib/types/update/have_pending_notifications.rb +0 -13
- data/lib/tdlib/types/update/installed_sticker_sets.rb +0 -10
- data/lib/tdlib/types/update/language_pack_strings.rb +0 -12
- data/lib/tdlib/types/update/message_content.rb +0 -12
- data/lib/tdlib/types/update/message_content_opened.rb +0 -12
- data/lib/tdlib/types/update/message_edited.rb +0 -15
- data/lib/tdlib/types/update/message_live_location_viewed.rb +0 -11
- data/lib/tdlib/types/update/message_mention_read.rb +0 -12
- data/lib/tdlib/types/update/message_send_acknowledged.rb +0 -14
- data/lib/tdlib/types/update/message_send_failed.rb +0 -16
- data/lib/tdlib/types/update/message_send_succeeded.rb +0 -11
- data/lib/tdlib/types/update/message_views.rb +0 -12
- data/lib/tdlib/types/update/new_callback_query.rb +0 -18
- data/lib/tdlib/types/update/new_chat.rb +0 -10
- data/lib/tdlib/types/update/new_chosen_inline_result.rb +0 -16
- data/lib/tdlib/types/update/new_custom_event.rb +0 -8
- data/lib/tdlib/types/update/new_custom_query.rb +0 -12
- data/lib/tdlib/types/update/new_inline_callback_query.rb +0 -16
- data/lib/tdlib/types/update/new_inline_query.rb +0 -16
- data/lib/tdlib/types/update/new_message.rb +0 -8
- data/lib/tdlib/types/update/new_pre_checkout_query.rb +0 -22
- data/lib/tdlib/types/update/new_shipping_query.rb +0 -15
- data/lib/tdlib/types/update/notification.rb +0 -10
- data/lib/tdlib/types/update/notification_group.rb +0 -26
- data/lib/tdlib/types/update/option.rb +0 -10
- data/lib/tdlib/types/update/poll.rb +0 -8
- data/lib/tdlib/types/update/recent_stickers.rb +0 -11
- data/lib/tdlib/types/update/saved_animations.rb +0 -8
- data/lib/tdlib/types/update/scope_notification_settings.rb +0 -10
- data/lib/tdlib/types/update/secret_chat.rb +0 -9
- data/lib/tdlib/types/update/selected_background.rb +0 -10
- data/lib/tdlib/types/update/service_notification.rb +0 -13
- data/lib/tdlib/types/update/supergroup.rb +0 -9
- data/lib/tdlib/types/update/supergroup_full_info.rb +0 -10
- data/lib/tdlib/types/update/terms_of_service.rb +0 -12
- data/lib/tdlib/types/update/trending_sticker_sets.rb +0 -8
- data/lib/tdlib/types/update/unread_chat_count.rb +0 -20
- data/lib/tdlib/types/update/unread_message_count.rb +0 -13
- data/lib/tdlib/types/update/user.rb +0 -9
- data/lib/tdlib/types/update/user_chat_action.rb +0 -12
- data/lib/tdlib/types/update/user_full_info.rb +0 -10
- data/lib/tdlib/types/update/user_privacy_setting_rules.rb +0 -10
- data/lib/tdlib/types/update/user_status.rb +0 -10
- data/lib/tdlib/types/update/users_nearby.rb +0 -9
- data/lib/tdlib/types/updates.rb +0 -8
- data/lib/tdlib/types/user.rb +0 -42
- data/lib/tdlib/types/user_full_info.rb +0 -24
- data/lib/tdlib/types/user_privacy_setting.rb +0 -17
- data/lib/tdlib/types/user_privacy_setting/allow_calls.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/allow_chat_invites.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/allow_finding_by_phone_number.rb +0 -7
- data/lib/tdlib/types/user_privacy_setting/allow_peer_to_peer_calls.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/show_link_in_forwarded_messages.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/show_phone_number.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/show_profile_photo.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting/show_status.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting_rule.rb +0 -17
- data/lib/tdlib/types/user_privacy_setting_rule/allow_all.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting_rule/allow_chat_members.rb +0 -8
- data/lib/tdlib/types/user_privacy_setting_rule/allow_contacts.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting_rule/allow_users.rb +0 -8
- data/lib/tdlib/types/user_privacy_setting_rule/restrict_all.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting_rule/restrict_chat_members.rb +0 -8
- data/lib/tdlib/types/user_privacy_setting_rule/restrict_contacts.rb +0 -5
- data/lib/tdlib/types/user_privacy_setting_rule/restrict_users.rb +0 -8
- data/lib/tdlib/types/user_privacy_setting_rules.rb +0 -11
- data/lib/tdlib/types/user_profile_photo.rb +0 -12
- data/lib/tdlib/types/user_profile_photos.rb +0 -10
- data/lib/tdlib/types/user_status.rb +0 -15
- data/lib/tdlib/types/user_status/empty.rb +0 -5
- data/lib/tdlib/types/user_status/last_month.rb +0 -5
- data/lib/tdlib/types/user_status/last_week.rb +0 -5
- data/lib/tdlib/types/user_status/offline.rb +0 -8
- data/lib/tdlib/types/user_status/online.rb +0 -8
- data/lib/tdlib/types/user_status/recently.rb +0 -5
- data/lib/tdlib/types/user_type.rb +0 -14
- data/lib/tdlib/types/user_type/bot.rb +0 -18
- data/lib/tdlib/types/user_type/deleted.rb +0 -7
- data/lib/tdlib/types/user_type/regular.rb +0 -5
- data/lib/tdlib/types/user_type/unknown.rb +0 -7
- data/lib/tdlib/types/users.rb +0 -10
- data/lib/tdlib/types/validated_order_info.rb +0 -11
- data/lib/tdlib/types/venue.rb +0 -19
- data/lib/tdlib/types/video.rb +0 -26
- data/lib/tdlib/types/video_note.rb +0 -17
- data/lib/tdlib/types/voice_note.rb +0 -16
- data/lib/tdlib/types/web_page.rb +0 -52
- data/lib/tdlib/types/web_page_instant_view.rb +0 -18
data/lib/tdlib/client_methods.rb
DELETED
|
@@ -1,4244 +0,0 @@
|
|
|
1
|
-
# This is a generated module from current TDLib scheme
|
|
2
|
-
# It contains all available TDLib methods
|
|
3
|
-
module TD::ClientMethods
|
|
4
|
-
# Accepts an incoming call.
|
|
5
|
-
#
|
|
6
|
-
# @param call_id [Integer] Call identifier.
|
|
7
|
-
# @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the client.
|
|
8
|
-
# @return [TD::Types::Ok]
|
|
9
|
-
def accept_call(call_id, protocol)
|
|
10
|
-
broadcast('@type' => 'acceptCall',
|
|
11
|
-
'call_id' => call_id,
|
|
12
|
-
'protocol' => protocol)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# Accepts Telegram terms of services.
|
|
16
|
-
#
|
|
17
|
-
# @param terms_of_service_id [String] Terms of service identifier.
|
|
18
|
-
# @return [TD::Types::Ok]
|
|
19
|
-
def accept_terms_of_service(terms_of_service_id)
|
|
20
|
-
broadcast('@type' => 'acceptTermsOfService',
|
|
21
|
-
'terms_of_service_id' => terms_of_service_id)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Adds a new member to a chat.
|
|
25
|
-
# Members can't be added to private or secret chats.
|
|
26
|
-
# Members will not be added until the chat state has been synchronized with the server.
|
|
27
|
-
#
|
|
28
|
-
# @param chat_id [Integer] Chat identifier.
|
|
29
|
-
# @param user_id [Integer] Identifier of the user.
|
|
30
|
-
# @param forward_limit [Integer] The number of earlier messages from the chat to be forwarded to the new member; up
|
|
31
|
-
# to 100.
|
|
32
|
-
# Ignored for supergroups and channels.
|
|
33
|
-
# @return [TD::Types::Ok]
|
|
34
|
-
def add_chat_member(chat_id, user_id, forward_limit)
|
|
35
|
-
broadcast('@type' => 'addChatMember',
|
|
36
|
-
'chat_id' => chat_id,
|
|
37
|
-
'user_id' => user_id,
|
|
38
|
-
'forward_limit' => forward_limit)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# Adds multiple new members to a chat.
|
|
42
|
-
# Currently this option is only available for supergroups and channels.
|
|
43
|
-
# This option can't be used to join a chat.
|
|
44
|
-
# Members can't be added to a channel if it has more than 200 members.
|
|
45
|
-
# Members will not be added until the chat state has been synchronized with the server.
|
|
46
|
-
#
|
|
47
|
-
# @param chat_id [Integer] Chat identifier.
|
|
48
|
-
# @param user_ids [Array<Integer>] Identifiers of the users to be added to the chat.
|
|
49
|
-
# @return [TD::Types::Ok]
|
|
50
|
-
def add_chat_members(chat_id, user_ids)
|
|
51
|
-
broadcast('@type' => 'addChatMembers',
|
|
52
|
-
'chat_id' => chat_id,
|
|
53
|
-
'user_ids' => user_ids)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Adds a user to the contact list or edits an existing contact by their user identifier.
|
|
57
|
-
#
|
|
58
|
-
# @param contact [TD::Types::Contact, nil] The contact to add or edit; phone number can be empty and needs to be
|
|
59
|
-
# specified only if known, vCard is ignored.
|
|
60
|
-
# @param share_phone_number [Boolean] True, if the new contact needs to be allowed to see current user's phone
|
|
61
|
-
# number.
|
|
62
|
-
# A corresponding rule to {TD::Types::UserPrivacySetting::ShowPhoneNumber} will be added if needed.
|
|
63
|
-
# Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be
|
|
64
|
-
# asked to share their phone number.
|
|
65
|
-
# @return [TD::Types::Ok]
|
|
66
|
-
def add_contact(contact = nil, share_phone_number)
|
|
67
|
-
broadcast('@type' => 'addContact',
|
|
68
|
-
'contact' => contact,
|
|
69
|
-
'share_phone_number' => share_phone_number)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# Adds a custom server language pack to the list of installed language packs in current localization target.
|
|
73
|
-
# Can be called before authorization.
|
|
74
|
-
#
|
|
75
|
-
# @param language_pack_id [String] Identifier of a language pack to be added; may be different from a name that is
|
|
76
|
-
# used in an "https://t.me/setlanguage/" link.
|
|
77
|
-
# @return [TD::Types::Ok]
|
|
78
|
-
def add_custom_server_language_pack(language_pack_id)
|
|
79
|
-
broadcast('@type' => 'addCustomServerLanguagePack',
|
|
80
|
-
'language_pack_id' => language_pack_id)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Adds a new sticker to the list of favorite stickers.
|
|
84
|
-
# The new sticker is added to the top of the list.
|
|
85
|
-
# If the sticker was already in the list, it is removed from the list first.
|
|
86
|
-
# Only stickers belonging to a sticker set can be added to this list.
|
|
87
|
-
#
|
|
88
|
-
# @param sticker [TD::Types::InputFile] Sticker file to add.
|
|
89
|
-
# @return [TD::Types::Ok]
|
|
90
|
-
def add_favorite_sticker(sticker)
|
|
91
|
-
broadcast('@type' => 'addFavoriteSticker',
|
|
92
|
-
'sticker' => sticker)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Adds a local message to a chat.
|
|
96
|
-
# The message is persistent across application restarts only if the message database is used.
|
|
97
|
-
# Returns the added message.
|
|
98
|
-
#
|
|
99
|
-
# @param chat_id [Integer] Target chat.
|
|
100
|
-
# @param sender_user_id [Integer] Identifier of the user who will be shown as the sender of the message; may be 0 for
|
|
101
|
-
# channel posts.
|
|
102
|
-
# @param reply_to_message_id [Integer] Identifier of the message to reply to or 0.
|
|
103
|
-
# @param disable_notification [Boolean] Pass true to disable notification for the message.
|
|
104
|
-
# @param input_message_content [TD::Types::InputMessageContent] The content of the message to be added.
|
|
105
|
-
# @return [TD::Types::Message]
|
|
106
|
-
def add_local_message(chat_id, sender_user_id, reply_to_message_id, disable_notification, input_message_content)
|
|
107
|
-
broadcast('@type' => 'addLocalMessage',
|
|
108
|
-
'chat_id' => chat_id,
|
|
109
|
-
'sender_user_id' => sender_user_id,
|
|
110
|
-
'reply_to_message_id' => reply_to_message_id,
|
|
111
|
-
'disable_notification' => disable_notification,
|
|
112
|
-
'input_message_content' => input_message_content)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
# Adds a message to TDLib internal log.
|
|
116
|
-
# This is an offline method.
|
|
117
|
-
# Can be called before authorization.
|
|
118
|
-
# Can be called synchronously.
|
|
119
|
-
#
|
|
120
|
-
# @param verbosity_level [Integer] The minimum verbosity level needed for the message to be logged, 0-1023.
|
|
121
|
-
# @param text [String] Text of a message to log.
|
|
122
|
-
# @return [TD::Types::Ok]
|
|
123
|
-
def add_log_message(verbosity_level, text)
|
|
124
|
-
broadcast('@type' => 'addLogMessage',
|
|
125
|
-
'verbosity_level' => verbosity_level,
|
|
126
|
-
'text' => text)
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
# Adds the specified data to data usage statistics.
|
|
130
|
-
# Can be called before authorization.
|
|
131
|
-
#
|
|
132
|
-
# @param entry [TD::Types::NetworkStatisticsEntry] The network statistics entry with the data to be added to
|
|
133
|
-
# statistics.
|
|
134
|
-
# @return [TD::Types::Ok]
|
|
135
|
-
def add_network_statistics(entry)
|
|
136
|
-
broadcast('@type' => 'addNetworkStatistics',
|
|
137
|
-
'entry' => entry)
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
# Adds a proxy server for network requests.
|
|
141
|
-
# Can be called before authorization.
|
|
142
|
-
#
|
|
143
|
-
# @param server [String] Proxy server IP address.
|
|
144
|
-
# @param port [Integer] Proxy server port.
|
|
145
|
-
# @param enable [Boolean] True, if the proxy should be enabled.
|
|
146
|
-
# @param type [TD::Types::ProxyType] Proxy type.
|
|
147
|
-
# @return [TD::Types::Proxy]
|
|
148
|
-
def add_proxy(server, port, enable, type)
|
|
149
|
-
broadcast('@type' => 'addProxy',
|
|
150
|
-
'server' => server,
|
|
151
|
-
'port' => port,
|
|
152
|
-
'enable' => enable,
|
|
153
|
-
'type' => type)
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
# Manually adds a new sticker to the list of recently used stickers.
|
|
157
|
-
# The new sticker is added to the top of the list.
|
|
158
|
-
# If the sticker was already in the list, it is removed from the list first.
|
|
159
|
-
# Only stickers belonging to a sticker set can be added to this list.
|
|
160
|
-
#
|
|
161
|
-
# @param is_attached [Boolean] Pass true to add the sticker to the list of stickers recently attached to photo or
|
|
162
|
-
# video files; pass false to add the sticker to the list of recently sent stickers.
|
|
163
|
-
# @param sticker [TD::Types::InputFile] Sticker file to add.
|
|
164
|
-
# @return [TD::Types::Stickers]
|
|
165
|
-
def add_recent_sticker(is_attached, sticker)
|
|
166
|
-
broadcast('@type' => 'addRecentSticker',
|
|
167
|
-
'is_attached' => is_attached,
|
|
168
|
-
'sticker' => sticker)
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
# Adds a chat to the list of recently found chats.
|
|
172
|
-
# The chat is added to the beginning of the list.
|
|
173
|
-
# If the chat is already in the list, it will be removed from the list first.
|
|
174
|
-
#
|
|
175
|
-
# @param chat_id [Integer] Identifier of the chat to add.
|
|
176
|
-
# @return [TD::Types::Ok]
|
|
177
|
-
def add_recently_found_chat(chat_id)
|
|
178
|
-
broadcast('@type' => 'addRecentlyFoundChat',
|
|
179
|
-
'chat_id' => chat_id)
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
# Manually adds a new animation to the list of saved animations.
|
|
183
|
-
# The new animation is added to the beginning of the list.
|
|
184
|
-
# If the animation was already in the list, it is removed first.
|
|
185
|
-
# Only non-secret video animations with MIME type "video/mp4" can be added to the list.
|
|
186
|
-
#
|
|
187
|
-
# @param animation [TD::Types::InputFile] The animation file to be added.
|
|
188
|
-
# Only animations known to the server (i.e.
|
|
189
|
-
# successfully sent via a message) can be added to the list.
|
|
190
|
-
# @return [TD::Types::Ok]
|
|
191
|
-
def add_saved_animation(animation)
|
|
192
|
-
broadcast('@type' => 'addSavedAnimation',
|
|
193
|
-
'animation' => animation)
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
# Adds a new sticker to a set; for bots only.
|
|
197
|
-
# Returns the sticker set.
|
|
198
|
-
#
|
|
199
|
-
# @param user_id [Integer] Sticker set owner.
|
|
200
|
-
# @param name [String] Sticker set name.
|
|
201
|
-
# @param sticker [TD::Types::InputSticker] Sticker to add to the set.
|
|
202
|
-
# @return [TD::Types::StickerSet]
|
|
203
|
-
def add_sticker_to_set(user_id, name, sticker)
|
|
204
|
-
broadcast('@type' => 'addStickerToSet',
|
|
205
|
-
'user_id' => user_id,
|
|
206
|
-
'name' => name,
|
|
207
|
-
'sticker' => sticker)
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
# Sets the result of a callback query; for bots only.
|
|
211
|
-
#
|
|
212
|
-
# @param callback_query_id [Integer] Identifier of the callback query.
|
|
213
|
-
# @param text [String] Text of the answer.
|
|
214
|
-
# @param show_alert [Boolean] If true, an alert should be shown to the user instead of a toast notification.
|
|
215
|
-
# @param url [String] URL to be opened.
|
|
216
|
-
# @param cache_time [Integer] Time during which the result of the query can be cached, in seconds.
|
|
217
|
-
# @return [TD::Types::Ok]
|
|
218
|
-
def answer_callback_query(callback_query_id, text, show_alert, url, cache_time)
|
|
219
|
-
broadcast('@type' => 'answerCallbackQuery',
|
|
220
|
-
'callback_query_id' => callback_query_id,
|
|
221
|
-
'text' => text,
|
|
222
|
-
'show_alert' => show_alert,
|
|
223
|
-
'url' => url,
|
|
224
|
-
'cache_time' => cache_time)
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
# Answers a custom query; for bots only.
|
|
228
|
-
#
|
|
229
|
-
# @param custom_query_id [Integer] Identifier of a custom query.
|
|
230
|
-
# @param data [String] JSON-serialized answer to the query.
|
|
231
|
-
# @return [TD::Types::Ok]
|
|
232
|
-
def answer_custom_query(custom_query_id, data)
|
|
233
|
-
broadcast('@type' => 'answerCustomQuery',
|
|
234
|
-
'custom_query_id' => custom_query_id,
|
|
235
|
-
'data' => data)
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
# Sets the result of an inline query; for bots only.
|
|
239
|
-
#
|
|
240
|
-
# @param inline_query_id [Integer] Identifier of the inline query.
|
|
241
|
-
# @param is_personal [Boolean] True, if the result of the query can be cached for the specified user.
|
|
242
|
-
# @param results [Array<TD::Types::InputInlineQueryResult>] The results of the query.
|
|
243
|
-
# @param cache_time [Integer] Allowed time to cache the results of the query, in seconds.
|
|
244
|
-
# @param next_offset [String] Offset for the next inline query; pass an empty string if there are no more results.
|
|
245
|
-
# @param switch_pm_text [String] If non-empty, this text should be shown on the button that opens a private chat with
|
|
246
|
-
# the bot and sends a start message to the bot with the parameter switch_pm_parameter.
|
|
247
|
-
# @param switch_pm_parameter [String] The parameter for the bot start message.
|
|
248
|
-
# @return [TD::Types::Ok]
|
|
249
|
-
def answer_inline_query(inline_query_id, is_personal, results, cache_time, next_offset, switch_pm_text,
|
|
250
|
-
switch_pm_parameter)
|
|
251
|
-
broadcast('@type' => 'answerInlineQuery',
|
|
252
|
-
'inline_query_id' => inline_query_id,
|
|
253
|
-
'is_personal' => is_personal,
|
|
254
|
-
'results' => results,
|
|
255
|
-
'cache_time' => cache_time,
|
|
256
|
-
'next_offset' => next_offset,
|
|
257
|
-
'switch_pm_text' => switch_pm_text,
|
|
258
|
-
'switch_pm_parameter' => switch_pm_parameter)
|
|
259
|
-
end
|
|
260
|
-
|
|
261
|
-
# Sets the result of a pre-checkout query; for bots only.
|
|
262
|
-
#
|
|
263
|
-
# @param pre_checkout_query_id [Integer] Identifier of the pre-checkout query.
|
|
264
|
-
# @param error_message [String] An error message, empty on success.
|
|
265
|
-
# @return [TD::Types::Ok]
|
|
266
|
-
def answer_pre_checkout_query(pre_checkout_query_id, error_message)
|
|
267
|
-
broadcast('@type' => 'answerPreCheckoutQuery',
|
|
268
|
-
'pre_checkout_query_id' => pre_checkout_query_id,
|
|
269
|
-
'error_message' => error_message)
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Sets the result of a shipping query; for bots only.
|
|
273
|
-
#
|
|
274
|
-
# @param shipping_query_id [Integer] Identifier of the shipping query.
|
|
275
|
-
# @param shipping_options [Array<TD::Types::ShippingOption>] Available shipping options.
|
|
276
|
-
# @param error_message [String] An error message, empty on success.
|
|
277
|
-
# @return [TD::Types::Ok]
|
|
278
|
-
def answer_shipping_query(shipping_query_id, shipping_options, error_message)
|
|
279
|
-
broadcast('@type' => 'answerShippingQuery',
|
|
280
|
-
'shipping_query_id' => shipping_query_id,
|
|
281
|
-
'shipping_options' => shipping_options,
|
|
282
|
-
'error_message' => error_message)
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
# Adds a user to the blacklist.
|
|
286
|
-
#
|
|
287
|
-
# @param user_id [Integer] User identifier.
|
|
288
|
-
# @return [TD::Types::Ok]
|
|
289
|
-
def block_user(user_id)
|
|
290
|
-
broadcast('@type' => 'blockUser',
|
|
291
|
-
'user_id' => user_id)
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
# Checks whether the current session can be used to transfer a chat ownership to another user.
|
|
295
|
-
#
|
|
296
|
-
# @return [TD::Types::CanTransferOwnershipResult]
|
|
297
|
-
def can_transfer_ownership
|
|
298
|
-
broadcast('@type' => 'canTransferOwnership')
|
|
299
|
-
end
|
|
300
|
-
|
|
301
|
-
# Stops the downloading of a file.
|
|
302
|
-
# If a file has already been downloaded, does nothing.
|
|
303
|
-
#
|
|
304
|
-
# @param file_id [Integer] Identifier of a file to stop downloading.
|
|
305
|
-
# @param only_if_pending [Boolean] Pass true to stop downloading only if it hasn't been started, i.e.
|
|
306
|
-
# request hasn't been sent to server.
|
|
307
|
-
# @return [TD::Types::Ok]
|
|
308
|
-
def cancel_download_file(file_id, only_if_pending)
|
|
309
|
-
broadcast('@type' => 'cancelDownloadFile',
|
|
310
|
-
'file_id' => file_id,
|
|
311
|
-
'only_if_pending' => only_if_pending)
|
|
312
|
-
end
|
|
313
|
-
|
|
314
|
-
# Stops the uploading of a file.
|
|
315
|
-
# Supported only for files uploaded by using uploadFile.
|
|
316
|
-
# For other files the behavior is undefined.
|
|
317
|
-
#
|
|
318
|
-
# @param file_id [Integer] Identifier of the file to stop uploading.
|
|
319
|
-
# @return [TD::Types::Ok]
|
|
320
|
-
def cancel_upload_file(file_id)
|
|
321
|
-
broadcast('@type' => 'cancelUploadFile',
|
|
322
|
-
'file_id' => file_id)
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
# Changes imported contacts using the list of current user contacts saved on the device.
|
|
326
|
-
# Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts.
|
|
327
|
-
# Query result depends on the result of the previous query, so only one query is possible at the same time.
|
|
328
|
-
#
|
|
329
|
-
# @param contacts [Array<TD::Types::Contact>] The new list of contacts, contact's vCard are ignored and are not
|
|
330
|
-
# imported.
|
|
331
|
-
# @return [TD::Types::ImportedContacts]
|
|
332
|
-
def change_imported_contacts(contacts)
|
|
333
|
-
broadcast('@type' => 'changeImportedContacts',
|
|
334
|
-
'contacts' => contacts)
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
# Changes the phone number of the user and sends an authentication code to the user's new phone number.
|
|
338
|
-
# On success, returns information about the sent code.
|
|
339
|
-
#
|
|
340
|
-
# @param phone_number [String] The new phone number of the user in international format.
|
|
341
|
-
# @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone
|
|
342
|
-
# number.
|
|
343
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
344
|
-
def change_phone_number(phone_number, settings)
|
|
345
|
-
broadcast('@type' => 'changePhoneNumber',
|
|
346
|
-
'phone_number' => phone_number,
|
|
347
|
-
'settings' => settings)
|
|
348
|
-
end
|
|
349
|
-
|
|
350
|
-
# Installs/uninstalls or activates/archives a sticker set.
|
|
351
|
-
#
|
|
352
|
-
# @param set_id [Integer] Identifier of the sticker set.
|
|
353
|
-
# @param is_installed [Boolean] The new value of is_installed.
|
|
354
|
-
# @param is_archived [Boolean] The new value of is_archived.
|
|
355
|
-
# A sticker set can't be installed and archived simultaneously.
|
|
356
|
-
# @return [TD::Types::Ok]
|
|
357
|
-
def change_sticker_set(set_id, is_installed, is_archived)
|
|
358
|
-
broadcast('@type' => 'changeStickerSet',
|
|
359
|
-
'set_id' => set_id,
|
|
360
|
-
'is_installed' => is_installed,
|
|
361
|
-
'is_archived' => is_archived)
|
|
362
|
-
end
|
|
363
|
-
|
|
364
|
-
# Checks the authentication token of a bot; to log in as a bot.
|
|
365
|
-
# Works only when the current authorization state is authorizationStateWaitPhoneNumber.
|
|
366
|
-
# Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in.
|
|
367
|
-
#
|
|
368
|
-
# @param token [String] The bot token.
|
|
369
|
-
# @return [TD::Types::Ok]
|
|
370
|
-
def check_authentication_bot_token(token)
|
|
371
|
-
broadcast('@type' => 'checkAuthenticationBotToken',
|
|
372
|
-
'token' => token)
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
# Checks the authentication code.
|
|
376
|
-
# Works only when the current authorization state is authorizationStateWaitCode.
|
|
377
|
-
#
|
|
378
|
-
# @param code [String] The verification code received via SMS, Telegram message, phone call, or flash call.
|
|
379
|
-
# @return [TD::Types::Ok]
|
|
380
|
-
def check_authentication_code(code)
|
|
381
|
-
broadcast('@type' => 'checkAuthenticationCode',
|
|
382
|
-
'code' => code)
|
|
383
|
-
end
|
|
384
|
-
|
|
385
|
-
# Checks the authentication password for correctness.
|
|
386
|
-
# Works only when the current authorization state is authorizationStateWaitPassword.
|
|
387
|
-
#
|
|
388
|
-
# @param password [String] The password to check.
|
|
389
|
-
# @return [TD::Types::Ok]
|
|
390
|
-
def check_authentication_password(password)
|
|
391
|
-
broadcast('@type' => 'checkAuthenticationPassword',
|
|
392
|
-
'password' => password)
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
# Checks the authentication code sent to confirm a new phone number of the user.
|
|
396
|
-
#
|
|
397
|
-
# @param code [String] Verification code received by SMS, phone call or flash call.
|
|
398
|
-
# @return [TD::Types::Ok]
|
|
399
|
-
def check_change_phone_number_code(code)
|
|
400
|
-
broadcast('@type' => 'checkChangePhoneNumberCode',
|
|
401
|
-
'code' => code)
|
|
402
|
-
end
|
|
403
|
-
|
|
404
|
-
# Checks the validity of an invite link for a chat and returns information about the corresponding chat.
|
|
405
|
-
#
|
|
406
|
-
# @param invite_link [String] Invite link to be checked; should begin with "https://t.me/joinchat/",
|
|
407
|
-
# "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/".
|
|
408
|
-
# @return [TD::Types::ChatInviteLinkInfo]
|
|
409
|
-
def check_chat_invite_link(invite_link)
|
|
410
|
-
broadcast('@type' => 'checkChatInviteLink',
|
|
411
|
-
'invite_link' => invite_link)
|
|
412
|
-
end
|
|
413
|
-
|
|
414
|
-
# Checks whether a username can be set for a chat.
|
|
415
|
-
#
|
|
416
|
-
# @param chat_id [Integer] Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a
|
|
417
|
-
# private chat with self, or zero if chat is being created.
|
|
418
|
-
# @param username [String] Username to be checked.
|
|
419
|
-
# @return [TD::Types::CheckChatUsernameResult]
|
|
420
|
-
def check_chat_username(chat_id, username)
|
|
421
|
-
broadcast('@type' => 'checkChatUsername',
|
|
422
|
-
'chat_id' => chat_id,
|
|
423
|
-
'username' => username)
|
|
424
|
-
end
|
|
425
|
-
|
|
426
|
-
# Checks whether the maximum number of owned public chats has been reached.
|
|
427
|
-
# Returns corresponding error if the limit was reached.
|
|
428
|
-
#
|
|
429
|
-
# @param type [TD::Types::PublicChatType] Type of the public chats, for which to check the limit.
|
|
430
|
-
# @return [TD::Types::Ok]
|
|
431
|
-
def check_created_public_chats_limit(type)
|
|
432
|
-
broadcast('@type' => 'checkCreatedPublicChatsLimit',
|
|
433
|
-
'type' => type)
|
|
434
|
-
end
|
|
435
|
-
|
|
436
|
-
# Checks the database encryption key for correctness.
|
|
437
|
-
# Works only when the current authorization state is authorizationStateWaitEncryptionKey.
|
|
438
|
-
#
|
|
439
|
-
# @param encryption_key [String] Encryption key to check or set up.
|
|
440
|
-
# @return [TD::Types::Ok]
|
|
441
|
-
def check_database_encryption_key(encryption_key)
|
|
442
|
-
broadcast('@type' => 'checkDatabaseEncryptionKey',
|
|
443
|
-
'encryption_key' => encryption_key)
|
|
444
|
-
end
|
|
445
|
-
|
|
446
|
-
# Checks the email address verification code for Telegram Passport.
|
|
447
|
-
#
|
|
448
|
-
# @param code [String] Verification code.
|
|
449
|
-
# @return [TD::Types::Ok]
|
|
450
|
-
def check_email_address_verification_code(code)
|
|
451
|
-
broadcast('@type' => 'checkEmailAddressVerificationCode',
|
|
452
|
-
'code' => code)
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
# Checks phone number confirmation code.
|
|
456
|
-
#
|
|
457
|
-
# @param code [String] The phone number confirmation code.
|
|
458
|
-
# @return [TD::Types::Ok]
|
|
459
|
-
def check_phone_number_confirmation_code(code)
|
|
460
|
-
broadcast('@type' => 'checkPhoneNumberConfirmationCode',
|
|
461
|
-
'code' => code)
|
|
462
|
-
end
|
|
463
|
-
|
|
464
|
-
# Checks the phone number verification code for Telegram Passport.
|
|
465
|
-
#
|
|
466
|
-
# @param code [String] Verification code.
|
|
467
|
-
# @return [TD::Types::Ok]
|
|
468
|
-
def check_phone_number_verification_code(code)
|
|
469
|
-
broadcast('@type' => 'checkPhoneNumberVerificationCode',
|
|
470
|
-
'code' => code)
|
|
471
|
-
end
|
|
472
|
-
|
|
473
|
-
# Checks the 2-step verification recovery email address verification code.
|
|
474
|
-
#
|
|
475
|
-
# @param code [String] Verification code.
|
|
476
|
-
# @return [TD::Types::PasswordState]
|
|
477
|
-
def check_recovery_email_address_code(code)
|
|
478
|
-
broadcast('@type' => 'checkRecoveryEmailAddressCode',
|
|
479
|
-
'code' => code)
|
|
480
|
-
end
|
|
481
|
-
|
|
482
|
-
# Removes potentially dangerous characters from the name of a file.
|
|
483
|
-
# The encoding of the file name is supposed to be UTF-8.
|
|
484
|
-
# Returns an empty string on failure.
|
|
485
|
-
# This is an offline method.
|
|
486
|
-
# Can be called before authorization.
|
|
487
|
-
# Can be called synchronously.
|
|
488
|
-
#
|
|
489
|
-
# @param file_name [String] File name or path to the file.
|
|
490
|
-
# @return [TD::Types::Text]
|
|
491
|
-
def clean_file_name(file_name)
|
|
492
|
-
broadcast('@type' => 'cleanFileName',
|
|
493
|
-
'file_name' => file_name)
|
|
494
|
-
end
|
|
495
|
-
|
|
496
|
-
# Clears draft messages in all chats.
|
|
497
|
-
#
|
|
498
|
-
# @param exclude_secret_chats [Boolean] If true, local draft messages in secret chats will not be cleared.
|
|
499
|
-
# @return [TD::Types::Ok]
|
|
500
|
-
def clear_all_draft_messages(exclude_secret_chats)
|
|
501
|
-
broadcast('@type' => 'clearAllDraftMessages',
|
|
502
|
-
'exclude_secret_chats' => exclude_secret_chats)
|
|
503
|
-
end
|
|
504
|
-
|
|
505
|
-
# Clears all imported contacts, contact list remains unchanged.
|
|
506
|
-
#
|
|
507
|
-
# @return [TD::Types::Ok]
|
|
508
|
-
def clear_imported_contacts
|
|
509
|
-
broadcast('@type' => 'clearImportedContacts')
|
|
510
|
-
end
|
|
511
|
-
|
|
512
|
-
# Clears the list of recently used stickers.
|
|
513
|
-
#
|
|
514
|
-
# @param is_attached [Boolean] Pass true to clear the list of stickers recently attached to photo or video files;
|
|
515
|
-
# pass false to clear the list of recently sent stickers.
|
|
516
|
-
# @return [TD::Types::Ok]
|
|
517
|
-
def clear_recent_stickers(is_attached)
|
|
518
|
-
broadcast('@type' => 'clearRecentStickers',
|
|
519
|
-
'is_attached' => is_attached)
|
|
520
|
-
end
|
|
521
|
-
|
|
522
|
-
# Clears the list of recently found chats.
|
|
523
|
-
#
|
|
524
|
-
# @return [TD::Types::Ok]
|
|
525
|
-
def clear_recently_found_chats
|
|
526
|
-
broadcast('@type' => 'clearRecentlyFoundChats')
|
|
527
|
-
end
|
|
528
|
-
|
|
529
|
-
# Closes the TDLib instance.
|
|
530
|
-
# All databases will be flushed to disk and properly closed.
|
|
531
|
-
# After the close completes, updateAuthorizationState with authorizationStateClosed will be sent.
|
|
532
|
-
#
|
|
533
|
-
# @return [TD::Types::Ok]
|
|
534
|
-
def close
|
|
535
|
-
broadcast('@type' => 'close')
|
|
536
|
-
end
|
|
537
|
-
|
|
538
|
-
# Informs TDLib that the chat is closed by the user.
|
|
539
|
-
# Many useful activities depend on the chat being opened or closed.
|
|
540
|
-
#
|
|
541
|
-
# @param chat_id [Integer] Chat identifier.
|
|
542
|
-
# @return [TD::Types::Ok]
|
|
543
|
-
def close_chat(chat_id)
|
|
544
|
-
broadcast('@type' => 'closeChat',
|
|
545
|
-
'chat_id' => chat_id)
|
|
546
|
-
end
|
|
547
|
-
|
|
548
|
-
# Closes a secret chat, effectively transfering its state to secretChatStateClosed.
|
|
549
|
-
#
|
|
550
|
-
# @param secret_chat_id [Integer] Secret chat identifier.
|
|
551
|
-
# @return [TD::Types::Ok]
|
|
552
|
-
def close_secret_chat(secret_chat_id)
|
|
553
|
-
broadcast('@type' => 'closeSecretChat',
|
|
554
|
-
'secret_chat_id' => secret_chat_id)
|
|
555
|
-
end
|
|
556
|
-
|
|
557
|
-
# Confirms QR code authentication on another device.
|
|
558
|
-
# Returns created session on success.
|
|
559
|
-
#
|
|
560
|
-
# @param link [String] A link from a QR code.
|
|
561
|
-
# The link must be scanned by the in-app camera.
|
|
562
|
-
# @return [TD::Types::Session]
|
|
563
|
-
def confirm_qr_code_authentication(link)
|
|
564
|
-
broadcast('@type' => 'confirmQrCodeAuthentication',
|
|
565
|
-
'link' => link)
|
|
566
|
-
end
|
|
567
|
-
|
|
568
|
-
# Returns an existing chat corresponding to a known basic group.
|
|
569
|
-
#
|
|
570
|
-
# @param basic_group_id [Integer] Basic group identifier.
|
|
571
|
-
# @param force [Boolean] If true, the chat will be created without network request.
|
|
572
|
-
# In this case all information about the chat except its type, title and photo can be incorrect.
|
|
573
|
-
# @return [TD::Types::Chat]
|
|
574
|
-
def create_basic_group_chat(basic_group_id, force)
|
|
575
|
-
broadcast('@type' => 'createBasicGroupChat',
|
|
576
|
-
'basic_group_id' => basic_group_id,
|
|
577
|
-
'force' => force)
|
|
578
|
-
end
|
|
579
|
-
|
|
580
|
-
# Creates a new call.
|
|
581
|
-
#
|
|
582
|
-
# @param user_id [Integer] Identifier of the user to be called.
|
|
583
|
-
# @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the client.
|
|
584
|
-
# @return [TD::Types::CallId]
|
|
585
|
-
def create_call(user_id, protocol)
|
|
586
|
-
broadcast('@type' => 'createCall',
|
|
587
|
-
'user_id' => user_id,
|
|
588
|
-
'protocol' => protocol)
|
|
589
|
-
end
|
|
590
|
-
|
|
591
|
-
# Creates a new basic group and sends a corresponding messageBasicGroupChatCreate.
|
|
592
|
-
# Returns the newly created chat.
|
|
593
|
-
#
|
|
594
|
-
# @param user_ids [Array<Integer>] Identifiers of users to be added to the basic group.
|
|
595
|
-
# @param title [String] Title of the new basic group; 1-128 characters.
|
|
596
|
-
# @return [TD::Types::Chat]
|
|
597
|
-
def create_new_basic_group_chat(user_ids, title)
|
|
598
|
-
broadcast('@type' => 'createNewBasicGroupChat',
|
|
599
|
-
'user_ids' => user_ids,
|
|
600
|
-
'title' => title)
|
|
601
|
-
end
|
|
602
|
-
|
|
603
|
-
# Creates a new secret chat.
|
|
604
|
-
# Returns the newly created chat.
|
|
605
|
-
#
|
|
606
|
-
# @param user_id [Integer] Identifier of the target user.
|
|
607
|
-
# @return [TD::Types::Chat]
|
|
608
|
-
def create_new_secret_chat(user_id)
|
|
609
|
-
broadcast('@type' => 'createNewSecretChat',
|
|
610
|
-
'user_id' => user_id)
|
|
611
|
-
end
|
|
612
|
-
|
|
613
|
-
# Creates a new sticker set; for bots only.
|
|
614
|
-
# Returns the newly created sticker set.
|
|
615
|
-
#
|
|
616
|
-
# @param user_id [Integer] Sticker set owner.
|
|
617
|
-
# @param title [String] Sticker set title; 1-64 characters.
|
|
618
|
-
# @param name [String] Sticker set name.
|
|
619
|
-
# Can contain only English letters, digits and underscores.
|
|
620
|
-
# Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive); 1-64 characters.
|
|
621
|
-
# @param is_masks [Boolean] True, if stickers are masks.
|
|
622
|
-
# @param stickers [Array<TD::Types::InputSticker>] List of stickers to be added to the set.
|
|
623
|
-
# @return [TD::Types::StickerSet]
|
|
624
|
-
def create_new_sticker_set(user_id, title, name, is_masks, stickers)
|
|
625
|
-
broadcast('@type' => 'createNewStickerSet',
|
|
626
|
-
'user_id' => user_id,
|
|
627
|
-
'title' => title,
|
|
628
|
-
'name' => name,
|
|
629
|
-
'is_masks' => is_masks,
|
|
630
|
-
'stickers' => stickers)
|
|
631
|
-
end
|
|
632
|
-
|
|
633
|
-
# Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate.
|
|
634
|
-
# Returns the newly created chat.
|
|
635
|
-
#
|
|
636
|
-
# @param title [String] Title of the new chat; 1-128 characters.
|
|
637
|
-
# @param is_channel [Boolean] True, if a channel chat should be created.
|
|
638
|
-
# @param description [String] Chat description; 0-255 characters.
|
|
639
|
-
# @param location [TD::Types::ChatLocation] Chat location if a location-based supergroup is being created.
|
|
640
|
-
# @return [TD::Types::Chat]
|
|
641
|
-
def create_new_supergroup_chat(title, is_channel, description, location)
|
|
642
|
-
broadcast('@type' => 'createNewSupergroupChat',
|
|
643
|
-
'title' => title,
|
|
644
|
-
'is_channel' => is_channel,
|
|
645
|
-
'description' => description,
|
|
646
|
-
'location' => location)
|
|
647
|
-
end
|
|
648
|
-
|
|
649
|
-
# Returns an existing chat corresponding to a given user.
|
|
650
|
-
#
|
|
651
|
-
# @param user_id [Integer] User identifier.
|
|
652
|
-
# @param force [Boolean] If true, the chat will be created without network request.
|
|
653
|
-
# In this case all information about the chat except its type, title and photo can be incorrect.
|
|
654
|
-
# @return [TD::Types::Chat]
|
|
655
|
-
def create_private_chat(user_id, force)
|
|
656
|
-
broadcast('@type' => 'createPrivateChat',
|
|
657
|
-
'user_id' => user_id,
|
|
658
|
-
'force' => force)
|
|
659
|
-
end
|
|
660
|
-
|
|
661
|
-
# Returns an existing chat corresponding to a known secret chat.
|
|
662
|
-
#
|
|
663
|
-
# @param secret_chat_id [Integer] Secret chat identifier.
|
|
664
|
-
# @return [TD::Types::Chat]
|
|
665
|
-
def create_secret_chat(secret_chat_id)
|
|
666
|
-
broadcast('@type' => 'createSecretChat',
|
|
667
|
-
'secret_chat_id' => secret_chat_id)
|
|
668
|
-
end
|
|
669
|
-
|
|
670
|
-
# Returns an existing chat corresponding to a known supergroup or channel.
|
|
671
|
-
#
|
|
672
|
-
# @param supergroup_id [Integer] Supergroup or channel identifier.
|
|
673
|
-
# @param force [Boolean] If true, the chat will be created without network request.
|
|
674
|
-
# In this case all information about the chat except its type, title and photo can be incorrect.
|
|
675
|
-
# @return [TD::Types::Chat]
|
|
676
|
-
def create_supergroup_chat(supergroup_id, force)
|
|
677
|
-
broadcast('@type' => 'createSupergroupChat',
|
|
678
|
-
'supergroup_id' => supergroup_id,
|
|
679
|
-
'force' => force)
|
|
680
|
-
end
|
|
681
|
-
|
|
682
|
-
# Creates a new temporary password for processing payments.
|
|
683
|
-
#
|
|
684
|
-
# @param password [String] Persistent user password.
|
|
685
|
-
# @param valid_for [Integer] Time during which the temporary password will be valid, in seconds; should be between 60
|
|
686
|
-
# and 86400.
|
|
687
|
-
# @return [TD::Types::TemporaryPasswordState]
|
|
688
|
-
def create_temporary_password(password, valid_for)
|
|
689
|
-
broadcast('@type' => 'createTemporaryPassword',
|
|
690
|
-
'password' => password,
|
|
691
|
-
'valid_for' => valid_for)
|
|
692
|
-
end
|
|
693
|
-
|
|
694
|
-
# Deletes the account of the current user, deleting all information associated with the user from the server.
|
|
695
|
-
# The phone number of the account can be used to create a new account.
|
|
696
|
-
# Can be called before authorization when the current authorization state is authorizationStateWaitPassword.
|
|
697
|
-
#
|
|
698
|
-
# @param reason [String, nil] The reason why the account was deleted; optional.
|
|
699
|
-
# @return [TD::Types::Ok]
|
|
700
|
-
def delete_account(reason = nil)
|
|
701
|
-
broadcast('@type' => 'deleteAccount',
|
|
702
|
-
'reason' => reason)
|
|
703
|
-
end
|
|
704
|
-
|
|
705
|
-
# Deletes all messages in the chat.
|
|
706
|
-
# Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the
|
|
707
|
-
# method can be applied to the chat.
|
|
708
|
-
#
|
|
709
|
-
# @param chat_id [Integer] Chat identifier.
|
|
710
|
-
# @param remove_from_chat_list [Boolean] Pass true if the chat should be removed from the chat list.
|
|
711
|
-
# @param revoke [Boolean] Pass true to try to delete chat history for all users.
|
|
712
|
-
# @return [TD::Types::Ok]
|
|
713
|
-
def delete_chat_history(chat_id, remove_from_chat_list, revoke)
|
|
714
|
-
broadcast('@type' => 'deleteChatHistory',
|
|
715
|
-
'chat_id' => chat_id,
|
|
716
|
-
'remove_from_chat_list' => remove_from_chat_list,
|
|
717
|
-
'revoke' => revoke)
|
|
718
|
-
end
|
|
719
|
-
|
|
720
|
-
# Deletes all messages sent by the specified user to a chat.
|
|
721
|
-
# Supported only for supergroups; requires can_delete_messages administrator privileges.
|
|
722
|
-
#
|
|
723
|
-
# @param chat_id [Integer] Chat identifier.
|
|
724
|
-
# @param user_id [Integer] User identifier.
|
|
725
|
-
# @return [TD::Types::Ok]
|
|
726
|
-
def delete_chat_messages_from_user(chat_id, user_id)
|
|
727
|
-
broadcast('@type' => 'deleteChatMessagesFromUser',
|
|
728
|
-
'chat_id' => chat_id,
|
|
729
|
-
'user_id' => user_id)
|
|
730
|
-
end
|
|
731
|
-
|
|
732
|
-
# Deletes the default reply markup from a chat.
|
|
733
|
-
# Must be called after a one-time keyboard or a ForceReply reply markup has been used.
|
|
734
|
-
# UpdateChatReplyMarkup will be sent if the reply markup will be changed.
|
|
735
|
-
#
|
|
736
|
-
# @param chat_id [Integer] Chat identifier.
|
|
737
|
-
# @param message_id [Integer] The message identifier of the used keyboard.
|
|
738
|
-
# @return [TD::Types::Ok]
|
|
739
|
-
def delete_chat_reply_markup(chat_id, message_id)
|
|
740
|
-
broadcast('@type' => 'deleteChatReplyMarkup',
|
|
741
|
-
'chat_id' => chat_id,
|
|
742
|
-
'message_id' => message_id)
|
|
743
|
-
end
|
|
744
|
-
|
|
745
|
-
# Deletes a file from the TDLib file cache.
|
|
746
|
-
#
|
|
747
|
-
# @param file_id [Integer] Identifier of the file to delete.
|
|
748
|
-
# @return [TD::Types::Ok]
|
|
749
|
-
def delete_file(file_id)
|
|
750
|
-
broadcast('@type' => 'deleteFile',
|
|
751
|
-
'file_id' => file_id)
|
|
752
|
-
end
|
|
753
|
-
|
|
754
|
-
# Deletes all information about a language pack in the current localization target.
|
|
755
|
-
# The language pack which is currently in use (including base language pack) or is being synchronized can't be
|
|
756
|
-
# deleted.
|
|
757
|
-
# Can be called before authorization.
|
|
758
|
-
#
|
|
759
|
-
# @param language_pack_id [String] Identifier of the language pack to delete.
|
|
760
|
-
# @return [TD::Types::Ok]
|
|
761
|
-
def delete_language_pack(language_pack_id)
|
|
762
|
-
broadcast('@type' => 'deleteLanguagePack',
|
|
763
|
-
'language_pack_id' => language_pack_id)
|
|
764
|
-
end
|
|
765
|
-
|
|
766
|
-
# Deletes messages.
|
|
767
|
-
#
|
|
768
|
-
# @param chat_id [Integer] Chat identifier.
|
|
769
|
-
# @param message_ids [Array<Integer>] Identifiers of the messages to be deleted.
|
|
770
|
-
# @param revoke [Boolean] Pass true to try to delete messages for all chat members.
|
|
771
|
-
# Always true for supergroups, channels and secret chats.
|
|
772
|
-
# @return [TD::Types::Ok]
|
|
773
|
-
def delete_messages(chat_id, message_ids, revoke)
|
|
774
|
-
broadcast('@type' => 'deleteMessages',
|
|
775
|
-
'chat_id' => chat_id,
|
|
776
|
-
'message_ids' => message_ids,
|
|
777
|
-
'revoke' => revoke)
|
|
778
|
-
end
|
|
779
|
-
|
|
780
|
-
# Deletes a Telegram Passport element.
|
|
781
|
-
#
|
|
782
|
-
# @param type [TD::Types::PassportElementType] Element type.
|
|
783
|
-
# @return [TD::Types::Ok]
|
|
784
|
-
def delete_passport_element(type)
|
|
785
|
-
broadcast('@type' => 'deletePassportElement',
|
|
786
|
-
'type' => type)
|
|
787
|
-
end
|
|
788
|
-
|
|
789
|
-
# Deletes a profile photo.
|
|
790
|
-
# If something changes, updateUser will be sent.
|
|
791
|
-
#
|
|
792
|
-
# @param profile_photo_id [Integer] Identifier of the profile photo to delete.
|
|
793
|
-
# @return [TD::Types::Ok]
|
|
794
|
-
def delete_profile_photo(profile_photo_id)
|
|
795
|
-
broadcast('@type' => 'deleteProfilePhoto',
|
|
796
|
-
'profile_photo_id' => profile_photo_id)
|
|
797
|
-
end
|
|
798
|
-
|
|
799
|
-
# Deletes saved credentials for all payment provider bots.
|
|
800
|
-
#
|
|
801
|
-
# @return [TD::Types::Ok]
|
|
802
|
-
def delete_saved_credentials
|
|
803
|
-
broadcast('@type' => 'deleteSavedCredentials')
|
|
804
|
-
end
|
|
805
|
-
|
|
806
|
-
# Deletes saved order info.
|
|
807
|
-
#
|
|
808
|
-
# @return [TD::Types::Ok]
|
|
809
|
-
def delete_saved_order_info
|
|
810
|
-
broadcast('@type' => 'deleteSavedOrderInfo')
|
|
811
|
-
end
|
|
812
|
-
|
|
813
|
-
# Deletes a supergroup or channel along with all messages in the corresponding chat.
|
|
814
|
-
# This will release the supergroup or channel username and remove all members; requires owner privileges in the
|
|
815
|
-
# supergroup or channel.
|
|
816
|
-
# Chats with more than 1000 members can't be deleted using this method.
|
|
817
|
-
#
|
|
818
|
-
# @param supergroup_id [Integer] Identifier of the supergroup or channel.
|
|
819
|
-
# @return [TD::Types::Ok]
|
|
820
|
-
def delete_supergroup(supergroup_id)
|
|
821
|
-
broadcast('@type' => 'deleteSupergroup',
|
|
822
|
-
'supergroup_id' => supergroup_id)
|
|
823
|
-
end
|
|
824
|
-
|
|
825
|
-
# Closes the TDLib instance, destroying all local data without a proper logout.
|
|
826
|
-
# The current user session will remain in the list of all active sessions.
|
|
827
|
-
# All local data will be destroyed.
|
|
828
|
-
# After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent.
|
|
829
|
-
#
|
|
830
|
-
# @return [TD::Types::Ok]
|
|
831
|
-
def destroy
|
|
832
|
-
broadcast('@type' => 'destroy')
|
|
833
|
-
end
|
|
834
|
-
|
|
835
|
-
# Disables the currently enabled proxy.
|
|
836
|
-
# Can be called before authorization.
|
|
837
|
-
#
|
|
838
|
-
# @return [TD::Types::Ok]
|
|
839
|
-
def disable_proxy
|
|
840
|
-
broadcast('@type' => 'disableProxy')
|
|
841
|
-
end
|
|
842
|
-
|
|
843
|
-
# Discards a call.
|
|
844
|
-
#
|
|
845
|
-
# @param call_id [Integer] Call identifier.
|
|
846
|
-
# @param is_disconnected [Boolean] True, if the user was disconnected.
|
|
847
|
-
# @param duration [Integer] The call duration, in seconds.
|
|
848
|
-
# @param connection_id [Integer] Identifier of the connection used during the call.
|
|
849
|
-
# @return [TD::Types::Ok]
|
|
850
|
-
def discard_call(call_id, is_disconnected, duration, connection_id)
|
|
851
|
-
broadcast('@type' => 'discardCall',
|
|
852
|
-
'call_id' => call_id,
|
|
853
|
-
'is_disconnected' => is_disconnected,
|
|
854
|
-
'duration' => duration,
|
|
855
|
-
'connection_id' => connection_id)
|
|
856
|
-
end
|
|
857
|
-
|
|
858
|
-
# Disconnects all websites from the current user's Telegram account.
|
|
859
|
-
#
|
|
860
|
-
# @return [TD::Types::Ok]
|
|
861
|
-
def disconnect_all_websites
|
|
862
|
-
broadcast('@type' => 'disconnectAllWebsites')
|
|
863
|
-
end
|
|
864
|
-
|
|
865
|
-
# Disconnects website from the current user's Telegram account.
|
|
866
|
-
#
|
|
867
|
-
# @param website_id [Integer] Website identifier.
|
|
868
|
-
# @return [TD::Types::Ok]
|
|
869
|
-
def disconnect_website(website_id)
|
|
870
|
-
broadcast('@type' => 'disconnectWebsite',
|
|
871
|
-
'website_id' => website_id)
|
|
872
|
-
end
|
|
873
|
-
|
|
874
|
-
# Downloads a file from the cloud.
|
|
875
|
-
# Download progress and completion of the download will be notified through updateFile updates.
|
|
876
|
-
#
|
|
877
|
-
# @param file_id [Integer] Identifier of the file to download.
|
|
878
|
-
# @param priority [Integer] Priority of the download (1-32).
|
|
879
|
-
# The higher the priority, the earlier the file will be downloaded.
|
|
880
|
-
# If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded
|
|
881
|
-
# first.
|
|
882
|
-
# @param offset [Integer] The starting position from which the file should be downloaded.
|
|
883
|
-
# @param limit [Integer] Number of bytes which should be downloaded starting from the "offset" position before the
|
|
884
|
-
# download will be automatically cancelled; use 0 to download without a limit.
|
|
885
|
-
# @param synchronous [Boolean] If false, this request returns file state just after the download has been started.
|
|
886
|
-
# If true, this request returns file state only after the download has succeeded, has failed, has been cancelled or
|
|
887
|
-
# a new downloadFile request with different offset/limit parameters was sent.
|
|
888
|
-
# @return [TD::Types::File]
|
|
889
|
-
def download_file(file_id, priority, offset, limit, synchronous)
|
|
890
|
-
broadcast('@type' => 'downloadFile',
|
|
891
|
-
'file_id' => file_id,
|
|
892
|
-
'priority' => priority,
|
|
893
|
-
'offset' => offset,
|
|
894
|
-
'limit' => limit,
|
|
895
|
-
'synchronous' => synchronous)
|
|
896
|
-
end
|
|
897
|
-
|
|
898
|
-
# Edits information about a custom local language pack in the current localization target.
|
|
899
|
-
# Can be called before authorization.
|
|
900
|
-
#
|
|
901
|
-
# @param info [TD::Types::LanguagePackInfo] New information about the custom local language pack.
|
|
902
|
-
# @return [TD::Types::Ok]
|
|
903
|
-
def edit_custom_language_pack_info(info)
|
|
904
|
-
broadcast('@type' => 'editCustomLanguagePackInfo',
|
|
905
|
-
'info' => info)
|
|
906
|
-
end
|
|
907
|
-
|
|
908
|
-
# Edits the caption of an inline message sent via a bot; for bots only.
|
|
909
|
-
#
|
|
910
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
911
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup.
|
|
912
|
-
# @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max")
|
|
913
|
-
# characters.
|
|
914
|
-
# @return [TD::Types::Ok]
|
|
915
|
-
def edit_inline_message_caption(inline_message_id, reply_markup, caption)
|
|
916
|
-
broadcast('@type' => 'editInlineMessageCaption',
|
|
917
|
-
'inline_message_id' => inline_message_id,
|
|
918
|
-
'reply_markup' => reply_markup,
|
|
919
|
-
'caption' => caption)
|
|
920
|
-
end
|
|
921
|
-
|
|
922
|
-
# Edits the content of a live location in an inline message sent via a bot; for bots only.
|
|
923
|
-
#
|
|
924
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
925
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup.
|
|
926
|
-
# @param location [TD::Types::Location, nil] New location content of the message; may be null.
|
|
927
|
-
# Pass null to stop sharing the live location.
|
|
928
|
-
# @return [TD::Types::Ok]
|
|
929
|
-
def edit_inline_message_live_location(inline_message_id, reply_markup, location = nil)
|
|
930
|
-
broadcast('@type' => 'editInlineMessageLiveLocation',
|
|
931
|
-
'inline_message_id' => inline_message_id,
|
|
932
|
-
'reply_markup' => reply_markup,
|
|
933
|
-
'location' => location)
|
|
934
|
-
end
|
|
935
|
-
|
|
936
|
-
# Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message
|
|
937
|
-
# sent via a bot; for bots only.
|
|
938
|
-
#
|
|
939
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
940
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
941
|
-
# @param input_message_content [TD::Types::InputMessageContent] New content of the message.
|
|
942
|
-
# Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument,
|
|
943
|
-
# InputMessagePhoto or InputMessageVideo.
|
|
944
|
-
# @return [TD::Types::Ok]
|
|
945
|
-
def edit_inline_message_media(inline_message_id, reply_markup, input_message_content)
|
|
946
|
-
broadcast('@type' => 'editInlineMessageMedia',
|
|
947
|
-
'inline_message_id' => inline_message_id,
|
|
948
|
-
'reply_markup' => reply_markup,
|
|
949
|
-
'input_message_content' => input_message_content)
|
|
950
|
-
end
|
|
951
|
-
|
|
952
|
-
# Edits the reply markup of an inline message sent via a bot; for bots only.
|
|
953
|
-
#
|
|
954
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
955
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup.
|
|
956
|
-
# @return [TD::Types::Ok]
|
|
957
|
-
def edit_inline_message_reply_markup(inline_message_id, reply_markup)
|
|
958
|
-
broadcast('@type' => 'editInlineMessageReplyMarkup',
|
|
959
|
-
'inline_message_id' => inline_message_id,
|
|
960
|
-
'reply_markup' => reply_markup)
|
|
961
|
-
end
|
|
962
|
-
|
|
963
|
-
# Edits the text of an inline text or game message sent via a bot; for bots only.
|
|
964
|
-
#
|
|
965
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
966
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup.
|
|
967
|
-
# @param input_message_content [TD::Types::InputMessageContent] New text content of the message.
|
|
968
|
-
# Should be of type InputMessageText.
|
|
969
|
-
# @return [TD::Types::Ok]
|
|
970
|
-
def edit_inline_message_text(inline_message_id, reply_markup, input_message_content)
|
|
971
|
-
broadcast('@type' => 'editInlineMessageText',
|
|
972
|
-
'inline_message_id' => inline_message_id,
|
|
973
|
-
'reply_markup' => reply_markup,
|
|
974
|
-
'input_message_content' => input_message_content)
|
|
975
|
-
end
|
|
976
|
-
|
|
977
|
-
# Edits the message content caption.
|
|
978
|
-
# Returns the edited message after the edit is completed on the server side.
|
|
979
|
-
#
|
|
980
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
981
|
-
# @param message_id [Integer] Identifier of the message.
|
|
982
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
983
|
-
# @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max")
|
|
984
|
-
# characters.
|
|
985
|
-
# @return [TD::Types::Message]
|
|
986
|
-
def edit_message_caption(chat_id, message_id, reply_markup, caption)
|
|
987
|
-
broadcast('@type' => 'editMessageCaption',
|
|
988
|
-
'chat_id' => chat_id,
|
|
989
|
-
'message_id' => message_id,
|
|
990
|
-
'reply_markup' => reply_markup,
|
|
991
|
-
'caption' => caption)
|
|
992
|
-
end
|
|
993
|
-
|
|
994
|
-
# Edits the message content of a live location.
|
|
995
|
-
# Messages can be edited for a limited period of time specified in the live location.
|
|
996
|
-
# Returns the edited message after the edit is completed on the server side.
|
|
997
|
-
#
|
|
998
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
999
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1000
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
1001
|
-
# @param location [TD::Types::Location, nil] New location content of the message; may be null.
|
|
1002
|
-
# Pass null to stop sharing the live location.
|
|
1003
|
-
# @return [TD::Types::Message]
|
|
1004
|
-
def edit_message_live_location(chat_id, message_id, reply_markup, location = nil)
|
|
1005
|
-
broadcast('@type' => 'editMessageLiveLocation',
|
|
1006
|
-
'chat_id' => chat_id,
|
|
1007
|
-
'message_id' => message_id,
|
|
1008
|
-
'reply_markup' => reply_markup,
|
|
1009
|
-
'location' => location)
|
|
1010
|
-
end
|
|
1011
|
-
|
|
1012
|
-
# Edits the content of a message with an animation, an audio, a document, a photo or a video.
|
|
1013
|
-
# The media in the message can't be replaced if the message was set to self-destruct.
|
|
1014
|
-
# Media can't be replaced by self-destructing media.
|
|
1015
|
-
# Media in an album can be edited only to contain a photo or a video.
|
|
1016
|
-
# Returns the edited message after the edit is completed on the server side.
|
|
1017
|
-
#
|
|
1018
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
1019
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1020
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
1021
|
-
# @param input_message_content [TD::Types::InputMessageContent] New content of the message.
|
|
1022
|
-
# Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument,
|
|
1023
|
-
# InputMessagePhoto or InputMessageVideo.
|
|
1024
|
-
# @return [TD::Types::Message]
|
|
1025
|
-
def edit_message_media(chat_id, message_id, reply_markup, input_message_content)
|
|
1026
|
-
broadcast('@type' => 'editMessageMedia',
|
|
1027
|
-
'chat_id' => chat_id,
|
|
1028
|
-
'message_id' => message_id,
|
|
1029
|
-
'reply_markup' => reply_markup,
|
|
1030
|
-
'input_message_content' => input_message_content)
|
|
1031
|
-
end
|
|
1032
|
-
|
|
1033
|
-
# Edits the message reply markup; for bots only.
|
|
1034
|
-
# Returns the edited message after the edit is completed on the server side.
|
|
1035
|
-
#
|
|
1036
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
1037
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1038
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup.
|
|
1039
|
-
# @return [TD::Types::Message]
|
|
1040
|
-
def edit_message_reply_markup(chat_id, message_id, reply_markup)
|
|
1041
|
-
broadcast('@type' => 'editMessageReplyMarkup',
|
|
1042
|
-
'chat_id' => chat_id,
|
|
1043
|
-
'message_id' => message_id,
|
|
1044
|
-
'reply_markup' => reply_markup)
|
|
1045
|
-
end
|
|
1046
|
-
|
|
1047
|
-
# Edits the time when a scheduled message will be sent.
|
|
1048
|
-
# Scheduling state of all messages in the same album or forwarded together with the message will be also changed.
|
|
1049
|
-
#
|
|
1050
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
1051
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1052
|
-
# @param scheduling_state [TD::Types::MessageSchedulingState] The new message scheduling state.
|
|
1053
|
-
# Pass null to send the message immediately.
|
|
1054
|
-
# @return [TD::Types::Ok]
|
|
1055
|
-
def edit_message_scheduling_state(chat_id, message_id, scheduling_state)
|
|
1056
|
-
broadcast('@type' => 'editMessageSchedulingState',
|
|
1057
|
-
'chat_id' => chat_id,
|
|
1058
|
-
'message_id' => message_id,
|
|
1059
|
-
'scheduling_state' => scheduling_state)
|
|
1060
|
-
end
|
|
1061
|
-
|
|
1062
|
-
# Edits the text of a message (or a text of a game message).
|
|
1063
|
-
# Returns the edited message after the edit is completed on the server side.
|
|
1064
|
-
#
|
|
1065
|
-
# @param chat_id [Integer] The chat the message belongs to.
|
|
1066
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1067
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
1068
|
-
# @param input_message_content [TD::Types::InputMessageContent] New text content of the message.
|
|
1069
|
-
# Should be of type InputMessageText.
|
|
1070
|
-
# @return [TD::Types::Message]
|
|
1071
|
-
def edit_message_text(chat_id, message_id, reply_markup, input_message_content)
|
|
1072
|
-
broadcast('@type' => 'editMessageText',
|
|
1073
|
-
'chat_id' => chat_id,
|
|
1074
|
-
'message_id' => message_id,
|
|
1075
|
-
'reply_markup' => reply_markup,
|
|
1076
|
-
'input_message_content' => input_message_content)
|
|
1077
|
-
end
|
|
1078
|
-
|
|
1079
|
-
# Edits an existing proxy server for network requests.
|
|
1080
|
-
# Can be called before authorization.
|
|
1081
|
-
#
|
|
1082
|
-
# @param proxy_id [Integer] Proxy identifier.
|
|
1083
|
-
# @param server [String] Proxy server IP address.
|
|
1084
|
-
# @param port [Integer] Proxy server port.
|
|
1085
|
-
# @param enable [Boolean] True, if the proxy should be enabled.
|
|
1086
|
-
# @param type [TD::Types::ProxyType] Proxy type.
|
|
1087
|
-
# @return [TD::Types::Proxy]
|
|
1088
|
-
def edit_proxy(proxy_id, server, port, enable, type)
|
|
1089
|
-
broadcast('@type' => 'editProxy',
|
|
1090
|
-
'proxy_id' => proxy_id,
|
|
1091
|
-
'server' => server,
|
|
1092
|
-
'port' => port,
|
|
1093
|
-
'enable' => enable,
|
|
1094
|
-
'type' => type)
|
|
1095
|
-
end
|
|
1096
|
-
|
|
1097
|
-
# Enables a proxy.
|
|
1098
|
-
# Only one proxy can be enabled at a time.
|
|
1099
|
-
# Can be called before authorization.
|
|
1100
|
-
#
|
|
1101
|
-
# @param proxy_id [Integer] Proxy identifier.
|
|
1102
|
-
# @return [TD::Types::Ok]
|
|
1103
|
-
def enable_proxy(proxy_id)
|
|
1104
|
-
broadcast('@type' => 'enableProxy',
|
|
1105
|
-
'proxy_id' => proxy_id)
|
|
1106
|
-
end
|
|
1107
|
-
|
|
1108
|
-
# Finishes the file generation.
|
|
1109
|
-
#
|
|
1110
|
-
# @param generation_id [Integer] The identifier of the generation process.
|
|
1111
|
-
# @param error [TD::Types::Error] If set, means that file generation has failed and should be terminated.
|
|
1112
|
-
# @return [TD::Types::Ok]
|
|
1113
|
-
def finish_file_generation(generation_id, error)
|
|
1114
|
-
broadcast('@type' => 'finishFileGeneration',
|
|
1115
|
-
'generation_id' => generation_id,
|
|
1116
|
-
'error' => error)
|
|
1117
|
-
end
|
|
1118
|
-
|
|
1119
|
-
# Forwards previously sent messages.
|
|
1120
|
-
# Returns the forwarded messages in the same order as the message identifiers passed in message_ids.
|
|
1121
|
-
# If a message can't be forwarded, null will be returned instead of the message.
|
|
1122
|
-
#
|
|
1123
|
-
# @param chat_id [Integer] Identifier of the chat to which to forward messages.
|
|
1124
|
-
# @param from_chat_id [Integer] Identifier of the chat from which to forward messages.
|
|
1125
|
-
# @param message_ids [Array<Integer>] Identifiers of the messages to forward.
|
|
1126
|
-
# @param options [TD::Types::SendMessageOptions] Options to be used to send the messages.
|
|
1127
|
-
# @param as_album [Boolean] True, if the messages should be grouped into an album after forwarding.
|
|
1128
|
-
# For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages.
|
|
1129
|
-
# @param send_copy [Boolean] True, if content of the messages needs to be copied without links to the original
|
|
1130
|
-
# messages.
|
|
1131
|
-
# Always true if the messages are forwarded to a secret chat.
|
|
1132
|
-
# @param remove_caption [Boolean] True, if media captions of message copies needs to be removed.
|
|
1133
|
-
# Ignored if send_copy is false.
|
|
1134
|
-
# @return [TD::Types::Messages]
|
|
1135
|
-
def forward_messages(chat_id, from_chat_id, message_ids, options, as_album, send_copy, remove_caption)
|
|
1136
|
-
broadcast('@type' => 'forwardMessages',
|
|
1137
|
-
'chat_id' => chat_id,
|
|
1138
|
-
'from_chat_id' => from_chat_id,
|
|
1139
|
-
'message_ids' => message_ids,
|
|
1140
|
-
'options' => options,
|
|
1141
|
-
'as_album' => as_album,
|
|
1142
|
-
'send_copy' => send_copy,
|
|
1143
|
-
'remove_caption' => remove_caption)
|
|
1144
|
-
end
|
|
1145
|
-
|
|
1146
|
-
# Generates a new invite link for a chat; the previously generated link is revoked.
|
|
1147
|
-
# Available for basic groups, supergroups, and channels.
|
|
1148
|
-
# Requires administrator privileges and can_invite_users right.
|
|
1149
|
-
#
|
|
1150
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1151
|
-
# @return [TD::Types::ChatInviteLink]
|
|
1152
|
-
def generate_chat_invite_link(chat_id)
|
|
1153
|
-
broadcast('@type' => 'generateChatInviteLink',
|
|
1154
|
-
'chat_id' => chat_id)
|
|
1155
|
-
end
|
|
1156
|
-
|
|
1157
|
-
# Returns the period of inactivity after which the account of the current user will automatically be deleted.
|
|
1158
|
-
#
|
|
1159
|
-
# @return [TD::Types::AccountTtl]
|
|
1160
|
-
def get_account_ttl
|
|
1161
|
-
broadcast('@type' => 'getAccountTtl')
|
|
1162
|
-
end
|
|
1163
|
-
|
|
1164
|
-
# Returns all active live locations that should be updated by the client.
|
|
1165
|
-
# The list is persistent across application restarts only if the message database is used.
|
|
1166
|
-
#
|
|
1167
|
-
# @return [TD::Types::Messages]
|
|
1168
|
-
def get_active_live_location_messages
|
|
1169
|
-
broadcast('@type' => 'getActiveLiveLocationMessages')
|
|
1170
|
-
end
|
|
1171
|
-
|
|
1172
|
-
# Returns all active sessions of the current user.
|
|
1173
|
-
#
|
|
1174
|
-
# @return [TD::Types::Sessions]
|
|
1175
|
-
def get_active_sessions
|
|
1176
|
-
broadcast('@type' => 'getActiveSessions')
|
|
1177
|
-
end
|
|
1178
|
-
|
|
1179
|
-
# Returns all available Telegram Passport elements.
|
|
1180
|
-
#
|
|
1181
|
-
# @param password [String] Password of the current user.
|
|
1182
|
-
# @return [TD::Types::PassportElements]
|
|
1183
|
-
def get_all_passport_elements(password)
|
|
1184
|
-
broadcast('@type' => 'getAllPassportElements',
|
|
1185
|
-
'password' => password)
|
|
1186
|
-
end
|
|
1187
|
-
|
|
1188
|
-
# Returns application config, provided by the server.
|
|
1189
|
-
# Can be called before authorization.
|
|
1190
|
-
#
|
|
1191
|
-
# @return [TD::Types::JsonValue]
|
|
1192
|
-
def get_application_config
|
|
1193
|
-
broadcast('@type' => 'getApplicationConfig')
|
|
1194
|
-
end
|
|
1195
|
-
|
|
1196
|
-
# Returns a list of archived sticker sets.
|
|
1197
|
-
#
|
|
1198
|
-
# @param is_masks [Boolean] Pass true to return mask stickers sets; pass false to return ordinary sticker sets.
|
|
1199
|
-
# @param offset_sticker_set_id [Integer] Identifier of the sticker set from which to return the result.
|
|
1200
|
-
# @param limit [Integer] The maximum number of sticker sets to return.
|
|
1201
|
-
# @return [TD::Types::StickerSets]
|
|
1202
|
-
def get_archived_sticker_sets(is_masks, offset_sticker_set_id, limit)
|
|
1203
|
-
broadcast('@type' => 'getArchivedStickerSets',
|
|
1204
|
-
'is_masks' => is_masks,
|
|
1205
|
-
'offset_sticker_set_id' => offset_sticker_set_id,
|
|
1206
|
-
'limit' => limit)
|
|
1207
|
-
end
|
|
1208
|
-
|
|
1209
|
-
# Returns a list of sticker sets attached to a file.
|
|
1210
|
-
# Currently only photos and videos can have attached sticker sets.
|
|
1211
|
-
#
|
|
1212
|
-
# @param file_id [Integer] File identifier.
|
|
1213
|
-
# @return [TD::Types::StickerSets]
|
|
1214
|
-
def get_attached_sticker_sets(file_id)
|
|
1215
|
-
broadcast('@type' => 'getAttachedStickerSets',
|
|
1216
|
-
'file_id' => file_id)
|
|
1217
|
-
end
|
|
1218
|
-
|
|
1219
|
-
# Returns the current authorization state; this is an offline request.
|
|
1220
|
-
# For informational purposes only.
|
|
1221
|
-
# Use updateAuthorizationState instead to maintain the current authorization state.
|
|
1222
|
-
#
|
|
1223
|
-
# @return [TD::Types::AuthorizationState]
|
|
1224
|
-
def get_authorization_state
|
|
1225
|
-
broadcast('@type' => 'getAuthorizationState')
|
|
1226
|
-
end
|
|
1227
|
-
|
|
1228
|
-
# Returns auto-download settings presets for the currently logged in user.
|
|
1229
|
-
#
|
|
1230
|
-
# @return [TD::Types::AutoDownloadSettingsPresets]
|
|
1231
|
-
def get_auto_download_settings_presets
|
|
1232
|
-
broadcast('@type' => 'getAutoDownloadSettingsPresets')
|
|
1233
|
-
end
|
|
1234
|
-
|
|
1235
|
-
# Constructs a persistent HTTP URL for a background.
|
|
1236
|
-
#
|
|
1237
|
-
# @param name [String] Background name.
|
|
1238
|
-
# @param type [TD::Types::BackgroundType] Background type.
|
|
1239
|
-
# @return [TD::Types::HttpUrl]
|
|
1240
|
-
def get_background_url(name, type)
|
|
1241
|
-
broadcast('@type' => 'getBackgroundUrl',
|
|
1242
|
-
'name' => name,
|
|
1243
|
-
'type' => type)
|
|
1244
|
-
end
|
|
1245
|
-
|
|
1246
|
-
# Returns backgrounds installed by the user.
|
|
1247
|
-
#
|
|
1248
|
-
# @param for_dark_theme [Boolean] True, if the backgrounds needs to be ordered for dark theme.
|
|
1249
|
-
# @return [TD::Types::Backgrounds]
|
|
1250
|
-
def get_backgrounds(for_dark_theme)
|
|
1251
|
-
broadcast('@type' => 'getBackgrounds',
|
|
1252
|
-
'for_dark_theme' => for_dark_theme)
|
|
1253
|
-
end
|
|
1254
|
-
|
|
1255
|
-
# Returns information about a basic group by its identifier.
|
|
1256
|
-
# This is an offline request if the current user is not a bot.
|
|
1257
|
-
#
|
|
1258
|
-
# @param basic_group_id [Integer] Basic group identifier.
|
|
1259
|
-
# @return [TD::Types::BasicGroup]
|
|
1260
|
-
def get_basic_group(basic_group_id)
|
|
1261
|
-
broadcast('@type' => 'getBasicGroup',
|
|
1262
|
-
'basic_group_id' => basic_group_id)
|
|
1263
|
-
end
|
|
1264
|
-
|
|
1265
|
-
# Returns full information about a basic group by its identifier.
|
|
1266
|
-
#
|
|
1267
|
-
# @param basic_group_id [Integer] Basic group identifier.
|
|
1268
|
-
# @return [TD::Types::BasicGroupFullInfo]
|
|
1269
|
-
def get_basic_group_full_info(basic_group_id)
|
|
1270
|
-
broadcast('@type' => 'getBasicGroupFullInfo',
|
|
1271
|
-
'basic_group_id' => basic_group_id)
|
|
1272
|
-
end
|
|
1273
|
-
|
|
1274
|
-
# Returns users that were blocked by the current user.
|
|
1275
|
-
#
|
|
1276
|
-
# @param offset [Integer] Number of users to skip in the result; must be non-negative.
|
|
1277
|
-
# @param limit [Integer] The maximum number of users to return; up to 100.
|
|
1278
|
-
# @return [TD::Types::Users]
|
|
1279
|
-
def get_blocked_users(offset, limit)
|
|
1280
|
-
broadcast('@type' => 'getBlockedUsers',
|
|
1281
|
-
'offset' => offset,
|
|
1282
|
-
'limit' => limit)
|
|
1283
|
-
end
|
|
1284
|
-
|
|
1285
|
-
# Sends a callback query to a bot and returns an answer.
|
|
1286
|
-
# Returns an error with code 502 if the bot fails to answer the query before the query timeout expires.
|
|
1287
|
-
#
|
|
1288
|
-
# @param chat_id [Integer] Identifier of the chat with the message.
|
|
1289
|
-
# @param message_id [Integer] Identifier of the message from which the query originated.
|
|
1290
|
-
# @param payload [TD::Types::CallbackQueryPayload] Query payload.
|
|
1291
|
-
# @return [TD::Types::CallbackQueryAnswer]
|
|
1292
|
-
def get_callback_query_answer(chat_id, message_id, payload)
|
|
1293
|
-
broadcast('@type' => 'getCallbackQueryAnswer',
|
|
1294
|
-
'chat_id' => chat_id,
|
|
1295
|
-
'message_id' => message_id,
|
|
1296
|
-
'payload' => payload)
|
|
1297
|
-
end
|
|
1298
|
-
|
|
1299
|
-
# Returns information about a chat by its identifier, this is an offline request if the current user is not a bot.
|
|
1300
|
-
#
|
|
1301
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1302
|
-
# @return [TD::Types::Chat]
|
|
1303
|
-
def get_chat(chat_id)
|
|
1304
|
-
broadcast('@type' => 'getChat',
|
|
1305
|
-
'chat_id' => chat_id)
|
|
1306
|
-
end
|
|
1307
|
-
|
|
1308
|
-
# Returns a list of administrators of the chat with their custom titles.
|
|
1309
|
-
#
|
|
1310
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1311
|
-
# @return [TD::Types::ChatAdministrators]
|
|
1312
|
-
def get_chat_administrators(chat_id)
|
|
1313
|
-
broadcast('@type' => 'getChatAdministrators',
|
|
1314
|
-
'chat_id' => chat_id)
|
|
1315
|
-
end
|
|
1316
|
-
|
|
1317
|
-
# Returns a list of service actions taken by chat members and administrators in the last 48 hours.
|
|
1318
|
-
# Available only for supergroups and channels.
|
|
1319
|
-
# Requires administrator rights.
|
|
1320
|
-
# Returns results in reverse chronological order (i.
|
|
1321
|
-
# e., in order of decreasing event_id).
|
|
1322
|
-
#
|
|
1323
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1324
|
-
# @param query [String] Search query by which to filter events.
|
|
1325
|
-
# @param from_event_id [Integer] Identifier of an event from which to return results.
|
|
1326
|
-
# Use 0 to get results from the latest events.
|
|
1327
|
-
# @param limit [Integer] The maximum number of events to return; up to 100.
|
|
1328
|
-
# @param filters [TD::Types::ChatEventLogFilters] The types of events to return.
|
|
1329
|
-
# By default, all types will be returned.
|
|
1330
|
-
# @param user_ids [Array<Integer>] User identifiers by which to filter events.
|
|
1331
|
-
# By default, events relating to all users will be returned.
|
|
1332
|
-
# @return [TD::Types::ChatEvents]
|
|
1333
|
-
def get_chat_event_log(chat_id, query, from_event_id, limit, filters, user_ids)
|
|
1334
|
-
broadcast('@type' => 'getChatEventLog',
|
|
1335
|
-
'chat_id' => chat_id,
|
|
1336
|
-
'query' => query,
|
|
1337
|
-
'from_event_id' => from_event_id,
|
|
1338
|
-
'limit' => limit,
|
|
1339
|
-
'filters' => filters,
|
|
1340
|
-
'user_ids' => user_ids)
|
|
1341
|
-
end
|
|
1342
|
-
|
|
1343
|
-
# Returns messages in a chat.
|
|
1344
|
-
# The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).
|
|
1345
|
-
# For optimal performance the number of returned messages is chosen by the library.
|
|
1346
|
-
# This is an offline request if only_local is true.
|
|
1347
|
-
#
|
|
1348
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1349
|
-
# @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to
|
|
1350
|
-
# get results from the last message.
|
|
1351
|
-
# @param offset [Integer] Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to
|
|
1352
|
-
# get additionally some newer messages.
|
|
1353
|
-
# @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than
|
|
1354
|
-
# 100.
|
|
1355
|
-
# If the offset is negative, the limit must be greater or equal to -offset.
|
|
1356
|
-
# Fewer messages may be returned than specified by the limit, even if the end of the message history has not been
|
|
1357
|
-
# reached.
|
|
1358
|
-
# @param only_local [Boolean] If true, returns only messages that are available locally without sending network
|
|
1359
|
-
# requests.
|
|
1360
|
-
# @return [TD::Types::Messages]
|
|
1361
|
-
def get_chat_history(chat_id, from_message_id, offset, limit, only_local)
|
|
1362
|
-
broadcast('@type' => 'getChatHistory',
|
|
1363
|
-
'chat_id' => chat_id,
|
|
1364
|
-
'from_message_id' => from_message_id,
|
|
1365
|
-
'offset' => offset,
|
|
1366
|
-
'limit' => limit,
|
|
1367
|
-
'only_local' => only_local)
|
|
1368
|
-
end
|
|
1369
|
-
|
|
1370
|
-
# Returns information about a single member of a chat.
|
|
1371
|
-
#
|
|
1372
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1373
|
-
# @param user_id [Integer] User identifier.
|
|
1374
|
-
# @return [TD::Types::ChatMember]
|
|
1375
|
-
def get_chat_member(chat_id, user_id)
|
|
1376
|
-
broadcast('@type' => 'getChatMember',
|
|
1377
|
-
'chat_id' => chat_id,
|
|
1378
|
-
'user_id' => user_id)
|
|
1379
|
-
end
|
|
1380
|
-
|
|
1381
|
-
# Returns the last message sent in a chat no later than the specified date.
|
|
1382
|
-
#
|
|
1383
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1384
|
-
# @param date [Integer] Point in time (Unix timestamp) relative to which to search for messages.
|
|
1385
|
-
# @return [TD::Types::Message]
|
|
1386
|
-
def get_chat_message_by_date(chat_id, date)
|
|
1387
|
-
broadcast('@type' => 'getChatMessageByDate',
|
|
1388
|
-
'chat_id' => chat_id,
|
|
1389
|
-
'date' => date)
|
|
1390
|
-
end
|
|
1391
|
-
|
|
1392
|
-
# Returns approximate number of messages of the specified type in the chat.
|
|
1393
|
-
#
|
|
1394
|
-
# @param chat_id [Integer] Identifier of the chat in which to count messages.
|
|
1395
|
-
# @param filter [TD::Types::SearchMessagesFilter] Filter for message content;
|
|
1396
|
-
# {TD::Types::SearchMessagesFilter::Empty} is unsupported in this function.
|
|
1397
|
-
# @param return_local [Boolean] If true, returns count that is available locally without sending network requests,
|
|
1398
|
-
# returning -1 if the number of messages is unknown.
|
|
1399
|
-
# @return [TD::Types::Count]
|
|
1400
|
-
def get_chat_message_count(chat_id, filter, return_local)
|
|
1401
|
-
broadcast('@type' => 'getChatMessageCount',
|
|
1402
|
-
'chat_id' => chat_id,
|
|
1403
|
-
'filter' => filter,
|
|
1404
|
-
'return_local' => return_local)
|
|
1405
|
-
end
|
|
1406
|
-
|
|
1407
|
-
# Returns list of chats with non-default notification settings.
|
|
1408
|
-
#
|
|
1409
|
-
# @param scope [TD::Types::NotificationSettingsScope] If specified, only chats from the specified scope will be
|
|
1410
|
-
# returned.
|
|
1411
|
-
# @param compare_sound [Boolean] If true, also chats with non-default sound will be returned.
|
|
1412
|
-
# @return [TD::Types::Chats]
|
|
1413
|
-
def get_chat_notification_settings_exceptions(scope, compare_sound)
|
|
1414
|
-
broadcast('@type' => 'getChatNotificationSettingsExceptions',
|
|
1415
|
-
'scope' => scope,
|
|
1416
|
-
'compare_sound' => compare_sound)
|
|
1417
|
-
end
|
|
1418
|
-
|
|
1419
|
-
# Returns information about a pinned chat message.
|
|
1420
|
-
#
|
|
1421
|
-
# @param chat_id [Integer] Identifier of the chat the message belongs to.
|
|
1422
|
-
# @return [TD::Types::Message]
|
|
1423
|
-
def get_chat_pinned_message(chat_id)
|
|
1424
|
-
broadcast('@type' => 'getChatPinnedMessage',
|
|
1425
|
-
'chat_id' => chat_id)
|
|
1426
|
-
end
|
|
1427
|
-
|
|
1428
|
-
# Returns all scheduled messages in a chat.
|
|
1429
|
-
# The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).
|
|
1430
|
-
#
|
|
1431
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1432
|
-
# @return [TD::Types::Messages]
|
|
1433
|
-
def get_chat_scheduled_messages(chat_id)
|
|
1434
|
-
broadcast('@type' => 'getChatScheduledMessages',
|
|
1435
|
-
'chat_id' => chat_id)
|
|
1436
|
-
end
|
|
1437
|
-
|
|
1438
|
-
# Returns an HTTP URL with the chat statistics.
|
|
1439
|
-
# Currently this method can be used only for channels.
|
|
1440
|
-
# Can be used only if SupergroupFullInfo.can_view_statistics == true.
|
|
1441
|
-
#
|
|
1442
|
-
# @param chat_id [Integer] Chat identifier.
|
|
1443
|
-
# @param parameters [String] Parameters from "tg://statsrefresh?params=******" link.
|
|
1444
|
-
# @param is_dark [Boolean] Pass true if a URL with the dark theme must be returned.
|
|
1445
|
-
# @return [TD::Types::HttpUrl]
|
|
1446
|
-
def get_chat_statistics_url(chat_id, parameters, is_dark)
|
|
1447
|
-
broadcast('@type' => 'getChatStatisticsUrl',
|
|
1448
|
-
'chat_id' => chat_id,
|
|
1449
|
-
'parameters' => parameters,
|
|
1450
|
-
'is_dark' => is_dark)
|
|
1451
|
-
end
|
|
1452
|
-
|
|
1453
|
-
# Returns an ordered list of chats in a chat list.
|
|
1454
|
-
# Chats are sorted by the pair (order, chat_id) in decreasing order.
|
|
1455
|
-
# (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed
|
|
1456
|
-
# 64-bit number 9223372036854775807 == 2^63 - 1).
|
|
1457
|
-
# For optimal performance the number of returned chats is chosen by the library.
|
|
1458
|
-
#
|
|
1459
|
-
# @param chat_list [TD::Types::ChatList] The chat list in which to return chats.
|
|
1460
|
-
# @param offset_order [Integer] Chat order to return chats from.
|
|
1461
|
-
# @param offset_chat_id [Integer] Chat identifier to return chats from.
|
|
1462
|
-
# @param limit [Integer] The maximum number of chats to be returned.
|
|
1463
|
-
# It is possible that fewer chats than the limit are returned even if the end of the list is not reached.
|
|
1464
|
-
# @return [TD::Types::Chats]
|
|
1465
|
-
def get_chats(chat_list, offset_order, offset_chat_id, limit)
|
|
1466
|
-
broadcast('@type' => 'getChats',
|
|
1467
|
-
'chat_list' => chat_list,
|
|
1468
|
-
'offset_order' => offset_order,
|
|
1469
|
-
'offset_chat_id' => offset_chat_id,
|
|
1470
|
-
'limit' => limit)
|
|
1471
|
-
end
|
|
1472
|
-
|
|
1473
|
-
# Returns all website where the current user used Telegram to log in.
|
|
1474
|
-
#
|
|
1475
|
-
# @return [TD::Types::ConnectedWebsites]
|
|
1476
|
-
def get_connected_websites
|
|
1477
|
-
broadcast('@type' => 'getConnectedWebsites')
|
|
1478
|
-
end
|
|
1479
|
-
|
|
1480
|
-
# Returns all user contacts.
|
|
1481
|
-
#
|
|
1482
|
-
# @return [TD::Types::Users]
|
|
1483
|
-
def get_contacts
|
|
1484
|
-
broadcast('@type' => 'getContacts')
|
|
1485
|
-
end
|
|
1486
|
-
|
|
1487
|
-
# Uses current user IP to found their country.
|
|
1488
|
-
# Returns two-letter ISO 3166-1 alpha-2 country code.
|
|
1489
|
-
# Can be called before authorization.
|
|
1490
|
-
#
|
|
1491
|
-
# @return [TD::Types::Text]
|
|
1492
|
-
def get_country_code
|
|
1493
|
-
broadcast('@type' => 'getCountryCode')
|
|
1494
|
-
end
|
|
1495
|
-
|
|
1496
|
-
# Returns a list of public chats of the specified type, owned by the user.
|
|
1497
|
-
#
|
|
1498
|
-
# @param type [TD::Types::PublicChatType] Type of the public chats to return.
|
|
1499
|
-
# @return [TD::Types::Chats]
|
|
1500
|
-
def get_created_public_chats(type)
|
|
1501
|
-
broadcast('@type' => 'getCreatedPublicChats',
|
|
1502
|
-
'type' => type)
|
|
1503
|
-
end
|
|
1504
|
-
|
|
1505
|
-
# Returns all updates needed to restore current TDLib state, i.e.
|
|
1506
|
-
# all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others.
|
|
1507
|
-
# This is especially usefull if TDLib is run in a separate process.
|
|
1508
|
-
# This is an offline method.
|
|
1509
|
-
# Can be called before authorization.
|
|
1510
|
-
#
|
|
1511
|
-
# @return [TD::Types::Updates]
|
|
1512
|
-
def get_current_state
|
|
1513
|
-
broadcast('@type' => 'getCurrentState')
|
|
1514
|
-
end
|
|
1515
|
-
|
|
1516
|
-
# Returns database statistics.
|
|
1517
|
-
#
|
|
1518
|
-
# @return [TD::Types::DatabaseStatistics]
|
|
1519
|
-
def get_database_statistics
|
|
1520
|
-
broadcast('@type' => 'getDatabaseStatistics')
|
|
1521
|
-
end
|
|
1522
|
-
|
|
1523
|
-
# Returns information about a tg:// deep link.
|
|
1524
|
-
# Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing.
|
|
1525
|
-
# Returns a 404 error for unknown links.
|
|
1526
|
-
# Can be called before authorization.
|
|
1527
|
-
#
|
|
1528
|
-
# @param link [String] The link.
|
|
1529
|
-
# @return [TD::Types::DeepLinkInfo]
|
|
1530
|
-
def get_deep_link_info(link)
|
|
1531
|
-
broadcast('@type' => 'getDeepLinkInfo',
|
|
1532
|
-
'link' => link)
|
|
1533
|
-
end
|
|
1534
|
-
|
|
1535
|
-
# Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji
|
|
1536
|
-
# replacements.
|
|
1537
|
-
# The URL will be valid for 30 seconds after generation.
|
|
1538
|
-
#
|
|
1539
|
-
# @param language_code [String] Language code for which the emoji replacements will be suggested.
|
|
1540
|
-
# @return [TD::Types::HttpUrl]
|
|
1541
|
-
def get_emoji_suggestions_url(language_code)
|
|
1542
|
-
broadcast('@type' => 'getEmojiSuggestionsUrl',
|
|
1543
|
-
'language_code' => language_code)
|
|
1544
|
-
end
|
|
1545
|
-
|
|
1546
|
-
# Returns favorite stickers.
|
|
1547
|
-
#
|
|
1548
|
-
# @return [TD::Types::Stickers]
|
|
1549
|
-
def get_favorite_stickers
|
|
1550
|
-
broadcast('@type' => 'getFavoriteStickers')
|
|
1551
|
-
end
|
|
1552
|
-
|
|
1553
|
-
# Returns information about a file; this is an offline request.
|
|
1554
|
-
#
|
|
1555
|
-
# @param file_id [Integer] Identifier of the file to get.
|
|
1556
|
-
# @return [TD::Types::File]
|
|
1557
|
-
def get_file(file_id)
|
|
1558
|
-
broadcast('@type' => 'getFile',
|
|
1559
|
-
'file_id' => file_id)
|
|
1560
|
-
end
|
|
1561
|
-
|
|
1562
|
-
# Returns file downloaded prefix size from a given offset.
|
|
1563
|
-
#
|
|
1564
|
-
# @param file_id [Integer] Identifier of the file.
|
|
1565
|
-
# @param offset [Integer] Offset from which downloaded prefix size should be calculated.
|
|
1566
|
-
# @return [TD::Types::Count]
|
|
1567
|
-
def get_file_downloaded_prefix_size(file_id, offset)
|
|
1568
|
-
broadcast('@type' => 'getFileDownloadedPrefixSize',
|
|
1569
|
-
'file_id' => file_id,
|
|
1570
|
-
'offset' => offset)
|
|
1571
|
-
end
|
|
1572
|
-
|
|
1573
|
-
# Returns the extension of a file, guessed by its MIME type.
|
|
1574
|
-
# Returns an empty string on failure.
|
|
1575
|
-
# This is an offline method.
|
|
1576
|
-
# Can be called before authorization.
|
|
1577
|
-
# Can be called synchronously.
|
|
1578
|
-
#
|
|
1579
|
-
# @param mime_type [String] The MIME type of the file.
|
|
1580
|
-
# @return [TD::Types::Text]
|
|
1581
|
-
def get_file_extension(mime_type)
|
|
1582
|
-
broadcast('@type' => 'getFileExtension',
|
|
1583
|
-
'mime_type' => mime_type)
|
|
1584
|
-
end
|
|
1585
|
-
|
|
1586
|
-
# Returns the MIME type of a file, guessed by its extension.
|
|
1587
|
-
# Returns an empty string on failure.
|
|
1588
|
-
# This is an offline method.
|
|
1589
|
-
# Can be called before authorization.
|
|
1590
|
-
# Can be called synchronously.
|
|
1591
|
-
#
|
|
1592
|
-
# @param file_name [String] The name of the file or path to the file.
|
|
1593
|
-
# @return [TD::Types::Text]
|
|
1594
|
-
def get_file_mime_type(file_name)
|
|
1595
|
-
broadcast('@type' => 'getFileMimeType',
|
|
1596
|
-
'file_name' => file_name)
|
|
1597
|
-
end
|
|
1598
|
-
|
|
1599
|
-
# Returns the high scores for a game and some part of the high score table in the range of the specified user; for
|
|
1600
|
-
# bots only.
|
|
1601
|
-
#
|
|
1602
|
-
# @param chat_id [Integer] The chat that contains the message with the game.
|
|
1603
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1604
|
-
# @param user_id [Integer] User identifier.
|
|
1605
|
-
# @return [TD::Types::GameHighScores]
|
|
1606
|
-
def get_game_high_scores(chat_id, message_id, user_id)
|
|
1607
|
-
broadcast('@type' => 'getGameHighScores',
|
|
1608
|
-
'chat_id' => chat_id,
|
|
1609
|
-
'message_id' => message_id,
|
|
1610
|
-
'user_id' => user_id)
|
|
1611
|
-
end
|
|
1612
|
-
|
|
1613
|
-
# Returns a list of common group chats with a given user.
|
|
1614
|
-
# Chats are sorted by their type and creation date.
|
|
1615
|
-
#
|
|
1616
|
-
# @param user_id [Integer] User identifier.
|
|
1617
|
-
# @param offset_chat_id [Integer] Chat identifier starting from which to return chats; use 0 for the first request.
|
|
1618
|
-
# @param limit [Integer] The maximum number of chats to be returned; up to 100.
|
|
1619
|
-
# @return [TD::Types::Chats]
|
|
1620
|
-
def get_groups_in_common(user_id, offset_chat_id, limit)
|
|
1621
|
-
broadcast('@type' => 'getGroupsInCommon',
|
|
1622
|
-
'user_id' => user_id,
|
|
1623
|
-
'offset_chat_id' => offset_chat_id,
|
|
1624
|
-
'limit' => limit)
|
|
1625
|
-
end
|
|
1626
|
-
|
|
1627
|
-
# Returns the total number of imported contacts.
|
|
1628
|
-
#
|
|
1629
|
-
# @return [TD::Types::Count]
|
|
1630
|
-
def get_imported_contact_count
|
|
1631
|
-
broadcast('@type' => 'getImportedContactCount')
|
|
1632
|
-
end
|
|
1633
|
-
|
|
1634
|
-
# Returns a list of recently inactive supergroups and channels.
|
|
1635
|
-
# Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH
|
|
1636
|
-
# error.
|
|
1637
|
-
#
|
|
1638
|
-
# @return [TD::Types::Chats]
|
|
1639
|
-
def get_inactive_supergroup_chats
|
|
1640
|
-
broadcast('@type' => 'getInactiveSupergroupChats')
|
|
1641
|
-
end
|
|
1642
|
-
|
|
1643
|
-
# Returns game high scores and some part of the high score table in the range of the specified user; for bots only.
|
|
1644
|
-
#
|
|
1645
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
1646
|
-
# @param user_id [Integer] User identifier.
|
|
1647
|
-
# @return [TD::Types::GameHighScores]
|
|
1648
|
-
def get_inline_game_high_scores(inline_message_id, user_id)
|
|
1649
|
-
broadcast('@type' => 'getInlineGameHighScores',
|
|
1650
|
-
'inline_message_id' => inline_message_id,
|
|
1651
|
-
'user_id' => user_id)
|
|
1652
|
-
end
|
|
1653
|
-
|
|
1654
|
-
# Sends an inline query to a bot and returns its results.
|
|
1655
|
-
# Returns an error with code 502 if the bot fails to answer the query before the query timeout expires.
|
|
1656
|
-
#
|
|
1657
|
-
# @param bot_user_id [Integer] The identifier of the target bot.
|
|
1658
|
-
# @param chat_id [Integer] Identifier of the chat where the query was sent.
|
|
1659
|
-
# @param user_location [TD::Types::Location] Location of the user, only if needed.
|
|
1660
|
-
# @param query [String] Text of the query.
|
|
1661
|
-
# @param offset [String] Offset of the first entry to return.
|
|
1662
|
-
# @return [TD::Types::InlineQueryResults]
|
|
1663
|
-
def get_inline_query_results(bot_user_id, chat_id, user_location, query, offset)
|
|
1664
|
-
broadcast('@type' => 'getInlineQueryResults',
|
|
1665
|
-
'bot_user_id' => bot_user_id,
|
|
1666
|
-
'chat_id' => chat_id,
|
|
1667
|
-
'user_location' => user_location,
|
|
1668
|
-
'query' => query,
|
|
1669
|
-
'offset' => offset)
|
|
1670
|
-
end
|
|
1671
|
-
|
|
1672
|
-
# Returns a list of installed sticker sets.
|
|
1673
|
-
#
|
|
1674
|
-
# @param is_masks [Boolean] Pass true to return mask sticker sets; pass false to return ordinary sticker sets.
|
|
1675
|
-
# @return [TD::Types::StickerSets]
|
|
1676
|
-
def get_installed_sticker_sets(is_masks)
|
|
1677
|
-
broadcast('@type' => 'getInstalledStickerSets',
|
|
1678
|
-
'is_masks' => is_masks)
|
|
1679
|
-
end
|
|
1680
|
-
|
|
1681
|
-
# Returns the default text for invitation messages to be used as a placeholder when the current user invites friends
|
|
1682
|
-
# to Telegram.
|
|
1683
|
-
#
|
|
1684
|
-
# @return [TD::Types::Text]
|
|
1685
|
-
def get_invite_text
|
|
1686
|
-
broadcast('@type' => 'getInviteText')
|
|
1687
|
-
end
|
|
1688
|
-
|
|
1689
|
-
# Converts a JsonValue object to corresponding JSON-serialized string.
|
|
1690
|
-
# This is an offline method.
|
|
1691
|
-
# Can be called before authorization.
|
|
1692
|
-
# Can be called synchronously.
|
|
1693
|
-
#
|
|
1694
|
-
# @param json_value [TD::Types::JsonValue] The {TD::Types::JsonValue} object.
|
|
1695
|
-
# @return [TD::Types::Text]
|
|
1696
|
-
def get_json_string(json_value)
|
|
1697
|
-
broadcast('@type' => 'getJsonString',
|
|
1698
|
-
'json_value' => json_value)
|
|
1699
|
-
end
|
|
1700
|
-
|
|
1701
|
-
# Converts a JSON-serialized string to corresponding JsonValue object.
|
|
1702
|
-
# This is an offline method.
|
|
1703
|
-
# Can be called before authorization.
|
|
1704
|
-
# Can be called synchronously.
|
|
1705
|
-
#
|
|
1706
|
-
# @param json [String] The JSON-serialized string.
|
|
1707
|
-
# @return [TD::Types::JsonValue]
|
|
1708
|
-
def get_json_value(json)
|
|
1709
|
-
broadcast('@type' => 'getJsonValue',
|
|
1710
|
-
'json' => json)
|
|
1711
|
-
end
|
|
1712
|
-
|
|
1713
|
-
# Returns information about a language pack.
|
|
1714
|
-
# Returned language pack identifier may be different from a provided one.
|
|
1715
|
-
# Can be called before authorization.
|
|
1716
|
-
#
|
|
1717
|
-
# @param language_pack_id [String] Language pack identifier.
|
|
1718
|
-
# @return [TD::Types::LanguagePackInfo]
|
|
1719
|
-
def get_language_pack_info(language_pack_id)
|
|
1720
|
-
broadcast('@type' => 'getLanguagePackInfo',
|
|
1721
|
-
'language_pack_id' => language_pack_id)
|
|
1722
|
-
end
|
|
1723
|
-
|
|
1724
|
-
# Returns a string stored in the local database from the specified localization target and language pack by its key.
|
|
1725
|
-
# Returns a 404 error if the string is not found.
|
|
1726
|
-
# This is an offline method.
|
|
1727
|
-
# Can be called before authorization.
|
|
1728
|
-
# Can be called synchronously.
|
|
1729
|
-
#
|
|
1730
|
-
# @param language_pack_database_path [String] Path to the language pack database in which strings are stored.
|
|
1731
|
-
# @param localization_target [String] Localization target to which the language pack belongs.
|
|
1732
|
-
# @param language_pack_id [String] Language pack identifier.
|
|
1733
|
-
# @param key [String] Language pack key of the string to be returned.
|
|
1734
|
-
# @return [TD::Types::LanguagePackStringValue]
|
|
1735
|
-
def get_language_pack_string(language_pack_database_path, localization_target, language_pack_id, key)
|
|
1736
|
-
broadcast('@type' => 'getLanguagePackString',
|
|
1737
|
-
'language_pack_database_path' => language_pack_database_path,
|
|
1738
|
-
'localization_target' => localization_target,
|
|
1739
|
-
'language_pack_id' => language_pack_id,
|
|
1740
|
-
'key' => key)
|
|
1741
|
-
end
|
|
1742
|
-
|
|
1743
|
-
# Returns strings from a language pack in the current localization target by their keys.
|
|
1744
|
-
# Can be called before authorization.
|
|
1745
|
-
#
|
|
1746
|
-
# @param language_pack_id [String] Language pack identifier of the strings to be returned.
|
|
1747
|
-
# @param keys [Array<String>] Language pack keys of the strings to be returned; leave empty to request all available
|
|
1748
|
-
# strings.
|
|
1749
|
-
# @return [TD::Types::LanguagePackStrings]
|
|
1750
|
-
def get_language_pack_strings(language_pack_id, keys)
|
|
1751
|
-
broadcast('@type' => 'getLanguagePackStrings',
|
|
1752
|
-
'language_pack_id' => language_pack_id,
|
|
1753
|
-
'keys' => keys)
|
|
1754
|
-
end
|
|
1755
|
-
|
|
1756
|
-
# Returns information about the current localization target.
|
|
1757
|
-
# This is an offline request if only_local is true.
|
|
1758
|
-
# Can be called before authorization.
|
|
1759
|
-
#
|
|
1760
|
-
# @param only_local [Boolean] If true, returns only locally available information without sending network requests.
|
|
1761
|
-
# @return [TD::Types::LocalizationTargetInfo]
|
|
1762
|
-
def get_localization_target_info(only_local)
|
|
1763
|
-
broadcast('@type' => 'getLocalizationTargetInfo',
|
|
1764
|
-
'only_local' => only_local)
|
|
1765
|
-
end
|
|
1766
|
-
|
|
1767
|
-
# Returns information about currently used log stream for internal logging of TDLib.
|
|
1768
|
-
# This is an offline method.
|
|
1769
|
-
# Can be called before authorization.
|
|
1770
|
-
# Can be called synchronously.
|
|
1771
|
-
#
|
|
1772
|
-
# @return [TD::Types::LogStream]
|
|
1773
|
-
def get_log_stream
|
|
1774
|
-
broadcast('@type' => 'getLogStream')
|
|
1775
|
-
end
|
|
1776
|
-
|
|
1777
|
-
# Returns current verbosity level for a specified TDLib internal log tag.
|
|
1778
|
-
# This is an offline method.
|
|
1779
|
-
# Can be called before authorization.
|
|
1780
|
-
# Can be called synchronously.
|
|
1781
|
-
#
|
|
1782
|
-
# @param tag [String] Logging tag to change verbosity level.
|
|
1783
|
-
# @return [TD::Types::LogVerbosityLevel]
|
|
1784
|
-
def get_log_tag_verbosity_level(tag)
|
|
1785
|
-
broadcast('@type' => 'getLogTagVerbosityLevel',
|
|
1786
|
-
'tag' => tag)
|
|
1787
|
-
end
|
|
1788
|
-
|
|
1789
|
-
# Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications",
|
|
1790
|
-
# "proxy"].
|
|
1791
|
-
# This is an offline method.
|
|
1792
|
-
# Can be called before authorization.
|
|
1793
|
-
# Can be called synchronously.
|
|
1794
|
-
#
|
|
1795
|
-
# @return [TD::Types::LogTags]
|
|
1796
|
-
def get_log_tags
|
|
1797
|
-
broadcast('@type' => 'getLogTags')
|
|
1798
|
-
end
|
|
1799
|
-
|
|
1800
|
-
# Returns current verbosity level of the internal logging of TDLib.
|
|
1801
|
-
# This is an offline method.
|
|
1802
|
-
# Can be called before authorization.
|
|
1803
|
-
# Can be called synchronously.
|
|
1804
|
-
#
|
|
1805
|
-
# @return [TD::Types::LogVerbosityLevel]
|
|
1806
|
-
def get_log_verbosity_level
|
|
1807
|
-
broadcast('@type' => 'getLogVerbosityLevel')
|
|
1808
|
-
end
|
|
1809
|
-
|
|
1810
|
-
# Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline
|
|
1811
|
-
# button of type inlineKeyboardButtonTypeLoginUrl.
|
|
1812
|
-
# Use the method getLoginUrlInfo to find whether a prior user confirmation is needed.
|
|
1813
|
-
# If an error is returned, then the button must be handled as an ordinary URL button.
|
|
1814
|
-
#
|
|
1815
|
-
# @param chat_id [Integer] Chat identifier of the message with the button.
|
|
1816
|
-
# @param message_id [Integer] Message identifier of the message with the button.
|
|
1817
|
-
# @param button_id [Integer] Button identifier.
|
|
1818
|
-
# @param allow_write_access [Boolean] True, if the user allowed the bot to send them messages.
|
|
1819
|
-
# @return [TD::Types::HttpUrl]
|
|
1820
|
-
def get_login_url(chat_id, message_id, button_id, allow_write_access)
|
|
1821
|
-
broadcast('@type' => 'getLoginUrl',
|
|
1822
|
-
'chat_id' => chat_id,
|
|
1823
|
-
'message_id' => message_id,
|
|
1824
|
-
'button_id' => button_id,
|
|
1825
|
-
'allow_write_access' => allow_write_access)
|
|
1826
|
-
end
|
|
1827
|
-
|
|
1828
|
-
# Returns information about a button of type inlineKeyboardButtonTypeLoginUrl.
|
|
1829
|
-
# The method needs to be called when the user presses the button.
|
|
1830
|
-
#
|
|
1831
|
-
# @param chat_id [Integer] Chat identifier of the message with the button.
|
|
1832
|
-
# @param message_id [Integer] Message identifier of the message with the button.
|
|
1833
|
-
# @param button_id [Integer] Button identifier.
|
|
1834
|
-
# @return [TD::Types::LoginUrlInfo]
|
|
1835
|
-
def get_login_url_info(chat_id, message_id, button_id)
|
|
1836
|
-
broadcast('@type' => 'getLoginUrlInfo',
|
|
1837
|
-
'chat_id' => chat_id,
|
|
1838
|
-
'message_id' => message_id,
|
|
1839
|
-
'button_id' => button_id)
|
|
1840
|
-
end
|
|
1841
|
-
|
|
1842
|
-
# Returns information about a file with a map thumbnail in PNG format.
|
|
1843
|
-
# Only map thumbnail files with size less than 1MB can be downloaded.
|
|
1844
|
-
#
|
|
1845
|
-
# @param location [TD::Types::Location] Location of the map center.
|
|
1846
|
-
# @param zoom [Integer] Map zoom level; 13-20.
|
|
1847
|
-
# @param width [Integer] Map width in pixels before applying scale; 16-1024.
|
|
1848
|
-
# @param height [Integer] Map height in pixels before applying scale; 16-1024.
|
|
1849
|
-
# @param scale [Integer] Map scale; 1-3.
|
|
1850
|
-
# @param chat_id [Integer] Identifier of a chat, in which the thumbnail will be shown.
|
|
1851
|
-
# Use 0 if unknown.
|
|
1852
|
-
# @return [TD::Types::File]
|
|
1853
|
-
def get_map_thumbnail_file(location, zoom, width, height, scale, chat_id)
|
|
1854
|
-
broadcast('@type' => 'getMapThumbnailFile',
|
|
1855
|
-
'location' => location,
|
|
1856
|
-
'zoom' => zoom,
|
|
1857
|
-
'width' => width,
|
|
1858
|
-
'height' => height,
|
|
1859
|
-
'scale' => scale,
|
|
1860
|
-
'chat_id' => chat_id)
|
|
1861
|
-
end
|
|
1862
|
-
|
|
1863
|
-
# Returns the current user.
|
|
1864
|
-
#
|
|
1865
|
-
# @return [TD::Types::User]
|
|
1866
|
-
def get_me
|
|
1867
|
-
broadcast('@type' => 'getMe')
|
|
1868
|
-
end
|
|
1869
|
-
|
|
1870
|
-
# Returns information about a message.
|
|
1871
|
-
#
|
|
1872
|
-
# @param chat_id [Integer] Identifier of the chat the message belongs to.
|
|
1873
|
-
# @param message_id [Integer] Identifier of the message to get.
|
|
1874
|
-
# @return [TD::Types::Message]
|
|
1875
|
-
def get_message(chat_id, message_id)
|
|
1876
|
-
broadcast('@type' => 'getMessage',
|
|
1877
|
-
'chat_id' => chat_id,
|
|
1878
|
-
'message_id' => message_id)
|
|
1879
|
-
end
|
|
1880
|
-
|
|
1881
|
-
# Returns a private HTTPS link to a message in a chat.
|
|
1882
|
-
# Available only for already sent messages in supergroups and channels.
|
|
1883
|
-
# The link will work only for members of the chat.
|
|
1884
|
-
#
|
|
1885
|
-
# @param chat_id [Integer] Identifier of the chat to which the message belongs.
|
|
1886
|
-
# @param message_id [Integer] Identifier of the message.
|
|
1887
|
-
# @return [TD::Types::HttpUrl]
|
|
1888
|
-
def get_message_link(chat_id, message_id)
|
|
1889
|
-
broadcast('@type' => 'getMessageLink',
|
|
1890
|
-
'chat_id' => chat_id,
|
|
1891
|
-
'message_id' => message_id)
|
|
1892
|
-
end
|
|
1893
|
-
|
|
1894
|
-
# Returns information about a public or private message link.
|
|
1895
|
-
#
|
|
1896
|
-
# @param url [String] The message link in the format "https://t.me/c/...", or "tg://privatepost?...", or
|
|
1897
|
-
# "https://t.me/username/...", or "tg://resolve?...".
|
|
1898
|
-
# @return [TD::Types::MessageLinkInfo]
|
|
1899
|
-
def get_message_link_info(url)
|
|
1900
|
-
broadcast('@type' => 'getMessageLinkInfo',
|
|
1901
|
-
'url' => url)
|
|
1902
|
-
end
|
|
1903
|
-
|
|
1904
|
-
# Returns information about a message, if it is available locally without sending network request.
|
|
1905
|
-
# This is an offline request.
|
|
1906
|
-
#
|
|
1907
|
-
# @param chat_id [Integer] Identifier of the chat the message belongs to.
|
|
1908
|
-
# @param message_id [Integer] Identifier of the message to get.
|
|
1909
|
-
# @return [TD::Types::Message]
|
|
1910
|
-
def get_message_locally(chat_id, message_id)
|
|
1911
|
-
broadcast('@type' => 'getMessageLocally',
|
|
1912
|
-
'chat_id' => chat_id,
|
|
1913
|
-
'message_id' => message_id)
|
|
1914
|
-
end
|
|
1915
|
-
|
|
1916
|
-
# Returns information about messages.
|
|
1917
|
-
# If a message is not found, returns null on the corresponding position of the result.
|
|
1918
|
-
#
|
|
1919
|
-
# @param chat_id [Integer] Identifier of the chat the messages belong to.
|
|
1920
|
-
# @param message_ids [Array<Integer>] Identifiers of the messages to get.
|
|
1921
|
-
# @return [TD::Types::Messages]
|
|
1922
|
-
def get_messages(chat_id, message_ids)
|
|
1923
|
-
broadcast('@type' => 'getMessages',
|
|
1924
|
-
'chat_id' => chat_id,
|
|
1925
|
-
'message_ids' => message_ids)
|
|
1926
|
-
end
|
|
1927
|
-
|
|
1928
|
-
# Returns network data usage statistics.
|
|
1929
|
-
# Can be called before authorization.
|
|
1930
|
-
#
|
|
1931
|
-
# @param only_current [Boolean] If true, returns only data for the current library launch.
|
|
1932
|
-
# @return [TD::Types::NetworkStatistics]
|
|
1933
|
-
def get_network_statistics(only_current)
|
|
1934
|
-
broadcast('@type' => 'getNetworkStatistics',
|
|
1935
|
-
'only_current' => only_current)
|
|
1936
|
-
end
|
|
1937
|
-
|
|
1938
|
-
# Returns the value of an option by its name.
|
|
1939
|
-
# (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before
|
|
1940
|
-
# authorization.
|
|
1941
|
-
#
|
|
1942
|
-
# @param name [String] The name of the option.
|
|
1943
|
-
# @return [TD::Types::OptionValue]
|
|
1944
|
-
def get_option(name)
|
|
1945
|
-
broadcast('@type' => 'getOption',
|
|
1946
|
-
'name' => name)
|
|
1947
|
-
end
|
|
1948
|
-
|
|
1949
|
-
# Returns a Telegram Passport authorization form for sharing data with a service.
|
|
1950
|
-
#
|
|
1951
|
-
# @param bot_user_id [Integer] User identifier of the service's bot.
|
|
1952
|
-
# @param scope [String] Telegram Passport element types requested by the service.
|
|
1953
|
-
# @param public_key [String] Service's public_key.
|
|
1954
|
-
# @param nonce [String] Authorization form nonce provided by the service.
|
|
1955
|
-
# @return [TD::Types::PassportAuthorizationForm]
|
|
1956
|
-
def get_passport_authorization_form(bot_user_id, scope, public_key, nonce)
|
|
1957
|
-
broadcast('@type' => 'getPassportAuthorizationForm',
|
|
1958
|
-
'bot_user_id' => bot_user_id,
|
|
1959
|
-
'scope' => scope,
|
|
1960
|
-
'public_key' => public_key,
|
|
1961
|
-
'nonce' => nonce)
|
|
1962
|
-
end
|
|
1963
|
-
|
|
1964
|
-
# Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization
|
|
1965
|
-
# form.
|
|
1966
|
-
# Result can be received only once for each authorization form.
|
|
1967
|
-
#
|
|
1968
|
-
# @param autorization_form_id [Integer] Authorization form identifier.
|
|
1969
|
-
# @param password [String] Password of the current user.
|
|
1970
|
-
# @return [TD::Types::PassportElementsWithErrors]
|
|
1971
|
-
def get_passport_authorization_form_available_elements(autorization_form_id, password)
|
|
1972
|
-
broadcast('@type' => 'getPassportAuthorizationFormAvailableElements',
|
|
1973
|
-
'autorization_form_id' => autorization_form_id,
|
|
1974
|
-
'password' => password)
|
|
1975
|
-
end
|
|
1976
|
-
|
|
1977
|
-
# Returns one of the available Telegram Passport elements.
|
|
1978
|
-
#
|
|
1979
|
-
# @param type [TD::Types::PassportElementType] Telegram Passport element type.
|
|
1980
|
-
# @param password [String] Password of the current user.
|
|
1981
|
-
# @return [TD::Types::PassportElement]
|
|
1982
|
-
def get_passport_element(type, password)
|
|
1983
|
-
broadcast('@type' => 'getPassportElement',
|
|
1984
|
-
'type' => type,
|
|
1985
|
-
'password' => password)
|
|
1986
|
-
end
|
|
1987
|
-
|
|
1988
|
-
# Returns the current state of 2-step verification.
|
|
1989
|
-
#
|
|
1990
|
-
# @return [TD::Types::PasswordState]
|
|
1991
|
-
def get_password_state
|
|
1992
|
-
broadcast('@type' => 'getPasswordState')
|
|
1993
|
-
end
|
|
1994
|
-
|
|
1995
|
-
# Returns an invoice payment form.
|
|
1996
|
-
# This method should be called when the user presses inlineKeyboardButtonBuy.
|
|
1997
|
-
#
|
|
1998
|
-
# @param chat_id [Integer] Chat identifier of the Invoice message.
|
|
1999
|
-
# @param message_id [Integer] Message identifier.
|
|
2000
|
-
# @return [TD::Types::PaymentForm]
|
|
2001
|
-
def get_payment_form(chat_id, message_id)
|
|
2002
|
-
broadcast('@type' => 'getPaymentForm',
|
|
2003
|
-
'chat_id' => chat_id,
|
|
2004
|
-
'message_id' => message_id)
|
|
2005
|
-
end
|
|
2006
|
-
|
|
2007
|
-
# Returns information about a successful payment.
|
|
2008
|
-
#
|
|
2009
|
-
# @param chat_id [Integer] Chat identifier of the PaymentSuccessful message.
|
|
2010
|
-
# @param message_id [Integer] Message identifier.
|
|
2011
|
-
# @return [TD::Types::PaymentReceipt]
|
|
2012
|
-
def get_payment_receipt(chat_id, message_id)
|
|
2013
|
-
broadcast('@type' => 'getPaymentReceipt',
|
|
2014
|
-
'chat_id' => chat_id,
|
|
2015
|
-
'message_id' => message_id)
|
|
2016
|
-
end
|
|
2017
|
-
|
|
2018
|
-
# Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields
|
|
2019
|
-
# in Telegram Passport personal details.
|
|
2020
|
-
# Returns a 404 error if unknown.
|
|
2021
|
-
#
|
|
2022
|
-
# @param country_code [String] A two-letter ISO 3166-1 alpha-2 country code.
|
|
2023
|
-
# @return [TD::Types::Text]
|
|
2024
|
-
def get_preferred_country_language(country_code)
|
|
2025
|
-
broadcast('@type' => 'getPreferredCountryLanguage',
|
|
2026
|
-
'country_code' => country_code)
|
|
2027
|
-
end
|
|
2028
|
-
|
|
2029
|
-
# Returns list of proxies that are currently set up.
|
|
2030
|
-
# Can be called before authorization.
|
|
2031
|
-
#
|
|
2032
|
-
# @return [TD::Types::Proxies]
|
|
2033
|
-
def get_proxies
|
|
2034
|
-
broadcast('@type' => 'getProxies')
|
|
2035
|
-
end
|
|
2036
|
-
|
|
2037
|
-
# Returns an HTTPS link, which can be used to add a proxy.
|
|
2038
|
-
# Available only for SOCKS5 and MTProto proxies.
|
|
2039
|
-
# Can be called before authorization.
|
|
2040
|
-
#
|
|
2041
|
-
# @param proxy_id [Integer] Proxy identifier.
|
|
2042
|
-
# @return [TD::Types::Text]
|
|
2043
|
-
def get_proxy_link(proxy_id)
|
|
2044
|
-
broadcast('@type' => 'getProxyLink',
|
|
2045
|
-
'proxy_id' => proxy_id)
|
|
2046
|
-
end
|
|
2047
|
-
|
|
2048
|
-
# Returns a public HTTPS link to a message.
|
|
2049
|
-
# Available only for messages in supergroups and channels with a username.
|
|
2050
|
-
#
|
|
2051
|
-
# @param chat_id [Integer] Identifier of the chat to which the message belongs.
|
|
2052
|
-
# @param message_id [Integer] Identifier of the message.
|
|
2053
|
-
# @param for_album [Boolean] Pass true if a link for a whole media album should be returned.
|
|
2054
|
-
# @return [TD::Types::PublicMessageLink]
|
|
2055
|
-
def get_public_message_link(chat_id, message_id, for_album)
|
|
2056
|
-
broadcast('@type' => 'getPublicMessageLink',
|
|
2057
|
-
'chat_id' => chat_id,
|
|
2058
|
-
'message_id' => message_id,
|
|
2059
|
-
'for_album' => for_album)
|
|
2060
|
-
end
|
|
2061
|
-
|
|
2062
|
-
# Returns a globally unique push notification subscription identifier for identification of an account, which has
|
|
2063
|
-
# received a push notification.
|
|
2064
|
-
# This is an offline method.
|
|
2065
|
-
# Can be called before authorization.
|
|
2066
|
-
# Can be called synchronously.
|
|
2067
|
-
#
|
|
2068
|
-
# @param payload [String] JSON-encoded push notification payload.
|
|
2069
|
-
# @return [TD::Types::PushReceiverId]
|
|
2070
|
-
def get_push_receiver_id(payload)
|
|
2071
|
-
broadcast('@type' => 'getPushReceiverId',
|
|
2072
|
-
'payload' => payload)
|
|
2073
|
-
end
|
|
2074
|
-
|
|
2075
|
-
# Returns up to 20 recently used inline bots in the order of their last usage.
|
|
2076
|
-
#
|
|
2077
|
-
# @return [TD::Types::Users]
|
|
2078
|
-
def get_recent_inline_bots
|
|
2079
|
-
broadcast('@type' => 'getRecentInlineBots')
|
|
2080
|
-
end
|
|
2081
|
-
|
|
2082
|
-
# Returns a list of recently used stickers.
|
|
2083
|
-
#
|
|
2084
|
-
# @param is_attached [Boolean] Pass true to return stickers and masks that were recently attached to photos or video
|
|
2085
|
-
# files; pass false to return recently sent stickers.
|
|
2086
|
-
# @return [TD::Types::Stickers]
|
|
2087
|
-
def get_recent_stickers(is_attached)
|
|
2088
|
-
broadcast('@type' => 'getRecentStickers',
|
|
2089
|
-
'is_attached' => is_attached)
|
|
2090
|
-
end
|
|
2091
|
-
|
|
2092
|
-
# Returns t.me URLs recently visited by a newly registered user.
|
|
2093
|
-
#
|
|
2094
|
-
# @param referrer [String] Google Play referrer to identify the user.
|
|
2095
|
-
# @return [TD::Types::TMeUrls]
|
|
2096
|
-
def get_recently_visited_t_me_urls(referrer)
|
|
2097
|
-
broadcast('@type' => 'getRecentlyVisitedTMeUrls',
|
|
2098
|
-
'referrer' => referrer)
|
|
2099
|
-
end
|
|
2100
|
-
|
|
2101
|
-
# Returns a 2-step verification recovery email address that was previously set up.
|
|
2102
|
-
# This method can be used to verify a password provided by the user.
|
|
2103
|
-
#
|
|
2104
|
-
# @param password [String] The password for the current user.
|
|
2105
|
-
# @return [TD::Types::RecoveryEmailAddress]
|
|
2106
|
-
def get_recovery_email_address(password)
|
|
2107
|
-
broadcast('@type' => 'getRecoveryEmailAddress',
|
|
2108
|
-
'password' => password)
|
|
2109
|
-
end
|
|
2110
|
-
|
|
2111
|
-
# Returns information about a file by its remote ID; this is an offline request.
|
|
2112
|
-
# Can be used to register a URL as a file for further uploading, or sending as a message.
|
|
2113
|
-
# Even the request succeeds, the file can be used only if it is still accessible to the user.
|
|
2114
|
-
# For example, if the file is from a message, then the message must be not deleted and accessible to the user.
|
|
2115
|
-
# If the file database is disabled, then the corresponding object with the file must be preloaded by the client.
|
|
2116
|
-
#
|
|
2117
|
-
# @param remote_file_id [String] Remote identifier of the file to get.
|
|
2118
|
-
# @param file_type [TD::Types::FileType] File type, if known.
|
|
2119
|
-
# @return [TD::Types::File]
|
|
2120
|
-
def get_remote_file(remote_file_id, file_type)
|
|
2121
|
-
broadcast('@type' => 'getRemoteFile',
|
|
2122
|
-
'remote_file_id' => remote_file_id,
|
|
2123
|
-
'file_type' => file_type)
|
|
2124
|
-
end
|
|
2125
|
-
|
|
2126
|
-
# Returns information about a message that is replied by given message.
|
|
2127
|
-
#
|
|
2128
|
-
# @param chat_id [Integer] Identifier of the chat the message belongs to.
|
|
2129
|
-
# @param message_id [Integer] Identifier of the message reply to which get.
|
|
2130
|
-
# @return [TD::Types::Message]
|
|
2131
|
-
def get_replied_message(chat_id, message_id)
|
|
2132
|
-
broadcast('@type' => 'getRepliedMessage',
|
|
2133
|
-
'chat_id' => chat_id,
|
|
2134
|
-
'message_id' => message_id)
|
|
2135
|
-
end
|
|
2136
|
-
|
|
2137
|
-
# Returns saved animations.
|
|
2138
|
-
#
|
|
2139
|
-
# @return [TD::Types::Animations]
|
|
2140
|
-
def get_saved_animations
|
|
2141
|
-
broadcast('@type' => 'getSavedAnimations')
|
|
2142
|
-
end
|
|
2143
|
-
|
|
2144
|
-
# Returns saved order info, if any.
|
|
2145
|
-
#
|
|
2146
|
-
# @return [TD::Types::OrderInfo]
|
|
2147
|
-
def get_saved_order_info
|
|
2148
|
-
broadcast('@type' => 'getSavedOrderInfo')
|
|
2149
|
-
end
|
|
2150
|
-
|
|
2151
|
-
# Returns the notification settings for chats of a given type.
|
|
2152
|
-
#
|
|
2153
|
-
# @param scope [TD::Types::NotificationSettingsScope] Types of chats for which to return the notification settings
|
|
2154
|
-
# information.
|
|
2155
|
-
# @return [TD::Types::ScopeNotificationSettings]
|
|
2156
|
-
def get_scope_notification_settings(scope)
|
|
2157
|
-
broadcast('@type' => 'getScopeNotificationSettings',
|
|
2158
|
-
'scope' => scope)
|
|
2159
|
-
end
|
|
2160
|
-
|
|
2161
|
-
# Returns information about a secret chat by its identifier.
|
|
2162
|
-
# This is an offline request.
|
|
2163
|
-
#
|
|
2164
|
-
# @param secret_chat_id [Integer] Secret chat identifier.
|
|
2165
|
-
# @return [TD::Types::SecretChat]
|
|
2166
|
-
def get_secret_chat(secret_chat_id)
|
|
2167
|
-
broadcast('@type' => 'getSecretChat',
|
|
2168
|
-
'secret_chat_id' => secret_chat_id)
|
|
2169
|
-
end
|
|
2170
|
-
|
|
2171
|
-
# Returns emoji corresponding to a sticker.
|
|
2172
|
-
# The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the
|
|
2173
|
-
# corresponding Sticker object.
|
|
2174
|
-
#
|
|
2175
|
-
# @param sticker [TD::Types::InputFile] Sticker file identifier.
|
|
2176
|
-
# @return [TD::Types::Emojis]
|
|
2177
|
-
def get_sticker_emojis(sticker)
|
|
2178
|
-
broadcast('@type' => 'getStickerEmojis',
|
|
2179
|
-
'sticker' => sticker)
|
|
2180
|
-
end
|
|
2181
|
-
|
|
2182
|
-
# Returns information about a sticker set by its identifier.
|
|
2183
|
-
#
|
|
2184
|
-
# @param set_id [Integer] Identifier of the sticker set.
|
|
2185
|
-
# @return [TD::Types::StickerSet]
|
|
2186
|
-
def get_sticker_set(set_id)
|
|
2187
|
-
broadcast('@type' => 'getStickerSet',
|
|
2188
|
-
'set_id' => set_id)
|
|
2189
|
-
end
|
|
2190
|
-
|
|
2191
|
-
# Returns stickers from the installed sticker sets that correspond to a given emoji.
|
|
2192
|
-
# If the emoji is not empty, favorite and recently used stickers may also be returned.
|
|
2193
|
-
#
|
|
2194
|
-
# @param emoji [String] String representation of emoji.
|
|
2195
|
-
# If empty, returns all known installed stickers.
|
|
2196
|
-
# @param limit [Integer] The maximum number of stickers to be returned.
|
|
2197
|
-
# @return [TD::Types::Stickers]
|
|
2198
|
-
def get_stickers(emoji, limit)
|
|
2199
|
-
broadcast('@type' => 'getStickers',
|
|
2200
|
-
'emoji' => emoji,
|
|
2201
|
-
'limit' => limit)
|
|
2202
|
-
end
|
|
2203
|
-
|
|
2204
|
-
# Returns storage usage statistics.
|
|
2205
|
-
# Can be called before authorization.
|
|
2206
|
-
#
|
|
2207
|
-
# @param chat_limit [Integer] The maximum number of chats with the largest storage usage for which separate
|
|
2208
|
-
# statistics should be returned.
|
|
2209
|
-
# All other chats will be grouped in entries with chat_id == 0.
|
|
2210
|
-
# If the chat info database is not used, the chat_limit is ignored and is always set to 0.
|
|
2211
|
-
# @return [TD::Types::StorageStatistics]
|
|
2212
|
-
def get_storage_statistics(chat_limit)
|
|
2213
|
-
broadcast('@type' => 'getStorageStatistics',
|
|
2214
|
-
'chat_limit' => chat_limit)
|
|
2215
|
-
end
|
|
2216
|
-
|
|
2217
|
-
# Quickly returns approximate storage usage statistics.
|
|
2218
|
-
# Can be called before authorization.
|
|
2219
|
-
#
|
|
2220
|
-
# @return [TD::Types::StorageStatisticsFast]
|
|
2221
|
-
def get_storage_statistics_fast
|
|
2222
|
-
broadcast('@type' => 'getStorageStatisticsFast')
|
|
2223
|
-
end
|
|
2224
|
-
|
|
2225
|
-
# Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel.
|
|
2226
|
-
# Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group.
|
|
2227
|
-
#
|
|
2228
|
-
# @return [TD::Types::Chats]
|
|
2229
|
-
def get_suitable_discussion_chats
|
|
2230
|
-
broadcast('@type' => 'getSuitableDiscussionChats')
|
|
2231
|
-
end
|
|
2232
|
-
|
|
2233
|
-
# Returns information about a supergroup or a channel by its identifier.
|
|
2234
|
-
# This is an offline request if the current user is not a bot.
|
|
2235
|
-
#
|
|
2236
|
-
# @param supergroup_id [Integer] Supergroup or channel identifier.
|
|
2237
|
-
# @return [TD::Types::Supergroup]
|
|
2238
|
-
def get_supergroup(supergroup_id)
|
|
2239
|
-
broadcast('@type' => 'getSupergroup',
|
|
2240
|
-
'supergroup_id' => supergroup_id)
|
|
2241
|
-
end
|
|
2242
|
-
|
|
2243
|
-
# Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute.
|
|
2244
|
-
#
|
|
2245
|
-
# @param supergroup_id [Integer] Supergroup or channel identifier.
|
|
2246
|
-
# @return [TD::Types::SupergroupFullInfo]
|
|
2247
|
-
def get_supergroup_full_info(supergroup_id)
|
|
2248
|
-
broadcast('@type' => 'getSupergroupFullInfo',
|
|
2249
|
-
'supergroup_id' => supergroup_id)
|
|
2250
|
-
end
|
|
2251
|
-
|
|
2252
|
-
# Returns information about members or banned users in a supergroup or channel.
|
|
2253
|
-
# Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be
|
|
2254
|
-
# required for some filters.
|
|
2255
|
-
#
|
|
2256
|
-
# @param supergroup_id [Integer] Identifier of the supergroup or channel.
|
|
2257
|
-
# @param filter [TD::Types::SupergroupMembersFilter] The type of users to return.
|
|
2258
|
-
# By default, supergroupMembersRecent.
|
|
2259
|
-
# @param offset [Integer] Number of users to skip.
|
|
2260
|
-
# @param limit [Integer] The maximum number of users be returned; up to 200.
|
|
2261
|
-
# @return [TD::Types::ChatMembers]
|
|
2262
|
-
def get_supergroup_members(supergroup_id, filter, offset, limit)
|
|
2263
|
-
broadcast('@type' => 'getSupergroupMembers',
|
|
2264
|
-
'supergroup_id' => supergroup_id,
|
|
2265
|
-
'filter' => filter,
|
|
2266
|
-
'offset' => offset,
|
|
2267
|
-
'limit' => limit)
|
|
2268
|
-
end
|
|
2269
|
-
|
|
2270
|
-
# Returns a user that can be contacted to get support.
|
|
2271
|
-
#
|
|
2272
|
-
# @return [TD::Types::User]
|
|
2273
|
-
def get_support_user
|
|
2274
|
-
broadcast('@type' => 'getSupportUser')
|
|
2275
|
-
end
|
|
2276
|
-
|
|
2277
|
-
# Returns information about the current temporary password.
|
|
2278
|
-
#
|
|
2279
|
-
# @return [TD::Types::TemporaryPasswordState]
|
|
2280
|
-
def get_temporary_password_state
|
|
2281
|
-
broadcast('@type' => 'getTemporaryPasswordState')
|
|
2282
|
-
end
|
|
2283
|
-
|
|
2284
|
-
# Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text.
|
|
2285
|
-
# This is an offline method.
|
|
2286
|
-
# Can be called before authorization.
|
|
2287
|
-
# Can be called synchronously.
|
|
2288
|
-
#
|
|
2289
|
-
# @param text [String] The text in which to look for entites.
|
|
2290
|
-
# @return [TD::Types::TextEntities]
|
|
2291
|
-
def get_text_entities(text)
|
|
2292
|
-
broadcast('@type' => 'getTextEntities',
|
|
2293
|
-
'text' => text)
|
|
2294
|
-
end
|
|
2295
|
-
|
|
2296
|
-
# Returns a salt to be used with locally stored password to access a local TON-based wallet.
|
|
2297
|
-
#
|
|
2298
|
-
# @return [TD::Types::TonWalletPasswordSalt]
|
|
2299
|
-
def get_ton_wallet_password_salt
|
|
2300
|
-
broadcast('@type' => 'getTonWalletPasswordSalt')
|
|
2301
|
-
end
|
|
2302
|
-
|
|
2303
|
-
# Returns a list of frequently used chats.
|
|
2304
|
-
# Supported only if the chat info database is enabled.
|
|
2305
|
-
#
|
|
2306
|
-
# @param category [TD::Types::TopChatCategory] Category of chats to be returned.
|
|
2307
|
-
# @param limit [Integer] The maximum number of chats to be returned; up to 30.
|
|
2308
|
-
# @return [TD::Types::Chats]
|
|
2309
|
-
def get_top_chats(category, limit)
|
|
2310
|
-
broadcast('@type' => 'getTopChats',
|
|
2311
|
-
'category' => category,
|
|
2312
|
-
'limit' => limit)
|
|
2313
|
-
end
|
|
2314
|
-
|
|
2315
|
-
# Returns a list of trending sticker sets.
|
|
2316
|
-
#
|
|
2317
|
-
# @return [TD::Types::StickerSets]
|
|
2318
|
-
def get_trending_sticker_sets
|
|
2319
|
-
broadcast('@type' => 'getTrendingStickerSets')
|
|
2320
|
-
end
|
|
2321
|
-
|
|
2322
|
-
# Returns information about a user by their identifier.
|
|
2323
|
-
# This is an offline request if the current user is not a bot.
|
|
2324
|
-
#
|
|
2325
|
-
# @param user_id [Integer] User identifier.
|
|
2326
|
-
# @return [TD::Types::User]
|
|
2327
|
-
def get_user(user_id)
|
|
2328
|
-
broadcast('@type' => 'getUser',
|
|
2329
|
-
'user_id' => user_id)
|
|
2330
|
-
end
|
|
2331
|
-
|
|
2332
|
-
# Returns full information about a user by their identifier.
|
|
2333
|
-
#
|
|
2334
|
-
# @param user_id [Integer] User identifier.
|
|
2335
|
-
# @return [TD::Types::UserFullInfo]
|
|
2336
|
-
def get_user_full_info(user_id)
|
|
2337
|
-
broadcast('@type' => 'getUserFullInfo',
|
|
2338
|
-
'user_id' => user_id)
|
|
2339
|
-
end
|
|
2340
|
-
|
|
2341
|
-
# Returns the current privacy settings.
|
|
2342
|
-
#
|
|
2343
|
-
# @param setting [TD::Types::UserPrivacySetting] The privacy setting.
|
|
2344
|
-
# @return [TD::Types::UserPrivacySettingRules]
|
|
2345
|
-
def get_user_privacy_setting_rules(setting)
|
|
2346
|
-
broadcast('@type' => 'getUserPrivacySettingRules',
|
|
2347
|
-
'setting' => setting)
|
|
2348
|
-
end
|
|
2349
|
-
|
|
2350
|
-
# Returns the profile photos of a user.
|
|
2351
|
-
# The result of this query may be outdated: some photos might have been deleted already.
|
|
2352
|
-
#
|
|
2353
|
-
# @param user_id [Integer] User identifier.
|
|
2354
|
-
# @param offset [Integer] The number of photos to skip; must be non-negative.
|
|
2355
|
-
# @param limit [Integer] The maximum number of photos to be returned; up to 100.
|
|
2356
|
-
# @return [TD::Types::UserProfilePhotos]
|
|
2357
|
-
def get_user_profile_photos(user_id, offset, limit)
|
|
2358
|
-
broadcast('@type' => 'getUserProfilePhotos',
|
|
2359
|
-
'user_id' => user_id,
|
|
2360
|
-
'offset' => offset,
|
|
2361
|
-
'limit' => limit)
|
|
2362
|
-
end
|
|
2363
|
-
|
|
2364
|
-
# Returns an instant view version of a web page if available.
|
|
2365
|
-
# Returns a 404 error if the web page has no instant view page.
|
|
2366
|
-
#
|
|
2367
|
-
# @param url [String] The web page URL.
|
|
2368
|
-
# @param force_full [Boolean] If true, the full instant view for the web page will be returned.
|
|
2369
|
-
# @return [TD::Types::WebPageInstantView]
|
|
2370
|
-
def get_web_page_instant_view(url, force_full)
|
|
2371
|
-
broadcast('@type' => 'getWebPageInstantView',
|
|
2372
|
-
'url' => url,
|
|
2373
|
-
'force_full' => force_full)
|
|
2374
|
-
end
|
|
2375
|
-
|
|
2376
|
-
# Returns a web page preview by the text of the message.
|
|
2377
|
-
# Do not call this function too often.
|
|
2378
|
-
# Returns a 404 error if the web page has no preview.
|
|
2379
|
-
#
|
|
2380
|
-
# @param text [TD::Types::FormattedText] Message text with formatting.
|
|
2381
|
-
# @return [TD::Types::WebPage]
|
|
2382
|
-
def get_web_page_preview(text)
|
|
2383
|
-
broadcast('@type' => 'getWebPagePreview',
|
|
2384
|
-
'text' => text)
|
|
2385
|
-
end
|
|
2386
|
-
|
|
2387
|
-
# Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored.
|
|
2388
|
-
#
|
|
2389
|
-
# @param contacts [Array<TD::Types::Contact>] The list of contacts to import or edit; contacts' vCard are ignored and
|
|
2390
|
-
# are not imported.
|
|
2391
|
-
# @return [TD::Types::ImportedContacts]
|
|
2392
|
-
def import_contacts(contacts)
|
|
2393
|
-
broadcast('@type' => 'importContacts',
|
|
2394
|
-
'contacts' => contacts)
|
|
2395
|
-
end
|
|
2396
|
-
|
|
2397
|
-
# Adds current user as a new member to a chat.
|
|
2398
|
-
# Private and secret chats can't be joined using this method.
|
|
2399
|
-
#
|
|
2400
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2401
|
-
# @return [TD::Types::Ok]
|
|
2402
|
-
def join_chat(chat_id)
|
|
2403
|
-
broadcast('@type' => 'joinChat',
|
|
2404
|
-
'chat_id' => chat_id)
|
|
2405
|
-
end
|
|
2406
|
-
|
|
2407
|
-
# Uses an invite link to add the current user to the chat if possible.
|
|
2408
|
-
# The new member will not be added until the chat state has been synchronized with the server.
|
|
2409
|
-
#
|
|
2410
|
-
# @param invite_link [String] Invite link to import; should begin with "https://t.me/joinchat/",
|
|
2411
|
-
# "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/".
|
|
2412
|
-
# @return [TD::Types::Chat]
|
|
2413
|
-
def join_chat_by_invite_link(invite_link)
|
|
2414
|
-
broadcast('@type' => 'joinChatByInviteLink',
|
|
2415
|
-
'invite_link' => invite_link)
|
|
2416
|
-
end
|
|
2417
|
-
|
|
2418
|
-
# Removes current user from chat members.
|
|
2419
|
-
# Private and secret chats can't be left using this method.
|
|
2420
|
-
#
|
|
2421
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2422
|
-
# @return [TD::Types::Ok]
|
|
2423
|
-
def leave_chat(chat_id)
|
|
2424
|
-
broadcast('@type' => 'leaveChat',
|
|
2425
|
-
'chat_id' => chat_id)
|
|
2426
|
-
end
|
|
2427
|
-
|
|
2428
|
-
# Closes the TDLib instance after a proper logout.
|
|
2429
|
-
# Requires an available network connection.
|
|
2430
|
-
# All local data will be destroyed.
|
|
2431
|
-
# After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent.
|
|
2432
|
-
#
|
|
2433
|
-
# @return [TD::Types::Ok]
|
|
2434
|
-
def log_out
|
|
2435
|
-
broadcast('@type' => 'logOut')
|
|
2436
|
-
end
|
|
2437
|
-
|
|
2438
|
-
# Informs TDLib that the chat is opened by the user.
|
|
2439
|
-
# Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are
|
|
2440
|
-
# received only for opened chats).
|
|
2441
|
-
#
|
|
2442
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2443
|
-
# @return [TD::Types::Ok]
|
|
2444
|
-
def open_chat(chat_id)
|
|
2445
|
-
broadcast('@type' => 'openChat',
|
|
2446
|
-
'chat_id' => chat_id)
|
|
2447
|
-
end
|
|
2448
|
-
|
|
2449
|
-
# Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document,
|
|
2450
|
-
# location or venue, or has listened to an audio file or voice note message).
|
|
2451
|
-
# An updateMessageContentOpened update will be generated if something has changed.
|
|
2452
|
-
#
|
|
2453
|
-
# @param chat_id [Integer] Chat identifier of the message.
|
|
2454
|
-
# @param message_id [Integer] Identifier of the message with the opened content.
|
|
2455
|
-
# @return [TD::Types::Ok]
|
|
2456
|
-
def open_message_content(chat_id, message_id)
|
|
2457
|
-
broadcast('@type' => 'openMessageContent',
|
|
2458
|
-
'chat_id' => chat_id,
|
|
2459
|
-
'message_id' => message_id)
|
|
2460
|
-
end
|
|
2461
|
-
|
|
2462
|
-
# Optimizes storage usage, i.e.
|
|
2463
|
-
# deletes some files and returns new storage usage statistics.
|
|
2464
|
-
# Secret thumbnails can't be deleted.
|
|
2465
|
-
#
|
|
2466
|
-
# @param size [Integer] Limit on the total size of files after deletion.
|
|
2467
|
-
# Pass -1 to use the default limit.
|
|
2468
|
-
# @param ttl [Integer] Limit on the time that has passed since the last time a file was accessed (or creation time
|
|
2469
|
-
# for some filesystems).
|
|
2470
|
-
# Pass -1 to use the default limit.
|
|
2471
|
-
# @param count [Integer] Limit on the total count of files after deletion.
|
|
2472
|
-
# Pass -1 to use the default limit.
|
|
2473
|
-
# @param immunity_delay [Integer] The amount of time after the creation of a file during which it can't be deleted,
|
|
2474
|
-
# in seconds.
|
|
2475
|
-
# Pass -1 to use the default value.
|
|
2476
|
-
# @param file_types [Array<TD::Types::FileType>] If not empty, only files with the given type(s) are considered.
|
|
2477
|
-
# By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
|
|
2478
|
-
# @param chat_ids [Array<Integer>] If not empty, only files from the given chats are considered.
|
|
2479
|
-
# Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos).
|
|
2480
|
-
# @param exclude_chat_ids [Array<Integer>] If not empty, files from the given chats are excluded.
|
|
2481
|
-
# Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos).
|
|
2482
|
-
# @param chat_limit [Integer] Same as in getStorageStatistics.
|
|
2483
|
-
# Affects only returned statistics.
|
|
2484
|
-
# @return [TD::Types::StorageStatistics]
|
|
2485
|
-
def optimize_storage(size, ttl, count, immunity_delay, file_types, chat_ids, exclude_chat_ids, chat_limit)
|
|
2486
|
-
broadcast('@type' => 'optimizeStorage',
|
|
2487
|
-
'size' => size,
|
|
2488
|
-
'ttl' => ttl,
|
|
2489
|
-
'count' => count,
|
|
2490
|
-
'immunity_delay' => immunity_delay,
|
|
2491
|
-
'file_types' => file_types,
|
|
2492
|
-
'chat_ids' => chat_ids,
|
|
2493
|
-
'exclude_chat_ids' => exclude_chat_ids,
|
|
2494
|
-
'chat_limit' => chat_limit)
|
|
2495
|
-
end
|
|
2496
|
-
|
|
2497
|
-
# Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in
|
|
2498
|
-
# the text.
|
|
2499
|
-
# This is an offline method.
|
|
2500
|
-
# Can be called before authorization.
|
|
2501
|
-
# Can be called synchronously.
|
|
2502
|
-
#
|
|
2503
|
-
# @param text [String] The text which should be parsed.
|
|
2504
|
-
# @param parse_mode [TD::Types::TextParseMode] Text parse mode.
|
|
2505
|
-
# @return [TD::Types::FormattedText]
|
|
2506
|
-
def parse_text_entities(text, parse_mode)
|
|
2507
|
-
broadcast('@type' => 'parseTextEntities',
|
|
2508
|
-
'text' => text,
|
|
2509
|
-
'parse_mode' => parse_mode)
|
|
2510
|
-
end
|
|
2511
|
-
|
|
2512
|
-
# Pins a message in a chat; requires can_pin_messages rights.
|
|
2513
|
-
#
|
|
2514
|
-
# @param chat_id [Integer] Identifier of the chat.
|
|
2515
|
-
# @param message_id [Integer] Identifier of the new pinned message.
|
|
2516
|
-
# @param disable_notification [Boolean] True, if there should be no notification about the pinned message.
|
|
2517
|
-
# @return [TD::Types::Ok]
|
|
2518
|
-
def pin_chat_message(chat_id, message_id, disable_notification)
|
|
2519
|
-
broadcast('@type' => 'pinChatMessage',
|
|
2520
|
-
'chat_id' => chat_id,
|
|
2521
|
-
'message_id' => message_id,
|
|
2522
|
-
'disable_notification' => disable_notification)
|
|
2523
|
-
end
|
|
2524
|
-
|
|
2525
|
-
# Computes time needed to receive a response from a Telegram server through a proxy.
|
|
2526
|
-
# Can be called before authorization.
|
|
2527
|
-
#
|
|
2528
|
-
# @param proxy_id [Integer] Proxy identifier.
|
|
2529
|
-
# Use 0 to ping a Telegram server without a proxy.
|
|
2530
|
-
# @return [TD::Types::Seconds]
|
|
2531
|
-
def ping_proxy(proxy_id)
|
|
2532
|
-
broadcast('@type' => 'pingProxy',
|
|
2533
|
-
'proxy_id' => proxy_id)
|
|
2534
|
-
end
|
|
2535
|
-
|
|
2536
|
-
# Handles a push notification.
|
|
2537
|
-
# Returns error with code 406 if the push notification is not supported and connection to the server is required to
|
|
2538
|
-
# fetch new data.
|
|
2539
|
-
# Can be called before authorization.
|
|
2540
|
-
#
|
|
2541
|
-
# @param payload [String] JSON-encoded push notification payload with all fields sent by the server, and
|
|
2542
|
-
# "google.sent_time" and "google.notification.sound" fields added.
|
|
2543
|
-
# @return [TD::Types::Ok]
|
|
2544
|
-
def process_push_notification(payload)
|
|
2545
|
-
broadcast('@type' => 'processPushNotification',
|
|
2546
|
-
'payload' => payload)
|
|
2547
|
-
end
|
|
2548
|
-
|
|
2549
|
-
# Marks all mentions in a chat as read.
|
|
2550
|
-
#
|
|
2551
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2552
|
-
# @return [TD::Types::Ok]
|
|
2553
|
-
def read_all_chat_mentions(chat_id)
|
|
2554
|
-
broadcast('@type' => 'readAllChatMentions',
|
|
2555
|
-
'chat_id' => chat_id)
|
|
2556
|
-
end
|
|
2557
|
-
|
|
2558
|
-
# Reads a part of a file from the TDLib file cache and returns read bytes.
|
|
2559
|
-
# This method is intended to be used only if the client has no direct access to TDLib's file system, because it is
|
|
2560
|
-
# usually slower than a direct read from the file.
|
|
2561
|
-
#
|
|
2562
|
-
# @param file_id [Integer] Identifier of the file.
|
|
2563
|
-
# The file must be located in the TDLib file cache.
|
|
2564
|
-
# @param offset [Integer] The offset from which to read the file.
|
|
2565
|
-
# @param count [Integer] Number of bytes to read.
|
|
2566
|
-
# An error will be returned if there are not enough bytes available in the file from the specified position.
|
|
2567
|
-
# Pass 0 to read all available data from the specified position.
|
|
2568
|
-
# @return [TD::Types::FilePart]
|
|
2569
|
-
def read_file_part(file_id, offset, count)
|
|
2570
|
-
broadcast('@type' => 'readFilePart',
|
|
2571
|
-
'file_id' => file_id,
|
|
2572
|
-
'offset' => offset,
|
|
2573
|
-
'count' => count)
|
|
2574
|
-
end
|
|
2575
|
-
|
|
2576
|
-
# Recovers the password with a password recovery code sent to an email address that was previously set up.
|
|
2577
|
-
# Works only when the current authorization state is authorizationStateWaitPassword.
|
|
2578
|
-
#
|
|
2579
|
-
# @param recovery_code [String] Recovery code to check.
|
|
2580
|
-
# @return [TD::Types::Ok]
|
|
2581
|
-
def recover_authentication_password(recovery_code)
|
|
2582
|
-
broadcast('@type' => 'recoverAuthenticationPassword',
|
|
2583
|
-
'recovery_code' => recovery_code)
|
|
2584
|
-
end
|
|
2585
|
-
|
|
2586
|
-
# Recovers the password using a recovery code sent to an email address that was previously set up.
|
|
2587
|
-
#
|
|
2588
|
-
# @param recovery_code [String] Recovery code to check.
|
|
2589
|
-
# @return [TD::Types::PasswordState]
|
|
2590
|
-
def recover_password(recovery_code)
|
|
2591
|
-
broadcast('@type' => 'recoverPassword',
|
|
2592
|
-
'recovery_code' => recovery_code)
|
|
2593
|
-
end
|
|
2594
|
-
|
|
2595
|
-
# Registers the currently used device for receiving push notifications.
|
|
2596
|
-
# Returns a globally unique identifier of the push notification subscription.
|
|
2597
|
-
#
|
|
2598
|
-
# @param device_token [TD::Types::DeviceToken] Device token.
|
|
2599
|
-
# @param other_user_ids [Array<Integer>] List of user identifiers of other users currently using the client.
|
|
2600
|
-
# @return [TD::Types::PushReceiverId]
|
|
2601
|
-
def register_device(device_token, other_user_ids)
|
|
2602
|
-
broadcast('@type' => 'registerDevice',
|
|
2603
|
-
'device_token' => device_token,
|
|
2604
|
-
'other_user_ids' => other_user_ids)
|
|
2605
|
-
end
|
|
2606
|
-
|
|
2607
|
-
# Finishes user registration.
|
|
2608
|
-
# Works only when the current authorization state is authorizationStateWaitRegistration.
|
|
2609
|
-
#
|
|
2610
|
-
# @param first_name [String] The first name of the user; 1-64 characters.
|
|
2611
|
-
# @param last_name [String] The last name of the user; 0-64 characters.
|
|
2612
|
-
# @return [TD::Types::Ok]
|
|
2613
|
-
def register_user(first_name, last_name)
|
|
2614
|
-
broadcast('@type' => 'registerUser',
|
|
2615
|
-
'first_name' => first_name,
|
|
2616
|
-
'last_name' => last_name)
|
|
2617
|
-
end
|
|
2618
|
-
|
|
2619
|
-
# Removes background from the list of installed backgrounds.
|
|
2620
|
-
#
|
|
2621
|
-
# @param background_id [Integer] The background indentifier.
|
|
2622
|
-
# @return [TD::Types::Ok]
|
|
2623
|
-
def remove_background(background_id)
|
|
2624
|
-
broadcast('@type' => 'removeBackground',
|
|
2625
|
-
'background_id' => background_id)
|
|
2626
|
-
end
|
|
2627
|
-
|
|
2628
|
-
# Removes a chat action bar without any other action.
|
|
2629
|
-
#
|
|
2630
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2631
|
-
# @return [TD::Types::Ok]
|
|
2632
|
-
def remove_chat_action_bar(chat_id)
|
|
2633
|
-
broadcast('@type' => 'removeChatActionBar',
|
|
2634
|
-
'chat_id' => chat_id)
|
|
2635
|
-
end
|
|
2636
|
-
|
|
2637
|
-
# Removes users from the contact list.
|
|
2638
|
-
#
|
|
2639
|
-
# @param user_ids [Array<Integer>] Identifiers of users to be deleted.
|
|
2640
|
-
# @return [TD::Types::Ok]
|
|
2641
|
-
def remove_contacts(user_ids)
|
|
2642
|
-
broadcast('@type' => 'removeContacts',
|
|
2643
|
-
'user_ids' => user_ids)
|
|
2644
|
-
end
|
|
2645
|
-
|
|
2646
|
-
# Removes a sticker from the list of favorite stickers.
|
|
2647
|
-
#
|
|
2648
|
-
# @param sticker [TD::Types::InputFile] Sticker file to delete from the list.
|
|
2649
|
-
# @return [TD::Types::Ok]
|
|
2650
|
-
def remove_favorite_sticker(sticker)
|
|
2651
|
-
broadcast('@type' => 'removeFavoriteSticker',
|
|
2652
|
-
'sticker' => sticker)
|
|
2653
|
-
end
|
|
2654
|
-
|
|
2655
|
-
# Removes an active notification from notification list.
|
|
2656
|
-
# Needs to be called only if the notification is removed by the current user.
|
|
2657
|
-
#
|
|
2658
|
-
# @param notification_group_id [Integer] Identifier of notification group to which the notification belongs.
|
|
2659
|
-
# @param notification_id [Integer] Identifier of removed notification.
|
|
2660
|
-
# @return [TD::Types::Ok]
|
|
2661
|
-
def remove_notification(notification_group_id, notification_id)
|
|
2662
|
-
broadcast('@type' => 'removeNotification',
|
|
2663
|
-
'notification_group_id' => notification_group_id,
|
|
2664
|
-
'notification_id' => notification_id)
|
|
2665
|
-
end
|
|
2666
|
-
|
|
2667
|
-
# Removes a group of active notifications.
|
|
2668
|
-
# Needs to be called only if the notification group is removed by the current user.
|
|
2669
|
-
#
|
|
2670
|
-
# @param notification_group_id [Integer] Notification group identifier.
|
|
2671
|
-
# @param max_notification_id [Integer] The maximum identifier of removed notifications.
|
|
2672
|
-
# @return [TD::Types::Ok]
|
|
2673
|
-
def remove_notification_group(notification_group_id, max_notification_id)
|
|
2674
|
-
broadcast('@type' => 'removeNotificationGroup',
|
|
2675
|
-
'notification_group_id' => notification_group_id,
|
|
2676
|
-
'max_notification_id' => max_notification_id)
|
|
2677
|
-
end
|
|
2678
|
-
|
|
2679
|
-
# Removes a proxy server.
|
|
2680
|
-
# Can be called before authorization.
|
|
2681
|
-
#
|
|
2682
|
-
# @param proxy_id [Integer] Proxy identifier.
|
|
2683
|
-
# @return [TD::Types::Ok]
|
|
2684
|
-
def remove_proxy(proxy_id)
|
|
2685
|
-
broadcast('@type' => 'removeProxy',
|
|
2686
|
-
'proxy_id' => proxy_id)
|
|
2687
|
-
end
|
|
2688
|
-
|
|
2689
|
-
# Removes a hashtag from the list of recently used hashtags.
|
|
2690
|
-
#
|
|
2691
|
-
# @param hashtag [String] Hashtag to delete.
|
|
2692
|
-
# @return [TD::Types::Ok]
|
|
2693
|
-
def remove_recent_hashtag(hashtag)
|
|
2694
|
-
broadcast('@type' => 'removeRecentHashtag',
|
|
2695
|
-
'hashtag' => hashtag)
|
|
2696
|
-
end
|
|
2697
|
-
|
|
2698
|
-
# Removes a sticker from the list of recently used stickers.
|
|
2699
|
-
#
|
|
2700
|
-
# @param is_attached [Boolean] Pass true to remove the sticker from the list of stickers recently attached to photo
|
|
2701
|
-
# or video files; pass false to remove the sticker from the list of recently sent stickers.
|
|
2702
|
-
# @param sticker [TD::Types::InputFile] Sticker file to delete.
|
|
2703
|
-
# @return [TD::Types::Ok]
|
|
2704
|
-
def remove_recent_sticker(is_attached, sticker)
|
|
2705
|
-
broadcast('@type' => 'removeRecentSticker',
|
|
2706
|
-
'is_attached' => is_attached,
|
|
2707
|
-
'sticker' => sticker)
|
|
2708
|
-
end
|
|
2709
|
-
|
|
2710
|
-
# Removes a chat from the list of recently found chats.
|
|
2711
|
-
#
|
|
2712
|
-
# @param chat_id [Integer] Identifier of the chat to be removed.
|
|
2713
|
-
# @return [TD::Types::Ok]
|
|
2714
|
-
def remove_recently_found_chat(chat_id)
|
|
2715
|
-
broadcast('@type' => 'removeRecentlyFoundChat',
|
|
2716
|
-
'chat_id' => chat_id)
|
|
2717
|
-
end
|
|
2718
|
-
|
|
2719
|
-
# Removes an animation from the list of saved animations.
|
|
2720
|
-
#
|
|
2721
|
-
# @param animation [TD::Types::InputFile] Animation file to be removed.
|
|
2722
|
-
# @return [TD::Types::Ok]
|
|
2723
|
-
def remove_saved_animation(animation)
|
|
2724
|
-
broadcast('@type' => 'removeSavedAnimation',
|
|
2725
|
-
'animation' => animation)
|
|
2726
|
-
end
|
|
2727
|
-
|
|
2728
|
-
# Removes a sticker from the set to which it belongs; for bots only.
|
|
2729
|
-
# The sticker set must have been created by the bot.
|
|
2730
|
-
#
|
|
2731
|
-
# @param sticker [TD::Types::InputFile] Sticker.
|
|
2732
|
-
# @return [TD::Types::Ok]
|
|
2733
|
-
def remove_sticker_from_set(sticker)
|
|
2734
|
-
broadcast('@type' => 'removeStickerFromSet',
|
|
2735
|
-
'sticker' => sticker)
|
|
2736
|
-
end
|
|
2737
|
-
|
|
2738
|
-
# Removes a chat from the list of frequently used chats.
|
|
2739
|
-
# Supported only if the chat info database is enabled.
|
|
2740
|
-
#
|
|
2741
|
-
# @param category [TD::Types::TopChatCategory] Category of frequently used chats.
|
|
2742
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2743
|
-
# @return [TD::Types::Ok]
|
|
2744
|
-
def remove_top_chat(category, chat_id)
|
|
2745
|
-
broadcast('@type' => 'removeTopChat',
|
|
2746
|
-
'category' => category,
|
|
2747
|
-
'chat_id' => chat_id)
|
|
2748
|
-
end
|
|
2749
|
-
|
|
2750
|
-
# Changes the order of installed sticker sets.
|
|
2751
|
-
#
|
|
2752
|
-
# @param is_masks [Boolean] Pass true to change the order of mask sticker sets; pass false to change the order of
|
|
2753
|
-
# ordinary sticker sets.
|
|
2754
|
-
# @param sticker_set_ids [Array<Integer>] Identifiers of installed sticker sets in the new correct order.
|
|
2755
|
-
# @return [TD::Types::Ok]
|
|
2756
|
-
def reorder_installed_sticker_sets(is_masks, sticker_set_ids)
|
|
2757
|
-
broadcast('@type' => 'reorderInstalledStickerSets',
|
|
2758
|
-
'is_masks' => is_masks,
|
|
2759
|
-
'sticker_set_ids' => sticker_set_ids)
|
|
2760
|
-
end
|
|
2761
|
-
|
|
2762
|
-
# Reports a chat to the Telegram moderators.
|
|
2763
|
-
# Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by
|
|
2764
|
-
# moderators, or when the report is done from the chat action bar.
|
|
2765
|
-
#
|
|
2766
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2767
|
-
# @param reason [TD::Types::ChatReportReason] The reason for reporting the chat.
|
|
2768
|
-
# @param message_ids [Array<Integer>] Identifiers of reported messages, if any.
|
|
2769
|
-
# @return [TD::Types::Ok]
|
|
2770
|
-
def report_chat(chat_id, reason, message_ids)
|
|
2771
|
-
broadcast('@type' => 'reportChat',
|
|
2772
|
-
'chat_id' => chat_id,
|
|
2773
|
-
'reason' => reason,
|
|
2774
|
-
'message_ids' => message_ids)
|
|
2775
|
-
end
|
|
2776
|
-
|
|
2777
|
-
# Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup.
|
|
2778
|
-
#
|
|
2779
|
-
# @param supergroup_id [Integer] Supergroup identifier.
|
|
2780
|
-
# @param user_id [Integer] User identifier.
|
|
2781
|
-
# @param message_ids [Array<Integer>] Identifiers of messages sent in the supergroup by the user.
|
|
2782
|
-
# This list must be non-empty.
|
|
2783
|
-
# @return [TD::Types::Ok]
|
|
2784
|
-
def report_supergroup_spam(supergroup_id, user_id, message_ids)
|
|
2785
|
-
broadcast('@type' => 'reportSupergroupSpam',
|
|
2786
|
-
'supergroup_id' => supergroup_id,
|
|
2787
|
-
'user_id' => user_id,
|
|
2788
|
-
'message_ids' => message_ids)
|
|
2789
|
-
end
|
|
2790
|
-
|
|
2791
|
-
# Requests to send a password recovery code to an email address that was previously set up.
|
|
2792
|
-
# Works only when the current authorization state is authorizationStateWaitPassword.
|
|
2793
|
-
#
|
|
2794
|
-
# @return [TD::Types::Ok]
|
|
2795
|
-
def request_authentication_password_recovery
|
|
2796
|
-
broadcast('@type' => 'requestAuthenticationPasswordRecovery')
|
|
2797
|
-
end
|
|
2798
|
-
|
|
2799
|
-
# Requests to send a password recovery code to an email address that was previously set up.
|
|
2800
|
-
#
|
|
2801
|
-
# @return [TD::Types::EmailAddressAuthenticationCodeInfo]
|
|
2802
|
-
def request_password_recovery
|
|
2803
|
-
broadcast('@type' => 'requestPasswordRecovery')
|
|
2804
|
-
end
|
|
2805
|
-
|
|
2806
|
-
# Requests QR code authentication by scanning a QR code on another logged in device.
|
|
2807
|
-
# Works only when the current authorization state is authorizationStateWaitPhoneNumber.
|
|
2808
|
-
#
|
|
2809
|
-
# @param other_user_ids [Array<Integer>] List of user identifiers of other users currently using the client.
|
|
2810
|
-
# @return [TD::Types::Ok]
|
|
2811
|
-
def request_qr_code_authentication(other_user_ids)
|
|
2812
|
-
broadcast('@type' => 'requestQrCodeAuthentication',
|
|
2813
|
-
'other_user_ids' => other_user_ids)
|
|
2814
|
-
end
|
|
2815
|
-
|
|
2816
|
-
# Re-sends an authentication code to the user.
|
|
2817
|
-
# Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result
|
|
2818
|
-
# is not null.
|
|
2819
|
-
#
|
|
2820
|
-
# @return [TD::Types::Ok]
|
|
2821
|
-
def resend_authentication_code
|
|
2822
|
-
broadcast('@type' => 'resendAuthenticationCode')
|
|
2823
|
-
end
|
|
2824
|
-
|
|
2825
|
-
# Re-sends the authentication code sent to confirm a new phone number for the user.
|
|
2826
|
-
# Works only if the previously received authenticationCodeInfo next_code_type was not null.
|
|
2827
|
-
#
|
|
2828
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
2829
|
-
def resend_change_phone_number_code
|
|
2830
|
-
broadcast('@type' => 'resendChangePhoneNumberCode')
|
|
2831
|
-
end
|
|
2832
|
-
|
|
2833
|
-
# Re-sends the code to verify an email address to be added to a user's Telegram Passport.
|
|
2834
|
-
#
|
|
2835
|
-
# @return [TD::Types::EmailAddressAuthenticationCodeInfo]
|
|
2836
|
-
def resend_email_address_verification_code
|
|
2837
|
-
broadcast('@type' => 'resendEmailAddressVerificationCode')
|
|
2838
|
-
end
|
|
2839
|
-
|
|
2840
|
-
# Resends messages which failed to send.
|
|
2841
|
-
# Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in
|
|
2842
|
-
# messageSendingStateFailed.retry_after time passed.
|
|
2843
|
-
# If a message is re-sent, the corresponding failed to send message is deleted.
|
|
2844
|
-
# Returns the sent messages in the same order as the message identifiers passed in message_ids.
|
|
2845
|
-
# If a message can't be re-sent, null will be returned instead of the message.
|
|
2846
|
-
#
|
|
2847
|
-
# @param chat_id [Integer] Identifier of the chat to send messages.
|
|
2848
|
-
# @param message_ids [Array<Integer>] Identifiers of the messages to resend.
|
|
2849
|
-
# Message identifiers must be in a strictly increasing order.
|
|
2850
|
-
# @return [TD::Types::Messages]
|
|
2851
|
-
def resend_messages(chat_id, message_ids)
|
|
2852
|
-
broadcast('@type' => 'resendMessages',
|
|
2853
|
-
'chat_id' => chat_id,
|
|
2854
|
-
'message_ids' => message_ids)
|
|
2855
|
-
end
|
|
2856
|
-
|
|
2857
|
-
# Resends phone number confirmation code.
|
|
2858
|
-
#
|
|
2859
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
2860
|
-
def resend_phone_number_confirmation_code
|
|
2861
|
-
broadcast('@type' => 'resendPhoneNumberConfirmationCode')
|
|
2862
|
-
end
|
|
2863
|
-
|
|
2864
|
-
# Re-sends the code to verify a phone number to be added to a user's Telegram Passport.
|
|
2865
|
-
#
|
|
2866
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
2867
|
-
def resend_phone_number_verification_code
|
|
2868
|
-
broadcast('@type' => 'resendPhoneNumberVerificationCode')
|
|
2869
|
-
end
|
|
2870
|
-
|
|
2871
|
-
# Resends the 2-step verification recovery email address verification code.
|
|
2872
|
-
#
|
|
2873
|
-
# @return [TD::Types::PasswordState]
|
|
2874
|
-
def resend_recovery_email_address_code
|
|
2875
|
-
broadcast('@type' => 'resendRecoveryEmailAddressCode')
|
|
2876
|
-
end
|
|
2877
|
-
|
|
2878
|
-
# Resets all notification settings to their default values.
|
|
2879
|
-
# By default, all chats are unmuted, the sound is set to "default" and message previews are shown.
|
|
2880
|
-
#
|
|
2881
|
-
# @return [TD::Types::Ok]
|
|
2882
|
-
def reset_all_notification_settings
|
|
2883
|
-
broadcast('@type' => 'resetAllNotificationSettings')
|
|
2884
|
-
end
|
|
2885
|
-
|
|
2886
|
-
# Resets list of installed backgrounds to its default value.
|
|
2887
|
-
#
|
|
2888
|
-
# @return [TD::Types::Ok]
|
|
2889
|
-
def reset_backgrounds
|
|
2890
|
-
broadcast('@type' => 'resetBackgrounds')
|
|
2891
|
-
end
|
|
2892
|
-
|
|
2893
|
-
# Resets all network data usage statistics to zero.
|
|
2894
|
-
# Can be called before authorization.
|
|
2895
|
-
#
|
|
2896
|
-
# @return [TD::Types::Ok]
|
|
2897
|
-
def reset_network_statistics
|
|
2898
|
-
broadcast('@type' => 'resetNetworkStatistics')
|
|
2899
|
-
end
|
|
2900
|
-
|
|
2901
|
-
# Saves application log event on the server.
|
|
2902
|
-
# Can be called before authorization.
|
|
2903
|
-
#
|
|
2904
|
-
# @param type [String] Event type.
|
|
2905
|
-
# @param chat_id [Integer] Optional chat identifier, associated with the event.
|
|
2906
|
-
# @param data [TD::Types::JsonValue] The log event data.
|
|
2907
|
-
# @return [TD::Types::Ok]
|
|
2908
|
-
def save_application_log_event(type, chat_id, data)
|
|
2909
|
-
broadcast('@type' => 'saveApplicationLogEvent',
|
|
2910
|
-
'type' => type,
|
|
2911
|
-
'chat_id' => chat_id,
|
|
2912
|
-
'data' => data)
|
|
2913
|
-
end
|
|
2914
|
-
|
|
2915
|
-
# Searches for a background by its name.
|
|
2916
|
-
#
|
|
2917
|
-
# @param name [String] The name of the background.
|
|
2918
|
-
# @return [TD::Types::Background]
|
|
2919
|
-
def search_background(name)
|
|
2920
|
-
broadcast('@type' => 'searchBackground',
|
|
2921
|
-
'name' => name)
|
|
2922
|
-
end
|
|
2923
|
-
|
|
2924
|
-
# Searches for call messages.
|
|
2925
|
-
# Returns the results in reverse chronological order (i.
|
|
2926
|
-
# e., in order of decreasing message_id).
|
|
2927
|
-
# For optimal performance the number of returned messages is chosen by the library.
|
|
2928
|
-
#
|
|
2929
|
-
# @param from_message_id [Integer] Identifier of the message from which to search; use 0 to get results from the last
|
|
2930
|
-
# message.
|
|
2931
|
-
# @param limit [Integer] The maximum number of messages to be returned; up to 100.
|
|
2932
|
-
# Fewer messages may be returned than specified by the limit, even if the end of the message history has not been
|
|
2933
|
-
# reached.
|
|
2934
|
-
# @param only_missed [Boolean] If true, returns only messages with missed calls.
|
|
2935
|
-
# @return [TD::Types::Messages]
|
|
2936
|
-
def search_call_messages(from_message_id, limit, only_missed)
|
|
2937
|
-
broadcast('@type' => 'searchCallMessages',
|
|
2938
|
-
'from_message_id' => from_message_id,
|
|
2939
|
-
'limit' => limit,
|
|
2940
|
-
'only_missed' => only_missed)
|
|
2941
|
-
end
|
|
2942
|
-
|
|
2943
|
-
# Searches for a specified query in the first name, last name and username of the members of a specified chat.
|
|
2944
|
-
# Requires administrator rights in channels.
|
|
2945
|
-
#
|
|
2946
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2947
|
-
# @param query [String] Query to search for.
|
|
2948
|
-
# @param limit [Integer] The maximum number of users to be returned.
|
|
2949
|
-
# @param filter [TD::Types::ChatMembersFilter] The type of users to return.
|
|
2950
|
-
# By default, chatMembersFilterMembers.
|
|
2951
|
-
# @return [TD::Types::ChatMembers]
|
|
2952
|
-
def search_chat_members(chat_id, query, limit, filter)
|
|
2953
|
-
broadcast('@type' => 'searchChatMembers',
|
|
2954
|
-
'chat_id' => chat_id,
|
|
2955
|
-
'query' => query,
|
|
2956
|
-
'limit' => limit,
|
|
2957
|
-
'filter' => filter)
|
|
2958
|
-
end
|
|
2959
|
-
|
|
2960
|
-
# Searches for messages with given words in the chat.
|
|
2961
|
-
# Returns the results in reverse chronological order, i.e.
|
|
2962
|
-
# in order of decreasing message_id.
|
|
2963
|
-
# Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an
|
|
2964
|
-
# enabled message database.
|
|
2965
|
-
# For optimal performance the number of returned messages is chosen by the library.
|
|
2966
|
-
#
|
|
2967
|
-
# @param chat_id [Integer] Identifier of the chat in which to search messages.
|
|
2968
|
-
# @param query [String] Query to search for.
|
|
2969
|
-
# @param sender_user_id [Integer] If not 0, only messages sent by the specified user will be returned.
|
|
2970
|
-
# Not supported in secret chats.
|
|
2971
|
-
# @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to
|
|
2972
|
-
# get results from the last message.
|
|
2973
|
-
# @param offset [Integer] Specify 0 to get results from exactly the from_message_id or a negative offset to get the
|
|
2974
|
-
# specified message and some newer messages.
|
|
2975
|
-
# @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than
|
|
2976
|
-
# 100.
|
|
2977
|
-
# If the offset is negative, the limit must be greater than -offset.
|
|
2978
|
-
# Fewer messages may be returned than specified by the limit, even if the end of the message history has not been
|
|
2979
|
-
# reached.
|
|
2980
|
-
# @param filter [TD::Types::SearchMessagesFilter] Filter for message content in the search results.
|
|
2981
|
-
# @return [TD::Types::Messages]
|
|
2982
|
-
def search_chat_messages(chat_id, query, sender_user_id, from_message_id, offset, limit, filter)
|
|
2983
|
-
broadcast('@type' => 'searchChatMessages',
|
|
2984
|
-
'chat_id' => chat_id,
|
|
2985
|
-
'query' => query,
|
|
2986
|
-
'sender_user_id' => sender_user_id,
|
|
2987
|
-
'from_message_id' => from_message_id,
|
|
2988
|
-
'offset' => offset,
|
|
2989
|
-
'limit' => limit,
|
|
2990
|
-
'filter' => filter)
|
|
2991
|
-
end
|
|
2992
|
-
|
|
2993
|
-
# Returns information about the recent locations of chat members that were sent to the chat.
|
|
2994
|
-
# Returns up to 1 location message per user.
|
|
2995
|
-
#
|
|
2996
|
-
# @param chat_id [Integer] Chat identifier.
|
|
2997
|
-
# @param limit [Integer] The maximum number of messages to be returned.
|
|
2998
|
-
# @return [TD::Types::Messages]
|
|
2999
|
-
def search_chat_recent_location_messages(chat_id, limit)
|
|
3000
|
-
broadcast('@type' => 'searchChatRecentLocationMessages',
|
|
3001
|
-
'chat_id' => chat_id,
|
|
3002
|
-
'limit' => limit)
|
|
3003
|
-
end
|
|
3004
|
-
|
|
3005
|
-
# Searches for the specified query in the title and username of already known chats, this is an offline request.
|
|
3006
|
-
# Returns chats in the order seen in the chat list.
|
|
3007
|
-
#
|
|
3008
|
-
# @param query [String] Query to search for.
|
|
3009
|
-
# If the query is empty, returns up to 20 recently found chats.
|
|
3010
|
-
# @param limit [Integer] The maximum number of chats to be returned.
|
|
3011
|
-
# @return [TD::Types::Chats]
|
|
3012
|
-
def search_chats(query, limit)
|
|
3013
|
-
broadcast('@type' => 'searchChats',
|
|
3014
|
-
'query' => query,
|
|
3015
|
-
'limit' => limit)
|
|
3016
|
-
end
|
|
3017
|
-
|
|
3018
|
-
# Returns a list of users and location-based supergroups nearby.
|
|
3019
|
-
# The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby.
|
|
3020
|
-
# The request should be sent again every 25 seconds with adjusted location to not miss new chats.
|
|
3021
|
-
#
|
|
3022
|
-
# @param location [TD::Types::Location] Current user location.
|
|
3023
|
-
# @return [TD::Types::ChatsNearby]
|
|
3024
|
-
def search_chats_nearby(location)
|
|
3025
|
-
broadcast('@type' => 'searchChatsNearby',
|
|
3026
|
-
'location' => location)
|
|
3027
|
-
end
|
|
3028
|
-
|
|
3029
|
-
# Searches for the specified query in the title and username of already known chats via request to the server.
|
|
3030
|
-
# Returns chats in the order seen in the chat list.
|
|
3031
|
-
#
|
|
3032
|
-
# @param query [String] Query to search for.
|
|
3033
|
-
# @param limit [Integer] The maximum number of chats to be returned.
|
|
3034
|
-
# @return [TD::Types::Chats]
|
|
3035
|
-
def search_chats_on_server(query, limit)
|
|
3036
|
-
broadcast('@type' => 'searchChatsOnServer',
|
|
3037
|
-
'query' => query,
|
|
3038
|
-
'limit' => limit)
|
|
3039
|
-
end
|
|
3040
|
-
|
|
3041
|
-
# Searches for the specified query in the first names, last names and usernames of the known user contacts.
|
|
3042
|
-
#
|
|
3043
|
-
# @param query [String, nil] Query to search for; may be empty to return all contacts.
|
|
3044
|
-
# @param limit [Integer] The maximum number of users to be returned.
|
|
3045
|
-
# @return [TD::Types::Users]
|
|
3046
|
-
def search_contacts(query = nil, limit)
|
|
3047
|
-
broadcast('@type' => 'searchContacts',
|
|
3048
|
-
'query' => query,
|
|
3049
|
-
'limit' => limit)
|
|
3050
|
-
end
|
|
3051
|
-
|
|
3052
|
-
# Searches for emojis by keywords.
|
|
3053
|
-
# Supported only if the file database is enabled.
|
|
3054
|
-
#
|
|
3055
|
-
# @param text [String] Text to search for.
|
|
3056
|
-
# @param exact_match [Boolean] True, if only emojis, which exactly match text needs to be returned.
|
|
3057
|
-
# @param input_language_code [String, nil] IETF language tag of the user's input language; can be empty if unknown.
|
|
3058
|
-
# @return [TD::Types::Emojis]
|
|
3059
|
-
def search_emojis(text, exact_match, input_language_code = nil)
|
|
3060
|
-
broadcast('@type' => 'searchEmojis',
|
|
3061
|
-
'text' => text,
|
|
3062
|
-
'exact_match' => exact_match,
|
|
3063
|
-
'input_language_code' => input_language_code)
|
|
3064
|
-
end
|
|
3065
|
-
|
|
3066
|
-
# Searches for recently used hashtags by their prefix.
|
|
3067
|
-
#
|
|
3068
|
-
# @param prefix [String] Hashtag prefix to search for.
|
|
3069
|
-
# @param limit [Integer] The maximum number of hashtags to be returned.
|
|
3070
|
-
# @return [TD::Types::Hashtags]
|
|
3071
|
-
def search_hashtags(prefix, limit)
|
|
3072
|
-
broadcast('@type' => 'searchHashtags',
|
|
3073
|
-
'prefix' => prefix,
|
|
3074
|
-
'limit' => limit)
|
|
3075
|
-
end
|
|
3076
|
-
|
|
3077
|
-
# Searches for installed sticker sets by looking for specified query in their title and name.
|
|
3078
|
-
#
|
|
3079
|
-
# @param is_masks [Boolean] Pass true to return mask sticker sets; pass false to return ordinary sticker sets.
|
|
3080
|
-
# @param query [String] Query to search for.
|
|
3081
|
-
# @param limit [Integer] The maximum number of sticker sets to return.
|
|
3082
|
-
# @return [TD::Types::StickerSets]
|
|
3083
|
-
def search_installed_sticker_sets(is_masks, query, limit)
|
|
3084
|
-
broadcast('@type' => 'searchInstalledStickerSets',
|
|
3085
|
-
'is_masks' => is_masks,
|
|
3086
|
-
'query' => query,
|
|
3087
|
-
'limit' => limit)
|
|
3088
|
-
end
|
|
3089
|
-
|
|
3090
|
-
# Searches for messages in all chats except secret chats.
|
|
3091
|
-
# Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)).
|
|
3092
|
-
# For optimal performance the number of returned messages is chosen by the library.
|
|
3093
|
-
#
|
|
3094
|
-
# @param chat_list [TD::Types::ChatList] Chat list in which to search messages; pass null to search in all chats
|
|
3095
|
-
# regardless of their chat list.
|
|
3096
|
-
# @param query [String] Query to search for.
|
|
3097
|
-
# @param offset_date [Integer] The date of the message starting from which the results should be fetched.
|
|
3098
|
-
# Use 0 or any date in the future to get results from the last message.
|
|
3099
|
-
# @param offset_chat_id [Integer] The chat identifier of the last found message, or 0 for the first request.
|
|
3100
|
-
# @param offset_message_id [Integer] The message identifier of the last found message, or 0 for the first request.
|
|
3101
|
-
# @param limit [Integer] The maximum number of messages to be returned, up to 100.
|
|
3102
|
-
# Fewer messages may be returned than specified by the limit, even if the end of the message history has not been
|
|
3103
|
-
# reached.
|
|
3104
|
-
# @return [TD::Types::Messages]
|
|
3105
|
-
def search_messages(chat_list, query, offset_date, offset_chat_id, offset_message_id, limit)
|
|
3106
|
-
broadcast('@type' => 'searchMessages',
|
|
3107
|
-
'chat_list' => chat_list,
|
|
3108
|
-
'query' => query,
|
|
3109
|
-
'offset_date' => offset_date,
|
|
3110
|
-
'offset_chat_id' => offset_chat_id,
|
|
3111
|
-
'offset_message_id' => offset_message_id,
|
|
3112
|
-
'limit' => limit)
|
|
3113
|
-
end
|
|
3114
|
-
|
|
3115
|
-
# Searches a public chat by its username.
|
|
3116
|
-
# Currently only private chats, supergroups and channels can be public.
|
|
3117
|
-
# Returns the chat if found; otherwise an error is returned.
|
|
3118
|
-
#
|
|
3119
|
-
# @param username [String] Username to be resolved.
|
|
3120
|
-
# @return [TD::Types::Chat]
|
|
3121
|
-
def search_public_chat(username)
|
|
3122
|
-
broadcast('@type' => 'searchPublicChat',
|
|
3123
|
-
'username' => username)
|
|
3124
|
-
end
|
|
3125
|
-
|
|
3126
|
-
# Searches public chats by looking for specified query in their username and title.
|
|
3127
|
-
# Currently only private chats, supergroups and channels can be public.
|
|
3128
|
-
# Returns a meaningful number of results.
|
|
3129
|
-
# Returns nothing if the length of the searched username prefix is less than 5.
|
|
3130
|
-
# Excludes private chats with contacts and chats from the chat list from the results.
|
|
3131
|
-
#
|
|
3132
|
-
# @param query [String] Query to search for.
|
|
3133
|
-
# @return [TD::Types::Chats]
|
|
3134
|
-
def search_public_chats(query)
|
|
3135
|
-
broadcast('@type' => 'searchPublicChats',
|
|
3136
|
-
'query' => query)
|
|
3137
|
-
end
|
|
3138
|
-
|
|
3139
|
-
# Searches for messages in secret chats.
|
|
3140
|
-
# Returns the results in reverse chronological order.
|
|
3141
|
-
# For optimal performance the number of returned messages is chosen by the library.
|
|
3142
|
-
#
|
|
3143
|
-
# @param chat_id [Integer] Identifier of the chat in which to search.
|
|
3144
|
-
# Specify 0 to search in all secret chats.
|
|
3145
|
-
# @param query [String] Query to search for.
|
|
3146
|
-
# If empty, searchChatMessages should be used instead.
|
|
3147
|
-
# @param from_search_id [Integer] The identifier from the result of a previous request, use 0 to get results from the
|
|
3148
|
-
# last message.
|
|
3149
|
-
# @param limit [Integer] The maximum number of messages to be returned; up to 100.
|
|
3150
|
-
# Fewer messages may be returned than specified by the limit, even if the end of the message history has not been
|
|
3151
|
-
# reached.
|
|
3152
|
-
# @param filter [TD::Types::SearchMessagesFilter] A filter for the content of messages in the search results.
|
|
3153
|
-
# @return [TD::Types::FoundMessages]
|
|
3154
|
-
def search_secret_messages(chat_id, query, from_search_id, limit, filter)
|
|
3155
|
-
broadcast('@type' => 'searchSecretMessages',
|
|
3156
|
-
'chat_id' => chat_id,
|
|
3157
|
-
'query' => query,
|
|
3158
|
-
'from_search_id' => from_search_id,
|
|
3159
|
-
'limit' => limit,
|
|
3160
|
-
'filter' => filter)
|
|
3161
|
-
end
|
|
3162
|
-
|
|
3163
|
-
# Searches for a sticker set by its name.
|
|
3164
|
-
#
|
|
3165
|
-
# @param name [String] Name of the sticker set.
|
|
3166
|
-
# @return [TD::Types::StickerSet]
|
|
3167
|
-
def search_sticker_set(name)
|
|
3168
|
-
broadcast('@type' => 'searchStickerSet',
|
|
3169
|
-
'name' => name)
|
|
3170
|
-
end
|
|
3171
|
-
|
|
3172
|
-
# Searches for ordinary sticker sets by looking for specified query in their title and name.
|
|
3173
|
-
# Excludes installed sticker sets from the results.
|
|
3174
|
-
#
|
|
3175
|
-
# @param query [String] Query to search for.
|
|
3176
|
-
# @return [TD::Types::StickerSets]
|
|
3177
|
-
def search_sticker_sets(query)
|
|
3178
|
-
broadcast('@type' => 'searchStickerSets',
|
|
3179
|
-
'query' => query)
|
|
3180
|
-
end
|
|
3181
|
-
|
|
3182
|
-
# Searches for stickers from public sticker sets that correspond to a given emoji.
|
|
3183
|
-
#
|
|
3184
|
-
# @param emoji [String] String representation of emoji; must be non-empty.
|
|
3185
|
-
# @param limit [Integer, nil] The maximum number of stickers to be returned.
|
|
3186
|
-
# @return [TD::Types::Stickers]
|
|
3187
|
-
def search_stickers(emoji, limit = nil)
|
|
3188
|
-
broadcast('@type' => 'searchStickers',
|
|
3189
|
-
'emoji' => emoji,
|
|
3190
|
-
'limit' => limit)
|
|
3191
|
-
end
|
|
3192
|
-
|
|
3193
|
-
# Invites a bot to a chat (if it is not yet a member) and sends it the /start command.
|
|
3194
|
-
# Bots can't be invited to a private chat other than the chat with the bot.
|
|
3195
|
-
# Bots can't be invited to channels (although they can be added as admins) and secret chats.
|
|
3196
|
-
# Returns the sent message.
|
|
3197
|
-
#
|
|
3198
|
-
# @param bot_user_id [Integer] Identifier of the bot.
|
|
3199
|
-
# @param chat_id [Integer] Identifier of the target chat.
|
|
3200
|
-
# @param parameter [String] A hidden parameter sent to the bot for deep linking purposes
|
|
3201
|
-
# (https://core.telegram.org/bots#deep-linking).
|
|
3202
|
-
# @return [TD::Types::Message]
|
|
3203
|
-
def send_bot_start_message(bot_user_id, chat_id, parameter)
|
|
3204
|
-
broadcast('@type' => 'sendBotStartMessage',
|
|
3205
|
-
'bot_user_id' => bot_user_id,
|
|
3206
|
-
'chat_id' => chat_id,
|
|
3207
|
-
'parameter' => parameter)
|
|
3208
|
-
end
|
|
3209
|
-
|
|
3210
|
-
# Sends debug information for a call.
|
|
3211
|
-
#
|
|
3212
|
-
# @param call_id [Integer] Call identifier.
|
|
3213
|
-
# @param debug_information [String] Debug information in application-specific format.
|
|
3214
|
-
# @return [TD::Types::Ok]
|
|
3215
|
-
def send_call_debug_information(call_id, debug_information)
|
|
3216
|
-
broadcast('@type' => 'sendCallDebugInformation',
|
|
3217
|
-
'call_id' => call_id,
|
|
3218
|
-
'debug_information' => debug_information)
|
|
3219
|
-
end
|
|
3220
|
-
|
|
3221
|
-
# Sends a call rating.
|
|
3222
|
-
#
|
|
3223
|
-
# @param call_id [Integer] Call identifier.
|
|
3224
|
-
# @param rating [Integer] Call rating; 1-5.
|
|
3225
|
-
# @param comment [String] An optional user comment if the rating is less than 5.
|
|
3226
|
-
# @param problems [Array<TD::Types::CallProblem>] List of the exact types of problems with the call, specified by the
|
|
3227
|
-
# user.
|
|
3228
|
-
# @return [TD::Types::Ok]
|
|
3229
|
-
def send_call_rating(call_id, rating, comment, problems)
|
|
3230
|
-
broadcast('@type' => 'sendCallRating',
|
|
3231
|
-
'call_id' => call_id,
|
|
3232
|
-
'rating' => rating,
|
|
3233
|
-
'comment' => comment,
|
|
3234
|
-
'problems' => problems)
|
|
3235
|
-
end
|
|
3236
|
-
|
|
3237
|
-
# Sends a notification about user activity in a chat.
|
|
3238
|
-
#
|
|
3239
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3240
|
-
# @param action [TD::Types::ChatAction] The action description.
|
|
3241
|
-
# @return [TD::Types::Ok]
|
|
3242
|
-
def send_chat_action(chat_id, action)
|
|
3243
|
-
broadcast('@type' => 'sendChatAction',
|
|
3244
|
-
'chat_id' => chat_id,
|
|
3245
|
-
'action' => action)
|
|
3246
|
-
end
|
|
3247
|
-
|
|
3248
|
-
# Sends a notification about a screenshot taken in a chat.
|
|
3249
|
-
# Supported only in private and secret chats.
|
|
3250
|
-
#
|
|
3251
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3252
|
-
# @return [TD::Types::Ok]
|
|
3253
|
-
def send_chat_screenshot_taken_notification(chat_id)
|
|
3254
|
-
broadcast('@type' => 'sendChatScreenshotTakenNotification',
|
|
3255
|
-
'chat_id' => chat_id)
|
|
3256
|
-
end
|
|
3257
|
-
|
|
3258
|
-
# Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding
|
|
3259
|
-
# message.
|
|
3260
|
-
#
|
|
3261
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3262
|
-
# @param ttl [Integer] New TTL value, in seconds.
|
|
3263
|
-
# @return [TD::Types::Message]
|
|
3264
|
-
def send_chat_set_ttl_message(chat_id, ttl)
|
|
3265
|
-
broadcast('@type' => 'sendChatSetTtlMessage',
|
|
3266
|
-
'chat_id' => chat_id,
|
|
3267
|
-
'ttl' => ttl)
|
|
3268
|
-
end
|
|
3269
|
-
|
|
3270
|
-
# Sends a custom request; for bots only.
|
|
3271
|
-
#
|
|
3272
|
-
# @param method [String] The method name.
|
|
3273
|
-
# @param parameters [String] JSON-serialized method parameters.
|
|
3274
|
-
# @return [TD::Types::CustomRequestResult]
|
|
3275
|
-
def send_custom_request(method, parameters)
|
|
3276
|
-
broadcast('@type' => 'sendCustomRequest',
|
|
3277
|
-
'method' => method,
|
|
3278
|
-
'parameters' => parameters)
|
|
3279
|
-
end
|
|
3280
|
-
|
|
3281
|
-
# Sends a code to verify an email address to be added to a user's Telegram Passport.
|
|
3282
|
-
#
|
|
3283
|
-
# @param email_address [String] Email address.
|
|
3284
|
-
# @return [TD::Types::EmailAddressAuthenticationCodeInfo]
|
|
3285
|
-
def send_email_address_verification_code(email_address)
|
|
3286
|
-
broadcast('@type' => 'sendEmailAddressVerificationCode',
|
|
3287
|
-
'email_address' => email_address)
|
|
3288
|
-
end
|
|
3289
|
-
|
|
3290
|
-
# Sends the result of an inline query as a message.
|
|
3291
|
-
# Returns the sent message.
|
|
3292
|
-
# Always clears a chat draft message.
|
|
3293
|
-
#
|
|
3294
|
-
# @param chat_id [Integer] Target chat.
|
|
3295
|
-
# @param reply_to_message_id [Integer] Identifier of a message to reply to or 0.
|
|
3296
|
-
# @param options [TD::Types::SendMessageOptions] Options to be used to send the message.
|
|
3297
|
-
# @param query_id [Integer] Identifier of the inline query.
|
|
3298
|
-
# @param result_id [String] Identifier of the inline result.
|
|
3299
|
-
# @param hide_via_bot [Boolean] If true, there will be no mention of a bot, via which the message is sent.
|
|
3300
|
-
# Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and
|
|
3301
|
-
# GetOption("venue_search_bot_username").
|
|
3302
|
-
# @return [TD::Types::Message]
|
|
3303
|
-
def send_inline_query_result_message(chat_id, reply_to_message_id, options, query_id, result_id, hide_via_bot)
|
|
3304
|
-
broadcast('@type' => 'sendInlineQueryResultMessage',
|
|
3305
|
-
'chat_id' => chat_id,
|
|
3306
|
-
'reply_to_message_id' => reply_to_message_id,
|
|
3307
|
-
'options' => options,
|
|
3308
|
-
'query_id' => query_id,
|
|
3309
|
-
'result_id' => result_id,
|
|
3310
|
-
'hide_via_bot' => hide_via_bot)
|
|
3311
|
-
end
|
|
3312
|
-
|
|
3313
|
-
# Sends a message.
|
|
3314
|
-
# Returns the sent message.
|
|
3315
|
-
#
|
|
3316
|
-
# @param chat_id [Integer] Target chat.
|
|
3317
|
-
# @param reply_to_message_id [Integer] Identifier of the message to reply to or 0.
|
|
3318
|
-
# @param options [TD::Types::SendMessageOptions] Options to be used to send the message.
|
|
3319
|
-
# @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; for bots only.
|
|
3320
|
-
# @param input_message_content [TD::Types::InputMessageContent] The content of the message to be sent.
|
|
3321
|
-
# @return [TD::Types::Message]
|
|
3322
|
-
def send_message(chat_id, reply_to_message_id, options, reply_markup, input_message_content)
|
|
3323
|
-
broadcast('@type' => 'sendMessage',
|
|
3324
|
-
'chat_id' => chat_id,
|
|
3325
|
-
'reply_to_message_id' => reply_to_message_id,
|
|
3326
|
-
'options' => options,
|
|
3327
|
-
'reply_markup' => reply_markup,
|
|
3328
|
-
'input_message_content' => input_message_content)
|
|
3329
|
-
end
|
|
3330
|
-
|
|
3331
|
-
# Sends messages grouped together into an album.
|
|
3332
|
-
# Currently only photo and video messages can be grouped into an album.
|
|
3333
|
-
# Returns sent messages.
|
|
3334
|
-
#
|
|
3335
|
-
# @param chat_id [Integer] Target chat.
|
|
3336
|
-
# @param reply_to_message_id [Integer] Identifier of a message to reply to or 0.
|
|
3337
|
-
# @param options [TD::Types::SendMessageOptions] Options to be used to send the messages.
|
|
3338
|
-
# @param input_message_contents [Array<TD::Types::InputMessageContent>] Contents of messages to be sent.
|
|
3339
|
-
# @return [TD::Types::Messages]
|
|
3340
|
-
def send_message_album(chat_id, reply_to_message_id, options, input_message_contents)
|
|
3341
|
-
broadcast('@type' => 'sendMessageAlbum',
|
|
3342
|
-
'chat_id' => chat_id,
|
|
3343
|
-
'reply_to_message_id' => reply_to_message_id,
|
|
3344
|
-
'options' => options,
|
|
3345
|
-
'input_message_contents' => input_message_contents)
|
|
3346
|
-
end
|
|
3347
|
-
|
|
3348
|
-
# Sends a Telegram Passport authorization form, effectively sharing data with the service.
|
|
3349
|
-
# This method must be called after getPassportAuthorizationFormAvailableElements if some previously available
|
|
3350
|
-
# elements need to be used.
|
|
3351
|
-
#
|
|
3352
|
-
# @param autorization_form_id [Integer] Authorization form identifier.
|
|
3353
|
-
# @param types [Array<TD::Types::PassportElementType>] Types of Telegram Passport elements chosen by user to complete
|
|
3354
|
-
# the authorization form.
|
|
3355
|
-
# @return [TD::Types::Ok]
|
|
3356
|
-
def send_passport_authorization_form(autorization_form_id, types)
|
|
3357
|
-
broadcast('@type' => 'sendPassportAuthorizationForm',
|
|
3358
|
-
'autorization_form_id' => autorization_form_id,
|
|
3359
|
-
'types' => types)
|
|
3360
|
-
end
|
|
3361
|
-
|
|
3362
|
-
# Sends a filled-out payment form to the bot for final verification.
|
|
3363
|
-
#
|
|
3364
|
-
# @param chat_id [Integer] Chat identifier of the Invoice message.
|
|
3365
|
-
# @param message_id [Integer] Message identifier.
|
|
3366
|
-
# @param order_info_id [String] Identifier returned by ValidateOrderInfo, or an empty string.
|
|
3367
|
-
# @param shipping_option_id [String] Identifier of a chosen shipping option, if applicable.
|
|
3368
|
-
# @param credentials [TD::Types::InputCredentials] The credentials chosen by user for payment.
|
|
3369
|
-
# @return [TD::Types::PaymentResult]
|
|
3370
|
-
def send_payment_form(chat_id, message_id, order_info_id, shipping_option_id, credentials)
|
|
3371
|
-
broadcast('@type' => 'sendPaymentForm',
|
|
3372
|
-
'chat_id' => chat_id,
|
|
3373
|
-
'message_id' => message_id,
|
|
3374
|
-
'order_info_id' => order_info_id,
|
|
3375
|
-
'shipping_option_id' => shipping_option_id,
|
|
3376
|
-
'credentials' => credentials)
|
|
3377
|
-
end
|
|
3378
|
-
|
|
3379
|
-
# Sends phone number confirmation code.
|
|
3380
|
-
# Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or
|
|
3381
|
-
# "tg://confirmphone?phone=*******&hash=**********" link.
|
|
3382
|
-
#
|
|
3383
|
-
# @param hash [String] Value of the "hash" parameter from the link.
|
|
3384
|
-
# @param phone_number [String] Value of the "phone" parameter from the link.
|
|
3385
|
-
# @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone
|
|
3386
|
-
# number.
|
|
3387
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
3388
|
-
def send_phone_number_confirmation_code(hash, phone_number, settings)
|
|
3389
|
-
broadcast('@type' => 'sendPhoneNumberConfirmationCode',
|
|
3390
|
-
'hash' => hash,
|
|
3391
|
-
'phone_number' => phone_number,
|
|
3392
|
-
'settings' => settings)
|
|
3393
|
-
end
|
|
3394
|
-
|
|
3395
|
-
# Sends a code to verify a phone number to be added to a user's Telegram Passport.
|
|
3396
|
-
#
|
|
3397
|
-
# @param phone_number [String] The phone number of the user, in international format.
|
|
3398
|
-
# @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone
|
|
3399
|
-
# number.
|
|
3400
|
-
# @return [TD::Types::AuthenticationCodeInfo]
|
|
3401
|
-
def send_phone_number_verification_code(phone_number, settings)
|
|
3402
|
-
broadcast('@type' => 'sendPhoneNumberVerificationCode',
|
|
3403
|
-
'phone_number' => phone_number,
|
|
3404
|
-
'settings' => settings)
|
|
3405
|
-
end
|
|
3406
|
-
|
|
3407
|
-
# Sends a request to TON lite server through Telegram servers.
|
|
3408
|
-
# Can be called before authorization.
|
|
3409
|
-
#
|
|
3410
|
-
# @param request [String] The request.
|
|
3411
|
-
# @return [TD::Types::TonLiteServerResponse]
|
|
3412
|
-
def send_ton_lite_server_request(request)
|
|
3413
|
-
broadcast('@type' => 'sendTonLiteServerRequest',
|
|
3414
|
-
'request' => request)
|
|
3415
|
-
end
|
|
3416
|
-
|
|
3417
|
-
# Changes the period of inactivity after which the account of the current user will automatically be deleted.
|
|
3418
|
-
#
|
|
3419
|
-
# @param ttl [TD::Types::AccountTtl] New account TTL.
|
|
3420
|
-
# @return [TD::Types::Ok]
|
|
3421
|
-
def set_account_ttl(ttl)
|
|
3422
|
-
broadcast('@type' => 'setAccountTtl',
|
|
3423
|
-
'ttl' => ttl)
|
|
3424
|
-
end
|
|
3425
|
-
|
|
3426
|
-
# Succeeds after a specified amount of time has passed.
|
|
3427
|
-
# Can be called before authorization.
|
|
3428
|
-
# Can be called before initialization.
|
|
3429
|
-
#
|
|
3430
|
-
# @param seconds [Float] Number of seconds before the function returns.
|
|
3431
|
-
# @return [TD::Types::Ok]
|
|
3432
|
-
def set_alarm(seconds)
|
|
3433
|
-
broadcast('@type' => 'setAlarm',
|
|
3434
|
-
'seconds' => seconds)
|
|
3435
|
-
end
|
|
3436
|
-
|
|
3437
|
-
# Sets the phone number of the user and sends an authentication code to the user.
|
|
3438
|
-
# Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending
|
|
3439
|
-
# authentication query and the current authorization state is authorizationStateWaitCode or
|
|
3440
|
-
# authorizationStateWaitPassword.
|
|
3441
|
-
#
|
|
3442
|
-
# @param phone_number [String] The phone number of the user, in international format.
|
|
3443
|
-
# @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone
|
|
3444
|
-
# number.
|
|
3445
|
-
# @return [TD::Types::Ok]
|
|
3446
|
-
def set_authentication_phone_number(phone_number, settings)
|
|
3447
|
-
broadcast('@type' => 'setAuthenticationPhoneNumber',
|
|
3448
|
-
'phone_number' => phone_number,
|
|
3449
|
-
'settings' => settings)
|
|
3450
|
-
end
|
|
3451
|
-
|
|
3452
|
-
# Sets auto-download settings.
|
|
3453
|
-
#
|
|
3454
|
-
# @param settings [TD::Types::AutoDownloadSettings] New user auto-download settings.
|
|
3455
|
-
# @param type [TD::Types::NetworkType] Type of the network for which the new settings are applied.
|
|
3456
|
-
# @return [TD::Types::Ok]
|
|
3457
|
-
def set_auto_download_settings(settings, type)
|
|
3458
|
-
broadcast('@type' => 'setAutoDownloadSettings',
|
|
3459
|
-
'settings' => settings,
|
|
3460
|
-
'type' => type)
|
|
3461
|
-
end
|
|
3462
|
-
|
|
3463
|
-
# Changes the background selected by the user; adds background to the list of installed backgrounds.
|
|
3464
|
-
#
|
|
3465
|
-
# @param background [TD::Types::InputBackground] The input background to use, null for filled backgrounds.
|
|
3466
|
-
# @param type [TD::Types::BackgroundType] Background type; null for default background.
|
|
3467
|
-
# The method will return error 404 if type is null.
|
|
3468
|
-
# @param for_dark_theme [Boolean] True, if the background is chosen for dark theme.
|
|
3469
|
-
# @return [TD::Types::Background]
|
|
3470
|
-
def set_background(background, type, for_dark_theme)
|
|
3471
|
-
broadcast('@type' => 'setBackground',
|
|
3472
|
-
'background' => background,
|
|
3473
|
-
'type' => type,
|
|
3474
|
-
'for_dark_theme' => for_dark_theme)
|
|
3475
|
-
end
|
|
3476
|
-
|
|
3477
|
-
# Changes the bio of the current user.
|
|
3478
|
-
#
|
|
3479
|
-
# @param bio [String] The new value of the user bio; 0-70 characters without line feeds.
|
|
3480
|
-
# @return [TD::Types::Ok]
|
|
3481
|
-
def set_bio(bio)
|
|
3482
|
-
broadcast('@type' => 'setBio',
|
|
3483
|
-
'bio' => bio)
|
|
3484
|
-
end
|
|
3485
|
-
|
|
3486
|
-
# Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots
|
|
3487
|
-
# only.
|
|
3488
|
-
#
|
|
3489
|
-
# @param pending_update_count [Integer] The number of pending updates.
|
|
3490
|
-
# @param error_message [String] The last error message.
|
|
3491
|
-
# @return [TD::Types::Ok]
|
|
3492
|
-
def set_bot_updates_status(pending_update_count, error_message)
|
|
3493
|
-
broadcast('@type' => 'setBotUpdatesStatus',
|
|
3494
|
-
'pending_update_count' => pending_update_count,
|
|
3495
|
-
'error_message' => error_message)
|
|
3496
|
-
end
|
|
3497
|
-
|
|
3498
|
-
# Moves a chat to a different chat list.
|
|
3499
|
-
# Current chat list of the chat must ne non-null.
|
|
3500
|
-
#
|
|
3501
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3502
|
-
# @param chat_list [TD::Types::ChatList] New chat list of the chat.
|
|
3503
|
-
# @return [TD::Types::Ok]
|
|
3504
|
-
def set_chat_chat_list(chat_id, chat_list)
|
|
3505
|
-
broadcast('@type' => 'setChatChatList',
|
|
3506
|
-
'chat_id' => chat_id,
|
|
3507
|
-
'chat_list' => chat_list)
|
|
3508
|
-
end
|
|
3509
|
-
|
|
3510
|
-
# Changes client data associated with a chat.
|
|
3511
|
-
#
|
|
3512
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3513
|
-
# @param client_data [String] New value of client_data.
|
|
3514
|
-
# @return [TD::Types::Ok]
|
|
3515
|
-
def set_chat_client_data(chat_id, client_data)
|
|
3516
|
-
broadcast('@type' => 'setChatClientData',
|
|
3517
|
-
'chat_id' => chat_id,
|
|
3518
|
-
'client_data' => client_data)
|
|
3519
|
-
end
|
|
3520
|
-
|
|
3521
|
-
# Changes information about a chat.
|
|
3522
|
-
# Available for basic groups, supergroups, and channels.
|
|
3523
|
-
# Requires can_change_info rights.
|
|
3524
|
-
#
|
|
3525
|
-
# @param chat_id [Integer] Identifier of the chat.
|
|
3526
|
-
# @param description [String] New chat description; 0-255 characters.
|
|
3527
|
-
# @return [TD::Types::Ok]
|
|
3528
|
-
def set_chat_description(chat_id, description)
|
|
3529
|
-
broadcast('@type' => 'setChatDescription',
|
|
3530
|
-
'chat_id' => chat_id,
|
|
3531
|
-
'description' => description)
|
|
3532
|
-
end
|
|
3533
|
-
|
|
3534
|
-
# Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified.
|
|
3535
|
-
#
|
|
3536
|
-
# @param chat_id [Integer] Identifier of the channel chat.
|
|
3537
|
-
# Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires
|
|
3538
|
-
# can_pin_messages rights in the supergroup).
|
|
3539
|
-
# @param discussion_chat_id [Integer] Identifier of a new channel's discussion group.
|
|
3540
|
-
# Use 0 to remove the discussion group.
|
|
3541
|
-
# Use the method getSuitableDiscussionChats to find all suitable groups.
|
|
3542
|
-
# Basic group chats needs to be first upgraded to supergroup chats.
|
|
3543
|
-
# If new chat members don't have access to old messages in the supergroup, then
|
|
3544
|
-
# toggleSupergroupIsAllHistoryAvailable needs to be used first to change that.
|
|
3545
|
-
# @return [TD::Types::Ok]
|
|
3546
|
-
def set_chat_discussion_group(chat_id, discussion_chat_id)
|
|
3547
|
-
broadcast('@type' => 'setChatDiscussionGroup',
|
|
3548
|
-
'chat_id' => chat_id,
|
|
3549
|
-
'discussion_chat_id' => discussion_chat_id)
|
|
3550
|
-
end
|
|
3551
|
-
|
|
3552
|
-
# Changes the draft message in a chat.
|
|
3553
|
-
#
|
|
3554
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3555
|
-
# @param draft_message [TD::Types::DraftMessage, nil] New draft message; may be null.
|
|
3556
|
-
# @return [TD::Types::Ok]
|
|
3557
|
-
def set_chat_draft_message(chat_id, draft_message = nil)
|
|
3558
|
-
broadcast('@type' => 'setChatDraftMessage',
|
|
3559
|
-
'chat_id' => chat_id,
|
|
3560
|
-
'draft_message' => draft_message)
|
|
3561
|
-
end
|
|
3562
|
-
|
|
3563
|
-
# Changes the location of a chat.
|
|
3564
|
-
# Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the
|
|
3565
|
-
# method is allowed to use.
|
|
3566
|
-
#
|
|
3567
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3568
|
-
# @param location [TD::Types::ChatLocation] New location for the chat; must be valid and not null.
|
|
3569
|
-
# @return [TD::Types::Ok]
|
|
3570
|
-
def set_chat_location(chat_id, location)
|
|
3571
|
-
broadcast('@type' => 'setChatLocation',
|
|
3572
|
-
'chat_id' => chat_id,
|
|
3573
|
-
'location' => location)
|
|
3574
|
-
end
|
|
3575
|
-
|
|
3576
|
-
# Changes the status of a chat member, needs appropriate privileges.
|
|
3577
|
-
# This function is currently not suitable for adding new members to the chat and transferring chat ownership;
|
|
3578
|
-
# instead, use addChatMember or transferChatOwnership.
|
|
3579
|
-
# The chat member status will not be changed until it has been synchronized with the server.
|
|
3580
|
-
#
|
|
3581
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3582
|
-
# @param user_id [Integer] User identifier.
|
|
3583
|
-
# @param status [TD::Types::ChatMemberStatus] The new status of the member in the chat.
|
|
3584
|
-
# @return [TD::Types::Ok]
|
|
3585
|
-
def set_chat_member_status(chat_id, user_id, status)
|
|
3586
|
-
broadcast('@type' => 'setChatMemberStatus',
|
|
3587
|
-
'chat_id' => chat_id,
|
|
3588
|
-
'user_id' => user_id,
|
|
3589
|
-
'status' => status)
|
|
3590
|
-
end
|
|
3591
|
-
|
|
3592
|
-
# Changes the notification settings of a chat.
|
|
3593
|
-
# Notification settings of a chat with the current user (Saved Messages) can't be changed.
|
|
3594
|
-
#
|
|
3595
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3596
|
-
# @param notification_settings [TD::Types::ChatNotificationSettings] New notification settings for the chat.
|
|
3597
|
-
# If the chat is muted for more than 1 week, it is considered to be muted forever.
|
|
3598
|
-
# @return [TD::Types::Ok]
|
|
3599
|
-
def set_chat_notification_settings(chat_id, notification_settings)
|
|
3600
|
-
broadcast('@type' => 'setChatNotificationSettings',
|
|
3601
|
-
'chat_id' => chat_id,
|
|
3602
|
-
'notification_settings' => notification_settings)
|
|
3603
|
-
end
|
|
3604
|
-
|
|
3605
|
-
# Changes the chat members permissions.
|
|
3606
|
-
# Supported only for basic groups and supergroups.
|
|
3607
|
-
# Requires can_restrict_members administrator right.
|
|
3608
|
-
#
|
|
3609
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3610
|
-
# @param permissions [TD::Types::ChatPermissions] New non-administrator members permissions in the chat.
|
|
3611
|
-
# @return [TD::Types::Ok]
|
|
3612
|
-
def set_chat_permissions(chat_id, permissions)
|
|
3613
|
-
broadcast('@type' => 'setChatPermissions',
|
|
3614
|
-
'chat_id' => chat_id,
|
|
3615
|
-
'permissions' => permissions)
|
|
3616
|
-
end
|
|
3617
|
-
|
|
3618
|
-
# Changes the photo of a chat.
|
|
3619
|
-
# Supported only for basic groups, supergroups and channels.
|
|
3620
|
-
# Requires can_change_info rights.
|
|
3621
|
-
# The photo will not be changed before request to the server has been completed.
|
|
3622
|
-
#
|
|
3623
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3624
|
-
# @param photo [TD::Types::InputFile] New chat photo.
|
|
3625
|
-
# You can use a zero InputFileId to delete the chat photo.
|
|
3626
|
-
# Files that are accessible only by HTTP URL are not acceptable.
|
|
3627
|
-
# @return [TD::Types::Ok]
|
|
3628
|
-
def set_chat_photo(chat_id, photo)
|
|
3629
|
-
broadcast('@type' => 'setChatPhoto',
|
|
3630
|
-
'chat_id' => chat_id,
|
|
3631
|
-
'photo' => photo)
|
|
3632
|
-
end
|
|
3633
|
-
|
|
3634
|
-
# Changes the slow mode delay of a chat.
|
|
3635
|
-
# Available only for supergroups; requires can_restrict_members rights.
|
|
3636
|
-
#
|
|
3637
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3638
|
-
# @param slow_mode_delay [Integer] New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600.
|
|
3639
|
-
# @return [TD::Types::Ok]
|
|
3640
|
-
def set_chat_slow_mode_delay(chat_id, slow_mode_delay)
|
|
3641
|
-
broadcast('@type' => 'setChatSlowModeDelay',
|
|
3642
|
-
'chat_id' => chat_id,
|
|
3643
|
-
'slow_mode_delay' => slow_mode_delay)
|
|
3644
|
-
end
|
|
3645
|
-
|
|
3646
|
-
# Changes the chat title.
|
|
3647
|
-
# Supported only for basic groups, supergroups and channels.
|
|
3648
|
-
# Requires can_change_info rights.
|
|
3649
|
-
# The title will not be changed until the request to the server has been completed.
|
|
3650
|
-
#
|
|
3651
|
-
# @param chat_id [Integer] Chat identifier.
|
|
3652
|
-
# @param title [String] New title of the chat; 1-128 characters.
|
|
3653
|
-
# @return [TD::Types::Ok]
|
|
3654
|
-
def set_chat_title(chat_id, title)
|
|
3655
|
-
broadcast('@type' => 'setChatTitle',
|
|
3656
|
-
'chat_id' => chat_id,
|
|
3657
|
-
'title' => title)
|
|
3658
|
-
end
|
|
3659
|
-
|
|
3660
|
-
# Adds or changes a custom local language pack to the current localization target.
|
|
3661
|
-
#
|
|
3662
|
-
# @param info [TD::Types::LanguagePackInfo] Information about the language pack.
|
|
3663
|
-
# Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64
|
|
3664
|
-
# characters.
|
|
3665
|
-
# Can be called before authorization.
|
|
3666
|
-
# @param strings [Array<TD::Types::LanguagePackString>] Strings of the new language pack.
|
|
3667
|
-
# @return [TD::Types::Ok]
|
|
3668
|
-
def set_custom_language_pack(info, strings)
|
|
3669
|
-
broadcast('@type' => 'setCustomLanguagePack',
|
|
3670
|
-
'info' => info,
|
|
3671
|
-
'strings' => strings)
|
|
3672
|
-
end
|
|
3673
|
-
|
|
3674
|
-
# Adds, edits or deletes a string in a custom local language pack.
|
|
3675
|
-
# Can be called before authorization.
|
|
3676
|
-
#
|
|
3677
|
-
# @param language_pack_id [String] Identifier of a previously added custom local language pack in the current
|
|
3678
|
-
# localization target.
|
|
3679
|
-
# @param new_string [TD::Types::LanguagePackString] New language pack string.
|
|
3680
|
-
# @return [TD::Types::Ok]
|
|
3681
|
-
def set_custom_language_pack_string(language_pack_id, new_string)
|
|
3682
|
-
broadcast('@type' => 'setCustomLanguagePackString',
|
|
3683
|
-
'language_pack_id' => language_pack_id,
|
|
3684
|
-
'new_string' => new_string)
|
|
3685
|
-
end
|
|
3686
|
-
|
|
3687
|
-
# Changes the database encryption key.
|
|
3688
|
-
# Usually the encryption key is never changed and is stored in some OS keychain.
|
|
3689
|
-
#
|
|
3690
|
-
# @param new_encryption_key [String] New encryption key.
|
|
3691
|
-
# @return [TD::Types::Ok]
|
|
3692
|
-
def set_database_encryption_key(new_encryption_key)
|
|
3693
|
-
broadcast('@type' => 'setDatabaseEncryptionKey',
|
|
3694
|
-
'new_encryption_key' => new_encryption_key)
|
|
3695
|
-
end
|
|
3696
|
-
|
|
3697
|
-
# Informs TDLib on a file generation prograss.
|
|
3698
|
-
#
|
|
3699
|
-
# @param generation_id [Integer] The identifier of the generation process.
|
|
3700
|
-
# @param expected_size [Integer] Expected size of the generated file, in bytes; 0 if unknown.
|
|
3701
|
-
# @param local_prefix_size [Integer] The number of bytes already generated.
|
|
3702
|
-
# @return [TD::Types::Ok]
|
|
3703
|
-
def set_file_generation_progress(generation_id, expected_size, local_prefix_size)
|
|
3704
|
-
broadcast('@type' => 'setFileGenerationProgress',
|
|
3705
|
-
'generation_id' => generation_id,
|
|
3706
|
-
'expected_size' => expected_size,
|
|
3707
|
-
'local_prefix_size' => local_prefix_size)
|
|
3708
|
-
end
|
|
3709
|
-
|
|
3710
|
-
# Updates the game score of the specified user in the game; for bots only.
|
|
3711
|
-
#
|
|
3712
|
-
# @param chat_id [Integer] The chat to which the message with the game belongs.
|
|
3713
|
-
# @param message_id [Integer] Identifier of the message.
|
|
3714
|
-
# @param edit_message [Boolean] True, if the message should be edited.
|
|
3715
|
-
# @param user_id [Integer] User identifier.
|
|
3716
|
-
# @param score [Integer] The new score.
|
|
3717
|
-
# @param force [Boolean] Pass true to update the score even if it decreases.
|
|
3718
|
-
# If the score is 0, the user will be deleted from the high score table.
|
|
3719
|
-
# @return [TD::Types::Message]
|
|
3720
|
-
def set_game_score(chat_id, message_id, edit_message, user_id, score, force)
|
|
3721
|
-
broadcast('@type' => 'setGameScore',
|
|
3722
|
-
'chat_id' => chat_id,
|
|
3723
|
-
'message_id' => message_id,
|
|
3724
|
-
'edit_message' => edit_message,
|
|
3725
|
-
'user_id' => user_id,
|
|
3726
|
-
'score' => score,
|
|
3727
|
-
'force' => force)
|
|
3728
|
-
end
|
|
3729
|
-
|
|
3730
|
-
# Updates the game score of the specified user in a game; for bots only.
|
|
3731
|
-
#
|
|
3732
|
-
# @param inline_message_id [String] Inline message identifier.
|
|
3733
|
-
# @param edit_message [Boolean] True, if the message should be edited.
|
|
3734
|
-
# @param user_id [Integer] User identifier.
|
|
3735
|
-
# @param score [Integer] The new score.
|
|
3736
|
-
# @param force [Boolean] Pass true to update the score even if it decreases.
|
|
3737
|
-
# If the score is 0, the user will be deleted from the high score table.
|
|
3738
|
-
# @return [TD::Types::Ok]
|
|
3739
|
-
def set_inline_game_score(inline_message_id, edit_message, user_id, score, force)
|
|
3740
|
-
broadcast('@type' => 'setInlineGameScore',
|
|
3741
|
-
'inline_message_id' => inline_message_id,
|
|
3742
|
-
'edit_message' => edit_message,
|
|
3743
|
-
'user_id' => user_id,
|
|
3744
|
-
'score' => score,
|
|
3745
|
-
'force' => force)
|
|
3746
|
-
end
|
|
3747
|
-
|
|
3748
|
-
# Sets new log stream for internal logging of TDLib.
|
|
3749
|
-
# This is an offline method.
|
|
3750
|
-
# Can be called before authorization.
|
|
3751
|
-
# Can be called synchronously.
|
|
3752
|
-
#
|
|
3753
|
-
# @param log_stream [TD::Types::LogStream] New log stream.
|
|
3754
|
-
# @return [TD::Types::Ok]
|
|
3755
|
-
def set_log_stream(log_stream)
|
|
3756
|
-
broadcast('@type' => 'setLogStream',
|
|
3757
|
-
'log_stream' => log_stream)
|
|
3758
|
-
end
|
|
3759
|
-
|
|
3760
|
-
# Sets the verbosity level for a specified TDLib internal log tag.
|
|
3761
|
-
# This is an offline method.
|
|
3762
|
-
# Can be called before authorization.
|
|
3763
|
-
# Can be called synchronously.
|
|
3764
|
-
#
|
|
3765
|
-
# @param tag [String] Logging tag to change verbosity level.
|
|
3766
|
-
# @param new_verbosity_level [Integer] New verbosity level; 1-1024.
|
|
3767
|
-
# @return [TD::Types::Ok]
|
|
3768
|
-
def set_log_tag_verbosity_level(tag, new_verbosity_level)
|
|
3769
|
-
broadcast('@type' => 'setLogTagVerbosityLevel',
|
|
3770
|
-
'tag' => tag,
|
|
3771
|
-
'new_verbosity_level' => new_verbosity_level)
|
|
3772
|
-
end
|
|
3773
|
-
|
|
3774
|
-
# Sets the verbosity level of the internal logging of TDLib.
|
|
3775
|
-
# This is an offline method.
|
|
3776
|
-
# Can be called before authorization.
|
|
3777
|
-
# Can be called synchronously.
|
|
3778
|
-
#
|
|
3779
|
-
# @param new_verbosity_level [Integer] New value of the verbosity level for logging.
|
|
3780
|
-
# Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug
|
|
3781
|
-
# warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug,
|
|
3782
|
-
# value greater than 5 and up to 1023 can be used to enable even more logging.
|
|
3783
|
-
# @return [TD::Types::Ok]
|
|
3784
|
-
def set_log_verbosity_level(new_verbosity_level)
|
|
3785
|
-
broadcast('@type' => 'setLogVerbosityLevel',
|
|
3786
|
-
'new_verbosity_level' => new_verbosity_level)
|
|
3787
|
-
end
|
|
3788
|
-
|
|
3789
|
-
# Changes the first and last name of the current user.
|
|
3790
|
-
# If something changes, updateUser will be sent.
|
|
3791
|
-
#
|
|
3792
|
-
# @param first_name [String] The new value of the first name for the user; 1-64 characters.
|
|
3793
|
-
# @param last_name [String] The new value of the optional last name for the user; 0-64 characters.
|
|
3794
|
-
# @return [TD::Types::Ok]
|
|
3795
|
-
def set_name(first_name, last_name)
|
|
3796
|
-
broadcast('@type' => 'setName',
|
|
3797
|
-
'first_name' => first_name,
|
|
3798
|
-
'last_name' => last_name)
|
|
3799
|
-
end
|
|
3800
|
-
|
|
3801
|
-
# Sets the current network type.
|
|
3802
|
-
# Can be called before authorization.
|
|
3803
|
-
# Calling this method forces all network connections to reopen, mitigating the delay in switching between different
|
|
3804
|
-
# networks, so it should be called whenever the network is changed, even if the network type remains the same.
|
|
3805
|
-
# Network type is used to check whether the library can use the network at all and also for collecting detailed
|
|
3806
|
-
# network data usage statistics.
|
|
3807
|
-
#
|
|
3808
|
-
# @param type [TD::Types::NetworkType] The new network type.
|
|
3809
|
-
# By default, networkTypeOther.
|
|
3810
|
-
# @return [TD::Types::Ok]
|
|
3811
|
-
def set_network_type(type)
|
|
3812
|
-
broadcast('@type' => 'setNetworkType',
|
|
3813
|
-
'type' => type)
|
|
3814
|
-
end
|
|
3815
|
-
|
|
3816
|
-
# Sets the value of an option.
|
|
3817
|
-
# (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set.
|
|
3818
|
-
# Can be called before authorization.
|
|
3819
|
-
#
|
|
3820
|
-
# @param name [String] The name of the option.
|
|
3821
|
-
# @param value [TD::Types::OptionValue] The new value of the option.
|
|
3822
|
-
# @return [TD::Types::Ok]
|
|
3823
|
-
def set_option(name, value)
|
|
3824
|
-
broadcast('@type' => 'setOption',
|
|
3825
|
-
'name' => name,
|
|
3826
|
-
'value' => value)
|
|
3827
|
-
end
|
|
3828
|
-
|
|
3829
|
-
# Adds an element to the user's Telegram Passport.
|
|
3830
|
-
# May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone
|
|
3831
|
-
# number or the chosen email address must be verified first.
|
|
3832
|
-
#
|
|
3833
|
-
# @param element [TD::Types::InputPassportElement] Input Telegram Passport element.
|
|
3834
|
-
# @param password [String] Password of the current user.
|
|
3835
|
-
# @return [TD::Types::PassportElement]
|
|
3836
|
-
def set_passport_element(element, password)
|
|
3837
|
-
broadcast('@type' => 'setPassportElement',
|
|
3838
|
-
'element' => element,
|
|
3839
|
-
'password' => password)
|
|
3840
|
-
end
|
|
3841
|
-
|
|
3842
|
-
# Informs the user that some of the elements in their Telegram Passport contain errors; for bots only.
|
|
3843
|
-
# The user will not be able to resend the elements, until the errors are fixed.
|
|
3844
|
-
#
|
|
3845
|
-
# @param user_id [Integer] User identifier.
|
|
3846
|
-
# @param errors [Array<TD::Types::InputPassportElementError>] The errors.
|
|
3847
|
-
# @return [TD::Types::Ok]
|
|
3848
|
-
def set_passport_element_errors(user_id, errors)
|
|
3849
|
-
broadcast('@type' => 'setPassportElementErrors',
|
|
3850
|
-
'user_id' => user_id,
|
|
3851
|
-
'errors' => errors)
|
|
3852
|
-
end
|
|
3853
|
-
|
|
3854
|
-
# Changes the password for the user.
|
|
3855
|
-
# If a new recovery email address is specified, then the change will not be applied until the new recovery email
|
|
3856
|
-
# address is confirmed.
|
|
3857
|
-
#
|
|
3858
|
-
# @param old_password [String] Previous password of the user.
|
|
3859
|
-
# @param new_password [String, nil] New password of the user; may be empty to remove the password.
|
|
3860
|
-
# @param new_hint [String, nil] New password hint; may be empty.
|
|
3861
|
-
# @param set_recovery_email_address [Boolean] Pass true if the recovery email address should be changed.
|
|
3862
|
-
# @param new_recovery_email_address [String, nil] New recovery email address; may be empty.
|
|
3863
|
-
# @return [TD::Types::PasswordState]
|
|
3864
|
-
def set_password(old_password, new_password: nil, new_hint: nil, set_recovery_email_address: false,
|
|
3865
|
-
new_recovery_email_address: nil)
|
|
3866
|
-
broadcast('@type' => 'setPassword',
|
|
3867
|
-
'old_password' => old_password,
|
|
3868
|
-
'new_password' => new_password,
|
|
3869
|
-
'new_hint' => new_hint,
|
|
3870
|
-
'set_recovery_email_address' => set_recovery_email_address,
|
|
3871
|
-
'new_recovery_email_address' => new_recovery_email_address)
|
|
3872
|
-
end
|
|
3873
|
-
|
|
3874
|
-
# Changes the order of pinned chats.
|
|
3875
|
-
#
|
|
3876
|
-
# @param chat_list [TD::Types::ChatList] Chat list in which to change the order of pinned chats.
|
|
3877
|
-
# @param chat_ids [Array<Integer>] The new list of pinned chats.
|
|
3878
|
-
# @return [TD::Types::Ok]
|
|
3879
|
-
def set_pinned_chats(chat_list, chat_ids)
|
|
3880
|
-
broadcast('@type' => 'setPinnedChats',
|
|
3881
|
-
'chat_list' => chat_list,
|
|
3882
|
-
'chat_ids' => chat_ids)
|
|
3883
|
-
end
|
|
3884
|
-
|
|
3885
|
-
# Changes user answer to a poll.
|
|
3886
|
-
#
|
|
3887
|
-
# @param chat_id [Integer] Identifier of the chat to which the poll belongs.
|
|
3888
|
-
# @param message_id [Integer] Identifier of the message containing the poll.
|
|
3889
|
-
# @param option_ids [Array<Integer>] 0-based identifiers of options, chosen by the user.
|
|
3890
|
-
# Currently user can't choose more than 1 option.
|
|
3891
|
-
# @return [TD::Types::Ok]
|
|
3892
|
-
def set_poll_answer(chat_id, message_id, option_ids)
|
|
3893
|
-
broadcast('@type' => 'setPollAnswer',
|
|
3894
|
-
'chat_id' => chat_id,
|
|
3895
|
-
'message_id' => message_id,
|
|
3896
|
-
'option_ids' => option_ids)
|
|
3897
|
-
end
|
|
3898
|
-
|
|
3899
|
-
# Uploads a new profile photo for the current user.
|
|
3900
|
-
# If something changes, updateUser will be sent.
|
|
3901
|
-
#
|
|
3902
|
-
# @param photo [TD::Types::InputFile] Profile photo to set.
|
|
3903
|
-
# {TD::Types::InputFile::Id} and {TD::Types::InputFile::Remote} may still be unsupported.
|
|
3904
|
-
# @return [TD::Types::Ok]
|
|
3905
|
-
def set_profile_photo(photo)
|
|
3906
|
-
broadcast('@type' => 'setProfilePhoto',
|
|
3907
|
-
'photo' => photo)
|
|
3908
|
-
end
|
|
3909
|
-
|
|
3910
|
-
# Changes the 2-step verification recovery email address of the user.
|
|
3911
|
-
# If a new recovery email address is specified, then the change will not be applied until the new recovery email
|
|
3912
|
-
# address is confirmed.
|
|
3913
|
-
# If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds
|
|
3914
|
-
# immediately and aborts all other requests waiting for an email confirmation.
|
|
3915
|
-
#
|
|
3916
|
-
# @param password [String] Password of the current user.
|
|
3917
|
-
# @param new_recovery_email_address [String] New recovery email address.
|
|
3918
|
-
# @return [TD::Types::PasswordState]
|
|
3919
|
-
def set_recovery_email_address(password, new_recovery_email_address)
|
|
3920
|
-
broadcast('@type' => 'setRecoveryEmailAddress',
|
|
3921
|
-
'password' => password,
|
|
3922
|
-
'new_recovery_email_address' => new_recovery_email_address)
|
|
3923
|
-
end
|
|
3924
|
-
|
|
3925
|
-
# Changes notification settings for chats of a given type.
|
|
3926
|
-
#
|
|
3927
|
-
# @param scope [TD::Types::NotificationSettingsScope] Types of chats for which to change the notification settings.
|
|
3928
|
-
# @param notification_settings [TD::Types::ScopeNotificationSettings] The new notification settings for the given
|
|
3929
|
-
# scope.
|
|
3930
|
-
# @return [TD::Types::Ok]
|
|
3931
|
-
def set_scope_notification_settings(scope, notification_settings)
|
|
3932
|
-
broadcast('@type' => 'setScopeNotificationSettings',
|
|
3933
|
-
'scope' => scope,
|
|
3934
|
-
'notification_settings' => notification_settings)
|
|
3935
|
-
end
|
|
3936
|
-
|
|
3937
|
-
# Changes the position of a sticker in the set to which it belongs; for bots only.
|
|
3938
|
-
# The sticker set must have been created by the bot.
|
|
3939
|
-
#
|
|
3940
|
-
# @param sticker [TD::Types::InputFile] Sticker.
|
|
3941
|
-
# @param position [Integer] New position of the sticker in the set, zero-based.
|
|
3942
|
-
# @return [TD::Types::Ok]
|
|
3943
|
-
def set_sticker_position_in_set(sticker, position)
|
|
3944
|
-
broadcast('@type' => 'setStickerPositionInSet',
|
|
3945
|
-
'sticker' => sticker,
|
|
3946
|
-
'position' => position)
|
|
3947
|
-
end
|
|
3948
|
-
|
|
3949
|
-
# Changes the sticker set of a supergroup; requires can_change_info rights.
|
|
3950
|
-
#
|
|
3951
|
-
# @param supergroup_id [Integer] Identifier of the supergroup.
|
|
3952
|
-
# @param sticker_set_id [Integer] New value of the supergroup sticker set identifier.
|
|
3953
|
-
# Use 0 to remove the supergroup sticker set.
|
|
3954
|
-
# @return [TD::Types::Ok]
|
|
3955
|
-
def set_supergroup_sticker_set(supergroup_id, sticker_set_id)
|
|
3956
|
-
broadcast('@type' => 'setSupergroupStickerSet',
|
|
3957
|
-
'supergroup_id' => supergroup_id,
|
|
3958
|
-
'sticker_set_id' => sticker_set_id)
|
|
3959
|
-
end
|
|
3960
|
-
|
|
3961
|
-
# Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel.
|
|
3962
|
-
#
|
|
3963
|
-
# @param supergroup_id [Integer] Identifier of the supergroup or channel.
|
|
3964
|
-
# @param username [String] New value of the username.
|
|
3965
|
-
# Use an empty string to remove the username.
|
|
3966
|
-
# @return [TD::Types::Ok]
|
|
3967
|
-
def set_supergroup_username(supergroup_id, username)
|
|
3968
|
-
broadcast('@type' => 'setSupergroupUsername',
|
|
3969
|
-
'supergroup_id' => supergroup_id,
|
|
3970
|
-
'username' => username)
|
|
3971
|
-
end
|
|
3972
|
-
|
|
3973
|
-
# Sets the parameters for TDLib initialization.
|
|
3974
|
-
# Works only when the current authorization state is authorizationStateWaitTdlibParameters.
|
|
3975
|
-
#
|
|
3976
|
-
# @param parameters [TD::Types::TdlibParameters] Parameters.
|
|
3977
|
-
# @return [TD::Types::Ok]
|
|
3978
|
-
def set_tdlib_parameters(parameters)
|
|
3979
|
-
broadcast('@type' => 'setTdlibParameters',
|
|
3980
|
-
'parameters' => parameters)
|
|
3981
|
-
end
|
|
3982
|
-
|
|
3983
|
-
# Changes user privacy settings.
|
|
3984
|
-
#
|
|
3985
|
-
# @param setting [TD::Types::UserPrivacySetting] The privacy setting.
|
|
3986
|
-
# @param rules [TD::Types::UserPrivacySettingRules] The new privacy rules.
|
|
3987
|
-
# @return [TD::Types::Ok]
|
|
3988
|
-
def set_user_privacy_setting_rules(setting, rules)
|
|
3989
|
-
broadcast('@type' => 'setUserPrivacySettingRules',
|
|
3990
|
-
'setting' => setting,
|
|
3991
|
-
'rules' => rules)
|
|
3992
|
-
end
|
|
3993
|
-
|
|
3994
|
-
# Changes the username of the current user.
|
|
3995
|
-
# If something changes, updateUser will be sent.
|
|
3996
|
-
#
|
|
3997
|
-
# @param username [String] The new value of the username.
|
|
3998
|
-
# Use an empty string to remove the username.
|
|
3999
|
-
# @return [TD::Types::Ok]
|
|
4000
|
-
def set_username(username)
|
|
4001
|
-
broadcast('@type' => 'setUsername',
|
|
4002
|
-
'username' => username)
|
|
4003
|
-
end
|
|
4004
|
-
|
|
4005
|
-
# Shares the phone number of the current user with a mutual contact.
|
|
4006
|
-
# Supposed to be called when the user clicks on chatActionBarSharePhoneNumber.
|
|
4007
|
-
#
|
|
4008
|
-
# @param user_id [Integer] Identifier of the user with whom to share the phone number.
|
|
4009
|
-
# The user must be a mutual contact.
|
|
4010
|
-
# @return [TD::Types::Ok]
|
|
4011
|
-
def share_phone_number(user_id)
|
|
4012
|
-
broadcast('@type' => 'sharePhoneNumber',
|
|
4013
|
-
'user_id' => user_id)
|
|
4014
|
-
end
|
|
4015
|
-
|
|
4016
|
-
# Stops a poll.
|
|
4017
|
-
# A poll in a message can be stopped when the message has can_be_edited flag set.
|
|
4018
|
-
#
|
|
4019
|
-
# @param chat_id [Integer] Identifier of the chat to which the poll belongs.
|
|
4020
|
-
# @param message_id [Integer] Identifier of the message containing the poll.
|
|
4021
|
-
# @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only.
|
|
4022
|
-
# @return [TD::Types::Ok]
|
|
4023
|
-
def stop_poll(chat_id, message_id, reply_markup)
|
|
4024
|
-
broadcast('@type' => 'stopPoll',
|
|
4025
|
-
'chat_id' => chat_id,
|
|
4026
|
-
'message_id' => message_id,
|
|
4027
|
-
'reply_markup' => reply_markup)
|
|
4028
|
-
end
|
|
4029
|
-
|
|
4030
|
-
# Fetches the latest versions of all strings from a language pack in the current localization target from the server.
|
|
4031
|
-
# This method doesn't need to be called explicitly for the current used/base language packs.
|
|
4032
|
-
# Can be called before authorization.
|
|
4033
|
-
#
|
|
4034
|
-
# @param language_pack_id [String] Language pack identifier.
|
|
4035
|
-
# @return [TD::Types::Ok]
|
|
4036
|
-
def synchronize_language_pack(language_pack_id)
|
|
4037
|
-
broadcast('@type' => 'synchronizeLanguagePack',
|
|
4038
|
-
'language_pack_id' => language_pack_id)
|
|
4039
|
-
end
|
|
4040
|
-
|
|
4041
|
-
# Terminates all other sessions of the current user.
|
|
4042
|
-
#
|
|
4043
|
-
# @return [TD::Types::Ok]
|
|
4044
|
-
def terminate_all_other_sessions
|
|
4045
|
-
broadcast('@type' => 'terminateAllOtherSessions')
|
|
4046
|
-
end
|
|
4047
|
-
|
|
4048
|
-
# Terminates a session of the current user.
|
|
4049
|
-
#
|
|
4050
|
-
# @param session_id [Integer] Session identifier.
|
|
4051
|
-
# @return [TD::Types::Ok]
|
|
4052
|
-
def terminate_session(session_id)
|
|
4053
|
-
broadcast('@type' => 'terminateSession',
|
|
4054
|
-
'session_id' => session_id)
|
|
4055
|
-
end
|
|
4056
|
-
|
|
4057
|
-
# Changes the value of the default disable_notification parameter, used when a message is sent to a chat.
|
|
4058
|
-
#
|
|
4059
|
-
# @param chat_id [Integer] Chat identifier.
|
|
4060
|
-
# @param default_disable_notification [Boolean] New value of default_disable_notification.
|
|
4061
|
-
# @return [TD::Types::Ok]
|
|
4062
|
-
def toggle_chat_default_disable_notification(chat_id, default_disable_notification)
|
|
4063
|
-
broadcast('@type' => 'toggleChatDefaultDisableNotification',
|
|
4064
|
-
'chat_id' => chat_id,
|
|
4065
|
-
'default_disable_notification' => default_disable_notification)
|
|
4066
|
-
end
|
|
4067
|
-
|
|
4068
|
-
# Changes the marked as unread state of a chat.
|
|
4069
|
-
#
|
|
4070
|
-
# @param chat_id [Integer] Chat identifier.
|
|
4071
|
-
# @param is_marked_as_unread [Boolean] New value of is_marked_as_unread.
|
|
4072
|
-
# @return [TD::Types::Ok]
|
|
4073
|
-
def toggle_chat_is_marked_as_unread(chat_id, is_marked_as_unread)
|
|
4074
|
-
broadcast('@type' => 'toggleChatIsMarkedAsUnread',
|
|
4075
|
-
'chat_id' => chat_id,
|
|
4076
|
-
'is_marked_as_unread' => is_marked_as_unread)
|
|
4077
|
-
end
|
|
4078
|
-
|
|
4079
|
-
# Changes the pinned state of a chat.
|
|
4080
|
-
# You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") non-secret chats
|
|
4081
|
-
# and the same number of secret chats in the main/archive chat list.
|
|
4082
|
-
#
|
|
4083
|
-
# @param chat_id [Integer] Chat identifier.
|
|
4084
|
-
# @param is_pinned [Boolean] New value of is_pinned.
|
|
4085
|
-
# @return [TD::Types::Ok]
|
|
4086
|
-
def toggle_chat_is_pinned(chat_id, is_pinned)
|
|
4087
|
-
broadcast('@type' => 'toggleChatIsPinned',
|
|
4088
|
-
'chat_id' => chat_id,
|
|
4089
|
-
'is_pinned' => is_pinned)
|
|
4090
|
-
end
|
|
4091
|
-
|
|
4092
|
-
# Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights.
|
|
4093
|
-
#
|
|
4094
|
-
# @param supergroup_id [Integer] The identifier of the supergroup.
|
|
4095
|
-
# @param is_all_history_available [Boolean] The new value of is_all_history_available.
|
|
4096
|
-
# @return [TD::Types::Ok]
|
|
4097
|
-
def toggle_supergroup_is_all_history_available(supergroup_id, is_all_history_available)
|
|
4098
|
-
broadcast('@type' => 'toggleSupergroupIsAllHistoryAvailable',
|
|
4099
|
-
'supergroup_id' => supergroup_id,
|
|
4100
|
-
'is_all_history_available' => is_all_history_available)
|
|
4101
|
-
end
|
|
4102
|
-
|
|
4103
|
-
# Toggles sender signatures messages sent in a channel; requires can_change_info rights.
|
|
4104
|
-
#
|
|
4105
|
-
# @param supergroup_id [Integer] Identifier of the channel.
|
|
4106
|
-
# @param sign_messages [Boolean] New value of sign_messages.
|
|
4107
|
-
# @return [TD::Types::Ok]
|
|
4108
|
-
def toggle_supergroup_sign_messages(supergroup_id, sign_messages)
|
|
4109
|
-
broadcast('@type' => 'toggleSupergroupSignMessages',
|
|
4110
|
-
'supergroup_id' => supergroup_id,
|
|
4111
|
-
'sign_messages' => sign_messages)
|
|
4112
|
-
end
|
|
4113
|
-
|
|
4114
|
-
# Changes the owner of a chat.
|
|
4115
|
-
# The current user must be a current owner of the chat.
|
|
4116
|
-
# Use the method canTransferOwnership to check whether the ownership can be transferred from the current session.
|
|
4117
|
-
# Available only for supergroups and channel chats.
|
|
4118
|
-
#
|
|
4119
|
-
# @param chat_id [Integer] Chat identifier.
|
|
4120
|
-
# @param user_id [Integer] Identifier of the user to which transfer the ownership.
|
|
4121
|
-
# The ownership can't be transferred to a bot or to a deleted user.
|
|
4122
|
-
# @param password [String] The password of the current user.
|
|
4123
|
-
# @return [TD::Types::Ok]
|
|
4124
|
-
def transfer_chat_ownership(chat_id, user_id, password)
|
|
4125
|
-
broadcast('@type' => 'transferChatOwnership',
|
|
4126
|
-
'chat_id' => chat_id,
|
|
4127
|
-
'user_id' => user_id,
|
|
4128
|
-
'password' => password)
|
|
4129
|
-
end
|
|
4130
|
-
|
|
4131
|
-
# Removes a user from the blacklist.
|
|
4132
|
-
#
|
|
4133
|
-
# @param user_id [Integer] User identifier.
|
|
4134
|
-
# @return [TD::Types::Ok]
|
|
4135
|
-
def unblock_user(user_id)
|
|
4136
|
-
broadcast('@type' => 'unblockUser',
|
|
4137
|
-
'user_id' => user_id)
|
|
4138
|
-
end
|
|
4139
|
-
|
|
4140
|
-
# Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel.
|
|
4141
|
-
#
|
|
4142
|
-
# @param chat_id [Integer] Identifier of the chat.
|
|
4143
|
-
# @return [TD::Types::Ok]
|
|
4144
|
-
def unpin_chat_message(chat_id)
|
|
4145
|
-
broadcast('@type' => 'unpinChatMessage',
|
|
4146
|
-
'chat_id' => chat_id)
|
|
4147
|
-
end
|
|
4148
|
-
|
|
4149
|
-
# Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and
|
|
4150
|
-
# messageChatUpgradeFrom; requires creator privileges.
|
|
4151
|
-
# Deactivates the original basic group.
|
|
4152
|
-
#
|
|
4153
|
-
# @param chat_id [Integer] Identifier of the chat to upgrade.
|
|
4154
|
-
# @return [TD::Types::Chat]
|
|
4155
|
-
def upgrade_basic_group_chat_to_supergroup_chat(chat_id)
|
|
4156
|
-
broadcast('@type' => 'upgradeBasicGroupChatToSupergroupChat',
|
|
4157
|
-
'chat_id' => chat_id)
|
|
4158
|
-
end
|
|
4159
|
-
|
|
4160
|
-
# Asynchronously uploads a file to the cloud without sending it in a message.
|
|
4161
|
-
# updateFile will be used to notify about upload progress and successful completion of the upload.
|
|
4162
|
-
# The file will not have a persistent remote identifier until it will be sent in a message.
|
|
4163
|
-
#
|
|
4164
|
-
# @param file [TD::Types::InputFile] File to upload.
|
|
4165
|
-
# @param file_type [TD::Types::FileType] File type.
|
|
4166
|
-
# @param priority [Integer] Priority of the upload (1-32).
|
|
4167
|
-
# The higher the priority, the earlier the file will be uploaded.
|
|
4168
|
-
# If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded
|
|
4169
|
-
# first.
|
|
4170
|
-
# @return [TD::Types::File]
|
|
4171
|
-
def upload_file(file, file_type, priority)
|
|
4172
|
-
broadcast('@type' => 'uploadFile',
|
|
4173
|
-
'file' => file,
|
|
4174
|
-
'file_type' => file_type,
|
|
4175
|
-
'priority' => priority)
|
|
4176
|
-
end
|
|
4177
|
-
|
|
4178
|
-
# Uploads a PNG image with a sticker; for bots only; returns the uploaded file.
|
|
4179
|
-
#
|
|
4180
|
-
# @param user_id [Integer] Sticker file owner.
|
|
4181
|
-
# @param png_sticker [TD::Types::InputFile] PNG image with the sticker; must be up to 512 kB in size and fit in
|
|
4182
|
-
# 512x512 square.
|
|
4183
|
-
# @return [TD::Types::File]
|
|
4184
|
-
def upload_sticker_file(user_id, png_sticker)
|
|
4185
|
-
broadcast('@type' => 'uploadStickerFile',
|
|
4186
|
-
'user_id' => user_id,
|
|
4187
|
-
'png_sticker' => png_sticker)
|
|
4188
|
-
end
|
|
4189
|
-
|
|
4190
|
-
# Validates the order information provided by a user and returns the available shipping options for a flexible
|
|
4191
|
-
# invoice.
|
|
4192
|
-
#
|
|
4193
|
-
# @param chat_id [Integer] Chat identifier of the Invoice message.
|
|
4194
|
-
# @param message_id [Integer] Message identifier.
|
|
4195
|
-
# @param order_info [TD::Types::OrderInfo] The order information, provided by the user.
|
|
4196
|
-
# @param allow_save [Boolean] True, if the order information can be saved.
|
|
4197
|
-
# @return [TD::Types::ValidatedOrderInfo]
|
|
4198
|
-
def validate_order_info(chat_id, message_id, order_info, allow_save)
|
|
4199
|
-
broadcast('@type' => 'validateOrderInfo',
|
|
4200
|
-
'chat_id' => chat_id,
|
|
4201
|
-
'message_id' => message_id,
|
|
4202
|
-
'order_info' => order_info,
|
|
4203
|
-
'allow_save' => allow_save)
|
|
4204
|
-
end
|
|
4205
|
-
|
|
4206
|
-
# Informs TDLib that messages are being viewed by the user.
|
|
4207
|
-
# Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as
|
|
4208
|
-
# read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels).
|
|
4209
|
-
#
|
|
4210
|
-
# @param chat_id [Integer] Chat identifier.
|
|
4211
|
-
# @param message_ids [Array<Integer>] The identifiers of the messages being viewed.
|
|
4212
|
-
# @param force_read [Boolean] True, if messages in closed chats should be marked as read.
|
|
4213
|
-
# @return [TD::Types::Ok]
|
|
4214
|
-
def view_messages(chat_id, message_ids, force_read)
|
|
4215
|
-
broadcast('@type' => 'viewMessages',
|
|
4216
|
-
'chat_id' => chat_id,
|
|
4217
|
-
'message_ids' => message_ids,
|
|
4218
|
-
'force_read' => force_read)
|
|
4219
|
-
end
|
|
4220
|
-
|
|
4221
|
-
# Informs the server that some trending sticker sets have been viewed by the user.
|
|
4222
|
-
#
|
|
4223
|
-
# @param sticker_set_ids [Array<Integer>] Identifiers of viewed trending sticker sets.
|
|
4224
|
-
# @return [TD::Types::Ok]
|
|
4225
|
-
def view_trending_sticker_sets(sticker_set_ids)
|
|
4226
|
-
broadcast('@type' => 'viewTrendingStickerSets',
|
|
4227
|
-
'sticker_set_ids' => sticker_set_ids)
|
|
4228
|
-
end
|
|
4229
|
-
|
|
4230
|
-
# Writes a part of a generated file.
|
|
4231
|
-
# This method is intended to be used only if the client has no direct access to TDLib's file system, because it is
|
|
4232
|
-
# usually slower than a direct write to the destination file.
|
|
4233
|
-
#
|
|
4234
|
-
# @param generation_id [Integer] The identifier of the generation process.
|
|
4235
|
-
# @param offset [Integer] The offset from which to write the data to the file.
|
|
4236
|
-
# @param data [String] The data to write.
|
|
4237
|
-
# @return [TD::Types::Ok]
|
|
4238
|
-
def write_generated_file_part(generation_id, offset, data)
|
|
4239
|
-
broadcast('@type' => 'writeGeneratedFilePart',
|
|
4240
|
-
'generation_id' => generation_id,
|
|
4241
|
-
'offset' => offset,
|
|
4242
|
-
'data' => data)
|
|
4243
|
-
end
|
|
4244
|
-
end
|