Module: TD::ClientMethods

Included in:
Client
Defined in:
lib/tdlib/client_methods.rb

Overview

This is a generated module from current TDLib scheme It contains all available TDLib methods

Instance Method Summary collapse

Instance Method Details

#accept_call(call_id, protocol) ⇒ TD::Types::Ok

Accepts an incoming call.



9
10
11
12
13
# File 'lib/tdlib/client_methods.rb', line 9

def accept_call(call_id, protocol)
  broadcast('@type'    => 'acceptCall',
            'call_id'  => call_id,
            'protocol' => protocol)
end

#accept_terms_of_service(terms_of_service_id) ⇒ TD::Types::Ok

Accepts Telegram terms of services.



19
20
21
22
# File 'lib/tdlib/client_methods.rb', line 19

def accept_terms_of_service(terms_of_service_id)
  broadcast('@type'               => 'acceptTermsOfService',
            'terms_of_service_id' => terms_of_service_id)
end

#add_chat_member(chat_id, user_id, forward_limit) ⇒ TD::Types::Ok

Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server.



34
35
36
37
38
39
# File 'lib/tdlib/client_methods.rb', line 34

def add_chat_member(chat_id, user_id, forward_limit)
  broadcast('@type'         => 'addChatMember',
            'chat_id'       => chat_id,
            'user_id'       => user_id,
            'forward_limit' => forward_limit)
end

#add_chat_members(chat_id, user_ids) ⇒ TD::Types::Ok

Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server.



50
51
52
53
54
# File 'lib/tdlib/client_methods.rb', line 50

def add_chat_members(chat_id, user_ids)
  broadcast('@type'    => 'addChatMembers',
            'chat_id'  => chat_id,
            'user_ids' => user_ids)
end

#add_contact(contact = nil, share_phone_number) ⇒ TD::Types::Ok

Adds a user to the contact list or edits an existing contact by their user identifier.



66
67
68
69
70
# File 'lib/tdlib/client_methods.rb', line 66

def add_contact(contact = nil, share_phone_number)
  broadcast('@type'              => 'addContact',
            'contact'            => contact,
            'share_phone_number' => share_phone_number)
end

#add_custom_server_language_pack(language_pack_id) ⇒ TD::Types::Ok

Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization.



78
79
80
81
# File 'lib/tdlib/client_methods.rb', line 78

def add_custom_server_language_pack(language_pack_id)
  broadcast('@type'            => 'addCustomServerLanguagePack',
            'language_pack_id' => language_pack_id)
end

#add_favorite_sticker(sticker) ⇒ TD::Types::Ok

Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list.



90
91
92
93
# File 'lib/tdlib/client_methods.rb', line 90

def add_favorite_sticker(sticker)
  broadcast('@type'   => 'addFavoriteSticker',
            'sticker' => sticker)
end

#add_local_message(chat_id, sender_user_id, reply_to_message_id, disable_notification, input_message_content) ⇒ TD::Types::Message

Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message.



106
107
108
109
110
111
112
113
# File 'lib/tdlib/client_methods.rb', line 106

def add_local_message(chat_id, sender_user_id, reply_to_message_id, disable_notification, input_message_content)
  broadcast('@type'                 => 'addLocalMessage',
            'chat_id'               => chat_id,
            'sender_user_id'        => sender_user_id,
            'reply_to_message_id'   => reply_to_message_id,
            'disable_notification'  => disable_notification,
            'input_message_content' => input_message_content)
end

#add_log_message(verbosity_level, text) ⇒ TD::Types::Ok

Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously.



123
124
125
126
127
# File 'lib/tdlib/client_methods.rb', line 123

def add_log_message(verbosity_level, text)
  broadcast('@type'           => 'addLogMessage',
            'verbosity_level' => verbosity_level,
            'text'            => text)
end

#add_network_statistics(entry) ⇒ TD::Types::Ok

Adds the specified data to data usage statistics. Can be called before authorization.



135
136
137
138
# File 'lib/tdlib/client_methods.rb', line 135

def add_network_statistics(entry)
  broadcast('@type' => 'addNetworkStatistics',
            'entry' => entry)
end

#add_proxy(server, port, enable, type) ⇒ TD::Types::Proxy

Adds a proxy server for network requests. Can be called before authorization.



148
149
150
151
152
153
154
# File 'lib/tdlib/client_methods.rb', line 148

def add_proxy(server, port, enable, type)
  broadcast('@type'  => 'addProxy',
            'server' => server,
            'port'   => port,
            'enable' => enable,
            'type'   => type)
end

#add_recent_sticker(is_attached, sticker) ⇒ TD::Types::Stickers

Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list.



165
166
167
168
169
# File 'lib/tdlib/client_methods.rb', line 165

def add_recent_sticker(is_attached, sticker)
  broadcast('@type'       => 'addRecentSticker',
            'is_attached' => is_attached,
            'sticker'     => sticker)
end

#add_recently_found_chat(chat_id) ⇒ TD::Types::Ok

Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first.



177
178
179
180
# File 'lib/tdlib/client_methods.rb', line 177

def add_recently_found_chat(chat_id)
  broadcast('@type'   => 'addRecentlyFoundChat',
            'chat_id' => chat_id)
end

#add_saved_animation(animation) ⇒ TD::Types::Ok

Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list.



191
192
193
194
# File 'lib/tdlib/client_methods.rb', line 191

def add_saved_animation(animation)
  broadcast('@type'     => 'addSavedAnimation',
            'animation' => animation)
end

#add_sticker_to_set(user_id, name, sticker) ⇒ TD::Types::StickerSet

Adds a new sticker to a set; for bots only. Returns the sticker set.



203
204
205
206
207
208
# File 'lib/tdlib/client_methods.rb', line 203

def add_sticker_to_set(user_id, name, sticker)
  broadcast('@type'   => 'addStickerToSet',
            'user_id' => user_id,
            'name'    => name,
            'sticker' => sticker)
end

#answer_callback_query(callback_query_id, text, show_alert, url, cache_time) ⇒ TD::Types::Ok

Sets the result of a callback query; for bots only.



218
219
220
221
222
223
224
225
# File 'lib/tdlib/client_methods.rb', line 218

def answer_callback_query(callback_query_id, text, show_alert, url, cache_time)
  broadcast('@type'             => 'answerCallbackQuery',
            'callback_query_id' => callback_query_id,
            'text'              => text,
            'show_alert'        => show_alert,
            'url'               => url,
            'cache_time'        => cache_time)
end

#answer_custom_query(custom_query_id, data) ⇒ TD::Types::Ok

Answers a custom query; for bots only.



232
233
234
235
236
# File 'lib/tdlib/client_methods.rb', line 232

def answer_custom_query(custom_query_id, data)
  broadcast('@type'           => 'answerCustomQuery',
            'custom_query_id' => custom_query_id,
            'data'            => data)
end

#answer_inline_query(inline_query_id, is_personal, results, cache_time, next_offset, switch_pm_text, switch_pm_parameter) ⇒ TD::Types::Ok

Sets the result of an inline query; for bots only.



249
250
251
252
253
254
255
256
257
258
259
# File 'lib/tdlib/client_methods.rb', line 249

def answer_inline_query(inline_query_id, is_personal, results, cache_time, next_offset, switch_pm_text,
                        switch_pm_parameter)
  broadcast('@type'               => 'answerInlineQuery',
            'inline_query_id'     => inline_query_id,
            'is_personal'         => is_personal,
            'results'             => results,
            'cache_time'          => cache_time,
            'next_offset'         => next_offset,
            'switch_pm_text'      => switch_pm_text,
            'switch_pm_parameter' => switch_pm_parameter)
end

#answer_pre_checkout_query(pre_checkout_query_id, error_message) ⇒ TD::Types::Ok

Sets the result of a pre-checkout query; for bots only.



266
267
268
269
270
# File 'lib/tdlib/client_methods.rb', line 266

def answer_pre_checkout_query(pre_checkout_query_id, error_message)
  broadcast('@type'                 => 'answerPreCheckoutQuery',
            'pre_checkout_query_id' => pre_checkout_query_id,
            'error_message'         => error_message)
end

#answer_shipping_query(shipping_query_id, shipping_options, error_message) ⇒ TD::Types::Ok

Sets the result of a shipping query; for bots only.



278
279
280
281
282
283
# File 'lib/tdlib/client_methods.rb', line 278

def answer_shipping_query(shipping_query_id, shipping_options, error_message)
  broadcast('@type'             => 'answerShippingQuery',
            'shipping_query_id' => shipping_query_id,
            'shipping_options'  => shipping_options,
            'error_message'     => error_message)
end

#block_user(user_id) ⇒ TD::Types::Ok

Adds a user to the blacklist.



289
290
291
292
# File 'lib/tdlib/client_methods.rb', line 289

def block_user(user_id)
  broadcast('@type'   => 'blockUser',
            'user_id' => user_id)
end

#can_transfer_ownershipTD::Types::CanTransferOwnershipResult

Checks whether the current session can be used to transfer a chat ownership to another user.



297
298
299
# File 'lib/tdlib/client_methods.rb', line 297

def can_transfer_ownership
  broadcast('@type' => 'canTransferOwnership')
end

#cancel_download_file(file_id, only_if_pending) ⇒ TD::Types::Ok

Stops the downloading of a file. If a file has already been downloaded, does nothing.



308
309
310
311
312
# File 'lib/tdlib/client_methods.rb', line 308

def cancel_download_file(file_id, only_if_pending)
  broadcast('@type'           => 'cancelDownloadFile',
            'file_id'         => file_id,
            'only_if_pending' => only_if_pending)
end

#cancel_upload_file(file_id) ⇒ TD::Types::Ok

Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined.



320
321
322
323
# File 'lib/tdlib/client_methods.rb', line 320

def cancel_upload_file(file_id)
  broadcast('@type'   => 'cancelUploadFile',
            'file_id' => file_id)
end

#change_imported_contacts(contacts) ⇒ TD::Types::ImportedContacts

Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time.



332
333
334
335
# File 'lib/tdlib/client_methods.rb', line 332

def change_imported_contacts(contacts)
  broadcast('@type'    => 'changeImportedContacts',
            'contacts' => contacts)
end

#change_phone_number(phone_number, settings) ⇒ TD::Types::AuthenticationCodeInfo

Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code.



344
345
346
347
348
# File 'lib/tdlib/client_methods.rb', line 344

def change_phone_number(phone_number, settings)
  broadcast('@type'        => 'changePhoneNumber',
            'phone_number' => phone_number,
            'settings'     => settings)
end

#change_sticker_set(set_id, is_installed, is_archived) ⇒ TD::Types::Ok

Installs/uninstalls or activates/archives a sticker set.



357
358
359
360
361
362
# File 'lib/tdlib/client_methods.rb', line 357

def change_sticker_set(set_id, is_installed, is_archived)
  broadcast('@type'        => 'changeStickerSet',
            'set_id'       => set_id,
            'is_installed' => is_installed,
            'is_archived'  => is_archived)
end

#check_authentication_bot_token(token) ⇒ TD::Types::Ok

Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in.



370
371
372
373
# File 'lib/tdlib/client_methods.rb', line 370

def check_authentication_bot_token(token)
  broadcast('@type' => 'checkAuthenticationBotToken',
            'token' => token)
end

#check_authentication_code(code) ⇒ TD::Types::Ok

Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode.



380
381
382
383
# File 'lib/tdlib/client_methods.rb', line 380

def check_authentication_code(code)
  broadcast('@type' => 'checkAuthenticationCode',
            'code'  => code)
end

#check_authentication_password(password) ⇒ TD::Types::Ok

Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword.



390
391
392
393
# File 'lib/tdlib/client_methods.rb', line 390

def check_authentication_password(password)
  broadcast('@type'    => 'checkAuthenticationPassword',
            'password' => password)
end

#check_change_phone_number_code(code) ⇒ TD::Types::Ok

Checks the authentication code sent to confirm a new phone number of the user.



399
400
401
402
# File 'lib/tdlib/client_methods.rb', line 399

def check_change_phone_number_code(code)
  broadcast('@type' => 'checkChangePhoneNumberCode',
            'code'  => code)
end

Checks the validity of an invite link for a chat and returns information about the corresponding chat.



409
410
411
412
# File 'lib/tdlib/client_methods.rb', line 409

def check_chat_invite_link(invite_link)
  broadcast('@type'       => 'checkChatInviteLink',
            'invite_link' => invite_link)
end

#check_chat_username(chat_id, username) ⇒ TD::Types::CheckChatUsernameResult

Checks whether a username can be set for a chat.



420
421
422
423
424
# File 'lib/tdlib/client_methods.rb', line 420

def check_chat_username(chat_id, username)
  broadcast('@type'    => 'checkChatUsername',
            'chat_id'  => chat_id,
            'username' => username)
end

#check_created_public_chats_limit(type) ⇒ TD::Types::Ok

Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached.



431
432
433
434
# File 'lib/tdlib/client_methods.rb', line 431

def check_created_public_chats_limit(type)
  broadcast('@type' => 'checkCreatedPublicChatsLimit',
            'type'  => type)
end

#check_database_encryption_key(encryption_key) ⇒ TD::Types::Ok

Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey.



441
442
443
444
# File 'lib/tdlib/client_methods.rb', line 441

def check_database_encryption_key(encryption_key)
  broadcast('@type'          => 'checkDatabaseEncryptionKey',
            'encryption_key' => encryption_key)
end

#check_email_address_verification_code(code) ⇒ TD::Types::Ok

Checks the email address verification code for Telegram Passport.



450
451
452
453
# File 'lib/tdlib/client_methods.rb', line 450

def check_email_address_verification_code(code)
  broadcast('@type' => 'checkEmailAddressVerificationCode',
            'code'  => code)
end

#check_phone_number_confirmation_code(code) ⇒ TD::Types::Ok

Checks phone number confirmation code.



459
460
461
462
# File 'lib/tdlib/client_methods.rb', line 459

def check_phone_number_confirmation_code(code)
  broadcast('@type' => 'checkPhoneNumberConfirmationCode',
            'code'  => code)
end

#check_phone_number_verification_code(code) ⇒ TD::Types::Ok

Checks the phone number verification code for Telegram Passport.



468
469
470
471
# File 'lib/tdlib/client_methods.rb', line 468

def check_phone_number_verification_code(code)
  broadcast('@type' => 'checkPhoneNumberVerificationCode',
            'code'  => code)
end

#check_recovery_email_address_code(code) ⇒ TD::Types::PasswordState

Checks the 2-step verification recovery email address verification code.



477
478
479
480
# File 'lib/tdlib/client_methods.rb', line 477

def check_recovery_email_address_code(code)
  broadcast('@type' => 'checkRecoveryEmailAddressCode',
            'code'  => code)
end

#clean_file_name(file_name) ⇒ TD::Types::Text

Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously.



491
492
493
494
# File 'lib/tdlib/client_methods.rb', line 491

def clean_file_name(file_name)
  broadcast('@type'     => 'cleanFileName',
            'file_name' => file_name)
end

#clear_all_draft_messages(exclude_secret_chats) ⇒ TD::Types::Ok

Clears draft messages in all chats.



500
501
502
503
# File 'lib/tdlib/client_methods.rb', line 500

def clear_all_draft_messages(exclude_secret_chats)
  broadcast('@type'                => 'clearAllDraftMessages',
            'exclude_secret_chats' => exclude_secret_chats)
end

#clear_imported_contactsTD::Types::Ok

Clears all imported contacts, contact list remains unchanged.



508
509
510
# File 'lib/tdlib/client_methods.rb', line 508

def clear_imported_contacts
  broadcast('@type' => 'clearImportedContacts')
end

#clear_recent_stickers(is_attached) ⇒ TD::Types::Ok

Clears the list of recently used stickers.



517
518
519
520
# File 'lib/tdlib/client_methods.rb', line 517

def clear_recent_stickers(is_attached)
  broadcast('@type'       => 'clearRecentStickers',
            'is_attached' => is_attached)
end

#clear_recently_found_chatsTD::Types::Ok

Clears the list of recently found chats.



525
526
527
# File 'lib/tdlib/client_methods.rb', line 525

def clear_recently_found_chats
  broadcast('@type' => 'clearRecentlyFoundChats')
end

#closeTD::Types::Ok

Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent.



534
535
536
# File 'lib/tdlib/client_methods.rb', line 534

def close
  broadcast('@type' => 'close')
end

#close_chat(chat_id) ⇒ TD::Types::Ok

Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed.



543
544
545
546
# File 'lib/tdlib/client_methods.rb', line 543

def close_chat(chat_id)
  broadcast('@type'   => 'closeChat',
            'chat_id' => chat_id)
end

#close_secret_chat(secret_chat_id) ⇒ TD::Types::Ok

Closes a secret chat, effectively transfering its state to secretChatStateClosed.



552
553
554
555
# File 'lib/tdlib/client_methods.rb', line 552

def close_secret_chat(secret_chat_id)
  broadcast('@type'          => 'closeSecretChat',
            'secret_chat_id' => secret_chat_id)
end

#confirm_qr_code_authentication(link) ⇒ TD::Types::Session

Confirms QR code authentication on another device. Returns created session on success.



563
564
565
566
# File 'lib/tdlib/client_methods.rb', line 563

def confirm_qr_code_authentication(link)
  broadcast('@type' => 'confirmQrCodeAuthentication',
            'link'  => link)
end

#create_basic_group_chat(basic_group_id, force) ⇒ TD::Types::Chat

Returns an existing chat corresponding to a known basic group.



574
575
576
577
578
# File 'lib/tdlib/client_methods.rb', line 574

def create_basic_group_chat(basic_group_id, force)
  broadcast('@type'          => 'createBasicGroupChat',
            'basic_group_id' => basic_group_id,
            'force'          => force)
end

#create_call(user_id, protocol) ⇒ TD::Types::CallId

Creates a new call.



585
586
587
588
589
# File 'lib/tdlib/client_methods.rb', line 585

def create_call(user_id, protocol)
  broadcast('@type'    => 'createCall',
            'user_id'  => user_id,
            'protocol' => protocol)
end

#create_new_basic_group_chat(user_ids, title) ⇒ TD::Types::Chat

Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat.



597
598
599
600
601
# File 'lib/tdlib/client_methods.rb', line 597

def create_new_basic_group_chat(user_ids, title)
  broadcast('@type'    => 'createNewBasicGroupChat',
            'user_ids' => user_ids,
            'title'    => title)
end

#create_new_secret_chat(user_id) ⇒ TD::Types::Chat

Creates a new secret chat. Returns the newly created chat.



608
609
610
611
# File 'lib/tdlib/client_methods.rb', line 608

def create_new_secret_chat(user_id)
  broadcast('@type'   => 'createNewSecretChat',
            'user_id' => user_id)
end

#create_new_sticker_set(user_id, title, name, is_masks, stickers) ⇒ TD::Types::StickerSet

Creates a new sticker set; for bots only. Returns the newly created sticker set.



624
625
626
627
628
629
630
631
# File 'lib/tdlib/client_methods.rb', line 624

def create_new_sticker_set(user_id, title, name, is_masks, stickers)
  broadcast('@type'    => 'createNewStickerSet',
            'user_id'  => user_id,
            'title'    => title,
            'name'     => name,
            'is_masks' => is_masks,
            'stickers' => stickers)
end

#create_new_supergroup_chat(title, is_channel, description, location) ⇒ TD::Types::Chat

Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat.



641
642
643
644
645
646
647
# File 'lib/tdlib/client_methods.rb', line 641

def create_new_supergroup_chat(title, is_channel, description, location)
  broadcast('@type'       => 'createNewSupergroupChat',
            'title'       => title,
            'is_channel'  => is_channel,
            'description' => description,
            'location'    => location)
end

#create_private_chat(user_id, force) ⇒ TD::Types::Chat

Returns an existing chat corresponding to a given user.



655
656
657
658
659
# File 'lib/tdlib/client_methods.rb', line 655

def create_private_chat(user_id, force)
  broadcast('@type'   => 'createPrivateChat',
            'user_id' => user_id,
            'force'   => force)
end

#create_secret_chat(secret_chat_id) ⇒ TD::Types::Chat

Returns an existing chat corresponding to a known secret chat.



665
666
667
668
# File 'lib/tdlib/client_methods.rb', line 665

def create_secret_chat(secret_chat_id)
  broadcast('@type'          => 'createSecretChat',
            'secret_chat_id' => secret_chat_id)
end

#create_supergroup_chat(supergroup_id, force) ⇒ TD::Types::Chat

Returns an existing chat corresponding to a known supergroup or channel.



676
677
678
679
680
# File 'lib/tdlib/client_methods.rb', line 676

def create_supergroup_chat(supergroup_id, force)
  broadcast('@type'         => 'createSupergroupChat',
            'supergroup_id' => supergroup_id,
            'force'         => force)
end

#create_temporary_password(password, valid_for) ⇒ TD::Types::TemporaryPasswordState

Creates a new temporary password for processing payments.



688
689
690
691
692
# File 'lib/tdlib/client_methods.rb', line 688

def create_temporary_password(password, valid_for)
  broadcast('@type'     => 'createTemporaryPassword',
            'password'  => password,
            'valid_for' => valid_for)
end

#delete_account(reason = nil) ⇒ TD::Types::Ok

Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword.



700
701
702
703
# File 'lib/tdlib/client_methods.rb', line 700

def (reason = nil)
  broadcast('@type'  => 'deleteAccount',
            'reason' => reason)
end

#delete_chat_history(chat_id, remove_from_chat_list, revoke) ⇒ TD::Types::Ok

Deletes all messages in the chat. Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat.



713
714
715
716
717
718
# File 'lib/tdlib/client_methods.rb', line 713

def delete_chat_history(chat_id, remove_from_chat_list, revoke)
  broadcast('@type'                 => 'deleteChatHistory',
            'chat_id'               => chat_id,
            'remove_from_chat_list' => remove_from_chat_list,
            'revoke'                => revoke)
end

#delete_chat_messages_from_user(chat_id, user_id) ⇒ TD::Types::Ok

Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges.



726
727
728
729
730
# File 'lib/tdlib/client_methods.rb', line 726

def delete_chat_messages_from_user(chat_id, user_id)
  broadcast('@type'   => 'deleteChatMessagesFromUser',
            'chat_id' => chat_id,
            'user_id' => user_id)
end

#delete_chat_reply_markup(chat_id, message_id) ⇒ TD::Types::Ok

Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed.



739
740
741
742
743
# File 'lib/tdlib/client_methods.rb', line 739

def delete_chat_reply_markup(chat_id, message_id)
  broadcast('@type'      => 'deleteChatReplyMarkup',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#delete_file(file_id) ⇒ TD::Types::Ok

Deletes a file from the TDLib file cache.



749
750
751
752
# File 'lib/tdlib/client_methods.rb', line 749

def delete_file(file_id)
  broadcast('@type'   => 'deleteFile',
            'file_id' => file_id)
end

#delete_language_pack(language_pack_id) ⇒ TD::Types::Ok

Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted. Can be called before authorization.



761
762
763
764
# File 'lib/tdlib/client_methods.rb', line 761

def delete_language_pack(language_pack_id)
  broadcast('@type'            => 'deleteLanguagePack',
            'language_pack_id' => language_pack_id)
end

#delete_messages(chat_id, message_ids, revoke) ⇒ TD::Types::Ok

Deletes messages.



773
774
775
776
777
778
# File 'lib/tdlib/client_methods.rb', line 773

def delete_messages(chat_id, message_ids, revoke)
  broadcast('@type'       => 'deleteMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids,
            'revoke'      => revoke)
end

#delete_passport_element(type) ⇒ TD::Types::Ok

Deletes a Telegram Passport element.



784
785
786
787
# File 'lib/tdlib/client_methods.rb', line 784

def delete_passport_element(type)
  broadcast('@type' => 'deletePassportElement',
            'type'  => type)
end

#delete_profile_photo(profile_photo_id) ⇒ TD::Types::Ok

Deletes a profile photo. If something changes, updateUser will be sent.



794
795
796
797
# File 'lib/tdlib/client_methods.rb', line 794

def delete_profile_photo(profile_photo_id)
  broadcast('@type'            => 'deleteProfilePhoto',
            'profile_photo_id' => profile_photo_id)
end

#delete_saved_credentialsTD::Types::Ok

Deletes saved credentials for all payment provider bots.



802
803
804
# File 'lib/tdlib/client_methods.rb', line 802

def delete_saved_credentials
  broadcast('@type' => 'deleteSavedCredentials')
end

#delete_saved_order_infoTD::Types::Ok

Deletes saved order info.



809
810
811
# File 'lib/tdlib/client_methods.rb', line 809

def delete_saved_order_info
  broadcast('@type' => 'deleteSavedOrderInfo')
end

#delete_supergroup(supergroup_id) ⇒ TD::Types::Ok

Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires owner privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method.



820
821
822
823
# File 'lib/tdlib/client_methods.rb', line 820

def delete_supergroup(supergroup_id)
  broadcast('@type'         => 'deleteSupergroup',
            'supergroup_id' => supergroup_id)
end

#destroyTD::Types::Ok

Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent.



831
832
833
# File 'lib/tdlib/client_methods.rb', line 831

def destroy
  broadcast('@type' => 'destroy')
end

#disable_proxyTD::Types::Ok

Disables the currently enabled proxy. Can be called before authorization.



839
840
841
# File 'lib/tdlib/client_methods.rb', line 839

def disable_proxy
  broadcast('@type' => 'disableProxy')
end

#discard_call(call_id, is_disconnected, duration, connection_id) ⇒ TD::Types::Ok

Discards a call.



850
851
852
853
854
855
856
# File 'lib/tdlib/client_methods.rb', line 850

def discard_call(call_id, is_disconnected, duration, connection_id)
  broadcast('@type'           => 'discardCall',
            'call_id'         => call_id,
            'is_disconnected' => is_disconnected,
            'duration'        => duration,
            'connection_id'   => connection_id)
end

#disconnect_all_websitesTD::Types::Ok

Disconnects all websites from the current user's Telegram account.



861
862
863
# File 'lib/tdlib/client_methods.rb', line 861

def disconnect_all_websites
  broadcast('@type' => 'disconnectAllWebsites')
end

#disconnect_website(website_id) ⇒ TD::Types::Ok

Disconnects website from the current user's Telegram account.



869
870
871
872
# File 'lib/tdlib/client_methods.rb', line 869

def disconnect_website(website_id)
  broadcast('@type'      => 'disconnectWebsite',
            'website_id' => website_id)
end

#download_file(file_id, priority, offset, limit, synchronous) ⇒ TD::Types::File

Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.



889
890
891
892
893
894
895
896
# File 'lib/tdlib/client_methods.rb', line 889

def download_file(file_id, priority, offset, limit, synchronous)
  broadcast('@type'       => 'downloadFile',
            'file_id'     => file_id,
            'priority'    => priority,
            'offset'      => offset,
            'limit'       => limit,
            'synchronous' => synchronous)
end

#edit_custom_language_pack_info(info) ⇒ TD::Types::Ok

Edits information about a custom local language pack in the current localization target. Can be called before authorization.



903
904
905
906
# File 'lib/tdlib/client_methods.rb', line 903

def edit_custom_language_pack_info(info)
  broadcast('@type' => 'editCustomLanguagePackInfo',
            'info'  => info)
end

#edit_inline_message_caption(inline_message_id, reply_markup, caption) ⇒ TD::Types::Ok

Edits the caption of an inline message sent via a bot; for bots only.



915
916
917
918
919
920
# File 'lib/tdlib/client_methods.rb', line 915

def edit_inline_message_caption(inline_message_id, reply_markup, caption)
  broadcast('@type'             => 'editInlineMessageCaption',
            'inline_message_id' => inline_message_id,
            'reply_markup'      => reply_markup,
            'caption'           => caption)
end

#edit_inline_message_live_location(inline_message_id, reply_markup, location = nil) ⇒ TD::Types::Ok

Edits the content of a live location in an inline message sent via a bot; for bots only.



929
930
931
932
933
934
# File 'lib/tdlib/client_methods.rb', line 929

def edit_inline_message_live_location(inline_message_id, reply_markup, location = nil)
  broadcast('@type'             => 'editInlineMessageLiveLocation',
            'inline_message_id' => inline_message_id,
            'reply_markup'      => reply_markup,
            'location'          => location)
end

#edit_inline_message_media(inline_message_id, reply_markup, input_message_content) ⇒ TD::Types::Ok

Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only.



945
946
947
948
949
950
# File 'lib/tdlib/client_methods.rb', line 945

def edit_inline_message_media(inline_message_id, reply_markup, input_message_content)
  broadcast('@type'                 => 'editInlineMessageMedia',
            'inline_message_id'     => inline_message_id,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#edit_inline_message_reply_markup(inline_message_id, reply_markup) ⇒ TD::Types::Ok

Edits the reply markup of an inline message sent via a bot; for bots only.



957
958
959
960
961
# File 'lib/tdlib/client_methods.rb', line 957

def edit_inline_message_reply_markup(inline_message_id, reply_markup)
  broadcast('@type'             => 'editInlineMessageReplyMarkup',
            'inline_message_id' => inline_message_id,
            'reply_markup'      => reply_markup)
end

#edit_inline_message_text(inline_message_id, reply_markup, input_message_content) ⇒ TD::Types::Ok

Edits the text of an inline text or game message sent via a bot; for bots only.



970
971
972
973
974
975
# File 'lib/tdlib/client_methods.rb', line 970

def edit_inline_message_text(inline_message_id, reply_markup, input_message_content)
  broadcast('@type'                 => 'editInlineMessageText',
            'inline_message_id'     => inline_message_id,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#edit_message_caption(chat_id, message_id, reply_markup, caption) ⇒ TD::Types::Message

Edits the message content caption. Returns the edited message after the edit is completed on the server side.



986
987
988
989
990
991
992
# File 'lib/tdlib/client_methods.rb', line 986

def edit_message_caption(chat_id, message_id, reply_markup, caption)
  broadcast('@type'        => 'editMessageCaption',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'reply_markup' => reply_markup,
            'caption'      => caption)
end

#edit_message_live_location(chat_id, message_id, reply_markup, location = nil) ⇒ TD::Types::Message

Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side.



1004
1005
1006
1007
1008
1009
1010
# File 'lib/tdlib/client_methods.rb', line 1004

def edit_message_live_location(chat_id, message_id, reply_markup, location = nil)
  broadcast('@type'        => 'editMessageLiveLocation',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'reply_markup' => reply_markup,
            'location'     => location)
end

#edit_message_media(chat_id, message_id, reply_markup, input_message_content) ⇒ TD::Types::Message

Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can't be replaced if the message was set to self-destruct. Media can't be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side.



1025
1026
1027
1028
1029
1030
1031
# File 'lib/tdlib/client_methods.rb', line 1025

def edit_message_media(chat_id, message_id, reply_markup, input_message_content)
  broadcast('@type'                 => 'editMessageMedia',
            'chat_id'               => chat_id,
            'message_id'            => message_id,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#edit_message_reply_markup(chat_id, message_id, reply_markup) ⇒ TD::Types::Message

Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side.



1040
1041
1042
1043
1044
1045
# File 'lib/tdlib/client_methods.rb', line 1040

def edit_message_reply_markup(chat_id, message_id, reply_markup)
  broadcast('@type'        => 'editMessageReplyMarkup',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'reply_markup' => reply_markup)
end

#edit_message_scheduling_state(chat_id, message_id, scheduling_state) ⇒ TD::Types::Ok

Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed.



1055
1056
1057
1058
1059
1060
# File 'lib/tdlib/client_methods.rb', line 1055

def edit_message_scheduling_state(chat_id, message_id, scheduling_state)
  broadcast('@type'            => 'editMessageSchedulingState',
            'chat_id'          => chat_id,
            'message_id'       => message_id,
            'scheduling_state' => scheduling_state)
end

#edit_message_text(chat_id, message_id, reply_markup, input_message_content) ⇒ TD::Types::Message

Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side.



1071
1072
1073
1074
1075
1076
1077
# File 'lib/tdlib/client_methods.rb', line 1071

def edit_message_text(chat_id, message_id, reply_markup, input_message_content)
  broadcast('@type'                 => 'editMessageText',
            'chat_id'               => chat_id,
            'message_id'            => message_id,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#edit_proxy(proxy_id, server, port, enable, type) ⇒ TD::Types::Proxy

Edits an existing proxy server for network requests. Can be called before authorization.



1088
1089
1090
1091
1092
1093
1094
1095
# File 'lib/tdlib/client_methods.rb', line 1088

def edit_proxy(proxy_id, server, port, enable, type)
  broadcast('@type'    => 'editProxy',
            'proxy_id' => proxy_id,
            'server'   => server,
            'port'     => port,
            'enable'   => enable,
            'type'     => type)
end

#enable_proxy(proxy_id) ⇒ TD::Types::Ok

Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization.



1103
1104
1105
1106
# File 'lib/tdlib/client_methods.rb', line 1103

def enable_proxy(proxy_id)
  broadcast('@type'    => 'enableProxy',
            'proxy_id' => proxy_id)
end

#finish_file_generation(generation_id, error) ⇒ TD::Types::Ok

Finishes the file generation.



1113
1114
1115
1116
1117
# File 'lib/tdlib/client_methods.rb', line 1113

def finish_file_generation(generation_id, error)
  broadcast('@type'         => 'finishFileGeneration',
            'generation_id' => generation_id,
            'error'         => error)
end

#forward_messages(chat_id, from_chat_id, message_ids, options, as_album, send_copy, remove_caption) ⇒ TD::Types::Messages

Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message.



1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
# File 'lib/tdlib/client_methods.rb', line 1135

def forward_messages(chat_id, from_chat_id, message_ids, options, as_album, send_copy, remove_caption)
  broadcast('@type'          => 'forwardMessages',
            'chat_id'        => chat_id,
            'from_chat_id'   => from_chat_id,
            'message_ids'    => message_ids,
            'options'        => options,
            'as_album'       => as_album,
            'send_copy'      => send_copy,
            'remove_caption' => remove_caption)
end

Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right.



1152
1153
1154
1155
# File 'lib/tdlib/client_methods.rb', line 1152

def generate_chat_invite_link(chat_id)
  broadcast('@type'   => 'generateChatInviteLink',
            'chat_id' => chat_id)
end

#get_account_ttlTD::Types::AccountTtl

Returns the period of inactivity after which the account of the current user will automatically be deleted.



1160
1161
1162
# File 'lib/tdlib/client_methods.rb', line 1160

def 
  broadcast('@type' => 'getAccountTtl')
end

#get_active_live_location_messagesTD::Types::Messages

Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used.



1168
1169
1170
# File 'lib/tdlib/client_methods.rb', line 1168

def get_active_live_location_messages
  broadcast('@type' => 'getActiveLiveLocationMessages')
end

#get_active_sessionsTD::Types::Sessions

Returns all active sessions of the current user.



1175
1176
1177
# File 'lib/tdlib/client_methods.rb', line 1175

def get_active_sessions
  broadcast('@type' => 'getActiveSessions')
end

#get_all_passport_elements(password) ⇒ TD::Types::PassportElements

Returns all available Telegram Passport elements.



1183
1184
1185
1186
# File 'lib/tdlib/client_methods.rb', line 1183

def get_all_passport_elements(password)
  broadcast('@type'    => 'getAllPassportElements',
            'password' => password)
end

#get_application_configTD::Types::JsonValue

Returns application config, provided by the server. Can be called before authorization.



1192
1193
1194
# File 'lib/tdlib/client_methods.rb', line 1192

def get_application_config
  broadcast('@type' => 'getApplicationConfig')
end

#get_archived_sticker_sets(is_masks, offset_sticker_set_id, limit) ⇒ TD::Types::StickerSets

Returns a list of archived sticker sets.



1202
1203
1204
1205
1206
1207
# File 'lib/tdlib/client_methods.rb', line 1202

def get_archived_sticker_sets(is_masks, offset_sticker_set_id, limit)
  broadcast('@type'                 => 'getArchivedStickerSets',
            'is_masks'              => is_masks,
            'offset_sticker_set_id' => offset_sticker_set_id,
            'limit'                 => limit)
end

#get_attached_sticker_sets(file_id) ⇒ TD::Types::StickerSets

Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets.



1214
1215
1216
1217
# File 'lib/tdlib/client_methods.rb', line 1214

def get_attached_sticker_sets(file_id)
  broadcast('@type'   => 'getAttachedStickerSets',
            'file_id' => file_id)
end

#get_authorization_stateTD::Types::AuthorizationState

Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state.



1224
1225
1226
# File 'lib/tdlib/client_methods.rb', line 1224

def get_authorization_state
  broadcast('@type' => 'getAuthorizationState')
end

#get_auto_download_settings_presetsTD::Types::AutoDownloadSettingsPresets

Returns auto-download settings presets for the currently logged in user.



1231
1232
1233
# File 'lib/tdlib/client_methods.rb', line 1231

def get_auto_download_settings_presets
  broadcast('@type' => 'getAutoDownloadSettingsPresets')
end

#get_background_url(name, type) ⇒ TD::Types::HttpUrl

Constructs a persistent HTTP URL for a background.



1240
1241
1242
1243
1244
# File 'lib/tdlib/client_methods.rb', line 1240

def get_background_url(name, type)
  broadcast('@type' => 'getBackgroundUrl',
            'name'  => name,
            'type'  => type)
end

#get_backgrounds(for_dark_theme) ⇒ TD::Types::Backgrounds

Returns backgrounds installed by the user.



1250
1251
1252
1253
# File 'lib/tdlib/client_methods.rb', line 1250

def get_backgrounds(for_dark_theme)
  broadcast('@type'          => 'getBackgrounds',
            'for_dark_theme' => for_dark_theme)
end

#get_basic_group(basic_group_id) ⇒ TD::Types::BasicGroup

Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot.



1260
1261
1262
1263
# File 'lib/tdlib/client_methods.rb', line 1260

def get_basic_group(basic_group_id)
  broadcast('@type'          => 'getBasicGroup',
            'basic_group_id' => basic_group_id)
end

#get_basic_group_full_info(basic_group_id) ⇒ TD::Types::BasicGroupFullInfo

Returns full information about a basic group by its identifier.



1269
1270
1271
1272
# File 'lib/tdlib/client_methods.rb', line 1269

def get_basic_group_full_info(basic_group_id)
  broadcast('@type'          => 'getBasicGroupFullInfo',
            'basic_group_id' => basic_group_id)
end

#get_blocked_users(offset, limit) ⇒ TD::Types::Users

Returns users that were blocked by the current user.



1279
1280
1281
1282
1283
# File 'lib/tdlib/client_methods.rb', line 1279

def get_blocked_users(offset, limit)
  broadcast('@type'  => 'getBlockedUsers',
            'offset' => offset,
            'limit'  => limit)
end

#get_callback_query_answer(chat_id, message_id, payload) ⇒ TD::Types::CallbackQueryAnswer

Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires.



1292
1293
1294
1295
1296
1297
# File 'lib/tdlib/client_methods.rb', line 1292

def get_callback_query_answer(chat_id, message_id, payload)
  broadcast('@type'      => 'getCallbackQueryAnswer',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'payload'    => payload)
end

#get_chat(chat_id) ⇒ TD::Types::Chat

Returns information about a chat by its identifier, this is an offline request if the current user is not a bot.



1303
1304
1305
1306
# File 'lib/tdlib/client_methods.rb', line 1303

def get_chat(chat_id)
  broadcast('@type'   => 'getChat',
            'chat_id' => chat_id)
end

#get_chat_administrators(chat_id) ⇒ TD::Types::ChatAdministrators

Returns a list of administrators of the chat with their custom titles.



1312
1313
1314
1315
# File 'lib/tdlib/client_methods.rb', line 1312

def get_chat_administrators(chat_id)
  broadcast('@type'   => 'getChatAdministrators',
            'chat_id' => chat_id)
end

#get_chat_event_log(chat_id, query, from_event_id, limit, filters, user_ids) ⇒ TD::Types::ChatEvents

Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id).



1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/tdlib/client_methods.rb', line 1333

def get_chat_event_log(chat_id, query, from_event_id, limit, filters, user_ids)
  broadcast('@type'         => 'getChatEventLog',
            'chat_id'       => chat_id,
            'query'         => query,
            'from_event_id' => from_event_id,
            'limit'         => limit,
            'filters'       => filters,
            'user_ids'      => user_ids)
end

#get_chat_history(chat_id, from_message_id, offset, limit, only_local) ⇒ TD::Types::Messages

Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library. This is an offline request if only_local is true.



1361
1362
1363
1364
1365
1366
1367
1368
# File 'lib/tdlib/client_methods.rb', line 1361

def get_chat_history(chat_id, from_message_id, offset, limit, only_local)
  broadcast('@type'           => 'getChatHistory',
            'chat_id'         => chat_id,
            'from_message_id' => from_message_id,
            'offset'          => offset,
            'limit'           => limit,
            'only_local'      => only_local)
end

#get_chat_member(chat_id, user_id) ⇒ TD::Types::ChatMember

Returns information about a single member of a chat.



1375
1376
1377
1378
1379
# File 'lib/tdlib/client_methods.rb', line 1375

def get_chat_member(chat_id, user_id)
  broadcast('@type'   => 'getChatMember',
            'chat_id' => chat_id,
            'user_id' => user_id)
end

#get_chat_message_by_date(chat_id, date) ⇒ TD::Types::Message

Returns the last message sent in a chat no later than the specified date.



1386
1387
1388
1389
1390
# File 'lib/tdlib/client_methods.rb', line 1386

def get_chat_message_by_date(chat_id, date)
  broadcast('@type'   => 'getChatMessageByDate',
            'chat_id' => chat_id,
            'date'    => date)
end

#get_chat_message_count(chat_id, filter, return_local) ⇒ TD::Types::Count

Returns approximate number of messages of the specified type in the chat.



1400
1401
1402
1403
1404
1405
# File 'lib/tdlib/client_methods.rb', line 1400

def get_chat_message_count(chat_id, filter, return_local)
  broadcast('@type'        => 'getChatMessageCount',
            'chat_id'      => chat_id,
            'filter'       => filter,
            'return_local' => return_local)
end

#get_chat_notification_settings_exceptions(scope, compare_sound) ⇒ TD::Types::Chats

Returns list of chats with non-default notification settings.



1413
1414
1415
1416
1417
# File 'lib/tdlib/client_methods.rb', line 1413

def get_chat_notification_settings_exceptions(scope, compare_sound)
  broadcast('@type'         => 'getChatNotificationSettingsExceptions',
            'scope'         => scope,
            'compare_sound' => compare_sound)
end

#get_chat_pinned_message(chat_id) ⇒ TD::Types::Message

Returns information about a pinned chat message.



1423
1424
1425
1426
# File 'lib/tdlib/client_methods.rb', line 1423

def get_chat_pinned_message(chat_id)
  broadcast('@type'   => 'getChatPinnedMessage',
            'chat_id' => chat_id)
end

#get_chat_scheduled_messages(chat_id) ⇒ TD::Types::Messages

Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).



1433
1434
1435
1436
# File 'lib/tdlib/client_methods.rb', line 1433

def get_chat_scheduled_messages(chat_id)
  broadcast('@type'   => 'getChatScheduledMessages',
            'chat_id' => chat_id)
end

#get_chat_statistics_url(chat_id, parameters, is_dark) ⇒ TD::Types::HttpUrl

Returns an HTTP URL with the chat statistics. Currently this method can be used only for channels. Can be used only if SupergroupFullInfo.can_view_statistics == true.



1446
1447
1448
1449
1450
1451
# File 'lib/tdlib/client_methods.rb', line 1446

def get_chat_statistics_url(chat_id, parameters, is_dark)
  broadcast('@type'      => 'getChatStatisticsUrl',
            'chat_id'    => chat_id,
            'parameters' => parameters,
            'is_dark'    => is_dark)
end

#get_chats(chat_list, offset_order, offset_chat_id, limit) ⇒ TD::Types::Chats

Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library.



1465
1466
1467
1468
1469
1470
1471
# File 'lib/tdlib/client_methods.rb', line 1465

def get_chats(chat_list, offset_order, offset_chat_id, limit)
  broadcast('@type'          => 'getChats',
            'chat_list'      => chat_list,
            'offset_order'   => offset_order,
            'offset_chat_id' => offset_chat_id,
            'limit'          => limit)
end

#get_connected_websitesTD::Types::ConnectedWebsites

Returns all website where the current user used Telegram to log in.



1476
1477
1478
# File 'lib/tdlib/client_methods.rb', line 1476

def get_connected_websites
  broadcast('@type' => 'getConnectedWebsites')
end

#get_contactsTD::Types::Users

Returns all user contacts.



1483
1484
1485
# File 'lib/tdlib/client_methods.rb', line 1483

def get_contacts
  broadcast('@type' => 'getContacts')
end

#get_country_codeTD::Types::Text

Uses current user IP to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization.



1492
1493
1494
# File 'lib/tdlib/client_methods.rb', line 1492

def get_country_code
  broadcast('@type' => 'getCountryCode')
end

#get_created_public_chats(type) ⇒ TD::Types::Chats

Returns a list of public chats of the specified type, owned by the user.



1500
1501
1502
1503
# File 'lib/tdlib/client_methods.rb', line 1500

def get_created_public_chats(type)
  broadcast('@type' => 'getCreatedPublicChats',
            'type'  => type)
end

#get_current_stateTD::Types::Updates

Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially usefull if TDLib is run in a separate process. This is an offline method. Can be called before authorization.



1512
1513
1514
# File 'lib/tdlib/client_methods.rb', line 1512

def get_current_state
  broadcast('@type' => 'getCurrentState')
end

#get_database_statisticsTD::Types::DatabaseStatistics

Returns database statistics.



1519
1520
1521
# File 'lib/tdlib/client_methods.rb', line 1519

def get_database_statistics
  broadcast('@type' => 'getDatabaseStatistics')
end

Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization.



1530
1531
1532
1533
# File 'lib/tdlib/client_methods.rb', line 1530

def get_deep_link_info(link)
  broadcast('@type' => 'getDeepLinkInfo',
            'link'  => link)
end

#get_emoji_suggestions_url(language_code) ⇒ TD::Types::HttpUrl

Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation.



1541
1542
1543
1544
# File 'lib/tdlib/client_methods.rb', line 1541

def get_emoji_suggestions_url(language_code)
  broadcast('@type'         => 'getEmojiSuggestionsUrl',
            'language_code' => language_code)
end

#get_favorite_stickersTD::Types::Stickers

Returns favorite stickers.



1549
1550
1551
# File 'lib/tdlib/client_methods.rb', line 1549

def get_favorite_stickers
  broadcast('@type' => 'getFavoriteStickers')
end

#get_file(file_id) ⇒ TD::Types::File

Returns information about a file; this is an offline request.



1557
1558
1559
1560
# File 'lib/tdlib/client_methods.rb', line 1557

def get_file(file_id)
  broadcast('@type'   => 'getFile',
            'file_id' => file_id)
end

#get_file_downloaded_prefix_size(file_id, offset) ⇒ TD::Types::Count

Returns file downloaded prefix size from a given offset.



1567
1568
1569
1570
1571
# File 'lib/tdlib/client_methods.rb', line 1567

def get_file_downloaded_prefix_size(file_id, offset)
  broadcast('@type'   => 'getFileDownloadedPrefixSize',
            'file_id' => file_id,
            'offset'  => offset)
end

#get_file_extension(mime_type) ⇒ TD::Types::Text

Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously.



1581
1582
1583
1584
# File 'lib/tdlib/client_methods.rb', line 1581

def get_file_extension(mime_type)
  broadcast('@type'     => 'getFileExtension',
            'mime_type' => mime_type)
end

#get_file_mime_type(file_name) ⇒ TD::Types::Text

Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously.



1594
1595
1596
1597
# File 'lib/tdlib/client_methods.rb', line 1594

def get_file_mime_type(file_name)
  broadcast('@type'     => 'getFileMimeType',
            'file_name' => file_name)
end

#get_game_high_scores(chat_id, message_id, user_id) ⇒ TD::Types::GameHighScores

Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only.



1606
1607
1608
1609
1610
1611
# File 'lib/tdlib/client_methods.rb', line 1606

def get_game_high_scores(chat_id, message_id, user_id)
  broadcast('@type'      => 'getGameHighScores',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'user_id'    => user_id)
end

#get_groups_in_common(user_id, offset_chat_id, limit) ⇒ TD::Types::Chats

Returns a list of common group chats with a given user. Chats are sorted by their type and creation date.



1620
1621
1622
1623
1624
1625
# File 'lib/tdlib/client_methods.rb', line 1620

def get_groups_in_common(user_id, offset_chat_id, limit)
  broadcast('@type'          => 'getGroupsInCommon',
            'user_id'        => user_id,
            'offset_chat_id' => offset_chat_id,
            'limit'          => limit)
end

#get_imported_contact_countTD::Types::Count

Returns the total number of imported contacts.



1630
1631
1632
# File 'lib/tdlib/client_methods.rb', line 1630

def get_imported_contact_count
  broadcast('@type' => 'getImportedContactCount')
end

#get_inactive_supergroup_chatsTD::Types::Chats

Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error.



1639
1640
1641
# File 'lib/tdlib/client_methods.rb', line 1639

def get_inactive_supergroup_chats
  broadcast('@type' => 'getInactiveSupergroupChats')
end

#get_inline_game_high_scores(inline_message_id, user_id) ⇒ TD::Types::GameHighScores

Returns game high scores and some part of the high score table in the range of the specified user; for bots only.



1648
1649
1650
1651
1652
# File 'lib/tdlib/client_methods.rb', line 1648

def get_inline_game_high_scores(inline_message_id, user_id)
  broadcast('@type'             => 'getInlineGameHighScores',
            'inline_message_id' => inline_message_id,
            'user_id'           => user_id)
end

#get_inline_query_results(bot_user_id, chat_id, user_location, query, offset) ⇒ TD::Types::InlineQueryResults

Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires.



1663
1664
1665
1666
1667
1668
1669
1670
# File 'lib/tdlib/client_methods.rb', line 1663

def get_inline_query_results(bot_user_id, chat_id, user_location, query, offset)
  broadcast('@type'         => 'getInlineQueryResults',
            'bot_user_id'   => bot_user_id,
            'chat_id'       => chat_id,
            'user_location' => user_location,
            'query'         => query,
            'offset'        => offset)
end

#get_installed_sticker_sets(is_masks) ⇒ TD::Types::StickerSets

Returns a list of installed sticker sets.



1676
1677
1678
1679
# File 'lib/tdlib/client_methods.rb', line 1676

def get_installed_sticker_sets(is_masks)
  broadcast('@type'    => 'getInstalledStickerSets',
            'is_masks' => is_masks)
end

#get_invite_textTD::Types::Text

Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram.



1685
1686
1687
# File 'lib/tdlib/client_methods.rb', line 1685

def get_invite_text
  broadcast('@type' => 'getInviteText')
end

#get_json_string(json_value) ⇒ TD::Types::Text

Converts a JsonValue object to corresponding JSON-serialized string. This is an offline method. Can be called before authorization. Can be called synchronously.



1696
1697
1698
1699
# File 'lib/tdlib/client_methods.rb', line 1696

def get_json_string(json_value)
  broadcast('@type'      => 'getJsonString',
            'json_value' => json_value)
end

#get_json_value(json) ⇒ TD::Types::JsonValue

Converts a JSON-serialized string to corresponding JsonValue object. This is an offline method. Can be called before authorization. Can be called synchronously.



1708
1709
1710
1711
# File 'lib/tdlib/client_methods.rb', line 1708

def get_json_value(json)
  broadcast('@type' => 'getJsonValue',
            'json'  => json)
end

#get_language_pack_info(language_pack_id) ⇒ TD::Types::LanguagePackInfo

Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization.



1719
1720
1721
1722
# File 'lib/tdlib/client_methods.rb', line 1719

def get_language_pack_info(language_pack_id)
  broadcast('@type'            => 'getLanguagePackInfo',
            'language_pack_id' => language_pack_id)
end

#get_language_pack_string(language_pack_database_path, localization_target, language_pack_id, key) ⇒ TD::Types::LanguagePackStringValue

Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously.



1735
1736
1737
1738
1739
1740
1741
# File 'lib/tdlib/client_methods.rb', line 1735

def get_language_pack_string(language_pack_database_path, localization_target, language_pack_id, key)
  broadcast('@type'                       => 'getLanguagePackString',
            'language_pack_database_path' => language_pack_database_path,
            'localization_target'         => localization_target,
            'language_pack_id'            => language_pack_id,
            'key'                         => key)
end

#get_language_pack_strings(language_pack_id, keys) ⇒ TD::Types::LanguagePackStrings

Returns strings from a language pack in the current localization target by their keys. Can be called before authorization.



1750
1751
1752
1753
1754
# File 'lib/tdlib/client_methods.rb', line 1750

def get_language_pack_strings(language_pack_id, keys)
  broadcast('@type'            => 'getLanguagePackStrings',
            'language_pack_id' => language_pack_id,
            'keys'             => keys)
end

#get_localization_target_info(only_local) ⇒ TD::Types::LocalizationTargetInfo

Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization.



1762
1763
1764
1765
# File 'lib/tdlib/client_methods.rb', line 1762

def get_localization_target_info(only_local)
  broadcast('@type'      => 'getLocalizationTargetInfo',
            'only_local' => only_local)
end

#get_log_streamTD::Types::LogStream

Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously.



1773
1774
1775
# File 'lib/tdlib/client_methods.rb', line 1773

def get_log_stream
  broadcast('@type' => 'getLogStream')
end

#get_log_tag_verbosity_level(tag) ⇒ TD::Types::LogVerbosityLevel

Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously.



1784
1785
1786
1787
# File 'lib/tdlib/client_methods.rb', line 1784

def get_log_tag_verbosity_level(tag)
  broadcast('@type' => 'getLogTagVerbosityLevel',
            'tag'   => tag)
end

#get_log_tagsTD::Types::LogTags

Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. This is an offline method. Can be called before authorization. Can be called synchronously.



1796
1797
1798
# File 'lib/tdlib/client_methods.rb', line 1796

def get_log_tags
  broadcast('@type' => 'getLogTags')
end

#get_log_verbosity_levelTD::Types::LogVerbosityLevel

Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously.



1806
1807
1808
# File 'lib/tdlib/client_methods.rb', line 1806

def get_log_verbosity_level
  broadcast('@type' => 'getLogVerbosityLevel')
end

#get_login_url(chat_id, message_id, button_id, allow_write_access) ⇒ TD::Types::HttpUrl

Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button.



1820
1821
1822
1823
1824
1825
1826
# File 'lib/tdlib/client_methods.rb', line 1820

def (chat_id, message_id, button_id, allow_write_access)
  broadcast('@type'              => 'getLoginUrl',
            'chat_id'            => chat_id,
            'message_id'         => message_id,
            'button_id'          => button_id,
            'allow_write_access' => allow_write_access)
end

#get_login_url_info(chat_id, message_id, button_id) ⇒ TD::Types::LoginUrlInfo

Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button.



1835
1836
1837
1838
1839
1840
# File 'lib/tdlib/client_methods.rb', line 1835

def (chat_id, message_id, button_id)
  broadcast('@type'      => 'getLoginUrlInfo',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'button_id'  => button_id)
end

#get_map_thumbnail_file(location, zoom, width, height, scale, chat_id) ⇒ TD::Types::File

Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded.



1853
1854
1855
1856
1857
1858
1859
1860
1861
# File 'lib/tdlib/client_methods.rb', line 1853

def get_map_thumbnail_file(location, zoom, width, height, scale, chat_id)
  broadcast('@type'    => 'getMapThumbnailFile',
            'location' => location,
            'zoom'     => zoom,
            'width'    => width,
            'height'   => height,
            'scale'    => scale,
            'chat_id'  => chat_id)
end

#get_meTD::Types::User

Returns the current user.



1866
1867
1868
# File 'lib/tdlib/client_methods.rb', line 1866

def get_me
  broadcast('@type' => 'getMe')
end

#get_message(chat_id, message_id) ⇒ TD::Types::Message

Returns information about a message.



1875
1876
1877
1878
1879
# File 'lib/tdlib/client_methods.rb', line 1875

def get_message(chat_id, message_id)
  broadcast('@type'      => 'getMessage',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat.



1888
1889
1890
1891
1892
# File 'lib/tdlib/client_methods.rb', line 1888

def get_message_link(chat_id, message_id)
  broadcast('@type'      => 'getMessageLink',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

Returns information about a public or private message link.



1899
1900
1901
1902
# File 'lib/tdlib/client_methods.rb', line 1899

def get_message_link_info(url)
  broadcast('@type' => 'getMessageLinkInfo',
            'url'   => url)
end

#get_message_locally(chat_id, message_id) ⇒ TD::Types::Message

Returns information about a message, if it is available locally without sending network request. This is an offline request.



1910
1911
1912
1913
1914
# File 'lib/tdlib/client_methods.rb', line 1910

def get_message_locally(chat_id, message_id)
  broadcast('@type'      => 'getMessageLocally',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_messages(chat_id, message_ids) ⇒ TD::Types::Messages

Returns information about messages. If a message is not found, returns null on the corresponding position of the result.



1922
1923
1924
1925
1926
# File 'lib/tdlib/client_methods.rb', line 1922

def get_messages(chat_id, message_ids)
  broadcast('@type'       => 'getMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids)
end

#get_network_statistics(only_current) ⇒ TD::Types::NetworkStatistics

Returns network data usage statistics. Can be called before authorization.



1933
1934
1935
1936
# File 'lib/tdlib/client_methods.rb', line 1933

def get_network_statistics(only_current)
  broadcast('@type'        => 'getNetworkStatistics',
            'only_current' => only_current)
end

#get_option(name) ⇒ TD::Types::OptionValue

Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization.



1944
1945
1946
1947
# File 'lib/tdlib/client_methods.rb', line 1944

def get_option(name)
  broadcast('@type' => 'getOption',
            'name'  => name)
end

#get_passport_authorization_form(bot_user_id, scope, public_key, nonce) ⇒ TD::Types::PassportAuthorizationForm

Returns a Telegram Passport authorization form for sharing data with a service.



1956
1957
1958
1959
1960
1961
1962
# File 'lib/tdlib/client_methods.rb', line 1956

def get_passport_authorization_form(bot_user_id, scope, public_key, nonce)
  broadcast('@type'       => 'getPassportAuthorizationForm',
            'bot_user_id' => bot_user_id,
            'scope'       => scope,
            'public_key'  => public_key,
            'nonce'       => nonce)
end

#get_passport_authorization_form_available_elements(autorization_form_id, password) ⇒ TD::Types::PassportElementsWithErrors

Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form.



1971
1972
1973
1974
1975
# File 'lib/tdlib/client_methods.rb', line 1971

def get_passport_authorization_form_available_elements(autorization_form_id, password)
  broadcast('@type'                => 'getPassportAuthorizationFormAvailableElements',
            'autorization_form_id' => autorization_form_id,
            'password'             => password)
end

#get_passport_element(type, password) ⇒ TD::Types::PassportElement

Returns one of the available Telegram Passport elements.



1982
1983
1984
1985
1986
# File 'lib/tdlib/client_methods.rb', line 1982

def get_passport_element(type, password)
  broadcast('@type'    => 'getPassportElement',
            'type'     => type,
            'password' => password)
end

#get_password_stateTD::Types::PasswordState

Returns the current state of 2-step verification.



1991
1992
1993
# File 'lib/tdlib/client_methods.rb', line 1991

def get_password_state
  broadcast('@type' => 'getPasswordState')
end

#get_payment_form(chat_id, message_id) ⇒ TD::Types::PaymentForm

Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy.



2001
2002
2003
2004
2005
# File 'lib/tdlib/client_methods.rb', line 2001

def get_payment_form(chat_id, message_id)
  broadcast('@type'      => 'getPaymentForm',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_payment_receipt(chat_id, message_id) ⇒ TD::Types::PaymentReceipt

Returns information about a successful payment.



2012
2013
2014
2015
2016
# File 'lib/tdlib/client_methods.rb', line 2012

def get_payment_receipt(chat_id, message_id)
  broadcast('@type'      => 'getPaymentReceipt',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_preferred_country_language(country_code) ⇒ TD::Types::Text

Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown.



2024
2025
2026
2027
# File 'lib/tdlib/client_methods.rb', line 2024

def get_preferred_country_language(country_code)
  broadcast('@type'        => 'getPreferredCountryLanguage',
            'country_code' => country_code)
end

#get_proxiesTD::Types::Proxies

Returns list of proxies that are currently set up. Can be called before authorization.



2033
2034
2035
# File 'lib/tdlib/client_methods.rb', line 2033

def get_proxies
  broadcast('@type' => 'getProxies')
end

Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization.



2043
2044
2045
2046
# File 'lib/tdlib/client_methods.rb', line 2043

def get_proxy_link(proxy_id)
  broadcast('@type'    => 'getProxyLink',
            'proxy_id' => proxy_id)
end

Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username.



2055
2056
2057
2058
2059
2060
# File 'lib/tdlib/client_methods.rb', line 2055

def get_public_message_link(chat_id, message_id, for_album)
  broadcast('@type'      => 'getPublicMessageLink',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'for_album'  => for_album)
end

#get_push_receiver_id(payload) ⇒ TD::Types::PushReceiverId

Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously.



2070
2071
2072
2073
# File 'lib/tdlib/client_methods.rb', line 2070

def get_push_receiver_id(payload)
  broadcast('@type'   => 'getPushReceiverId',
            'payload' => payload)
end

#get_recent_inline_botsTD::Types::Users

Returns up to 20 recently used inline bots in the order of their last usage.



2078
2079
2080
# File 'lib/tdlib/client_methods.rb', line 2078

def get_recent_inline_bots
  broadcast('@type' => 'getRecentInlineBots')
end

#get_recent_stickers(is_attached) ⇒ TD::Types::Stickers

Returns a list of recently used stickers.



2087
2088
2089
2090
# File 'lib/tdlib/client_methods.rb', line 2087

def get_recent_stickers(is_attached)
  broadcast('@type'       => 'getRecentStickers',
            'is_attached' => is_attached)
end

#get_recently_visited_t_me_urls(referrer) ⇒ TD::Types::TMeUrls

Returns t.me URLs recently visited by a newly registered user.



2096
2097
2098
2099
# File 'lib/tdlib/client_methods.rb', line 2096

def get_recently_visited_t_me_urls(referrer)
  broadcast('@type'    => 'getRecentlyVisitedTMeUrls',
            'referrer' => referrer)
end

#get_recovery_email_address(password) ⇒ TD::Types::RecoveryEmailAddress

Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user.



2106
2107
2108
2109
# File 'lib/tdlib/client_methods.rb', line 2106

def get_recovery_email_address(password)
  broadcast('@type'    => 'getRecoveryEmailAddress',
            'password' => password)
end

#get_remote_file(remote_file_id, file_type) ⇒ TD::Types::File

Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client.



2120
2121
2122
2123
2124
# File 'lib/tdlib/client_methods.rb', line 2120

def get_remote_file(remote_file_id, file_type)
  broadcast('@type'          => 'getRemoteFile',
            'remote_file_id' => remote_file_id,
            'file_type'      => file_type)
end

#get_replied_message(chat_id, message_id) ⇒ TD::Types::Message

Returns information about a message that is replied by given message.



2131
2132
2133
2134
2135
# File 'lib/tdlib/client_methods.rb', line 2131

def get_replied_message(chat_id, message_id)
  broadcast('@type'      => 'getRepliedMessage',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_saved_animationsTD::Types::Animations

Returns saved animations.



2140
2141
2142
# File 'lib/tdlib/client_methods.rb', line 2140

def get_saved_animations
  broadcast('@type' => 'getSavedAnimations')
end

#get_saved_order_infoTD::Types::OrderInfo

Returns saved order info, if any.



2147
2148
2149
# File 'lib/tdlib/client_methods.rb', line 2147

def get_saved_order_info
  broadcast('@type' => 'getSavedOrderInfo')
end

#get_scope_notification_settings(scope) ⇒ TD::Types::ScopeNotificationSettings

Returns the notification settings for chats of a given type.



2156
2157
2158
2159
# File 'lib/tdlib/client_methods.rb', line 2156

def get_scope_notification_settings(scope)
  broadcast('@type' => 'getScopeNotificationSettings',
            'scope' => scope)
end

#get_secret_chat(secret_chat_id) ⇒ TD::Types::SecretChat

Returns information about a secret chat by its identifier. This is an offline request.



2166
2167
2168
2169
# File 'lib/tdlib/client_methods.rb', line 2166

def get_secret_chat(secret_chat_id)
  broadcast('@type'          => 'getSecretChat',
            'secret_chat_id' => secret_chat_id)
end

#get_sticker_emojis(sticker) ⇒ TD::Types::Emojis

Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object.



2177
2178
2179
2180
# File 'lib/tdlib/client_methods.rb', line 2177

def get_sticker_emojis(sticker)
  broadcast('@type'   => 'getStickerEmojis',
            'sticker' => sticker)
end

#get_sticker_set(set_id) ⇒ TD::Types::StickerSet

Returns information about a sticker set by its identifier.



2186
2187
2188
2189
# File 'lib/tdlib/client_methods.rb', line 2186

def get_sticker_set(set_id)
  broadcast('@type'  => 'getStickerSet',
            'set_id' => set_id)
end

#get_stickers(emoji, limit) ⇒ TD::Types::Stickers

Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned.



2198
2199
2200
2201
2202
# File 'lib/tdlib/client_methods.rb', line 2198

def get_stickers(emoji, limit)
  broadcast('@type' => 'getStickers',
            'emoji' => emoji,
            'limit' => limit)
end

#get_storage_statistics(chat_limit) ⇒ TD::Types::StorageStatistics

Returns storage usage statistics. Can be called before authorization.



2212
2213
2214
2215
# File 'lib/tdlib/client_methods.rb', line 2212

def get_storage_statistics(chat_limit)
  broadcast('@type'      => 'getStorageStatistics',
            'chat_limit' => chat_limit)
end

#get_storage_statistics_fastTD::Types::StorageStatisticsFast

Quickly returns approximate storage usage statistics. Can be called before authorization.



2221
2222
2223
# File 'lib/tdlib/client_methods.rb', line 2221

def get_storage_statistics_fast
  broadcast('@type' => 'getStorageStatisticsFast')
end

#get_suitable_discussion_chatsTD::Types::Chats

Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group.



2229
2230
2231
# File 'lib/tdlib/client_methods.rb', line 2229

def get_suitable_discussion_chats
  broadcast('@type' => 'getSuitableDiscussionChats')
end

#get_supergroup(supergroup_id) ⇒ TD::Types::Supergroup

Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot.



2238
2239
2240
2241
# File 'lib/tdlib/client_methods.rb', line 2238

def get_supergroup(supergroup_id)
  broadcast('@type'         => 'getSupergroup',
            'supergroup_id' => supergroup_id)
end

#get_supergroup_full_info(supergroup_id) ⇒ TD::Types::SupergroupFullInfo

Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute.



2247
2248
2249
2250
# File 'lib/tdlib/client_methods.rb', line 2247

def get_supergroup_full_info(supergroup_id)
  broadcast('@type'         => 'getSupergroupFullInfo',
            'supergroup_id' => supergroup_id)
end

#get_supergroup_members(supergroup_id, filter, offset, limit) ⇒ TD::Types::ChatMembers

Returns information about members or banned users in a supergroup or channel. Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters.



2262
2263
2264
2265
2266
2267
2268
# File 'lib/tdlib/client_methods.rb', line 2262

def get_supergroup_members(supergroup_id, filter, offset, limit)
  broadcast('@type'         => 'getSupergroupMembers',
            'supergroup_id' => supergroup_id,
            'filter'        => filter,
            'offset'        => offset,
            'limit'         => limit)
end

#get_support_userTD::Types::User

Returns a user that can be contacted to get support.



2273
2274
2275
# File 'lib/tdlib/client_methods.rb', line 2273

def get_support_user
  broadcast('@type' => 'getSupportUser')
end

#get_temporary_password_stateTD::Types::TemporaryPasswordState

Returns information about the current temporary password.



2280
2281
2282
# File 'lib/tdlib/client_methods.rb', line 2280

def get_temporary_password_state
  broadcast('@type' => 'getTemporaryPasswordState')
end

#get_text_entities(text) ⇒ TD::Types::TextEntities

Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously.



2291
2292
2293
2294
# File 'lib/tdlib/client_methods.rb', line 2291

def get_text_entities(text)
  broadcast('@type' => 'getTextEntities',
            'text'  => text)
end

#get_ton_wallet_password_saltTD::Types::TonWalletPasswordSalt

Returns a salt to be used with locally stored password to access a local TON-based wallet.



2299
2300
2301
# File 'lib/tdlib/client_methods.rb', line 2299

def get_ton_wallet_password_salt
  broadcast('@type' => 'getTonWalletPasswordSalt')
end

#get_top_chats(category, limit) ⇒ TD::Types::Chats

Returns a list of frequently used chats. Supported only if the chat info database is enabled.



2309
2310
2311
2312
2313
# File 'lib/tdlib/client_methods.rb', line 2309

def get_top_chats(category, limit)
  broadcast('@type'    => 'getTopChats',
            'category' => category,
            'limit'    => limit)
end

Returns a list of trending sticker sets.



2318
2319
2320
# File 'lib/tdlib/client_methods.rb', line 2318

def get_trending_sticker_sets
  broadcast('@type' => 'getTrendingStickerSets')
end

#get_user(user_id) ⇒ TD::Types::User

Returns information about a user by their identifier. This is an offline request if the current user is not a bot.



2327
2328
2329
2330
# File 'lib/tdlib/client_methods.rb', line 2327

def get_user(user_id)
  broadcast('@type'   => 'getUser',
            'user_id' => user_id)
end

#get_user_full_info(user_id) ⇒ TD::Types::UserFullInfo

Returns full information about a user by their identifier.



2336
2337
2338
2339
# File 'lib/tdlib/client_methods.rb', line 2336

def get_user_full_info(user_id)
  broadcast('@type'   => 'getUserFullInfo',
            'user_id' => user_id)
end

#get_user_privacy_setting_rules(setting) ⇒ TD::Types::UserPrivacySettingRules

Returns the current privacy settings.



2345
2346
2347
2348
# File 'lib/tdlib/client_methods.rb', line 2345

def get_user_privacy_setting_rules(setting)
  broadcast('@type'   => 'getUserPrivacySettingRules',
            'setting' => setting)
end

#get_user_profile_photos(user_id, offset, limit) ⇒ TD::Types::UserProfilePhotos

Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already.



2357
2358
2359
2360
2361
2362
# File 'lib/tdlib/client_methods.rb', line 2357

def (user_id, offset, limit)
  broadcast('@type'   => 'getUserProfilePhotos',
            'user_id' => user_id,
            'offset'  => offset,
            'limit'   => limit)
end

#get_web_page_instant_view(url, force_full) ⇒ TD::Types::WebPageInstantView

Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page.



2370
2371
2372
2373
2374
# File 'lib/tdlib/client_methods.rb', line 2370

def get_web_page_instant_view(url, force_full)
  broadcast('@type'      => 'getWebPageInstantView',
            'url'        => url,
            'force_full' => force_full)
end

#get_web_page_preview(text) ⇒ TD::Types::WebPage

Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview.



2382
2383
2384
2385
# File 'lib/tdlib/client_methods.rb', line 2382

def get_web_page_preview(text)
  broadcast('@type' => 'getWebPagePreview',
            'text'  => text)
end

#import_contacts(contacts) ⇒ TD::Types::ImportedContacts

Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored.



2392
2393
2394
2395
# File 'lib/tdlib/client_methods.rb', line 2392

def import_contacts(contacts)
  broadcast('@type'    => 'importContacts',
            'contacts' => contacts)
end

#join_chat(chat_id) ⇒ TD::Types::Ok

Adds current user as a new member to a chat. Private and secret chats can't be joined using this method.



2402
2403
2404
2405
# File 'lib/tdlib/client_methods.rb', line 2402

def join_chat(chat_id)
  broadcast('@type'   => 'joinChat',
            'chat_id' => chat_id)
end

Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server.



2413
2414
2415
2416
# File 'lib/tdlib/client_methods.rb', line 2413

def join_chat_by_invite_link(invite_link)
  broadcast('@type'       => 'joinChatByInviteLink',
            'invite_link' => invite_link)
end

#leave_chat(chat_id) ⇒ TD::Types::Ok

Removes current user from chat members. Private and secret chats can't be left using this method.



2423
2424
2425
2426
# File 'lib/tdlib/client_methods.rb', line 2423

def leave_chat(chat_id)
  broadcast('@type'   => 'leaveChat',
            'chat_id' => chat_id)
end

#log_outTD::Types::Ok

Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent.



2434
2435
2436
# File 'lib/tdlib/client_methods.rb', line 2434

def log_out
  broadcast('@type' => 'logOut')
end

#open_chat(chat_id) ⇒ TD::Types::Ok

Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats).



2444
2445
2446
2447
# File 'lib/tdlib/client_methods.rb', line 2444

def open_chat(chat_id)
  broadcast('@type'   => 'openChat',
            'chat_id' => chat_id)
end

#open_message_content(chat_id, message_id) ⇒ TD::Types::Ok

Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed.



2456
2457
2458
2459
2460
# File 'lib/tdlib/client_methods.rb', line 2456

def open_message_content(chat_id, message_id)
  broadcast('@type'      => 'openMessageContent',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#optimize_storage(size, ttl, count, immunity_delay, file_types, chat_ids, exclude_chat_ids, chat_limit) ⇒ TD::Types::StorageStatistics

Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.



2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
# File 'lib/tdlib/client_methods.rb', line 2485

def optimize_storage(size, ttl, count, immunity_delay, file_types, chat_ids, exclude_chat_ids, chat_limit)
  broadcast('@type'            => 'optimizeStorage',
            'size'             => size,
            'ttl'              => ttl,
            'count'            => count,
            'immunity_delay'   => immunity_delay,
            'file_types'       => file_types,
            'chat_ids'         => chat_ids,
            'exclude_chat_ids' => exclude_chat_ids,
            'chat_limit'       => chat_limit)
end

#parse_text_entities(text, parse_mode) ⇒ TD::Types::FormattedText

Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously.



2506
2507
2508
2509
2510
# File 'lib/tdlib/client_methods.rb', line 2506

def parse_text_entities(text, parse_mode)
  broadcast('@type'      => 'parseTextEntities',
            'text'       => text,
            'parse_mode' => parse_mode)
end

#pin_chat_message(chat_id, message_id, disable_notification) ⇒ TD::Types::Ok

Pins a message in a chat; requires can_pin_messages rights.



2518
2519
2520
2521
2522
2523
# File 'lib/tdlib/client_methods.rb', line 2518

def pin_chat_message(chat_id, message_id, disable_notification)
  broadcast('@type'                => 'pinChatMessage',
            'chat_id'              => chat_id,
            'message_id'           => message_id,
            'disable_notification' => disable_notification)
end

#ping_proxy(proxy_id) ⇒ TD::Types::Seconds

Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization.



2531
2532
2533
2534
# File 'lib/tdlib/client_methods.rb', line 2531

def ping_proxy(proxy_id)
  broadcast('@type'    => 'pingProxy',
            'proxy_id' => proxy_id)
end

#process_push_notification(payload) ⇒ TD::Types::Ok

Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization.



2544
2545
2546
2547
# File 'lib/tdlib/client_methods.rb', line 2544

def process_push_notification(payload)
  broadcast('@type'   => 'processPushNotification',
            'payload' => payload)
end

#read_all_chat_mentions(chat_id) ⇒ TD::Types::Ok

Marks all mentions in a chat as read.



2553
2554
2555
2556
# File 'lib/tdlib/client_methods.rb', line 2553

def read_all_chat_mentions(chat_id)
  broadcast('@type'   => 'readAllChatMentions',
            'chat_id' => chat_id)
end

#read_file_part(file_id, offset, count) ⇒ TD::Types::FilePart

Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.



2569
2570
2571
2572
2573
2574
# File 'lib/tdlib/client_methods.rb', line 2569

def read_file_part(file_id, offset, count)
  broadcast('@type'   => 'readFilePart',
            'file_id' => file_id,
            'offset'  => offset,
            'count'   => count)
end

#recover_authentication_password(recovery_code) ⇒ TD::Types::Ok

Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword.



2581
2582
2583
2584
# File 'lib/tdlib/client_methods.rb', line 2581

def recover_authentication_password(recovery_code)
  broadcast('@type'         => 'recoverAuthenticationPassword',
            'recovery_code' => recovery_code)
end

#recover_password(recovery_code) ⇒ TD::Types::PasswordState

Recovers the password using a recovery code sent to an email address that was previously set up.



2590
2591
2592
2593
# File 'lib/tdlib/client_methods.rb', line 2590

def recover_password(recovery_code)
  broadcast('@type'         => 'recoverPassword',
            'recovery_code' => recovery_code)
end

#register_device(device_token, other_user_ids) ⇒ TD::Types::PushReceiverId

Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription.



2601
2602
2603
2604
2605
# File 'lib/tdlib/client_methods.rb', line 2601

def register_device(device_token, other_user_ids)
  broadcast('@type'          => 'registerDevice',
            'device_token'   => device_token,
            'other_user_ids' => other_user_ids)
end

#register_user(first_name, last_name) ⇒ TD::Types::Ok

Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration.



2613
2614
2615
2616
2617
# File 'lib/tdlib/client_methods.rb', line 2613

def register_user(first_name, last_name)
  broadcast('@type'      => 'registerUser',
            'first_name' => first_name,
            'last_name'  => last_name)
end

#remove_background(background_id) ⇒ TD::Types::Ok

Removes background from the list of installed backgrounds.



2623
2624
2625
2626
# File 'lib/tdlib/client_methods.rb', line 2623

def remove_background(background_id)
  broadcast('@type'         => 'removeBackground',
            'background_id' => background_id)
end

#remove_chat_action_bar(chat_id) ⇒ TD::Types::Ok

Removes a chat action bar without any other action.



2632
2633
2634
2635
# File 'lib/tdlib/client_methods.rb', line 2632

def remove_chat_action_bar(chat_id)
  broadcast('@type'   => 'removeChatActionBar',
            'chat_id' => chat_id)
end

#remove_contacts(user_ids) ⇒ TD::Types::Ok

Removes users from the contact list.



2641
2642
2643
2644
# File 'lib/tdlib/client_methods.rb', line 2641

def remove_contacts(user_ids)
  broadcast('@type'    => 'removeContacts',
            'user_ids' => user_ids)
end

#remove_favorite_sticker(sticker) ⇒ TD::Types::Ok

Removes a sticker from the list of favorite stickers.



2650
2651
2652
2653
# File 'lib/tdlib/client_methods.rb', line 2650

def remove_favorite_sticker(sticker)
  broadcast('@type'   => 'removeFavoriteSticker',
            'sticker' => sticker)
end

#remove_notification(notification_group_id, notification_id) ⇒ TD::Types::Ok

Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user.



2661
2662
2663
2664
2665
# File 'lib/tdlib/client_methods.rb', line 2661

def remove_notification(notification_group_id, notification_id)
  broadcast('@type'                 => 'removeNotification',
            'notification_group_id' => notification_group_id,
            'notification_id'       => notification_id)
end

#remove_notification_group(notification_group_id, max_notification_id) ⇒ TD::Types::Ok

Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user.



2673
2674
2675
2676
2677
# File 'lib/tdlib/client_methods.rb', line 2673

def remove_notification_group(notification_group_id, max_notification_id)
  broadcast('@type'                 => 'removeNotificationGroup',
            'notification_group_id' => notification_group_id,
            'max_notification_id'   => max_notification_id)
end

#remove_proxy(proxy_id) ⇒ TD::Types::Ok

Removes a proxy server. Can be called before authorization.



2684
2685
2686
2687
# File 'lib/tdlib/client_methods.rb', line 2684

def remove_proxy(proxy_id)
  broadcast('@type'    => 'removeProxy',
            'proxy_id' => proxy_id)
end

#remove_recent_hashtag(hashtag) ⇒ TD::Types::Ok

Removes a hashtag from the list of recently used hashtags.



2693
2694
2695
2696
# File 'lib/tdlib/client_methods.rb', line 2693

def remove_recent_hashtag(hashtag)
  broadcast('@type'   => 'removeRecentHashtag',
            'hashtag' => hashtag)
end

#remove_recent_sticker(is_attached, sticker) ⇒ TD::Types::Ok

Removes a sticker from the list of recently used stickers.



2704
2705
2706
2707
2708
# File 'lib/tdlib/client_methods.rb', line 2704

def remove_recent_sticker(is_attached, sticker)
  broadcast('@type'       => 'removeRecentSticker',
            'is_attached' => is_attached,
            'sticker'     => sticker)
end

#remove_recently_found_chat(chat_id) ⇒ TD::Types::Ok

Removes a chat from the list of recently found chats.



2714
2715
2716
2717
# File 'lib/tdlib/client_methods.rb', line 2714

def remove_recently_found_chat(chat_id)
  broadcast('@type'   => 'removeRecentlyFoundChat',
            'chat_id' => chat_id)
end

#remove_saved_animation(animation) ⇒ TD::Types::Ok

Removes an animation from the list of saved animations.



2723
2724
2725
2726
# File 'lib/tdlib/client_methods.rb', line 2723

def remove_saved_animation(animation)
  broadcast('@type'     => 'removeSavedAnimation',
            'animation' => animation)
end

#remove_sticker_from_set(sticker) ⇒ TD::Types::Ok

Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot.



2733
2734
2735
2736
# File 'lib/tdlib/client_methods.rb', line 2733

def remove_sticker_from_set(sticker)
  broadcast('@type'   => 'removeStickerFromSet',
            'sticker' => sticker)
end

#remove_top_chat(category, chat_id) ⇒ TD::Types::Ok

Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled.



2744
2745
2746
2747
2748
# File 'lib/tdlib/client_methods.rb', line 2744

def remove_top_chat(category, chat_id)
  broadcast('@type'    => 'removeTopChat',
            'category' => category,
            'chat_id'  => chat_id)
end

#reorder_installed_sticker_sets(is_masks, sticker_set_ids) ⇒ TD::Types::Ok

Changes the order of installed sticker sets.



2756
2757
2758
2759
2760
# File 'lib/tdlib/client_methods.rb', line 2756

def reorder_installed_sticker_sets(is_masks, sticker_set_ids)
  broadcast('@type'           => 'reorderInstalledStickerSets',
            'is_masks'        => is_masks,
            'sticker_set_ids' => sticker_set_ids)
end

#report_chat(chat_id, reason, message_ids) ⇒ TD::Types::Ok

Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can't be checked by moderators, or when the report is done from the chat action bar.



2770
2771
2772
2773
2774
2775
# File 'lib/tdlib/client_methods.rb', line 2770

def report_chat(chat_id, reason, message_ids)
  broadcast('@type'       => 'reportChat',
            'chat_id'     => chat_id,
            'reason'      => reason,
            'message_ids' => message_ids)
end

#report_supergroup_spam(supergroup_id, user_id, message_ids) ⇒ TD::Types::Ok

Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup.



2784
2785
2786
2787
2788
2789
# File 'lib/tdlib/client_methods.rb', line 2784

def report_supergroup_spam(supergroup_id, user_id, message_ids)
  broadcast('@type'         => 'reportSupergroupSpam',
            'supergroup_id' => supergroup_id,
            'user_id'       => user_id,
            'message_ids'   => message_ids)
end

#request_authentication_password_recoveryTD::Types::Ok

Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword.



2795
2796
2797
# File 'lib/tdlib/client_methods.rb', line 2795

def request_authentication_password_recovery
  broadcast('@type' => 'requestAuthenticationPasswordRecovery')
end

#request_password_recoveryTD::Types::EmailAddressAuthenticationCodeInfo

Requests to send a password recovery code to an email address that was previously set up.



2802
2803
2804
# File 'lib/tdlib/client_methods.rb', line 2802

def request_password_recovery
  broadcast('@type' => 'requestPasswordRecovery')
end

#request_qr_code_authentication(other_user_ids) ⇒ TD::Types::Ok

Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber.



2811
2812
2813
2814
# File 'lib/tdlib/client_methods.rb', line 2811

def request_qr_code_authentication(other_user_ids)
  broadcast('@type'          => 'requestQrCodeAuthentication',
            'other_user_ids' => other_user_ids)
end

#resend_authentication_codeTD::Types::Ok

Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null.



2821
2822
2823
# File 'lib/tdlib/client_methods.rb', line 2821

def resend_authentication_code
  broadcast('@type' => 'resendAuthenticationCode')
end

#resend_change_phone_number_codeTD::Types::AuthenticationCodeInfo

Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null.



2829
2830
2831
# File 'lib/tdlib/client_methods.rb', line 2829

def resend_change_phone_number_code
  broadcast('@type' => 'resendChangePhoneNumberCode')
end

#resend_email_address_verification_codeTD::Types::EmailAddressAuthenticationCodeInfo

Re-sends the code to verify an email address to be added to a user's Telegram Passport.



2836
2837
2838
# File 'lib/tdlib/client_methods.rb', line 2836

def resend_email_address_verification_code
  broadcast('@type' => 'resendEmailAddressVerificationCode')
end

#resend_messages(chat_id, message_ids) ⇒ TD::Types::Messages

Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message.



2851
2852
2853
2854
2855
# File 'lib/tdlib/client_methods.rb', line 2851

def resend_messages(chat_id, message_ids)
  broadcast('@type'       => 'resendMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids)
end

#resend_phone_number_confirmation_codeTD::Types::AuthenticationCodeInfo

Resends phone number confirmation code.



2860
2861
2862
# File 'lib/tdlib/client_methods.rb', line 2860

def resend_phone_number_confirmation_code
  broadcast('@type' => 'resendPhoneNumberConfirmationCode')
end

#resend_phone_number_verification_codeTD::Types::AuthenticationCodeInfo

Re-sends the code to verify a phone number to be added to a user's Telegram Passport.



2867
2868
2869
# File 'lib/tdlib/client_methods.rb', line 2867

def resend_phone_number_verification_code
  broadcast('@type' => 'resendPhoneNumberVerificationCode')
end

#resend_recovery_email_address_codeTD::Types::PasswordState

Resends the 2-step verification recovery email address verification code.



2874
2875
2876
# File 'lib/tdlib/client_methods.rb', line 2874

def resend_recovery_email_address_code
  broadcast('@type' => 'resendRecoveryEmailAddressCode')
end

#reset_all_notification_settingsTD::Types::Ok

Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown.



2882
2883
2884
# File 'lib/tdlib/client_methods.rb', line 2882

def reset_all_notification_settings
  broadcast('@type' => 'resetAllNotificationSettings')
end

#reset_backgroundsTD::Types::Ok

Resets list of installed backgrounds to its default value.



2889
2890
2891
# File 'lib/tdlib/client_methods.rb', line 2889

def reset_backgrounds
  broadcast('@type' => 'resetBackgrounds')
end

#reset_network_statisticsTD::Types::Ok

Resets all network data usage statistics to zero. Can be called before authorization.



2897
2898
2899
# File 'lib/tdlib/client_methods.rb', line 2897

def reset_network_statistics
  broadcast('@type' => 'resetNetworkStatistics')
end

#save_application_log_event(type, chat_id, data) ⇒ TD::Types::Ok

Saves application log event on the server. Can be called before authorization.



2908
2909
2910
2911
2912
2913
# File 'lib/tdlib/client_methods.rb', line 2908

def save_application_log_event(type, chat_id, data)
  broadcast('@type'   => 'saveApplicationLogEvent',
            'type'    => type,
            'chat_id' => chat_id,
            'data'    => data)
end

#search_background(name) ⇒ TD::Types::Background

Searches for a background by its name.



2919
2920
2921
2922
# File 'lib/tdlib/client_methods.rb', line 2919

def search_background(name)
  broadcast('@type' => 'searchBackground',
            'name'  => name)
end

#search_call_messages(from_message_id, limit, only_missed) ⇒ TD::Types::Messages

Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library.



2936
2937
2938
2939
2940
2941
# File 'lib/tdlib/client_methods.rb', line 2936

def search_call_messages(from_message_id, limit, only_missed)
  broadcast('@type'           => 'searchCallMessages',
            'from_message_id' => from_message_id,
            'limit'           => limit,
            'only_missed'     => only_missed)
end

#search_chat_members(chat_id, query, limit, filter) ⇒ TD::Types::ChatMembers

Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels.



2952
2953
2954
2955
2956
2957
2958
# File 'lib/tdlib/client_methods.rb', line 2952

def search_chat_members(chat_id, query, limit, filter)
  broadcast('@type'   => 'searchChatMembers',
            'chat_id' => chat_id,
            'query'   => query,
            'limit'   => limit,
            'filter'  => filter)
end

#search_chat_messages(chat_id, query, sender_user_id, from_message_id, offset, limit, filter) ⇒ TD::Types::Messages

Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library.



2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
# File 'lib/tdlib/client_methods.rb', line 2982

def search_chat_messages(chat_id, query, sender_user_id, from_message_id, offset, limit, filter)
  broadcast('@type'           => 'searchChatMessages',
            'chat_id'         => chat_id,
            'query'           => query,
            'sender_user_id'  => sender_user_id,
            'from_message_id' => from_message_id,
            'offset'          => offset,
            'limit'           => limit,
            'filter'          => filter)
end

#search_chat_recent_location_messages(chat_id, limit) ⇒ TD::Types::Messages

Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user.



2999
3000
3001
3002
3003
# File 'lib/tdlib/client_methods.rb', line 2999

def search_chat_recent_location_messages(chat_id, limit)
  broadcast('@type'   => 'searchChatRecentLocationMessages',
            'chat_id' => chat_id,
            'limit'   => limit)
end

#search_chats(query, limit) ⇒ TD::Types::Chats

Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list.



3012
3013
3014
3015
3016
# File 'lib/tdlib/client_methods.rb', line 3012

def search_chats(query, limit)
  broadcast('@type' => 'searchChats',
            'query' => query,
            'limit' => limit)
end

#search_chats_nearby(location) ⇒ TD::Types::ChatsNearby

Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby. The request should be sent again every 25 seconds with adjusted location to not miss new chats.



3024
3025
3026
3027
# File 'lib/tdlib/client_methods.rb', line 3024

def search_chats_nearby(location)
  broadcast('@type'    => 'searchChatsNearby',
            'location' => location)
end

#search_chats_on_server(query, limit) ⇒ TD::Types::Chats

Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list.



3035
3036
3037
3038
3039
# File 'lib/tdlib/client_methods.rb', line 3035

def search_chats_on_server(query, limit)
  broadcast('@type' => 'searchChatsOnServer',
            'query' => query,
            'limit' => limit)
end

#search_contacts(query = nil, limit) ⇒ TD::Types::Users

Searches for the specified query in the first names, last names and usernames of the known user contacts.



3046
3047
3048
3049
3050
# File 'lib/tdlib/client_methods.rb', line 3046

def search_contacts(query = nil, limit)
  broadcast('@type' => 'searchContacts',
            'query' => query,
            'limit' => limit)
end

#search_emojis(text, exact_match, input_language_code = nil) ⇒ TD::Types::Emojis

Searches for emojis by keywords. Supported only if the file database is enabled.



3059
3060
3061
3062
3063
3064
# File 'lib/tdlib/client_methods.rb', line 3059

def search_emojis(text, exact_match, input_language_code = nil)
  broadcast('@type'               => 'searchEmojis',
            'text'                => text,
            'exact_match'         => exact_match,
            'input_language_code' => input_language_code)
end

#search_hashtags(prefix, limit) ⇒ TD::Types::Hashtags

Searches for recently used hashtags by their prefix.



3071
3072
3073
3074
3075
# File 'lib/tdlib/client_methods.rb', line 3071

def search_hashtags(prefix, limit)
  broadcast('@type'  => 'searchHashtags',
            'prefix' => prefix,
            'limit'  => limit)
end

#search_installed_sticker_sets(is_masks, query, limit) ⇒ TD::Types::StickerSets

Searches for installed sticker sets by looking for specified query in their title and name.



3083
3084
3085
3086
3087
3088
# File 'lib/tdlib/client_methods.rb', line 3083

def search_installed_sticker_sets(is_masks, query, limit)
  broadcast('@type'    => 'searchInstalledStickerSets',
            'is_masks' => is_masks,
            'query'    => query,
            'limit'    => limit)
end

#search_messages(chat_list, query, offset_date, offset_chat_id, offset_message_id, limit) ⇒ TD::Types::Messages

Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance the number of returned messages is chosen by the library.



3105
3106
3107
3108
3109
3110
3111
3112
3113
# File 'lib/tdlib/client_methods.rb', line 3105

def search_messages(chat_list, query, offset_date, offset_chat_id, offset_message_id, limit)
  broadcast('@type'             => 'searchMessages',
            'chat_list'         => chat_list,
            'query'             => query,
            'offset_date'       => offset_date,
            'offset_chat_id'    => offset_chat_id,
            'offset_message_id' => offset_message_id,
            'limit'             => limit)
end

#search_public_chat(username) ⇒ TD::Types::Chat

Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned.



3121
3122
3123
3124
# File 'lib/tdlib/client_methods.rb', line 3121

def search_public_chat(username)
  broadcast('@type'    => 'searchPublicChat',
            'username' => username)
end

#search_public_chats(query) ⇒ TD::Types::Chats

Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results.



3134
3135
3136
3137
# File 'lib/tdlib/client_methods.rb', line 3134

def search_public_chats(query)
  broadcast('@type' => 'searchPublicChats',
            'query' => query)
end

#search_secret_messages(chat_id, query, from_search_id, limit, filter) ⇒ TD::Types::FoundMessages

Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance the number of returned messages is chosen by the library.



3154
3155
3156
3157
3158
3159
3160
3161
# File 'lib/tdlib/client_methods.rb', line 3154

def search_secret_messages(chat_id, query, from_search_id, limit, filter)
  broadcast('@type'          => 'searchSecretMessages',
            'chat_id'        => chat_id,
            'query'          => query,
            'from_search_id' => from_search_id,
            'limit'          => limit,
            'filter'         => filter)
end

#search_sticker_set(name) ⇒ TD::Types::StickerSet

Searches for a sticker set by its name.



3167
3168
3169
3170
# File 'lib/tdlib/client_methods.rb', line 3167

def search_sticker_set(name)
  broadcast('@type' => 'searchStickerSet',
            'name'  => name)
end

#search_sticker_sets(query) ⇒ TD::Types::StickerSets

Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results.



3177
3178
3179
3180
# File 'lib/tdlib/client_methods.rb', line 3177

def search_sticker_sets(query)
  broadcast('@type' => 'searchStickerSets',
            'query' => query)
end

#search_stickers(emoji, limit = nil) ⇒ TD::Types::Stickers

Searches for stickers from public sticker sets that correspond to a given emoji.



3187
3188
3189
3190
3191
# File 'lib/tdlib/client_methods.rb', line 3187

def search_stickers(emoji, limit = nil)
  broadcast('@type' => 'searchStickers',
            'emoji' => emoji,
            'limit' => limit)
end

#send_bot_start_message(bot_user_id, chat_id, parameter) ⇒ TD::Types::Message

Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message.



3203
3204
3205
3206
3207
3208
# File 'lib/tdlib/client_methods.rb', line 3203

def send_bot_start_message(bot_user_id, chat_id, parameter)
  broadcast('@type'       => 'sendBotStartMessage',
            'bot_user_id' => bot_user_id,
            'chat_id'     => chat_id,
            'parameter'   => parameter)
end

#send_call_debug_information(call_id, debug_information) ⇒ TD::Types::Ok

Sends debug information for a call.



3215
3216
3217
3218
3219
# File 'lib/tdlib/client_methods.rb', line 3215

def send_call_debug_information(call_id, debug_information)
  broadcast('@type'             => 'sendCallDebugInformation',
            'call_id'           => call_id,
            'debug_information' => debug_information)
end

#send_call_rating(call_id, rating, comment, problems) ⇒ TD::Types::Ok

Sends a call rating.



3229
3230
3231
3232
3233
3234
3235
# File 'lib/tdlib/client_methods.rb', line 3229

def send_call_rating(call_id, rating, comment, problems)
  broadcast('@type'    => 'sendCallRating',
            'call_id'  => call_id,
            'rating'   => rating,
            'comment'  => comment,
            'problems' => problems)
end

#send_chat_action(chat_id, action) ⇒ TD::Types::Ok

Sends a notification about user activity in a chat.



3242
3243
3244
3245
3246
# File 'lib/tdlib/client_methods.rb', line 3242

def send_chat_action(chat_id, action)
  broadcast('@type'   => 'sendChatAction',
            'chat_id' => chat_id,
            'action'  => action)
end

#send_chat_screenshot_taken_notification(chat_id) ⇒ TD::Types::Ok

Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats.



3253
3254
3255
3256
# File 'lib/tdlib/client_methods.rb', line 3253

def send_chat_screenshot_taken_notification(chat_id)
  broadcast('@type'   => 'sendChatScreenshotTakenNotification',
            'chat_id' => chat_id)
end

#send_chat_set_ttl_message(chat_id, ttl) ⇒ TD::Types::Message

Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message.



3264
3265
3266
3267
3268
# File 'lib/tdlib/client_methods.rb', line 3264

def send_chat_set_ttl_message(chat_id, ttl)
  broadcast('@type'   => 'sendChatSetTtlMessage',
            'chat_id' => chat_id,
            'ttl'     => ttl)
end

#send_custom_request(method, parameters) ⇒ TD::Types::CustomRequestResult

Sends a custom request; for bots only.



3275
3276
3277
3278
3279
# File 'lib/tdlib/client_methods.rb', line 3275

def send_custom_request(method, parameters)
  broadcast('@type'      => 'sendCustomRequest',
            'method'     => method,
            'parameters' => parameters)
end

#send_email_address_verification_code(email_address) ⇒ TD::Types::EmailAddressAuthenticationCodeInfo

Sends a code to verify an email address to be added to a user's Telegram Passport.



3285
3286
3287
3288
# File 'lib/tdlib/client_methods.rb', line 3285

def send_email_address_verification_code(email_address)
  broadcast('@type'         => 'sendEmailAddressVerificationCode',
            'email_address' => email_address)
end

#send_inline_query_result_message(chat_id, reply_to_message_id, options, query_id, result_id, hide_via_bot) ⇒ TD::Types::Message

Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message.



3303
3304
3305
3306
3307
3308
3309
3310
3311
# File 'lib/tdlib/client_methods.rb', line 3303

def send_inline_query_result_message(chat_id, reply_to_message_id, options, query_id, result_id, hide_via_bot)
  broadcast('@type'               => 'sendInlineQueryResultMessage',
            'chat_id'             => chat_id,
            'reply_to_message_id' => reply_to_message_id,
            'options'             => options,
            'query_id'            => query_id,
            'result_id'           => result_id,
            'hide_via_bot'        => hide_via_bot)
end

#send_message(chat_id, reply_to_message_id, options, reply_markup, input_message_content) ⇒ TD::Types::Message

Sends a message. Returns the sent message.



3322
3323
3324
3325
3326
3327
3328
3329
# File 'lib/tdlib/client_methods.rb', line 3322

def send_message(chat_id, reply_to_message_id, options, reply_markup, input_message_content)
  broadcast('@type'                 => 'sendMessage',
            'chat_id'               => chat_id,
            'reply_to_message_id'   => reply_to_message_id,
            'options'               => options,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#send_message_album(chat_id, reply_to_message_id, options, input_message_contents) ⇒ TD::Types::Messages

Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages.



3340
3341
3342
3343
3344
3345
3346
# File 'lib/tdlib/client_methods.rb', line 3340

def send_message_album(chat_id, reply_to_message_id, options, input_message_contents)
  broadcast('@type'                  => 'sendMessageAlbum',
            'chat_id'                => chat_id,
            'reply_to_message_id'    => reply_to_message_id,
            'options'                => options,
            'input_message_contents' => input_message_contents)
end

#send_passport_authorization_form(autorization_form_id, types) ⇒ TD::Types::Ok

Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements need to be used.



3356
3357
3358
3359
3360
# File 'lib/tdlib/client_methods.rb', line 3356

def send_passport_authorization_form(autorization_form_id, types)
  broadcast('@type'                => 'sendPassportAuthorizationForm',
            'autorization_form_id' => autorization_form_id,
            'types'                => types)
end

#send_payment_form(chat_id, message_id, order_info_id, shipping_option_id, credentials) ⇒ TD::Types::PaymentResult

Sends a filled-out payment form to the bot for final verification.



3370
3371
3372
3373
3374
3375
3376
3377
# File 'lib/tdlib/client_methods.rb', line 3370

def send_payment_form(chat_id, message_id, order_info_id, shipping_option_id, credentials)
  broadcast('@type'              => 'sendPaymentForm',
            'chat_id'            => chat_id,
            'message_id'         => message_id,
            'order_info_id'      => order_info_id,
            'shipping_option_id' => shipping_option_id,
            'credentials'        => credentials)
end

#send_phone_number_confirmation_code(hash, phone_number, settings) ⇒ TD::Types::AuthenticationCodeInfo

Sends phone number confirmation code. Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or "tg://confirmphone?phone=****&hash=*******" link.



3388
3389
3390
3391
3392
3393
# File 'lib/tdlib/client_methods.rb', line 3388

def send_phone_number_confirmation_code(hash, phone_number, settings)
  broadcast('@type'        => 'sendPhoneNumberConfirmationCode',
            'hash'         => hash,
            'phone_number' => phone_number,
            'settings'     => settings)
end

#send_phone_number_verification_code(phone_number, settings) ⇒ TD::Types::AuthenticationCodeInfo

Sends a code to verify a phone number to be added to a user's Telegram Passport.



3401
3402
3403
3404
3405
# File 'lib/tdlib/client_methods.rb', line 3401

def send_phone_number_verification_code(phone_number, settings)
  broadcast('@type'        => 'sendPhoneNumberVerificationCode',
            'phone_number' => phone_number,
            'settings'     => settings)
end

#send_ton_lite_server_request(request) ⇒ TD::Types::TonLiteServerResponse

Sends a request to TON lite server through Telegram servers. Can be called before authorization.



3412
3413
3414
3415
# File 'lib/tdlib/client_methods.rb', line 3412

def send_ton_lite_server_request(request)
  broadcast('@type'   => 'sendTonLiteServerRequest',
            'request' => request)
end

#set_account_ttl(ttl) ⇒ TD::Types::Ok

Changes the period of inactivity after which the account of the current user will automatically be deleted.



3421
3422
3423
3424
# File 'lib/tdlib/client_methods.rb', line 3421

def (ttl)
  broadcast('@type' => 'setAccountTtl',
            'ttl'   => ttl)
end

#set_alarm(seconds) ⇒ TD::Types::Ok

Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization.



3432
3433
3434
3435
# File 'lib/tdlib/client_methods.rb', line 3432

def set_alarm(seconds)
  broadcast('@type'   => 'setAlarm',
            'seconds' => seconds)
end

#set_authentication_phone_number(phone_number, settings) ⇒ TD::Types::Ok

Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode or authorizationStateWaitPassword.



3446
3447
3448
3449
3450
# File 'lib/tdlib/client_methods.rb', line 3446

def set_authentication_phone_number(phone_number, settings)
  broadcast('@type'        => 'setAuthenticationPhoneNumber',
            'phone_number' => phone_number,
            'settings'     => settings)
end

#set_auto_download_settings(settings, type) ⇒ TD::Types::Ok

Sets auto-download settings.



3457
3458
3459
3460
3461
# File 'lib/tdlib/client_methods.rb', line 3457

def set_auto_download_settings(settings, type)
  broadcast('@type'    => 'setAutoDownloadSettings',
            'settings' => settings,
            'type'     => type)
end

#set_background(background, type, for_dark_theme) ⇒ TD::Types::Background

Changes the background selected by the user; adds background to the list of installed backgrounds.



3470
3471
3472
3473
3474
3475
# File 'lib/tdlib/client_methods.rb', line 3470

def set_background(background, type, for_dark_theme)
  broadcast('@type'          => 'setBackground',
            'background'     => background,
            'type'           => type,
            'for_dark_theme' => for_dark_theme)
end

#set_bio(bio) ⇒ TD::Types::Ok

Changes the bio of the current user.



3481
3482
3483
3484
# File 'lib/tdlib/client_methods.rb', line 3481

def set_bio(bio)
  broadcast('@type' => 'setBio',
            'bio'   => bio)
end

#set_bot_updates_status(pending_update_count, error_message) ⇒ TD::Types::Ok

Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only.



3492
3493
3494
3495
3496
# File 'lib/tdlib/client_methods.rb', line 3492

def set_bot_updates_status(pending_update_count, error_message)
  broadcast('@type'                => 'setBotUpdatesStatus',
            'pending_update_count' => pending_update_count,
            'error_message'        => error_message)
end

#set_chat_chat_list(chat_id, chat_list) ⇒ TD::Types::Ok

Moves a chat to a different chat list. Current chat list of the chat must ne non-null.



3504
3505
3506
3507
3508
# File 'lib/tdlib/client_methods.rb', line 3504

def set_chat_chat_list(chat_id, chat_list)
  broadcast('@type'     => 'setChatChatList',
            'chat_id'   => chat_id,
            'chat_list' => chat_list)
end

#set_chat_client_data(chat_id, client_data) ⇒ TD::Types::Ok

Changes client data associated with a chat.



3515
3516
3517
3518
3519
# File 'lib/tdlib/client_methods.rb', line 3515

def set_chat_client_data(chat_id, client_data)
  broadcast('@type'       => 'setChatClientData',
            'chat_id'     => chat_id,
            'client_data' => client_data)
end

#set_chat_description(chat_id, description) ⇒ TD::Types::Ok

Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights.



3528
3529
3530
3531
3532
# File 'lib/tdlib/client_methods.rb', line 3528

def set_chat_description(chat_id, description)
  broadcast('@type'       => 'setChatDescription',
            'chat_id'     => chat_id,
            'description' => description)
end

#set_chat_discussion_group(chat_id, discussion_chat_id) ⇒ TD::Types::Ok

Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified.



3546
3547
3548
3549
3550
# File 'lib/tdlib/client_methods.rb', line 3546

def set_chat_discussion_group(chat_id, discussion_chat_id)
  broadcast('@type'              => 'setChatDiscussionGroup',
            'chat_id'            => chat_id,
            'discussion_chat_id' => discussion_chat_id)
end

#set_chat_draft_message(chat_id, draft_message = nil) ⇒ TD::Types::Ok

Changes the draft message in a chat.



3557
3558
3559
3560
3561
# File 'lib/tdlib/client_methods.rb', line 3557

def set_chat_draft_message(chat_id, draft_message = nil)
  broadcast('@type'         => 'setChatDraftMessage',
            'chat_id'       => chat_id,
            'draft_message' => draft_message)
end

#set_chat_location(chat_id, location) ⇒ TD::Types::Ok

Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use.



3570
3571
3572
3573
3574
# File 'lib/tdlib/client_methods.rb', line 3570

def set_chat_location(chat_id, location)
  broadcast('@type'    => 'setChatLocation',
            'chat_id'  => chat_id,
            'location' => location)
end

#set_chat_member_status(chat_id, user_id, status) ⇒ TD::Types::Ok

Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership. The chat member status will not be changed until it has been synchronized with the server.



3585
3586
3587
3588
3589
3590
# File 'lib/tdlib/client_methods.rb', line 3585

def set_chat_member_status(chat_id, user_id, status)
  broadcast('@type'   => 'setChatMemberStatus',
            'chat_id' => chat_id,
            'user_id' => user_id,
            'status'  => status)
end

#set_chat_notification_settings(chat_id, notification_settings) ⇒ TD::Types::Ok

Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed.



3599
3600
3601
3602
3603
# File 'lib/tdlib/client_methods.rb', line 3599

def set_chat_notification_settings(chat_id, notification_settings)
  broadcast('@type'                 => 'setChatNotificationSettings',
            'chat_id'               => chat_id,
            'notification_settings' => notification_settings)
end

#set_chat_permissions(chat_id, permissions) ⇒ TD::Types::Ok

Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right.



3612
3613
3614
3615
3616
# File 'lib/tdlib/client_methods.rb', line 3612

def set_chat_permissions(chat_id, permissions)
  broadcast('@type'       => 'setChatPermissions',
            'chat_id'     => chat_id,
            'permissions' => permissions)
end

#set_chat_photo(chat_id, photo) ⇒ TD::Types::Ok

Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The photo will not be changed before request to the server has been completed.



3628
3629
3630
3631
3632
# File 'lib/tdlib/client_methods.rb', line 3628

def set_chat_photo(chat_id, photo)
  broadcast('@type'   => 'setChatPhoto',
            'chat_id' => chat_id,
            'photo'   => photo)
end

#set_chat_slow_mode_delay(chat_id, slow_mode_delay) ⇒ TD::Types::Ok

Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights.



3640
3641
3642
3643
3644
# File 'lib/tdlib/client_methods.rb', line 3640

def set_chat_slow_mode_delay(chat_id, slow_mode_delay)
  broadcast('@type'           => 'setChatSlowModeDelay',
            'chat_id'         => chat_id,
            'slow_mode_delay' => slow_mode_delay)
end

#set_chat_title(chat_id, title) ⇒ TD::Types::Ok

Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed.



3654
3655
3656
3657
3658
# File 'lib/tdlib/client_methods.rb', line 3654

def set_chat_title(chat_id, title)
  broadcast('@type'   => 'setChatTitle',
            'chat_id' => chat_id,
            'title'   => title)
end

#set_custom_language_pack(info, strings) ⇒ TD::Types::Ok

Adds or changes a custom local language pack to the current localization target.



3668
3669
3670
3671
3672
# File 'lib/tdlib/client_methods.rb', line 3668

def set_custom_language_pack(info, strings)
  broadcast('@type'   => 'setCustomLanguagePack',
            'info'    => info,
            'strings' => strings)
end

#set_custom_language_pack_string(language_pack_id, new_string) ⇒ TD::Types::Ok

Adds, edits or deletes a string in a custom local language pack. Can be called before authorization.



3681
3682
3683
3684
3685
# File 'lib/tdlib/client_methods.rb', line 3681

def set_custom_language_pack_string(language_pack_id, new_string)
  broadcast('@type'            => 'setCustomLanguagePackString',
            'language_pack_id' => language_pack_id,
            'new_string'       => new_string)
end

#set_database_encryption_key(new_encryption_key) ⇒ TD::Types::Ok

Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain.



3692
3693
3694
3695
# File 'lib/tdlib/client_methods.rb', line 3692

def set_database_encryption_key(new_encryption_key)
  broadcast('@type'              => 'setDatabaseEncryptionKey',
            'new_encryption_key' => new_encryption_key)
end

#set_file_generation_progress(generation_id, expected_size, local_prefix_size) ⇒ TD::Types::Ok

Informs TDLib on a file generation prograss.



3703
3704
3705
3706
3707
3708
# File 'lib/tdlib/client_methods.rb', line 3703

def set_file_generation_progress(generation_id, expected_size, local_prefix_size)
  broadcast('@type'             => 'setFileGenerationProgress',
            'generation_id'     => generation_id,
            'expected_size'     => expected_size,
            'local_prefix_size' => local_prefix_size)
end

#set_game_score(chat_id, message_id, edit_message, user_id, score, force) ⇒ TD::Types::Message

Updates the game score of the specified user in the game; for bots only.



3720
3721
3722
3723
3724
3725
3726
3727
3728
# File 'lib/tdlib/client_methods.rb', line 3720

def set_game_score(chat_id, message_id, edit_message, user_id, score, force)
  broadcast('@type'        => 'setGameScore',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'edit_message' => edit_message,
            'user_id'      => user_id,
            'score'        => score,
            'force'        => force)
end

#set_inline_game_score(inline_message_id, edit_message, user_id, score, force) ⇒ TD::Types::Ok

Updates the game score of the specified user in a game; for bots only.



3739
3740
3741
3742
3743
3744
3745
3746
# File 'lib/tdlib/client_methods.rb', line 3739

def set_inline_game_score(inline_message_id, edit_message, user_id, score, force)
  broadcast('@type'             => 'setInlineGameScore',
            'inline_message_id' => inline_message_id,
            'edit_message'      => edit_message,
            'user_id'           => user_id,
            'score'             => score,
            'force'             => force)
end

#set_log_stream(log_stream) ⇒ TD::Types::Ok

Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously.



3755
3756
3757
3758
# File 'lib/tdlib/client_methods.rb', line 3755

def set_log_stream(log_stream)
  broadcast('@type'      => 'setLogStream',
            'log_stream' => log_stream)
end

#set_log_tag_verbosity_level(tag, new_verbosity_level) ⇒ TD::Types::Ok

Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously.



3768
3769
3770
3771
3772
# File 'lib/tdlib/client_methods.rb', line 3768

def set_log_tag_verbosity_level(tag, new_verbosity_level)
  broadcast('@type'               => 'setLogTagVerbosityLevel',
            'tag'                 => tag,
            'new_verbosity_level' => new_verbosity_level)
end

#set_log_verbosity_level(new_verbosity_level) ⇒ TD::Types::Ok

Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously.



3784
3785
3786
3787
# File 'lib/tdlib/client_methods.rb', line 3784

def set_log_verbosity_level(new_verbosity_level)
  broadcast('@type'               => 'setLogVerbosityLevel',
            'new_verbosity_level' => new_verbosity_level)
end

#set_name(first_name, last_name) ⇒ TD::Types::Ok

Changes the first and last name of the current user. If something changes, updateUser will be sent.



3795
3796
3797
3798
3799
# File 'lib/tdlib/client_methods.rb', line 3795

def set_name(first_name, last_name)
  broadcast('@type'      => 'setName',
            'first_name' => first_name,
            'last_name'  => last_name)
end

#set_network_type(type) ⇒ TD::Types::Ok

Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it should be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics.



3811
3812
3813
3814
# File 'lib/tdlib/client_methods.rb', line 3811

def set_network_type(type)
  broadcast('@type' => 'setNetworkType',
            'type'  => type)
end

#set_option(name, value) ⇒ TD::Types::Ok

Sets the value of an option. (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization.



3823
3824
3825
3826
3827
# File 'lib/tdlib/client_methods.rb', line 3823

def set_option(name, value)
  broadcast('@type' => 'setOption',
            'name'  => name,
            'value' => value)
end

#set_passport_element(element, password) ⇒ TD::Types::PassportElement

Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first.



3836
3837
3838
3839
3840
# File 'lib/tdlib/client_methods.rb', line 3836

def set_passport_element(element, password)
  broadcast('@type'    => 'setPassportElement',
            'element'  => element,
            'password' => password)
end

#set_passport_element_errors(user_id, errors) ⇒ TD::Types::Ok

Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed.



3848
3849
3850
3851
3852
# File 'lib/tdlib/client_methods.rb', line 3848

def set_passport_element_errors(user_id, errors)
  broadcast('@type'   => 'setPassportElementErrors',
            'user_id' => user_id,
            'errors'  => errors)
end

#set_password(old_password, new_password: nil, new_hint: nil, set_recovery_email_address: false, new_recovery_email_address: nil) ⇒ TD::Types::PasswordState

Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed.



3864
3865
3866
3867
3868
3869
3870
3871
3872
# File 'lib/tdlib/client_methods.rb', line 3864

def set_password(old_password, new_password: nil, new_hint: nil, set_recovery_email_address: false,
                 new_recovery_email_address: nil)
  broadcast('@type'                      => 'setPassword',
            'old_password'               => old_password,
            'new_password'               => new_password,
            'new_hint'                   => new_hint,
            'set_recovery_email_address' => set_recovery_email_address,
            'new_recovery_email_address' => new_recovery_email_address)
end

#set_pinned_chats(chat_list, chat_ids) ⇒ TD::Types::Ok

Changes the order of pinned chats.



3879
3880
3881
3882
3883
# File 'lib/tdlib/client_methods.rb', line 3879

def set_pinned_chats(chat_list, chat_ids)
  broadcast('@type'     => 'setPinnedChats',
            'chat_list' => chat_list,
            'chat_ids'  => chat_ids)
end

#set_poll_answer(chat_id, message_id, option_ids) ⇒ TD::Types::Ok

Changes user answer to a poll.



3892
3893
3894
3895
3896
3897
# File 'lib/tdlib/client_methods.rb', line 3892

def set_poll_answer(chat_id, message_id, option_ids)
  broadcast('@type'      => 'setPollAnswer',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'option_ids' => option_ids)
end

#set_profile_photo(photo) ⇒ TD::Types::Ok

Uploads a new profile photo for the current user. If something changes, updateUser will be sent.



3905
3906
3907
3908
# File 'lib/tdlib/client_methods.rb', line 3905

def set_profile_photo(photo)
  broadcast('@type' => 'setProfilePhoto',
            'photo' => photo)
end

#set_recovery_email_address(password, new_recovery_email_address) ⇒ TD::Types::PasswordState

Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed. If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation.



3919
3920
3921
3922
3923
# File 'lib/tdlib/client_methods.rb', line 3919

def set_recovery_email_address(password, new_recovery_email_address)
  broadcast('@type'                      => 'setRecoveryEmailAddress',
            'password'                   => password,
            'new_recovery_email_address' => new_recovery_email_address)
end

#set_scope_notification_settings(scope, notification_settings) ⇒ TD::Types::Ok

Changes notification settings for chats of a given type.



3931
3932
3933
3934
3935
# File 'lib/tdlib/client_methods.rb', line 3931

def set_scope_notification_settings(scope, notification_settings)
  broadcast('@type'                 => 'setScopeNotificationSettings',
            'scope'                 => scope,
            'notification_settings' => notification_settings)
end

#set_sticker_position_in_set(sticker, position) ⇒ TD::Types::Ok

Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot.



3943
3944
3945
3946
3947
# File 'lib/tdlib/client_methods.rb', line 3943

def set_sticker_position_in_set(sticker, position)
  broadcast('@type'    => 'setStickerPositionInSet',
            'sticker'  => sticker,
            'position' => position)
end

#set_supergroup_sticker_set(supergroup_id, sticker_set_id) ⇒ TD::Types::Ok

Changes the sticker set of a supergroup; requires can_change_info rights.



3955
3956
3957
3958
3959
# File 'lib/tdlib/client_methods.rb', line 3955

def set_supergroup_sticker_set(supergroup_id, sticker_set_id)
  broadcast('@type'          => 'setSupergroupStickerSet',
            'supergroup_id'  => supergroup_id,
            'sticker_set_id' => sticker_set_id)
end

#set_supergroup_username(supergroup_id, username) ⇒ TD::Types::Ok

Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel.



3967
3968
3969
3970
3971
# File 'lib/tdlib/client_methods.rb', line 3967

def set_supergroup_username(supergroup_id, username)
  broadcast('@type'         => 'setSupergroupUsername',
            'supergroup_id' => supergroup_id,
            'username'      => username)
end

#set_tdlib_parameters(parameters) ⇒ TD::Types::Ok

Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters.



3978
3979
3980
3981
# File 'lib/tdlib/client_methods.rb', line 3978

def set_tdlib_parameters(parameters)
  broadcast('@type'      => 'setTdlibParameters',
            'parameters' => parameters)
end

#set_user_privacy_setting_rules(setting, rules) ⇒ TD::Types::Ok

Changes user privacy settings.



3988
3989
3990
3991
3992
# File 'lib/tdlib/client_methods.rb', line 3988

def set_user_privacy_setting_rules(setting, rules)
  broadcast('@type'   => 'setUserPrivacySettingRules',
            'setting' => setting,
            'rules'   => rules)
end

#set_username(username) ⇒ TD::Types::Ok

Changes the username of the current user. If something changes, updateUser will be sent.



4000
4001
4002
4003
# File 'lib/tdlib/client_methods.rb', line 4000

def set_username(username)
  broadcast('@type'    => 'setUsername',
            'username' => username)
end

#share_phone_number(user_id) ⇒ TD::Types::Ok

Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber.



4011
4012
4013
4014
# File 'lib/tdlib/client_methods.rb', line 4011

def share_phone_number(user_id)
  broadcast('@type'   => 'sharePhoneNumber',
            'user_id' => user_id)
end

#stop_poll(chat_id, message_id, reply_markup) ⇒ TD::Types::Ok

Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set.



4023
4024
4025
4026
4027
4028
# File 'lib/tdlib/client_methods.rb', line 4023

def stop_poll(chat_id, message_id, reply_markup)
  broadcast('@type'        => 'stopPoll',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'reply_markup' => reply_markup)
end

#synchronize_language_pack(language_pack_id) ⇒ TD::Types::Ok

Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization.



4036
4037
4038
4039
# File 'lib/tdlib/client_methods.rb', line 4036

def synchronize_language_pack(language_pack_id)
  broadcast('@type'            => 'synchronizeLanguagePack',
            'language_pack_id' => language_pack_id)
end

#terminate_all_other_sessionsTD::Types::Ok

Terminates all other sessions of the current user.



4044
4045
4046
# File 'lib/tdlib/client_methods.rb', line 4044

def terminate_all_other_sessions
  broadcast('@type' => 'terminateAllOtherSessions')
end

#terminate_session(session_id) ⇒ TD::Types::Ok

Terminates a session of the current user.



4052
4053
4054
4055
# File 'lib/tdlib/client_methods.rb', line 4052

def terminate_session(session_id)
  broadcast('@type'      => 'terminateSession',
            'session_id' => session_id)
end

#toggle_chat_default_disable_notification(chat_id, default_disable_notification) ⇒ TD::Types::Ok

Changes the value of the default disable_notification parameter, used when a message is sent to a chat.



4062
4063
4064
4065
4066
# File 'lib/tdlib/client_methods.rb', line 4062

def toggle_chat_default_disable_notification(chat_id, default_disable_notification)
  broadcast('@type'                        => 'toggleChatDefaultDisableNotification',
            'chat_id'                      => chat_id,
            'default_disable_notification' => default_disable_notification)
end

#toggle_chat_is_marked_as_unread(chat_id, is_marked_as_unread) ⇒ TD::Types::Ok

Changes the marked as unread state of a chat.



4073
4074
4075
4076
4077
# File 'lib/tdlib/client_methods.rb', line 4073

def toggle_chat_is_marked_as_unread(chat_id, is_marked_as_unread)
  broadcast('@type'               => 'toggleChatIsMarkedAsUnread',
            'chat_id'             => chat_id,
            'is_marked_as_unread' => is_marked_as_unread)
end

#toggle_chat_is_pinned(chat_id, is_pinned) ⇒ TD::Types::Ok

Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") non-secret chats and the same number of secret chats in the main/archive chat list.



4086
4087
4088
4089
4090
# File 'lib/tdlib/client_methods.rb', line 4086

def toggle_chat_is_pinned(chat_id, is_pinned)
  broadcast('@type'     => 'toggleChatIsPinned',
            'chat_id'   => chat_id,
            'is_pinned' => is_pinned)
end

#toggle_supergroup_is_all_history_available(supergroup_id, is_all_history_available) ⇒ TD::Types::Ok

Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights.



4097
4098
4099
4100
4101
# File 'lib/tdlib/client_methods.rb', line 4097

def toggle_supergroup_is_all_history_available(supergroup_id, is_all_history_available)
  broadcast('@type'                    => 'toggleSupergroupIsAllHistoryAvailable',
            'supergroup_id'            => supergroup_id,
            'is_all_history_available' => is_all_history_available)
end

#toggle_supergroup_sign_messages(supergroup_id, sign_messages) ⇒ TD::Types::Ok

Toggles sender signatures messages sent in a channel; requires can_change_info rights.



4108
4109
4110
4111
4112
# File 'lib/tdlib/client_methods.rb', line 4108

def toggle_supergroup_sign_messages(supergroup_id, sign_messages)
  broadcast('@type'         => 'toggleSupergroupSignMessages',
            'supergroup_id' => supergroup_id,
            'sign_messages' => sign_messages)
end

#transfer_chat_ownership(chat_id, user_id, password) ⇒ TD::Types::Ok

Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats.



4124
4125
4126
4127
4128
4129
# File 'lib/tdlib/client_methods.rb', line 4124

def transfer_chat_ownership(chat_id, user_id, password)
  broadcast('@type'    => 'transferChatOwnership',
            'chat_id'  => chat_id,
            'user_id'  => user_id,
            'password' => password)
end

#unblock_user(user_id) ⇒ TD::Types::Ok

Removes a user from the blacklist.



4135
4136
4137
4138
# File 'lib/tdlib/client_methods.rb', line 4135

def unblock_user(user_id)
  broadcast('@type'   => 'unblockUser',
            'user_id' => user_id)
end

#unpin_chat_message(chat_id) ⇒ TD::Types::Ok

Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel.



4144
4145
4146
4147
# File 'lib/tdlib/client_methods.rb', line 4144

def unpin_chat_message(chat_id)
  broadcast('@type'   => 'unpinChatMessage',
            'chat_id' => chat_id)
end

#upgrade_basic_group_chat_to_supergroup_chat(chat_id) ⇒ TD::Types::Chat

Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group.



4155
4156
4157
4158
# File 'lib/tdlib/client_methods.rb', line 4155

def upgrade_basic_group_chat_to_supergroup_chat(chat_id)
  broadcast('@type'   => 'upgradeBasicGroupChatToSupergroupChat',
            'chat_id' => chat_id)
end

#upload_file(file, file_type, priority) ⇒ TD::Types::File

Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message.



4171
4172
4173
4174
4175
4176
# File 'lib/tdlib/client_methods.rb', line 4171

def upload_file(file, file_type, priority)
  broadcast('@type'     => 'uploadFile',
            'file'      => file,
            'file_type' => file_type,
            'priority'  => priority)
end

#upload_sticker_file(user_id, png_sticker) ⇒ TD::Types::File

Uploads a PNG image with a sticker; for bots only; returns the uploaded file.



4184
4185
4186
4187
4188
# File 'lib/tdlib/client_methods.rb', line 4184

def upload_sticker_file(user_id, png_sticker)
  broadcast('@type'       => 'uploadStickerFile',
            'user_id'     => user_id,
            'png_sticker' => png_sticker)
end

#validate_order_info(chat_id, message_id, order_info, allow_save) ⇒ TD::Types::ValidatedOrderInfo

Validates the order information provided by a user and returns the available shipping options for a flexible invoice.



4198
4199
4200
4201
4202
4203
4204
# File 'lib/tdlib/client_methods.rb', line 4198

def validate_order_info(chat_id, message_id, order_info, allow_save)
  broadcast('@type'      => 'validateOrderInfo',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'order_info' => order_info,
            'allow_save' => allow_save)
end

#view_messages(chat_id, message_ids, force_read) ⇒ TD::Types::Ok

Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels).



4214
4215
4216
4217
4218
4219
# File 'lib/tdlib/client_methods.rb', line 4214

def view_messages(chat_id, message_ids, force_read)
  broadcast('@type'       => 'viewMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids,
            'force_read'  => force_read)
end

Informs the server that some trending sticker sets have been viewed by the user.



4225
4226
4227
4228
# File 'lib/tdlib/client_methods.rb', line 4225

def view_trending_sticker_sets(sticker_set_ids)
  broadcast('@type'           => 'viewTrendingStickerSets',
            'sticker_set_ids' => sticker_set_ids)
end

#write_generated_file_part(generation_id, offset, data) ⇒ TD::Types::Ok

Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file.



4238
4239
4240
4241
4242
4243
# File 'lib/tdlib/client_methods.rb', line 4238

def write_generated_file_part(generation_id, offset, data)
  broadcast('@type'         => 'writeGeneratedFilePart',
            'generation_id' => generation_id,
            'offset'        => offset,
            'data'          => data)
end