Module: TD::ClientMethods

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.

Parameters:

  • call_id (Integer)

    Call identifier.

  • protocol (TD::Types::CallProtocol)

    The call protocols supported by the application.

Returns:



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.

Parameters:

  • terms_of_service_id (TD::Types::String)

    Terms of service identifier.

Returns:



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

#activate_story_stealth_modeTD::Types::Ok

Activates stealth mode for stories, which hides all views of stories from the current user in the last

"story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram
Premium users only.

Returns:



29
30
31
# File 'lib/tdlib/client_methods.rb', line 29

def activate_story_stealth_mode
  broadcast('@type' => 'activateStoryStealthMode')
end

#add_bot_media_preview(bot_user_id:, language_code:, content:) ⇒ TD::Types::BotMediaPreview

Adds a new media preview to the beginning of the list of media previews of a bot. Returns the added preview after addition is completed server-side. The total number of previews must not exceed getOption(“bot_media_preview_count_max”) for the given language.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must be owned and must have the main Web App.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code for which preview is added. If empty, then the preview will be shown to all users for whose languages there are no dedicated previews. If non-empty, then there must be an official language pack of the same name, which is returned by getLocalizationTargetInfo.

  • content (TD::Types::InputStoryContent)

    Content of the added preview.

Returns:



45
46
47
48
49
50
# File 'lib/tdlib/client_methods.rb', line 45

def add_bot_media_preview(bot_user_id:, language_code:, content:)
  broadcast('@type'         => 'addBotMediaPreview',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'content'       => content)
end

Adds a chat folder by an invite link.

Parameters:

  • invite_link (TD::Types::String)

    Invite link for the chat folder.

  • chat_ids (Array<Integer>)

    Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren’t joined yet.

Returns:



58
59
60
61
62
# File 'lib/tdlib/client_methods.rb', line 58

def add_chat_folder_by_invite_link(invite_link:, chat_ids:)
  broadcast('@type'       => 'addChatFolderByInviteLink',
            'invite_link' => invite_link,
            'chat_ids'    => chat_ids)
end

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

Adds a new member to a chat; requires can_invite_users member right. Members can’t be added to private or secret chats. Returns information about members that weren’t added.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • user_id (Integer)

    Identifier of the user.

  • forward_limit (Integer)

    The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot.

Returns:



74
75
76
77
78
79
# File 'lib/tdlib/client_methods.rb', line 74

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::FailedToAddMembers

Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. This method can’t be used to join a chat. Members can’t be added to a channel if it has more than 200 members. Returns information about members that weren’t added.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • user_ids (Array<Integer>)

    Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels.

Returns:



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

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

#add_chat_to_list(chat_id:, chat_list:) ⇒ TD::Types::Ok

Adds a chat to a chat list. A chat can’t be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if

needed.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • chat_list (TD::Types::ChatList)

    The chat list. Use getChatListsToAddChat to get suitable chat lists.

Returns:



105
106
107
108
109
# File 'lib/tdlib/client_methods.rb', line 105

def add_chat_to_list(chat_id:, chat_list:)
  broadcast('@type'     => 'addChatToList',
            'chat_id'   => chat_id,
            'chat_list' => chat_list)
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.

Parameters:

  • contact (TD::Types::Contact, nil) (defaults to: nil)

    The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored.

  • share_phone_number (Boolean)

    Pass true to share the current user’s phone number with the new contact. A corresponding rule to Types::UserPrivacySetting::ShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number.

Returns:



120
121
122
123
124
# File 'lib/tdlib/client_methods.rb', line 120

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.

Parameters:

  • language_pack_id (TD::Types::String)

    Identifier of a language pack to be added.

Returns:



131
132
133
134
# File 'lib/tdlib/client_methods.rb', line 131

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 or in WEBP or WEBM format can be added to this list. Emoji stickers can’t be added to favorite stickers.

Parameters:

Returns:



144
145
146
147
# File 'lib/tdlib/client_methods.rb', line 144

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

#add_file_to_downloads(file_id:, chat_id:, message_id:, priority:) ⇒ TD::Types::File

Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file.

Parameters:

  • file_id (Integer)

    Identifier of the file to download.

  • chat_id (Integer)

    Chat identifier of the message with the file.

  • message_id (Integer)

    Message identifier.

  • priority (Integer)

    Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first.

Returns:



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

def add_file_to_downloads(file_id:, chat_id:, message_id:, priority:)
  broadcast('@type'      => 'addFileToDownloads',
            'file_id'    => file_id,
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'priority'   => priority)
end

#add_local_message(chat_id:, sender_id:, reply_to:, 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.

Parameters:

  • chat_id (Integer)

    Target chat.

  • sender_id (TD::Types::MessageSender)

    Identifier of the sender of the message.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message or story to be replied; pass null if none.

  • disable_notification (Boolean)

    Pass true to disable notification for the message.

  • input_message_content (TD::Types::InputMessageContent)

    The content of the message to be added.

Returns:



182
183
184
185
186
187
188
189
# File 'lib/tdlib/client_methods.rb', line 182

def add_local_message(chat_id:, sender_id:, reply_to:, disable_notification:, input_message_content:)
  broadcast('@type'                 => 'addLocalMessage',
            'chat_id'               => chat_id,
            'sender_id'             => sender_id,
            'reply_to'              => reply_to,
            '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. Can be called synchronously.

Parameters:

  • verbosity_level (Integer)

    The minimum verbosity level needed for the message to be logged; 0-1023.

  • text (TD::Types::String)

    Text of a message to log.

Returns:



197
198
199
200
201
# File 'lib/tdlib/client_methods.rb', line 197

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

#add_message_reaction(chat_id:, message_id:, reaction_type:, is_big:, update_recent_reactions:) ⇒ TD::Types::Ok

Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • reaction_type (TD::Types::ReactionType)

    Type of the reaction to add. Use addPaidMessageReaction instead to add the paid reaction.

  • is_big (Boolean)

    Pass true if the reaction is added with a big animation.

  • update_recent_reactions (Boolean)

    Pass true if the reaction needs to be added to recent reactions; tags are never added to the list of recent reactions.

Returns:



214
215
216
217
218
219
220
221
# File 'lib/tdlib/client_methods.rb', line 214

def add_message_reaction(chat_id:, message_id:, reaction_type:, is_big:, update_recent_reactions:)
  broadcast('@type'                   => 'addMessageReaction',
            'chat_id'                 => chat_id,
            'message_id'              => message_id,
            'reaction_type'           => reaction_type,
            'is_big'                  => is_big,
            'update_recent_reactions' => update_recent_reactions)
end

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

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

Parameters:

Returns:



229
230
231
232
# File 'lib/tdlib/client_methods.rb', line 229

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

#add_paid_message_reaction(chat_id:, message_id:, star_count:, is_anonymous:) ⇒ TD::Types::Ok

Adds the paid message reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • star_count (Integer)

    Number of Telegram Stars to be used for the reaction; 1-getOption(“paid_reaction_star_count_max”).

  • is_anonymous (Boolean)

    Pass true to make paid reaction of the user on the message anonymous; pass false to make the user’s profile visible among top reactors.

Returns:



244
245
246
247
248
249
250
# File 'lib/tdlib/client_methods.rb', line 244

def add_paid_message_reaction(chat_id:, message_id:, star_count:, is_anonymous:)
  broadcast('@type'        => 'addPaidMessageReaction',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'star_count'   => star_count,
            'is_anonymous' => is_anonymous)
end

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

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

Parameters:

  • server (TD::Types::String)

    Proxy server domain or IP address.

  • port (Integer)

    Proxy server port.

  • enable (Boolean)

    Pass true to immediately enable the proxy.

  • type (TD::Types::ProxyType)

    Proxy type.

Returns:



260
261
262
263
264
265
266
# File 'lib/tdlib/client_methods.rb', line 260

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

#add_quick_reply_shortcut_inline_query_result_message(shortcut_name:, reply_to_message_id:, query_id:, result_id:, hide_via_bot:) ⇒ TD::Types::QuickReplyMessage

Adds a message to a quick reply shortcut via inline bot. If shortcut doesn’t exist and there are less than getOption(“quick_reply_shortcut_count_max”) shortcuts, then a new

shortcut is created.

The shortcut must not contain more than getOption(“quick_reply_shortcut_message_count_max”) messages after adding

the new message.

Returns the added message.

Parameters:

  • shortcut_name (TD::Types::String)

    Name of the target shortcut.

  • reply_to_message_id (Integer)

    Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none.

  • query_id (Integer)

    Identifier of the inline query.

  • result_id (TD::Types::String)

    Identifier of the inline query result.

  • hide_via_bot (Boolean)

    Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption(“animation_search_bot_username”), getOption(“photo_search_bot_username”), and getOption(“venue_search_bot_username”).

Returns:



284
285
286
287
288
289
290
291
292
# File 'lib/tdlib/client_methods.rb', line 284

def add_quick_reply_shortcut_inline_query_result_message(shortcut_name:, reply_to_message_id:, query_id:, result_id:,
                                                         hide_via_bot:)
  broadcast('@type'               => 'addQuickReplyShortcutInlineQueryResultMessage',
            'shortcut_name'       => shortcut_name,
            'reply_to_message_id' => reply_to_message_id,
            'query_id'            => query_id,
            'result_id'           => result_id,
            'hide_via_bot'        => hide_via_bot)
end

#add_quick_reply_shortcut_message(shortcut_name:, reply_to_message_id:, input_message_content:) ⇒ TD::Types::QuickReplyMessage

Adds a message to a quick reply shortcut. If shortcut doesn’t exist and there are less than getOption(“quick_reply_shortcut_count_max”) shortcuts, then a new

shortcut is created.

The shortcut must not contain more than getOption(“quick_reply_shortcut_message_count_max”) messages after adding

the new message.

Returns the added message.

Parameters:

Returns:



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

def add_quick_reply_shortcut_message(shortcut_name:, reply_to_message_id:, input_message_content:)
  broadcast('@type'                 => 'addQuickReplyShortcutMessage',
            'shortcut_name'         => shortcut_name,
            'reply_to_message_id'   => reply_to_message_id,
            'input_message_content' => input_message_content)
end

#add_quick_reply_shortcut_message_album(shortcut_name:, reply_to_message_id:, input_message_contents:) ⇒ TD::Types::QuickReplyMessages

Adds 2-10 messages grouped together into an album to a quick reply shortcut. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages.

Parameters:

  • shortcut_name (TD::Types::String)

    Name of the target shortcut.

  • reply_to_message_id (Integer)

    Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none.

  • input_message_contents (Array<TD::Types::InputMessageContent>)

    Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media.

Returns:



327
328
329
330
331
332
# File 'lib/tdlib/client_methods.rb', line 327

def add_quick_reply_shortcut_message_album(shortcut_name:, reply_to_message_id:, input_message_contents:)
  broadcast('@type'                  => 'addQuickReplyShortcutMessageAlbum',
            'shortcut_name'          => shortcut_name,
            'reply_to_message_id'    => reply_to_message_id,
            'input_message_contents' => input_message_contents)
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 or in WEBP or WEBM format can be added to this list. Emoji stickers can’t be added to recent stickers.

Parameters:

  • is_attached (Boolean)

    Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers.

  • sticker (TD::Types::InputFile)

    Sticker file to add.

Returns:



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

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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to add.

Returns:



356
357
358
359
# File 'lib/tdlib/client_methods.rb', line 356

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.

Parameters:

  • animation (TD::Types::InputFile)

    The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list.

Returns:



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

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

#add_saved_notification_sound(sound:) ⇒ TD::Types::NotificationSound

Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn’t changed.

Parameters:

Returns:



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

def add_saved_notification_sound(sound:)
  broadcast('@type' => 'addSavedNotificationSound',
            'sound' => sound)
end

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

Adds a new sticker to a set.

Parameters:

  • user_id (Integer)

    Sticker set owner; ignored for regular users.

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise.

  • sticker (TD::Types::InputSticker)

    Sticker to add to the set.

Returns:



393
394
395
396
397
398
# File 'lib/tdlib/client_methods.rb', line 393

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

#allow_bot_to_send_messages(bot_user_id:) ⇒ TD::Types::Ok

Allows the specified bot to send messages to the user.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

Returns:



404
405
406
407
# File 'lib/tdlib/client_methods.rb', line 404

def allow_bot_to_send_messages(bot_user_id:)
  broadcast('@type'       => 'allowBotToSendMessages',
            'bot_user_id' => bot_user_id)
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.

Parameters:

  • callback_query_id (Integer)

    Identifier of the callback query.

  • text (TD::Types::String)

    Text of the answer.

  • show_alert (Boolean)

    Pass true to show an alert to the user instead of a toast notification.

  • url (TD::Types::String)

    URL to be opened.

  • cache_time (Integer)

    Time during which the result of the query can be cached, in seconds.

Returns:



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

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.

Parameters:

  • custom_query_id (Integer)

    Identifier of a custom query.

  • data (TD::Types::String)

    JSON-serialized answer to the query.

Returns:



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

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:, button:, results:, cache_time:, next_offset:) ⇒ TD::Types::Ok

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

Parameters:

  • inline_query_id (Integer)

    Identifier of the inline query.

  • is_personal (Boolean)

    Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query.

  • button (TD::Types::InlineQueryResultsButton)

    Button to be shown above inline query results; pass null if none.

  • results (Array<TD::Types::InputInlineQueryResult>)

    The results of the query.

  • cache_time (Integer)

    Allowed time to cache the results of the query, in seconds.

  • next_offset (TD::Types::String)

    Offset for the next inline query; pass an empty string if there are no more results.

Returns:



449
450
451
452
453
454
455
456
457
# File 'lib/tdlib/client_methods.rb', line 449

def answer_inline_query(inline_query_id:, is_personal:, button:, results:, cache_time:, next_offset:)
  broadcast('@type'           => 'answerInlineQuery',
            'inline_query_id' => inline_query_id,
            'is_personal'     => is_personal,
            'button'          => button,
            'results'         => results,
            'cache_time'      => cache_time,
            'next_offset'     => next_offset)
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.

Parameters:

  • pre_checkout_query_id (Integer)

    Identifier of the pre-checkout query.

  • error_message (TD::Types::String)

    An error message, empty on success.

Returns:



464
465
466
467
468
# File 'lib/tdlib/client_methods.rb', line 464

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.

Parameters:

  • shipping_query_id (Integer)

    Identifier of the shipping query.

  • shipping_options (Array<TD::Types::ShippingOption>)

    Available shipping options.

  • error_message (TD::Types::String)

    An error message, empty on success.

Returns:



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

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

#answer_web_app_query(web_app_query_id:, result:) ⇒ TD::Types::SentWebAppMessage

Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat

from which the query originated; for bots only.

Parameters:

Returns:



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

def answer_web_app_query(web_app_query_id:, result:)
  broadcast('@type'            => 'answerWebAppQuery',
            'web_app_query_id' => web_app_query_id,
            'result'           => result)
end

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

Applies a Telegram Premium gift code.

Parameters:

  • code (TD::Types::String)

    The code to apply.

Returns:



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

def apply_premium_gift_code(code:)
  broadcast('@type' => 'applyPremiumGiftCode',
            'code'  => code)
end

#assign_app_store_transaction(receipt:, purpose:) ⇒ TD::Types::Ok

Informs server about a purchase through App Store. For official applications only.

Parameters:

Returns:



510
511
512
513
514
# File 'lib/tdlib/client_methods.rb', line 510

def assign_app_store_transaction(receipt:, purpose:)
  broadcast('@type'   => 'assignAppStoreTransaction',
            'receipt' => receipt,
            'purpose' => purpose)
end

#assign_google_play_transaction(package_name:, store_product_id:, purchase_token:, purpose:) ⇒ TD::Types::Ok

Informs server about a purchase through Google Play. For official applications only.

Parameters:

  • package_name (TD::Types::String)

    Application package name.

  • store_product_id (TD::Types::String)

    Identifier of the purchased store product.

  • purchase_token (TD::Types::String)

    Google Play purchase token.

  • purpose (TD::Types::StorePaymentPurpose)

    Transaction purpose.

Returns:



524
525
526
527
528
529
530
# File 'lib/tdlib/client_methods.rb', line 524

def assign_google_play_transaction(package_name:, store_product_id:, purchase_token:, purpose:)
  broadcast('@type'            => 'assignGooglePlayTransaction',
            'package_name'     => package_name,
            'store_product_id' => store_product_id,
            'purchase_token'   => purchase_token,
            'purpose'          => purpose)
end

#ban_chat_member(chat_id:, member_id:, banned_until_date:, revoke_messages:) ⇒ TD::Types::Ok

Bans a member in a chat; requires can_restrict_members administrator right. Members can’t be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links,

etc., unless unbanned first.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • member_id (TD::Types::MessageSender)

    Member identifier.

  • banned_until_date (Integer)

    Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned.

  • revoke_messages (Boolean)

    Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels.

Returns:



546
547
548
549
550
551
552
# File 'lib/tdlib/client_methods.rb', line 546

def ban_chat_member(chat_id:, member_id:, banned_until_date:, revoke_messages:)
  broadcast('@type'             => 'banChatMember',
            'chat_id'           => chat_id,
            'member_id'         => member_id,
            'banned_until_date' => banned_until_date,
            'revoke_messages'   => revoke_messages)
end

#block_message_sender_from_replies(message_id:, delete_message:, delete_all_messages:, report_spam:) ⇒ TD::Types::Ok

Blocks an original sender of a message in the Replies chat.

Parameters:

  • message_id (Integer)

    The identifier of an incoming message in the Replies chat.

  • delete_message (Boolean)

    Pass true to delete the message.

  • delete_all_messages (Boolean)

    Pass true to delete all messages from the same sender.

  • report_spam (Boolean)

    Pass true to report the sender to the Telegram moderators.

Returns:



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

def block_message_sender_from_replies(message_id:, delete_message:, delete_all_messages:, report_spam:)
  broadcast('@type'               => 'blockMessageSenderFromReplies',
            'message_id'          => message_id,
            'delete_message'      => delete_message,
            'delete_all_messages' => delete_all_messages,
            'report_spam'         => report_spam)
end

#boost_chat(chat_id:, slot_ids:) ⇒ TD::Types::ChatBoostSlots

Boosts a chat and returns the list of available chat boost slots for the current user after the boost.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • slot_ids (Array<Integer>)

    Identifiers of boost slots of the current user from which to apply boosts to the chat.

Returns:



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

def boost_chat(chat_id:, slot_ids:)
  broadcast('@type'    => 'boostChat',
            'chat_id'  => chat_id,
            'slot_ids' => slot_ids)
end

#can_bot_send_messages(bot_user_id:) ⇒ TD::Types::Ok

Checks whether the specified bot can send messages to the user. Returns a 404 error if can’t and the access can be granted by call to allowBotToSendMessages.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

Returns:



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

def can_bot_send_messages(bot_user_id:)
  broadcast('@type'       => 'canBotSendMessages',
            'bot_user_id' => bot_user_id)
end

#can_purchase_from_store(purpose:) ⇒ TD::Types::Ok

Checks whether an in-store purchase is possible. Must be called before any in-store purchase.

Parameters:

Returns:



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

def can_purchase_from_store(purpose:)
  broadcast('@type'   => 'canPurchaseFromStore',
            'purpose' => purpose)
end

#can_send_message_to_user(user_id:, only_local:) ⇒ TD::Types::CanSendMessageToUserResult

Check whether the current user can message another user or try to create a chat with them.

Parameters:

  • user_id (Integer)

    Identifier of the other user.

  • only_local (Boolean)

    Pass true to get only locally available information without sending network requests.

Returns:



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

def can_send_message_to_user(user_id:, only_local:)
  broadcast('@type'      => 'canSendMessageToUser',
            'user_id'    => user_id,
            'only_local' => only_local)
end

#can_send_story(chat_id:) ⇒ TD::Types::CanSendStoryResult

Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for

supergroup and channel chats.

Parameters:

  • chat_id (Integer)

    Chat identifier. Pass Saved Messages chat identifier when posting a story on behalf of the current user.

Returns:



618
619
620
621
# File 'lib/tdlib/client_methods.rb', line 618

def can_send_story(chat_id:)
  broadcast('@type'   => 'canSendStory',
            'chat_id' => chat_id)
end

#can_transfer_ownershipTD::Types::CanTransferOwnershipResult

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



626
627
628
# File 'lib/tdlib/client_methods.rb', line 626

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.

Parameters:

  • file_id (Integer)

    Identifier of a file to stop downloading.

  • only_if_pending (Boolean)

    Pass true to stop downloading only if it hasn’t been started, i.e. request hasn’t been sent to server.

Returns:



637
638
639
640
641
# File 'lib/tdlib/client_methods.rb', line 637

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

#cancel_password_resetTD::Types::Ok

Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0.

Returns:



647
648
649
# File 'lib/tdlib/client_methods.rb', line 647

def cancel_password_reset
  broadcast('@type' => 'cancelPasswordReset')
end

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

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

Parameters:

  • file_id (Integer)

    Identifier of the file to stop uploading.

Returns:



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

def cancel_preliminary_upload_file(file_id:)
  broadcast('@type'   => 'cancelPreliminaryUploadFile',
            'file_id' => file_id)
end

#cancel_recovery_email_address_verificationTD::Types::PasswordState

Cancels verification of the 2-step verification recovery email address.



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

def cancel_recovery_email_address_verification
  broadcast('@type' => 'cancelRecoveryEmailAddressVerification')
end

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

Changes imported contacts using the list of 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.

Parameters:

  • contacts (Array<TD::Types::Contact>)

    The new list of contacts, contact’s vCard are ignored and are not imported.

Returns:



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

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

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

Installs/uninstalls or activates/archives a sticker set.

Parameters:

  • set_id (Integer)

    Identifier of the sticker set.

  • is_installed (Boolean)

    The new value of is_installed.

  • is_archived (Boolean)

    The new value of is_archived. A sticker set can’t be installed and archived simultaneously.

Returns:



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

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.

Parameters:

  • token (TD::Types::String)

    The bot token.

Returns:



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

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.

Parameters:

  • code (TD::Types::String)

    Authentication code to check.

Returns:



711
712
713
714
# File 'lib/tdlib/client_methods.rb', line 711

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

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

Checks the authentication of an email address. Works only when the current authorization state is authorizationStateWaitEmailCode.

Parameters:

Returns:



721
722
723
724
# File 'lib/tdlib/client_methods.rb', line 721

def check_authentication_email_code(code:)
  broadcast('@type' => 'checkAuthenticationEmailCode',
            'code'  => code)
end

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

Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword.

Parameters:

  • password (TD::Types::String)

    The 2-step verification password to check.

Returns:



731
732
733
734
# File 'lib/tdlib/client_methods.rb', line 731

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

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

Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword.

Parameters:

  • recovery_code (TD::Types::String)

    Recovery code to check.

Returns:



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

def check_authentication_password_recovery_code(recovery_code:)
  broadcast('@type'         => 'checkAuthenticationPasswordRecoveryCode',
            'recovery_code' => recovery_code)
end

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

folder.

Parameters:

  • invite_link (TD::Types::String)

    Invite link to be checked.

Returns:



751
752
753
754
# File 'lib/tdlib/client_methods.rb', line 751

def check_chat_folder_invite_link(invite_link:)
  broadcast('@type'       => 'checkChatFolderInviteLink',
            'invite_link' => invite_link)
end

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

Parameters:

  • invite_link (TD::Types::String)

    Invite link to be checked.

Returns:



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

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.

Parameters:

  • chat_id (Integer)

    Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created.

  • username (TD::Types::String)

    Username to be checked.

Returns:



771
772
773
774
775
# File 'lib/tdlib/client_methods.rb', line 771

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. The limit can be increased with Telegram Premium.

Parameters:

Returns:



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

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

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

Checks the email address verification code for Telegram Passport.

Parameters:

  • code (TD::Types::String)

    Verification code to check.

Returns:



792
793
794
795
# File 'lib/tdlib/client_methods.rb', line 792

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

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

Checks the login email address authentication.

Parameters:

Returns:



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

def (code:)
  broadcast('@type' => 'checkLoginEmailAddressCode',
            'code'  => code)
end

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

Checks whether a 2-step verification password recovery code sent to an email address is valid.

Parameters:

  • recovery_code (TD::Types::String)

    Recovery code to check.

Returns:



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

def check_password_recovery_code(recovery_code:)
  broadcast('@type'         => 'checkPasswordRecoveryCode',
            'recovery_code' => recovery_code)
end

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

Check the authentication code and completes the request for which the code was sent if appropriate.

Parameters:

  • code (TD::Types::String)

    Authentication code to check.

Returns:



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

def check_phone_number_code(code:)
  broadcast('@type' => 'checkPhoneNumberCode',
            'code'  => code)
end

#check_premium_gift_code(code:) ⇒ TD::Types::PremiumGiftCodeInfo

Return information about a Telegram Premium gift code.

Parameters:

  • code (TD::Types::String)

    The code to check.

Returns:



828
829
830
831
# File 'lib/tdlib/client_methods.rb', line 828

def check_premium_gift_code(code:)
  broadcast('@type' => 'checkPremiumGiftCode',
            'code'  => code)
end

#check_quick_reply_shortcut_name(name:) ⇒ TD::Types::Ok

Checks validness of a name for a quick reply shortcut. Can be called synchronously.

Parameters:

  • name (TD::Types::String)

    The name of the shortcut; 1-32 characters.

Returns:



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

def check_quick_reply_shortcut_name(name:)
  broadcast('@type' => 'checkQuickReplyShortcutName',
            'name'  => name)
end

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

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

Parameters:

  • code (TD::Types::String)

    Verification code to check.

Returns:



847
848
849
850
# File 'lib/tdlib/client_methods.rb', line 847

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

#check_sticker_set_name(name:) ⇒ TD::Types::CheckStickerSetNameResult

Checks whether a name can be used for a new sticker set.

Parameters:

  • name (TD::Types::String)

    Name to be checked.

Returns:



856
857
858
859
# File 'lib/tdlib/client_methods.rb', line 856

def check_sticker_set_name(name:)
  broadcast('@type' => 'checkStickerSetName',
            'name'  => name)
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. Can be called synchronously.

Parameters:

  • file_name (TD::Types::String)

    File name or path to the file.

Returns:



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

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 message drafts in all chats.

Parameters:

  • exclude_secret_chats (Boolean)

    Pass true to keep local message drafts in secret chats.

Returns:



877
878
879
880
# File 'lib/tdlib/client_methods.rb', line 877

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

#clear_autosave_settings_exceptionsTD::Types::Ok

Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings.

Returns:



886
887
888
# File 'lib/tdlib/client_methods.rb', line 886

def clear_autosave_settings_exceptions
  broadcast('@type' => 'clearAutosaveSettingsExceptions')
end

#clear_imported_contactsTD::Types::Ok

Clears all imported contacts, contact list remains unchanged.

Returns:



893
894
895
# File 'lib/tdlib/client_methods.rb', line 893

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

#clear_recent_emoji_statusesTD::Types::Ok

Clears the list of recently used emoji statuses for self status.

Returns:



900
901
902
# File 'lib/tdlib/client_methods.rb', line 900

def clear_recent_emoji_statuses
  broadcast('@type' => 'clearRecentEmojiStatuses')
end

#clear_recent_reactionsTD::Types::Ok

Clears the list of recently used reactions.

Returns:



907
908
909
# File 'lib/tdlib/client_methods.rb', line 907

def clear_recent_reactions
  broadcast('@type' => 'clearRecentReactions')
end

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

Clears the list of recently used stickers.

Parameters:

  • is_attached (Boolean)

    Pass true to clear the list of stickers recently attached to photo or video files; pass false to clear the list of recently sent stickers.

Returns:



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

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.

Returns:



924
925
926
# File 'lib/tdlib/client_methods.rb', line 924

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

#clear_searched_for_tags(clear_cashtags:) ⇒ TD::Types::Ok

Clears the list of recently searched for hashtags or cashtags.

Parameters:

  • clear_cashtags (Boolean)

    Pass true to clear the list of recently searched for cashtags; otherwise, the list of recently searched for hashtags will be cleared.

Returns:



933
934
935
936
# File 'lib/tdlib/client_methods.rb', line 933

def clear_searched_for_tags(clear_cashtags:)
  broadcast('@type'          => 'clearSearchedForTags',
            'clear_cashtags' => clear_cashtags)
end

#click_animated_emoji_message(chat_id:, message_id:) ⇒ TD::Types::Sticker

Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played.

Parameters:

  • chat_id (Integer)

    Chat identifier of the message.

  • message_id (Integer)

    Identifier of the clicked message.

Returns:



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

def click_animated_emoji_message(chat_id:, message_id:)
  broadcast('@type'      => 'clickAnimatedEmojiMessage',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

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

Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the

sponsored message.

Parameters:

  • chat_id (Integer)

    Chat identifier of the sponsored message.

  • message_id (Integer)

    Identifier of the sponsored message.

Returns:



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

def click_chat_sponsored_message(chat_id:, message_id:)
  broadcast('@type'      => 'clickChatSponsoredMessage',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#click_premium_subscription_buttonTD::Types::Ok

Informs TDLib that the user clicked Premium subscription button on the Premium features screen.

Returns:



965
966
967
# File 'lib/tdlib/client_methods.rb', line 965

def click_premium_subscription_button
  broadcast('@type' => 'clickPremiumSubscriptionButton')
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. Can be called before initialization.

Returns:



975
976
977
# File 'lib/tdlib/client_methods.rb', line 975

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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



984
985
986
987
# File 'lib/tdlib/client_methods.rb', line 984

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 transferring its state to secretChatStateClosed.

Parameters:

  • secret_chat_id (Integer)

    Secret chat identifier.

Returns:



993
994
995
996
# File 'lib/tdlib/client_methods.rb', line 993

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

#close_story(story_sender_chat_id:, story_id:) ⇒ TD::Types::Ok

Informs TDLib that a story is closed by the user.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the story to close.

  • story_id (Integer)

    The identifier of the story.

Returns:



1003
1004
1005
1006
1007
# File 'lib/tdlib/client_methods.rb', line 1003

def close_story(story_sender_chat_id:, story_id:)
  broadcast('@type'                => 'closeStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id)
end

#close_web_app(web_app_launch_id:) ⇒ TD::Types::Ok

Informs TDLib that a previously opened Web App was closed.

Parameters:

  • web_app_launch_id (Integer)

    Identifier of Web App launch, received from openWebApp.

Returns:



1013
1014
1015
1016
# File 'lib/tdlib/client_methods.rb', line 1013

def close_web_app(web_app_launch_id:)
  broadcast('@type'             => 'closeWebApp',
            'web_app_launch_id' => web_app_launch_id)
end

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

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

Parameters:

  • link (TD::Types::String)

    A link from a QR code. The link must be scanned by the in-app camera.

Returns:



1024
1025
1026
1027
# File 'lib/tdlib/client_methods.rb', line 1024

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

#confirm_session(session_id:) ⇒ TD::Types::Ok

Confirms an unconfirmed session of the current user from another device.

Parameters:

  • session_id (Integer)

    Session identifier.

Returns:



1033
1034
1035
1036
# File 'lib/tdlib/client_methods.rb', line 1033

def confirm_session(session_id:)
  broadcast('@type'      => 'confirmSession',
            'session_id' => session_id)
end

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

Returns an existing chat corresponding to a known basic group.

Parameters:

  • basic_group_id (Integer)

    Basic group identifier.

  • force (Boolean)

    Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect.

Returns:



1044
1045
1046
1047
1048
# File 'lib/tdlib/client_methods.rb', line 1044

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

Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to getOption(“business_chat_link_count_max”) links created. Returns the created link.

Parameters:

Returns:



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

def create_business_chat_link(link_info:)
  broadcast('@type'     => 'createBusinessChatLink',
            'link_info' => link_info)
end

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

Creates a new call.

Parameters:

  • user_id (Integer)

    Identifier of the user to be called.

  • protocol (TD::Types::CallProtocol)

    The call protocols supported by the application.

  • is_video (Boolean)

    Pass true to create a video call.

Returns:



1068
1069
1070
1071
1072
1073
# File 'lib/tdlib/client_methods.rb', line 1068

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

#create_chat_folder(folder:) ⇒ TD::Types::ChatFolderInfo

Creates new chat folder. Returns information about the created chat folder. There can be up to getOption(“chat_folder_count_max”) chat folders, but the limit can be increased with Telegram

Premium.

Parameters:

Returns:



1082
1083
1084
1085
# File 'lib/tdlib/client_methods.rb', line 1082

def create_chat_folder(folder:)
  broadcast('@type'  => 'createChatFolder',
            'folder' => folder)
end

Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • name (TD::Types::String)

    Name of the link; 0-32 characters.

  • chat_ids (Array<Integer>)

    Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation.

Returns:



1096
1097
1098
1099
1100
1101
# File 'lib/tdlib/client_methods.rb', line 1096

def create_chat_folder_invite_link(chat_folder_id:, name:, chat_ids:)
  broadcast('@type'          => 'createChatFolderInviteLink',
            'chat_folder_id' => chat_folder_id,
            'name'           => name,
            'chat_ids'       => chat_ids)
end

Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • name (TD::Types::String)

    Invite link name; 0-32 characters.

  • expiration_date (Integer)

    Point in time (Unix timestamp) when the link will expire; pass 0 if never.

  • member_limit (Integer)

    The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited.

  • creates_join_request (Boolean)

    Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0.

Returns:



1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/tdlib/client_methods.rb', line 1116

def create_chat_invite_link(chat_id:, name:, expiration_date:, member_limit:, creates_join_request:)
  broadcast('@type'                => 'createChatInviteLink',
            'chat_id'              => chat_id,
            'name'                 => name,
            'expiration_date'      => expiration_date,
            'member_limit'         => member_limit,
            'creates_join_request' => creates_join_request)
end

Creates a new subscription invite link for a channel chat. Requires can_invite_users right in the chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • name (TD::Types::String)

    Invite link name; 0-32 characters.

  • subscription_pricing (TD::Types::StarSubscriptionPricing)

    Information about subscription plan that will be applied to the users joining the chat via the link. Subscription period must be 2592000 in production environment, and 60 or 300 if Telegram test environment is used.

Returns:



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

def create_chat_subscription_invite_link(chat_id:, name:, subscription_pricing:)
  broadcast('@type'                => 'createChatSubscriptionInviteLink',
            'chat_id'              => chat_id,
            'name'                 => name,
            'subscription_pricing' => subscription_pricing)
end

#create_forum_topic(chat_id:, name:, icon:) ⇒ TD::Types::ForumTopicInfo

Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member

right in the supergroup.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • name (TD::Types::String)

    Name of the topic; 1-128 characters.

  • icon (TD::Types::ForumTopicIcon)

    Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons.

Returns:



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

def create_forum_topic(chat_id:, name:, icon:)
  broadcast('@type'   => 'createForumTopic',
            'chat_id' => chat_id,
            'name'    => name,
            'icon'    => icon)
end

Creates a link for the given invoice; for bots only.

Parameters:

Returns:



1163
1164
1165
1166
# File 'lib/tdlib/client_methods.rb', line 1163

def create_invoice_link(invoice:)
  broadcast('@type'   => 'createInvoiceLink',
            'invoice' => invoice)
end

#create_new_basic_group_chat(user_ids: nil, title:, message_auto_delete_time:) ⇒ TD::Types::CreatedBasicGroupChat

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

Parameters:

  • user_ids (Array<Integer>, nil) (defaults to: nil)

    Identifiers of users to be added to the basic group; may be empty to create a basic group without other members.

  • title (TD::Types::String)

    Title of the new basic group; 1-128 characters.

  • message_auto_delete_time (Integer)

    Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren’t deleted automatically.

Returns:



1178
1179
1180
1181
1182
1183
# File 'lib/tdlib/client_methods.rb', line 1178

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

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

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

Parameters:

  • user_id (Integer)

    Identifier of the target user.

Returns:



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

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

#create_new_sticker_set(user_id:, title:, name: nil, sticker_type:, needs_repainting:, stickers:, source: nil) ⇒ TD::Types::StickerSet

Creates a new sticker set. Returns the newly created sticker set.

Parameters:

  • user_id (Integer)

    Sticker set owner; ignored for regular users.

  • title (TD::Types::String)

    Sticker set title; 1-64 characters.

  • name (TD::Types::String, nil) (defaults to: nil)

    Sticker set name. Can contain only English letters, digits and underscores. Must end with *“by<bot username>”* (*<bot_username>* is case insensitive) for bots; 0-64 characters. If empty, then the name returned by getSuggestedStickerSetName will be used automatically.

  • sticker_type (TD::Types::StickerType)

    Type of the stickers in the set.

  • needs_repainting (Boolean)

    Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only.

  • stickers (Array<TD::Types::InputSticker>)

    List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown.

  • source (TD::Types::String, nil) (defaults to: nil)

    Source of the sticker set; may be empty if unknown.

Returns:



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
# File 'lib/tdlib/client_methods.rb', line 1212

def create_new_sticker_set(user_id:, title:, name: nil, sticker_type:, needs_repainting:, stickers:, source: nil)
  broadcast('@type'            => 'createNewStickerSet',
            'user_id'          => user_id,
            'title'            => title,
            'name'             => name,
            'sticker_type'     => sticker_type,
            'needs_repainting' => needs_repainting,
            'stickers'         => stickers,
            'source'           => source)
end

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

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

Parameters:

  • title (TD::Types::String)

    Title of the new chat; 1-128 characters.

  • is_forum (Boolean)

    Pass true to create a forum supergroup chat.

  • is_channel (Boolean)

    Pass true to create a channel chat; ignored if a forum is created.

  • description (TD::Types::String)

    Chat description; 0-255 characters.

  • location (TD::Types::ChatLocation)

    Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat.

  • message_auto_delete_time (Integer)

    Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren’t deleted automatically.

  • for_import (Boolean)

    Pass true to create a supergroup for importing messages using importMessages.

Returns:



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
# File 'lib/tdlib/client_methods.rb', line 1237

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

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

Returns an existing chat corresponding to a given user.

Parameters:

  • user_id (Integer)

    User identifier.

  • force (Boolean)

    Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect.

Returns:



1255
1256
1257
1258
1259
# File 'lib/tdlib/client_methods.rb', line 1255

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.

Parameters:

  • secret_chat_id (Integer)

    Secret chat identifier.

Returns:



1265
1266
1267
1268
# File 'lib/tdlib/client_methods.rb', line 1265

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.

Parameters:

  • supergroup_id (Integer)

    Supergroup or channel identifier.

  • force (Boolean)

    Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect.

Returns:



1276
1277
1278
1279
1280
# File 'lib/tdlib/client_methods.rb', line 1276

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.

Parameters:

  • password (TD::Types::String)

    The 2-step verification password of the current user.

  • valid_for (Integer)

    Time during which the temporary password will be valid, in seconds; must be between 60 and 86400.

Returns:



1288
1289
1290
1291
1292
# File 'lib/tdlib/client_methods.rb', line 1288

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

#create_video_chat(chat_id:, title: nil, start_date:, is_rtmp_stream:) ⇒ TD::Types::GroupCallId

Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right.

Parameters:

  • chat_id (Integer)

    Identifier of a chat in which the video chat will be created.

  • title (TD::Types::String, nil) (defaults to: nil)

    Group call title; if empty, chat title will be used.

  • start_date (Integer)

    Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future.

  • is_rtmp_stream (Boolean)

    Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges.

Returns:



1305
1306
1307
1308
1309
1310
1311
# File 'lib/tdlib/client_methods.rb', line 1305

def create_video_chat(chat_id:, title: nil, start_date:, is_rtmp_stream:)
  broadcast('@type'          => 'createVideoChat',
            'chat_id'        => chat_id,
            'title'          => title,
            'start_date'     => start_date,
            'is_rtmp_stream' => is_rtmp_stream)
end

#delete_account(reason: nil, password:) ⇒ 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.

Parameters:

  • reason (TD::Types::String, nil) (defaults to: nil)

    The reason why the account was deleted; optional.

  • password (TD::Types::String)

    The 2-step verification password of the current user. If the current user isn’t authorized, then an empty string can be passed and account deletion can be canceled within one week.

Returns:



1322
1323
1324
1325
1326
# File 'lib/tdlib/client_methods.rb', line 1322

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

#delete_all_call_messages(revoke:) ⇒ TD::Types::Ok

Deletes all call messages.

Parameters:

  • revoke (Boolean)

    Pass true to delete the messages for all users.

Returns:



1332
1333
1334
1335
# File 'lib/tdlib/client_methods.rb', line 1332

def delete_all_call_messages(revoke:)
  broadcast('@type'  => 'deleteAllCallMessages',
            'revoke' => revoke)
end

Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for

other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • creator_user_id (Integer)

    User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner.

Returns:



1345
1346
1347
1348
1349
# File 'lib/tdlib/client_methods.rb', line 1345

def delete_all_revoked_chat_invite_links(chat_id:, creator_user_id:)
  broadcast('@type'           => 'deleteAllRevokedChatInviteLinks',
            'chat_id'         => chat_id,
            'creator_user_id' => creator_user_id)
end

#delete_bot_media_previews(bot_user_id:, language_code:, file_ids:) ⇒ TD::Types::Ok

Delete media previews from the list of media previews of a bot.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must be owned and must have the main Web App.

  • language_code (TD::Types::String)

    Language code of the media previews to delete.

  • file_ids (Array<Integer>)

    File identifiers of the media to delete.

Returns:



1358
1359
1360
1361
1362
1363
# File 'lib/tdlib/client_methods.rb', line 1358

def delete_bot_media_previews(bot_user_id:, language_code:, file_ids:)
  broadcast('@type'         => 'deleteBotMediaPreviews',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'file_ids'      => file_ids)
end

Deletes a business chat link of the current account.

Parameters:

  • link (TD::Types::String)

    The link to delete.

Returns:



1369
1370
1371
1372
# File 'lib/tdlib/client_methods.rb', line 1369

def delete_business_chat_link(link:)
  broadcast('@type' => 'deleteBusinessChatLink',
            'link'  => link)
end

#delete_business_connected_bot(bot_user_id:) ⇒ TD::Types::Ok

Deletes the business bot that is connected to the current user account.

Parameters:

  • bot_user_id (Integer)

    Unique user identifier for the bot.

Returns:



1378
1379
1380
1381
# File 'lib/tdlib/client_methods.rb', line 1378

def delete_business_connected_bot(bot_user_id:)
  broadcast('@type'       => 'deleteBusinessConnectedBot',
            'bot_user_id' => bot_user_id)
end

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

Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



1389
1390
1391
1392
# File 'lib/tdlib/client_methods.rb', line 1389

def delete_chat(chat_id:)
  broadcast('@type'   => 'deleteChat',
            'chat_id' => chat_id)
end

#delete_chat_background(chat_id:, restore_previous:) ⇒ TD::Types::Ok

Deletes background in a specific chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • restore_previous (Boolean)

    Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. Supposed to be used from Types::MessageContent::ChatSetBackground messages with the currently set background that was set for both sides by the other user.

Returns:



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

def delete_chat_background(chat_id:, restore_previous:)
  broadcast('@type'            => 'deleteChatBackground',
            'chat_id'          => chat_id,
            'restore_previous' => restore_previous)
end

#delete_chat_folder(chat_folder_id:, leave_chat_ids:) ⇒ TD::Types::Ok

Deletes existing chat folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • leave_chat_ids (Array<Integer>)

    Identifiers of the chats to leave. The chats must be pinned or always included in the folder.

Returns:



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

def delete_chat_folder(chat_folder_id:, leave_chat_ids:)
  broadcast('@type'          => 'deleteChatFolder',
            'chat_folder_id' => chat_folder_id,
            'leave_chat_ids' => leave_chat_ids)
end

Deletes an invite link for a chat folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • invite_link (TD::Types::String)

    Invite link to be deleted.

Returns:



1425
1426
1427
1428
1429
# File 'lib/tdlib/client_methods.rb', line 1425

def delete_chat_folder_invite_link(chat_folder_id:, invite_link:)
  broadcast('@type'          => 'deleteChatFolderInviteLink',
            'chat_folder_id' => chat_folder_id,
            'invite_link'    => invite_link)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • remove_from_chat_list (Boolean)

    Pass true to remove the chat from all chat lists.

  • revoke (Boolean)

    Pass true to delete chat history for all users.

Returns:



1439
1440
1441
1442
1443
1444
# File 'lib/tdlib/client_methods.rb', line 1439

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_by_date(chat_id:, min_date:, max_date:, revoke:) ⇒ TD::Types::Ok

Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • min_date (Integer)

    The minimum date of the messages to delete.

  • max_date (Integer)

    The maximum date of the messages to delete.

  • revoke (Boolean)

    Pass true to delete chat messages for all users; private chats only.

Returns:



1455
1456
1457
1458
1459
1460
1461
# File 'lib/tdlib/client_methods.rb', line 1455

def delete_chat_messages_by_date(chat_id:, min_date:, max_date:, revoke:)
  broadcast('@type'    => 'deleteChatMessagesByDate',
            'chat_id'  => chat_id,
            'min_date' => min_date,
            'max_date' => max_date,
            'revoke'   => revoke)
end

#delete_chat_messages_by_sender(chat_id:, sender_id:) ⇒ TD::Types::Ok

Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • sender_id (TD::Types::MessageSender)

    Identifier of the sender of messages to delete.

Returns:



1469
1470
1471
1472
1473
# File 'lib/tdlib/client_methods.rb', line 1469

def delete_chat_messages_by_sender(chat_id:, sender_id:)
  broadcast('@type'     => 'deleteChatMessagesBySender',
            'chat_id'   => chat_id,
            'sender_id' => sender_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 replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    The message identifier of the used keyboard.

Returns:



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

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

#delete_commands(scope:, language_code:) ⇒ TD::Types::Ok

Deletes commands supported by the bot for the given user scope and language; for bots only.

Parameters:

  • scope (TD::Types::BotCommandScope)

    The scope to which the commands are relevant; pass null to delete commands in the default bot command scope.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code or an empty string.

Returns:



1494
1495
1496
1497
1498
# File 'lib/tdlib/client_methods.rb', line 1494

def delete_commands(scope:, language_code:)
  broadcast('@type'         => 'deleteCommands',
            'scope'         => scope,
            'language_code' => language_code)
end

#delete_default_background(for_dark_theme:) ⇒ TD::Types::Ok

Deletes default background for chats.

Parameters:

  • for_dark_theme (Boolean)

    Pass true if the background is deleted for a dark theme.

Returns:



1504
1505
1506
1507
# File 'lib/tdlib/client_methods.rb', line 1504

def delete_default_background(for_dark_theme:)
  broadcast('@type'          => 'deleteDefaultBackground',
            'for_dark_theme' => for_dark_theme)
end

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

Deletes a file from the TDLib file cache.

Parameters:

  • file_id (Integer)

    Identifier of the file to delete.

Returns:



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

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

#delete_forum_topic(chat_id:, message_thread_id:) ⇒ TD::Types::Ok

Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless

the user is creator of the topic, the topic has no messages from other users and has at most 11 messages.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

Returns:



1524
1525
1526
1527
1528
# File 'lib/tdlib/client_methods.rb', line 1524

def delete_forum_topic(chat_id:, message_thread_id:)
  broadcast('@type'             => 'deleteForumTopic',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_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.

Parameters:

  • language_pack_id (TD::Types::String)

    Identifier of the language pack to delete.

Returns:



1537
1538
1539
1540
# File 'lib/tdlib/client_methods.rb', line 1537

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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_ids (Array<Integer>)

    Identifiers of the messages to be deleted. Use messageProperties.can_be_deleted_only_for_self and messageProperties.can_be_deleted_for_all_users to get suitable messages.

  • revoke (Boolean)

    Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats.

Returns:



1551
1552
1553
1554
1555
1556
# File 'lib/tdlib/client_methods.rb', line 1551

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.

Parameters:

Returns:



1562
1563
1564
1565
# File 'lib/tdlib/client_methods.rb', line 1562

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

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

Deletes a profile photo.

Parameters:

  • profile_photo_id (Integer)

    Identifier of the profile photo to delete.

Returns:



1571
1572
1573
1574
# File 'lib/tdlib/client_methods.rb', line 1571

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

#delete_quick_reply_shortcut(shortcut_id:) ⇒ TD::Types::Ok

Deletes a quick reply shortcut.

Parameters:

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut.

Returns:



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

def delete_quick_reply_shortcut(shortcut_id:)
  broadcast('@type'       => 'deleteQuickReplyShortcut',
            'shortcut_id' => shortcut_id)
end

#delete_quick_reply_shortcut_messages(shortcut_id:, message_ids:) ⇒ TD::Types::Ok

Deletes specified quick reply messages.

Parameters:

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut to which the messages belong.

  • message_ids (Array<Integer>)

    Unique identifiers of the messages.

Returns:



1590
1591
1592
1593
1594
# File 'lib/tdlib/client_methods.rb', line 1590

def delete_quick_reply_shortcut_messages(shortcut_id:, message_ids:)
  broadcast('@type'       => 'deleteQuickReplyShortcutMessages',
            'shortcut_id' => shortcut_id,
            'message_ids' => message_ids)
end

Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for

other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link to revoke.

Returns:



1603
1604
1605
1606
1607
# File 'lib/tdlib/client_methods.rb', line 1603

def delete_revoked_chat_invite_link(chat_id:, invite_link:)
  broadcast('@type'       => 'deleteRevokedChatInviteLink',
            'chat_id'     => chat_id,
            'invite_link' => invite_link)
end

#delete_saved_credentialsTD::Types::Ok

Deletes saved credentials for all payment provider bots.

Returns:



1612
1613
1614
# File 'lib/tdlib/client_methods.rb', line 1612

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

#delete_saved_messages_topic_history(saved_messages_topic_id:) ⇒ TD::Types::Ok

Deletes all messages in a Saved Messages topic.

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic which messages will be deleted.

Returns:



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

def delete_saved_messages_topic_history(saved_messages_topic_id:)
  broadcast('@type'                   => 'deleteSavedMessagesTopicHistory',
            'saved_messages_topic_id' => saved_messages_topic_id)
end

#delete_saved_messages_topic_messages_by_date(saved_messages_topic_id:, min_date:, max_date:) ⇒ TD::Types::Ok

Deletes all messages between the specified dates in a Saved Messages topic. Messages sent in the last 30 seconds will not be deleted.

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic which messages will be deleted.

  • min_date (Integer)

    The minimum date of the messages to delete.

  • max_date (Integer)

    The maximum date of the messages to delete.

Returns:



1632
1633
1634
1635
1636
1637
# File 'lib/tdlib/client_methods.rb', line 1632

def delete_saved_messages_topic_messages_by_date(saved_messages_topic_id:, min_date:, max_date:)
  broadcast('@type'                   => 'deleteSavedMessagesTopicMessagesByDate',
            'saved_messages_topic_id' => saved_messages_topic_id,
            'min_date'                => min_date,
            'max_date'                => max_date)
end

#delete_saved_order_infoTD::Types::Ok

Deletes saved order information.

Returns:



1642
1643
1644
# File 'lib/tdlib/client_methods.rb', line 1642

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

#delete_sticker_set(name:) ⇒ TD::Types::Ok

Completely deletes a sticker set.

Parameters:

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user.

Returns:



1651
1652
1653
1654
# File 'lib/tdlib/client_methods.rb', line 1651

def delete_sticker_set(name:)
  broadcast('@type' => 'deleteStickerSet',
            'name'  => name)
end

#delete_story(story_sender_chat_id:, story_id:) ⇒ TD::Types::Ok

Deletes a previously sent story. Can be called only if story.can_be_deleted == true.

Parameters:

  • story_sender_chat_id (Integer)

    Identifier of the chat that posted the story.

  • story_id (Integer)

    Identifier of the story to delete.

Returns:



1662
1663
1664
1665
1666
# File 'lib/tdlib/client_methods.rb', line 1662

def delete_story(story_sender_chat_id:, story_id:)
  broadcast('@type'                => 'deleteStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_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. Can be called before authorization.

Returns:



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

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

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

Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup

or channel.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup or channel.

Returns:



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

def disable_all_supergroup_usernames(supergroup_id:)
  broadcast('@type'         => 'disableAllSupergroupUsernames',
            'supergroup_id' => supergroup_id)
end

#disable_proxyTD::Types::Ok

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

Returns:



1693
1694
1695
# File 'lib/tdlib/client_methods.rb', line 1693

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

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

Discards a call.

Parameters:

  • call_id (Integer)

    Call identifier.

  • is_disconnected (Boolean)

    Pass true if the user was disconnected.

  • duration (Integer)

    The call duration, in seconds.

  • is_video (Boolean)

    Pass true if the call was a video call.

  • connection_id (Integer)

    Identifier of the connection used during the call.

Returns:



1705
1706
1707
1708
1709
1710
1711
1712
# File 'lib/tdlib/client_methods.rb', line 1705

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

#disconnect_all_websitesTD::Types::Ok

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

Returns:



1717
1718
1719
# File 'lib/tdlib/client_methods.rb', line 1717

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

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

Disconnects website from the current user’s Telegram account.

Parameters:

  • website_id (Integer)

    Website identifier.

Returns:



1725
1726
1727
1728
# File 'lib/tdlib/client_methods.rb', line 1725

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.

Parameters:

  • file_id (Integer)

    Identifier of the file to download.

  • priority (Integer)

    Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first.

  • offset (Integer)

    The starting position from which the file needs to be downloaded.

  • limit (Integer)

    Number of bytes which need to be downloaded starting from the “offset” position before the download will automatically be canceled; use 0 to download without a limit.

  • synchronous (Boolean)

    Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started.

Returns:



1745
1746
1747
1748
1749
1750
1751
1752
# File 'lib/tdlib/client_methods.rb', line 1745

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_bot_media_preview(bot_user_id:, language_code:, file_id:, content:) ⇒ TD::Types::BotMediaPreview

Replaces media preview in the list of media previews of a bot. Returns the new preview after edit is completed server-side.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must be owned and must have the main Web App.

  • language_code (TD::Types::String)

    Language code of the media preview to edit.

  • file_id (Integer)

    File identifier of the media to replace.

  • content (TD::Types::InputStoryContent)

    Content of the new preview.

Returns:



1763
1764
1765
1766
1767
1768
1769
# File 'lib/tdlib/client_methods.rb', line 1763

def edit_bot_media_preview(bot_user_id:, language_code:, file_id:, content:)
  broadcast('@type'         => 'editBotMediaPreview',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'file_id'       => file_id,
            'content'       => content)
end

Edits a business chat link of the current account. Requires Telegram Business subscription. Returns the edited link.

Parameters:

Returns:



1778
1779
1780
1781
1782
# File 'lib/tdlib/client_methods.rb', line 1778

def edit_business_chat_link(link:, link_info:)
  broadcast('@type'     => 'editBusinessChatLink',
            'link'      => link,
            'link_info' => link_info)
end

#edit_business_message_caption(business_connection_id:, chat_id:, message_id:, reply_markup:, caption:, show_caption_above_media:) ⇒ TD::Types::BusinessMessage

Edits the caption of a message sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • caption (TD::Types::FormattedText)

    New message content caption; pass null to remove caption; 0-getOption(“message_caption_length_max”) characters.

  • show_caption_above_media (Boolean)

    Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages.

Returns:



1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
# File 'lib/tdlib/client_methods.rb', line 1797

def edit_business_message_caption(business_connection_id:, chat_id:, message_id:, reply_markup:, caption:,
                                  show_caption_above_media:)
  broadcast('@type'                    => 'editBusinessMessageCaption',
            'business_connection_id'   => business_connection_id,
            'chat_id'                  => chat_id,
            'message_id'               => message_id,
            'reply_markup'             => reply_markup,
            'caption'                  => caption,
            'show_caption_above_media' => show_caption_above_media)
end

#edit_business_message_live_location(business_connection_id:, chat_id:, message_id:, reply_markup:, location:, live_period:, heading:, proximity_alert_radius:) ⇒ TD::Types::BusinessMessage

Edits the content of a live location in a message sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • location (TD::Types::Location)

    New location content of the message; pass null to stop sharing the live location.

  • live_period (Integer)

    New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period.

  • heading (Integer)

    The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown.

  • proximity_alert_radius (Integer)

    The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled.

Returns:



1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
# File 'lib/tdlib/client_methods.rb', line 1828

def edit_business_message_live_location(business_connection_id:, chat_id:, message_id:, reply_markup:, location:,
                                        live_period:, heading:, proximity_alert_radius:)
  broadcast('@type'                  => 'editBusinessMessageLiveLocation',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup,
            'location'               => location,
            'live_period'            => live_period,
            'heading'                => heading,
            'proximity_alert_radius' => proximity_alert_radius)
end

#edit_business_message_media(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:) ⇒ TD::Types::BusinessMessage

Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on

behalf of a business ; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

  • input_message_content (TD::Types::InputMessageContent)

    New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, Types::InputMessageContent::Photo or inputMessageVideo.

Returns:



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

def edit_business_message_media(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:)
  broadcast('@type'                  => 'editBusinessMessageMedia',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup,
            'input_message_content'  => input_message_content)
end

#edit_business_message_reply_markup(business_connection_id:, chat_id:, message_id:, reply_markup:) ⇒ TD::Types::BusinessMessage

Edits the reply markup of a message sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

Returns:



1870
1871
1872
1873
1874
1875
1876
# File 'lib/tdlib/client_methods.rb', line 1870

def edit_business_message_reply_markup(business_connection_id:, chat_id:, message_id:, reply_markup:)
  broadcast('@type'                  => 'editBusinessMessageReplyMarkup',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup)
end

#edit_business_message_text(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:) ⇒ TD::Types::BusinessMessage

Edits the text of a text or game message sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • input_message_content (TD::Types::InputMessageContent)

    New text content of the message. Must be of type inputMessageText.

Returns:



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

def edit_business_message_text(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:)
  broadcast('@type'                  => 'editBusinessMessageText',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup,
            'input_message_content'  => input_message_content)
end

#edit_chat_folder(chat_folder_id:, folder:) ⇒ TD::Types::ChatFolderInfo

Edits existing chat folder. Returns information about the edited chat folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • folder (TD::Types::ChatFolder)

    The edited chat folder.

Returns:



1903
1904
1905
1906
1907
# File 'lib/tdlib/client_methods.rb', line 1903

def edit_chat_folder(chat_folder_id:, folder:)
  broadcast('@type'          => 'editChatFolder',
            'chat_folder_id' => chat_folder_id,
            'folder'         => folder)
end

Edits an invite link for a chat folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • invite_link (TD::Types::String)

    Invite link to be edited.

  • name (TD::Types::String)

    New name of the link; 0-32 characters.

  • chat_ids (Array<Integer>)

    New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing.

Returns:



1918
1919
1920
1921
1922
1923
1924
# File 'lib/tdlib/client_methods.rb', line 1918

def edit_chat_folder_invite_link(chat_folder_id:, invite_link:, name:, chat_ids:)
  broadcast('@type'          => 'editChatFolderInviteLink',
            'chat_folder_id' => chat_folder_id,
            'invite_link'    => invite_link,
            'name'           => name,
            'chat_ids'       => chat_ids)
end

Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used

Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other
links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link to be edited.

  • name (TD::Types::String)

    Invite link name; 0-32 characters.

  • expiration_date (Integer)

    Point in time (Unix timestamp) when the link will expire; pass 0 if never.

  • member_limit (Integer)

    The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited.

  • creates_join_request (Boolean)

    Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0.

Returns:



1942
1943
1944
1945
1946
1947
1948
1949
1950
# File 'lib/tdlib/client_methods.rb', line 1942

def edit_chat_invite_link(chat_id:, invite_link:, name:, expiration_date:, member_limit:, creates_join_request:)
  broadcast('@type'                => 'editChatInviteLink',
            'chat_id'              => chat_id,
            'invite_link'          => invite_link,
            'name'                 => name,
            'expiration_date'      => expiration_date,
            'member_limit'         => member_limit,
            'creates_join_request' => creates_join_request)
end

Edits a subscription invite link for a channel chat. Requires can_invite_users right in the chat for own links and owner privileges for other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link to be edited.

  • name (TD::Types::String)

    Invite link name; 0-32 characters.

Returns:



1959
1960
1961
1962
1963
1964
# File 'lib/tdlib/client_methods.rb', line 1959

def edit_chat_subscription_invite_link(chat_id:, invite_link:, name:)
  broadcast('@type'       => 'editChatSubscriptionInviteLink',
            'chat_id'     => chat_id,
            'invite_link' => invite_link,
            'name'        => name)
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.

Parameters:

Returns:



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

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

#edit_forum_topic(chat_id:, message_thread_id:, name: nil, edit_icon_custom_emoji:, icon_custom_emoji_id:) ⇒ TD::Types::Ok

Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup

unless the user is creator of the topic.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

  • name (TD::Types::String, nil) (defaults to: nil)

    New name of the topic; 0-128 characters. If empty, the previous topic name is kept.

  • edit_icon_custom_emoji (Boolean)

    Pass true to edit the icon of the topic. Icon of the General topic can’t be edited.

  • icon_custom_emoji_id (Integer)

    Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons.

Returns:



1991
1992
1993
1994
1995
1996
1997
1998
# File 'lib/tdlib/client_methods.rb', line 1991

def edit_forum_topic(chat_id:, message_thread_id:, name: nil, edit_icon_custom_emoji:, icon_custom_emoji_id:)
  broadcast('@type'                  => 'editForumTopic',
            'chat_id'                => chat_id,
            'message_thread_id'      => message_thread_id,
            'name'                   => name,
            'edit_icon_custom_emoji' => edit_icon_custom_emoji,
            'icon_custom_emoji_id'   => icon_custom_emoji_id)
end

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

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

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • caption (TD::Types::FormattedText)

    New message content caption; pass null to remove caption; 0-getOption(“message_caption_length_max”) characters.

  • show_caption_above_media (Boolean)

    Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages.

Returns:



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

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

#edit_inline_message_live_location(inline_message_id:, reply_markup:, location:, live_period:, heading:, proximity_alert_radius:) ⇒ TD::Types::Ok

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

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • location (TD::Types::Location)

    New location content of the message; pass null to stop sharing the live location.

  • live_period (Integer)

    New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period.

  • heading (Integer)

    The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown.

  • proximity_alert_radius (Integer)

    The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled.

Returns:



2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
# File 'lib/tdlib/client_methods.rb', line 2035

def edit_inline_message_live_location(inline_message_id:, reply_markup:, location:, live_period:, heading:,
                                      proximity_alert_radius:)
  broadcast('@type'                  => 'editInlineMessageLiveLocation',
            'inline_message_id'      => inline_message_id,
            'reply_markup'           => reply_markup,
            'location'               => location,
            'live_period'            => live_period,
            'heading'                => heading,
            'proximity_alert_radius' => proximity_alert_radius)
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.

Parameters:

Returns:



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

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.

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

Returns:



2067
2068
2069
2070
2071
# File 'lib/tdlib/client_methods.rb', line 2067

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.

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

  • input_message_content (TD::Types::InputMessageContent)

    New text content of the message. Must be of type inputMessageText.

Returns:



2080
2081
2082
2083
2084
2085
# File 'lib/tdlib/client_methods.rb', line 2080

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:, show_caption_above_media:) ⇒ TD::Types::Message

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

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

  • caption (TD::Types::FormattedText)

    New message content caption; 0-getOption(“message_caption_length_max”) characters; pass null to remove caption.

  • show_caption_above_media (Boolean)

    Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages.

Returns:



2100
2101
2102
2103
2104
2105
2106
2107
# File 'lib/tdlib/client_methods.rb', line 2100

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

#edit_message_live_location(chat_id:, message_id:, reply_markup:, location:, live_period:, heading:, proximity_alert_radius:) ⇒ 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.

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

  • location (TD::Types::Location)

    New location content of the message; pass null to stop sharing the live location.

  • live_period (Integer)

    New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period.

  • heading (Integer)

    The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown.

  • proximity_alert_radius (Integer)

    The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled.

Returns:



2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
# File 'lib/tdlib/client_methods.rb', line 2130

def edit_message_live_location(chat_id:, message_id:, reply_markup:, location:, live_period:, heading:,
                               proximity_alert_radius:)
  broadcast('@type'                  => 'editMessageLiveLocation',
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup,
            'location'               => location,
            'live_period'            => live_period,
            'heading'                => heading,
            'proximity_alert_radius' => proximity_alert_radius)
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, including message

caption.

If only the caption needs to be edited, use editMessageCaption instead. The media can’t be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can’t be changed with exception of replacing a photo with a video or vice

versa.

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

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

  • input_message_content (TD::Types::InputMessageContent)

    New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, Types::InputMessageContent::Photo or inputMessageVideo.

Returns:



2158
2159
2160
2161
2162
2163
2164
# File 'lib/tdlib/client_methods.rb', line 2158

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.

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

Returns:



2174
2175
2176
2177
2178
2179
# File 'lib/tdlib/client_methods.rb', line 2174

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.

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable.

  • scheduling_state (TD::Types::MessageSchedulingState)

    The new message scheduling state; pass null to send the message immediately.

Returns:



2190
2191
2192
2193
2194
2195
# File 'lib/tdlib/client_methods.rb', line 2190

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.

Parameters:

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

  • input_message_content (TD::Types::InputMessageContent)

    New text content of the message. Must be of type inputMessageText.

Returns:



2207
2208
2209
2210
2211
2212
2213
# File 'lib/tdlib/client_methods.rb', line 2207

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.

Parameters:

  • proxy_id (Integer)

    Proxy identifier.

  • server (TD::Types::String)

    Proxy server domain or IP address.

  • port (Integer)

    Proxy server port.

  • enable (Boolean)

    Pass true to immediately enable the proxy.

  • type (TD::Types::ProxyType)

    Proxy type.

Returns:



2224
2225
2226
2227
2228
2229
2230
2231
# File 'lib/tdlib/client_methods.rb', line 2224

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

#edit_quick_reply_message(shortcut_id:, message_id:, input_message_content:) ⇒ TD::Types::Ok

Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Text message can be edited only to a text message. The type of message content in an album can’t be changed with exception of replacing a photo with a video or vice

versa.

Parameters:

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut with the message.

  • message_id (Integer)

    Identifier of the message.

  • input_message_content (TD::Types::InputMessageContent)

    New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, Types::InputMessageContent::Photo or inputMessageVideo.

Returns:



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

def edit_quick_reply_message(shortcut_id:, message_id:, input_message_content:)
  broadcast('@type'                 => 'editQuickReplyMessage',
            'shortcut_id'           => shortcut_id,
            'message_id'            => message_id,
            'input_message_content' => input_message_content)
end

#edit_star_subscription(subscription_id:, is_canceled:) ⇒ TD::Types::Ok

Cancels or reenables Telegram Star subscription to a channel.

Parameters:

  • subscription_id (TD::Types::String)

    Identifier of the subscription to change.

  • is_canceled (Boolean)

    New value of is_canceled.

Returns:



2257
2258
2259
2260
2261
# File 'lib/tdlib/client_methods.rb', line 2257

def edit_star_subscription(subscription_id:, is_canceled:)
  broadcast('@type'           => 'editStarSubscription',
            'subscription_id' => subscription_id,
            'is_canceled'     => is_canceled)
end

#edit_story(story_sender_chat_id:, story_id:, content:, areas:, caption:) ⇒ TD::Types::Ok

Changes content and caption of a story. Can be called only if story.can_be_edited == true.

Parameters:

  • story_sender_chat_id (Integer)

    Identifier of the chat that posted the story.

  • story_id (Integer)

    Identifier of the story to edit.

  • content (TD::Types::InputStoryContent)

    New content of the story; pass null to keep the current content.

  • areas (TD::Types::InputStoryAreas)

    New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can’t be edited if story content isn’t changed.

  • caption (TD::Types::FormattedText)

    New story caption; pass null to keep the current caption.

Returns:



2274
2275
2276
2277
2278
2279
2280
2281
# File 'lib/tdlib/client_methods.rb', line 2274

def edit_story(story_sender_chat_id:, story_id:, content:, areas:, caption:)
  broadcast('@type'                => 'editStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id,
            'content'              => content,
            'areas'                => areas,
            'caption'              => caption)
end

#edit_story_cover(story_sender_chat_id:, story_id:, cover_frame_timestamp:) ⇒ TD::Types::Ok

Changes cover of a video story. Can be called only if story.can_be_edited == true and the story isn’t being edited now.

Parameters:

  • story_sender_chat_id (Integer)

    Identifier of the chat that posted the story.

  • story_id (Integer)

    Identifier of the story to edit.

  • cover_frame_timestamp (Float)

    New timestamp of the frame, which will be used as video thumbnail.

Returns:



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

def edit_story_cover(story_sender_chat_id:, story_id:, cover_frame_timestamp:)
  broadcast('@type'                 => 'editStoryCover',
            'story_sender_chat_id'  => story_sender_chat_id,
            'story_id'              => story_id,
            'cover_frame_timestamp' => cover_frame_timestamp)
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.

Parameters:

  • proxy_id (Integer)

    Proxy identifier.

Returns:



2303
2304
2305
2306
# File 'lib/tdlib/client_methods.rb', line 2303

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

#end_group_call(group_call_id:) ⇒ TD::Types::Ok

Ends a group call. Requires groupCall.can_be_managed.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



2313
2314
2315
2316
# File 'lib/tdlib/client_methods.rb', line 2313

def end_group_call(group_call_id:)
  broadcast('@type'         => 'endGroupCall',
            'group_call_id' => group_call_id)
end

#end_group_call_recording(group_call_id:) ⇒ TD::Types::Ok

Ends recording of an active group call. Requires groupCall.can_be_managed group call flag.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



2323
2324
2325
2326
# File 'lib/tdlib/client_methods.rb', line 2323

def end_group_call_recording(group_call_id:)
  broadcast('@type'         => 'endGroupCallRecording',
            'group_call_id' => group_call_id)
end

#end_group_call_screen_sharing(group_call_id:) ⇒ TD::Types::Ok

Ends screen sharing in a joined group call.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



2332
2333
2334
2335
# File 'lib/tdlib/client_methods.rb', line 2332

def end_group_call_screen_sharing(group_call_id:)
  broadcast('@type'         => 'endGroupCallScreenSharing',
            'group_call_id' => group_call_id)
end

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

Finishes the file generation.

Parameters:

  • generation_id (Integer)

    The identifier of the generation process.

  • error (TD::Types::Error)

    If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded.

Returns:



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

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

#forward_messages(chat_id:, message_thread_id:, from_chat_id:, message_ids:, options:, 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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which to forward messages.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the message will be sent; for forum threads only.

  • from_chat_id (Integer)

    Identifier of the chat from which to forward messages.

  • message_ids (Array<Integer>)

    Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded.

  • options (TD::Types::MessageSendOptions)

    Options to be used to send the messages; pass null to use default options.

  • send_copy (Boolean)

    Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local.

  • remove_caption (Boolean)

    Pass true to remove media captions of message copies. Ignored if send_copy is false.

Returns:



2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
# File 'lib/tdlib/client_methods.rb', line 2368

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

#get_account_ttlTD::Types::AccountTtl

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



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

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

#get_active_sessionsTD::Types::Sessions

Returns all active sessions of the current user.

Returns:



2389
2390
2391
# File 'lib/tdlib/client_methods.rb', line 2389

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

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

Returns all available Telegram Passport elements.

Parameters:

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



2397
2398
2399
2400
# File 'lib/tdlib/client_methods.rb', line 2397

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

#get_all_sticker_emojis(sticker_type:, query:, chat_id:, return_only_main_emoji:) ⇒ TD::Types::Emojis

Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000,

chat_id).

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the stickers to search for.

  • query (TD::Types::String)

    Search query.

  • chat_id (Integer)

    Chat identifier for which to find stickers.

  • return_only_main_emoji (Boolean)

    Pass true if only main emoji for each found sticker must be included in the result.

Returns:



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

def get_all_sticker_emojis(sticker_type:, query:, chat_id:, return_only_main_emoji:)
  broadcast('@type'                  => 'getAllStickerEmojis',
            'sticker_type'           => sticker_type,
            'query'                  => query,
            'chat_id'                => chat_id,
            'return_only_main_emoji' => return_only_main_emoji)
end

#get_animated_emoji(emoji:) ⇒ TD::Types::AnimatedEmoji

Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji.

Parameters:

  • emoji (TD::Types::String)

    The emoji.

Returns:



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

def get_animated_emoji(emoji:)
  broadcast('@type' => 'getAnimatedEmoji',
            'emoji' => emoji)
end

#get_application_configTD::Types::JsonValue

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



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

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

Returns the link for downloading official Telegram application to be used when the current user invites friends to

Telegram.

Returns:



2441
2442
2443
# File 'lib/tdlib/client_methods.rb', line 2441

def get_application_download_link
  broadcast('@type' => 'getApplicationDownloadLink')
end

#get_archive_chat_list_settingsTD::Types::ArchiveChatListSettings

Returns settings for automatic moving of chats to and from the Archive chat lists.



2448
2449
2450
# File 'lib/tdlib/client_methods.rb', line 2448

def get_archive_chat_list_settings
  broadcast('@type' => 'getArchiveChatListSettings')
end

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

Returns a list of archived sticker sets.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the sticker sets to return.

  • offset_sticker_set_id (Integer)

    Identifier of the sticker set from which to return the result; use 0 to get results from the beginning.

  • limit (Integer)

    The maximum number of sticker sets to return; up to 100.

Returns:



2459
2460
2461
2462
2463
2464
# File 'lib/tdlib/client_methods.rb', line 2459

def get_archived_sticker_sets(sticker_type:, offset_sticker_set_id:, limit:)
  broadcast('@type'                 => 'getArchivedStickerSets',
            'sticker_type'          => sticker_type,
            '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, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets.

Parameters:

  • file_id (Integer)

    File identifier.

Returns:



2471
2472
2473
2474
# File 'lib/tdlib/client_methods.rb', line 2471

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

#get_attachment_menu_bot(bot_user_id:) ⇒ TD::Types::AttachmentMenuBot

Returns information about a bot that can be added to attachment or side menu.

Parameters:

  • bot_user_id (Integer)

    Bot’s user identifier.

Returns:



2480
2481
2482
2483
# File 'lib/tdlib/client_methods.rb', line 2480

def get_attachment_menu_bot(bot_user_id:)
  broadcast('@type'       => 'getAttachmentMenuBot',
            'bot_user_id' => bot_user_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. Can be called before initialization.



2491
2492
2493
# File 'lib/tdlib/client_methods.rb', line 2491

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

#get_auto_download_settings_presetsTD::Types::AutoDownloadSettingsPresets

Returns auto-download settings presets for the current user.



2498
2499
2500
# File 'lib/tdlib/client_methods.rb', line 2498

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

#get_autosave_settingsTD::Types::AutosaveSettings

Returns autosave settings for the current user.



2505
2506
2507
# File 'lib/tdlib/client_methods.rb', line 2505

def get_autosave_settings
  broadcast('@type' => 'getAutosaveSettings')
end

#get_available_chat_boost_slotsTD::Types::ChatBoostSlots

Returns the list of available chat boost slots for the current user.



2512
2513
2514
# File 'lib/tdlib/client_methods.rb', line 2512

def get_available_chat_boost_slots
  broadcast('@type' => 'getAvailableChatBoostSlots')
end

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

Constructs a persistent HTTP URL for a background.

Parameters:

Returns:



2521
2522
2523
2524
2525
# File 'lib/tdlib/client_methods.rb', line 2521

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

#get_bank_card_info(bank_card_number:) ⇒ TD::Types::BankCardInfo

Returns information about a bank card.

Parameters:

  • bank_card_number (TD::Types::String)

    The bank card number.

Returns:



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

def get_bank_card_info(bank_card_number:)
  broadcast('@type'            => 'getBankCardInfo',
            'bank_card_number' => bank_card_number)
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.

Parameters:

  • basic_group_id (Integer)

    Basic group identifier.

Returns:



2541
2542
2543
2544
# File 'lib/tdlib/client_methods.rb', line 2541

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.

Parameters:

  • basic_group_id (Integer)

    Basic group identifier.

Returns:



2550
2551
2552
2553
# File 'lib/tdlib/client_methods.rb', line 2550

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

#get_blocked_message_senders(block_list:, offset:, limit:) ⇒ TD::Types::MessageSenders

Returns users and chats that were blocked by the current user.

Parameters:

  • block_list (TD::Types::BlockList)

    Block list from which to return users.

  • offset (Integer)

    Number of users and chats to skip in the result; must be non-negative.

  • limit (Integer)

    The maximum number of users and chats to return; up to 100.

Returns:



2561
2562
2563
2564
2565
2566
# File 'lib/tdlib/client_methods.rb', line 2561

def get_blocked_message_senders(block_list:, offset:, limit:)
  broadcast('@type'      => 'getBlockedMessageSenders',
            'block_list' => block_list,
            'offset'     => offset,
            'limit'      => limit)
end

#get_bot_info_description(bot_user_id:, language_code:) ⇒ TD::Types::Text

Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code or an empty string.

Returns:



2574
2575
2576
2577
2578
# File 'lib/tdlib/client_methods.rb', line 2574

def get_bot_info_description(bot_user_id:, language_code:)
  broadcast('@type'         => 'getBotInfoDescription',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code)
end

#get_bot_info_short_description(bot_user_id:, language_code:) ⇒ TD::Types::Text

Returns the text shown on a bot’s profile page and sent together with the link when users share the bot in the

given language.

Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code or an empty string.

Returns:



2587
2588
2589
2590
2591
# File 'lib/tdlib/client_methods.rb', line 2587

def get_bot_info_short_description(bot_user_id:, language_code:)
  broadcast('@type'         => 'getBotInfoShortDescription',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code)
end

#get_bot_media_preview_info(bot_user_id:, language_code:) ⇒ TD::Types::BotMediaPreviewInfo

Returns the list of media previews for the given language and the list of languages for which the bot has dedicated

previews.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must be owned and must have the main Web App.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code for which to get previews. If empty, then default previews are returned.

Returns:



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

def get_bot_media_preview_info(bot_user_id:, language_code:)
  broadcast('@type'         => 'getBotMediaPreviewInfo',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code)
end

#get_bot_media_previews(bot_user_id:) ⇒ TD::Types::BotMediaPreviews

Returns the list of media previews of a bot.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must have the main Web App.

Returns:



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

def get_bot_media_previews(bot_user_id:)
  broadcast('@type'       => 'getBotMediaPreviews',
            'bot_user_id' => bot_user_id)
end

#get_bot_name(bot_user_id:, language_code:) ⇒ TD::Types::Text

Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code or an empty string.

Returns:



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

def get_bot_name(bot_user_id:, language_code:)
  broadcast('@type'         => 'getBotName',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code)
end

Returns information about a business chat link.

Parameters:

  • link_name (TD::Types::String)

    Name of the link.

Returns:



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

def get_business_chat_link_info(link_name:)
  broadcast('@type'     => 'getBusinessChatLinkInfo',
            'link_name' => link_name)
end

Returns business chat links created for the current account.



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

def get_business_chat_links
  broadcast('@type' => 'getBusinessChatLinks')
end

#get_business_connected_botTD::Types::BusinessConnectedBot

Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot.



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

def get_business_connected_bot
  broadcast('@type' => 'getBusinessConnectedBot')
end

#get_business_connection(connection_id:) ⇒ TD::Types::BusinessConnection

Returns information about a business connection by its identifier; for bots only.

Parameters:

  • connection_id (TD::Types::String)

    Identifier of the business connection to return.

Returns:



2657
2658
2659
2660
# File 'lib/tdlib/client_methods.rb', line 2657

def get_business_connection(connection_id:)
  broadcast('@type'         => 'getBusinessConnection',
            'connection_id' => connection_id)
end

#get_business_features(source:) ⇒ TD::Types::BusinessFeatures

Returns information about features, available to Business users.

Parameters:

  • source (TD::Types::BusinessFeature)

    Source of the request; pass null if the method is called from settings or some non-standard source.

Returns:



2667
2668
2669
2670
# File 'lib/tdlib/client_methods.rb', line 2667

def get_business_features(source:)
  broadcast('@type'  => 'getBusinessFeatures',
            'source' => source)
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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat with the message.

  • message_id (Integer)

    Identifier of the message from which the query originated. The message must not be scheduled.

  • payload (TD::Types::CallbackQueryPayload)

    Query payload.

Returns:



2680
2681
2682
2683
2684
2685
# File 'lib/tdlib/client_methods.rb', line 2680

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_callback_query_message(chat_id:, message_id:, callback_query_id:) ⇒ TD::Types::Message

Returns information about a message with the callback button that originated a callback query; for bots only.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the message belongs to.

  • message_id (Integer)

    Message identifier.

  • callback_query_id (Integer)

    Identifier of the callback query.

Returns:



2693
2694
2695
2696
2697
2698
# File 'lib/tdlib/client_methods.rb', line 2693

def get_callback_query_message(chat_id:, message_id:, callback_query_id:)
  broadcast('@type'             => 'getCallbackQueryMessage',
            'chat_id'           => chat_id,
            'message_id'        => message_id,
            'callback_query_id' => callback_query_id)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



2704
2705
2706
2707
# File 'lib/tdlib/client_methods.rb', line 2704

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

#get_chat_active_stories(chat_id:) ⇒ TD::Types::ChatActiveStories

Returns the list of active stories posted by the given chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



2713
2714
2715
2716
# File 'lib/tdlib/client_methods.rb', line 2713

def get_chat_active_stories(chat_id:)
  broadcast('@type'   => 'getChatActiveStories',
            '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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



2722
2723
2724
2725
# File 'lib/tdlib/client_methods.rb', line 2722

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

#get_chat_archived_stories(chat_id:, from_story_id:, limit:) ⇒ TD::Types::Stories

Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • from_story_id (Integer)

    Identifier of the story starting from which stories must be returned; use 0 to get results from the last story.

  • limit (Integer)

    The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

Returns:



2737
2738
2739
2740
2741
2742
# File 'lib/tdlib/client_methods.rb', line 2737

def get_chat_archived_stories(chat_id:, from_story_id:, limit:)
  broadcast('@type'         => 'getChatArchivedStories',
            'chat_id'       => chat_id,
            'from_story_id' => from_story_id,
            'limit'         => limit)
end

#get_chat_available_message_senders(chat_id:) ⇒ TD::Types::ChatMessageSenders

Returns the list of message sender identifiers, which can be used to send messages in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



2748
2749
2750
2751
# File 'lib/tdlib/client_methods.rb', line 2748

def get_chat_available_message_senders(chat_id:)
  broadcast('@type'   => 'getChatAvailableMessageSenders',
            'chat_id' => chat_id)
end

#get_chat_boost_features(is_channel:) ⇒ TD::Types::ChatBoostFeatures

Returns the list of features available for different chat boost levels; this is an offline request.

Parameters:

  • is_channel (Boolean)

    Pass true to get the list of features for channels; pass false to get the list of features for supergroups.

Returns:



2758
2759
2760
2761
# File 'lib/tdlib/client_methods.rb', line 2758

def get_chat_boost_features(is_channel:)
  broadcast('@type'      => 'getChatBoostFeatures',
            'is_channel' => is_channel)
end

#get_chat_boost_level_features(is_channel:, level:) ⇒ TD::Types::ChatBoostLevelFeatures

Returns the list of features available on the specific chat boost level; this is an offline request.

Parameters:

  • is_channel (Boolean)

    Pass true to get the list of features for channels; pass false to get the list of features for supergroups.

  • level (Integer)

    Chat boost level.

Returns:



2769
2770
2771
2772
2773
# File 'lib/tdlib/client_methods.rb', line 2769

def get_chat_boost_level_features(is_channel:, level:)
  broadcast('@type'      => 'getChatBoostLevelFeatures',
            'is_channel' => is_channel,
            'level'      => level)
end

Returns an HTTPS link to boost the specified supergroup or channel chat.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

Returns:



2779
2780
2781
2782
# File 'lib/tdlib/client_methods.rb', line 2779

def get_chat_boost_link(chat_id:)
  broadcast('@type'   => 'getChatBoostLink',
            'chat_id' => chat_id)
end

Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost.

Parameters:

  • url (TD::Types::String)

    The link to boost a chat.

Returns:



2789
2790
2791
2792
# File 'lib/tdlib/client_methods.rb', line 2789

def get_chat_boost_link_info(url:)
  broadcast('@type' => 'getChatBoostLinkInfo',
            'url'   => url)
end

#get_chat_boost_status(chat_id:) ⇒ TD::Types::ChatBoostStatus

Returns the current boost status for a supergroup or a channel chat.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

Returns:



2798
2799
2800
2801
# File 'lib/tdlib/client_methods.rb', line 2798

def get_chat_boost_status(chat_id:)
  broadcast('@type'   => 'getChatBoostStatus',
            'chat_id' => chat_id)
end

#get_chat_boosts(chat_id:, only_gift_codes:, offset:, limit:) ⇒ TD::Types::FoundChatBoosts

Returns the list of boosts applied to a chat; requires administrator rights in the chat.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • only_gift_codes (Boolean)

    Pass true to receive only boosts received from gift codes and giveaways created by the chat.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit.

Returns:



2813
2814
2815
2816
2817
2818
2819
# File 'lib/tdlib/client_methods.rb', line 2813

def get_chat_boosts(chat_id:, only_gift_codes:, offset:, limit:)
  broadcast('@type'           => 'getChatBoosts',
            'chat_id'         => chat_id,
            'only_gift_codes' => only_gift_codes,
            'offset'          => offset,
            'limit'           => limit)
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).

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • query (TD::Types::String)

    Search query by which to filter events.

  • from_event_id (Integer)

    Identifier of an event from which to return results. Use 0 to get results from the latest events.

  • limit (Integer)

    The maximum number of events to return; up to 100.

  • filters (TD::Types::ChatEventLogFilters)

    The types of events to return; pass null to get chat events of all types.

  • user_ids (Array<Integer>)

    User identifiers by which to filter events. By default, events relating to all users will be returned.

Returns:



2836
2837
2838
2839
2840
2841
2842
2843
2844
# File 'lib/tdlib/client_methods.rb', line 2836

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_folder(chat_folder_id:) ⇒ TD::Types::ChatFolder

Returns information about a chat folder by its identifier.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

Returns:



2850
2851
2852
2853
# File 'lib/tdlib/client_methods.rb', line 2850

def get_chat_folder(chat_folder_id:)
  broadcast('@type'          => 'getChatFolder',
            'chat_folder_id' => chat_folder_id)
end

#get_chat_folder_chat_count(folder:) ⇒ TD::Types::Count

Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly.

Parameters:

Returns:



2860
2861
2862
2863
# File 'lib/tdlib/client_methods.rb', line 2860

def get_chat_folder_chat_count(folder:)
  broadcast('@type'  => 'getChatFolderChatCount',
            'folder' => folder)
end

#get_chat_folder_chats_to_leave(chat_folder_id:) ⇒ TD::Types::Chats

Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the

chat folder is deleted.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

Returns:



2870
2871
2872
2873
# File 'lib/tdlib/client_methods.rb', line 2870

def get_chat_folder_chats_to_leave(chat_folder_id:)
  broadcast('@type'          => 'getChatFolderChatsToLeave',
            'chat_folder_id' => chat_folder_id)
end

#get_chat_folder_default_icon_name(folder:) ⇒ TD::Types::ChatFolderIcon

Returns default icon name for a folder. Can be called synchronously.

Parameters:

Returns:



2880
2881
2882
2883
# File 'lib/tdlib/client_methods.rb', line 2880

def get_chat_folder_default_icon_name(folder:)
  broadcast('@type'  => 'getChatFolderDefaultIconName',
            'folder' => folder)
end

Returns invite links created by the current user for a shareable chat folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

Returns:



2889
2890
2891
2892
# File 'lib/tdlib/client_methods.rb', line 2889

def get_chat_folder_invite_links(chat_folder_id:)
  broadcast('@type'          => 'getChatFolderInviteLinks',
            'chat_folder_id' => chat_folder_id)
end

#get_chat_folder_new_chats(chat_folder_id:) ⇒ TD::Types::Chats

Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption(“chat_folder_new_chats_update_period”) for the given chat

folder.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

Returns:



2900
2901
2902
2903
# File 'lib/tdlib/client_methods.rb', line 2900

def get_chat_folder_new_chats(chat_folder_id:)
  broadcast('@type'          => 'getChatFolderNewChats',
            'chat_folder_id' => chat_folder_id)
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 reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • from_message_id (Integer)

    Identifier of the message starting from which history must be fetched; use 0 to get results from the last message.

  • offset (Integer)

    Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages.

  • limit (Integer)

    The maximum number of messages to be returned; must be positive and can’t be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

  • only_local (Boolean)

    Pass true to get only messages that are available without sending network requests.

Returns:



2922
2923
2924
2925
2926
2927
2928
2929
# File 'lib/tdlib/client_methods.rb', line 2922

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

Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to

get other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link to get.

Returns:



2938
2939
2940
2941
2942
# File 'lib/tdlib/client_methods.rb', line 2938

def get_chat_invite_link(chat_id:, invite_link:)
  broadcast('@type'       => 'getChatInviteLink',
            'chat_id'     => chat_id,
            'invite_link' => invite_link)
end

Returns the list of chat administrators with number of their invite links. Requires owner privileges in the chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



2949
2950
2951
2952
# File 'lib/tdlib/client_methods.rb', line 2949

def get_chat_invite_link_counts(chat_id:)
  broadcast('@type'   => 'getChatInviteLinkCounts',
            'chat_id' => chat_id)
end

Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for

other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link for which to return chat members.

  • only_with_expired_subscription (Boolean)

    Pass true if the link is a subscription link and only members with expired subscription must be returned.

  • offset_member (TD::Types::ChatInviteLinkMember)

    A chat member from which to return next chat members; pass null to get results from the beginning.

  • limit (Integer)

    The maximum number of chat members to return; up to 100.

Returns:



2966
2967
2968
2969
2970
2971
2972
2973
# File 'lib/tdlib/client_methods.rb', line 2966

def get_chat_invite_link_members(chat_id:, invite_link:, only_with_expired_subscription:, offset_member:, limit:)
  broadcast('@type'                          => 'getChatInviteLinkMembers',
            'chat_id'                        => chat_id,
            'invite_link'                    => invite_link,
            'only_with_expired_subscription' => only_with_expired_subscription,
            'offset_member'                  => offset_member,
            'limit'                          => limit)
end

Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to

get other links.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • creator_user_id (Integer)

    User identifier of a chat administrator. Must be an identifier of the current user for non-owner.

  • is_revoked (Boolean)

    Pass true if revoked links needs to be returned instead of active or expired.

  • offset_date (Integer)

    Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning.

  • offset_invite_link (TD::Types::String)

    Invite link starting after which to return invite links; use empty string to get results from the beginning.

  • limit (Integer)

    The maximum number of invite links to return; up to 100.

Returns:



2989
2990
2991
2992
2993
2994
2995
2996
2997
# File 'lib/tdlib/client_methods.rb', line 2989

def get_chat_invite_links(chat_id:, creator_user_id:, is_revoked:, offset_date:, offset_invite_link:, limit:)
  broadcast('@type'              => 'getChatInviteLinks',
            'chat_id'            => chat_id,
            'creator_user_id'    => creator_user_id,
            'is_revoked'         => is_revoked,
            'offset_date'        => offset_date,
            'offset_invite_link' => offset_invite_link,
            'limit'              => limit)
end

#get_chat_join_requests(chat_id:, invite_link:, query:, offset_request:, limit:) ⇒ TD::Types::ChatJoinRequests

Returns pending join requests in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.

  • query (TD::Types::String)

    A query to search for in the first names, last names and usernames of the users to return.

  • offset_request (TD::Types::ChatJoinRequest)

    A chat join request from which to return next requests; pass null to get results from the beginning.

  • limit (Integer)

    The maximum number of requests to join the chat to return.

Returns:



3012
3013
3014
3015
3016
3017
3018
3019
# File 'lib/tdlib/client_methods.rb', line 3012

def get_chat_join_requests(chat_id:, invite_link:, query:, offset_request:, limit:)
  broadcast('@type'          => 'getChatJoinRequests',
            'chat_id'        => chat_id,
            'invite_link'    => invite_link,
            'query'          => query,
            'offset_request' => offset_request,
            'limit'          => limit)
end

#get_chat_lists_to_add_chat(chat_id:) ⇒ TD::Types::ChatLists

Returns chat lists to which the chat can be added. This is an offline request.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



3026
3027
3028
3029
# File 'lib/tdlib/client_methods.rb', line 3026

def get_chat_lists_to_add_chat(chat_id:)
  broadcast('@type'   => 'getChatListsToAddChat',
            'chat_id' => chat_id)
end

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

Returns information about a single member of a chat.

Parameters:

Returns:



3036
3037
3038
3039
3040
# File 'lib/tdlib/client_methods.rb', line 3036

def get_chat_member(chat_id:, member_id:)
  broadcast('@type'     => 'getChatMember',
            'chat_id'   => chat_id,
            'member_id' => member_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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • date (Integer)

    Point in time (Unix timestamp) relative to which to search for messages.

Returns:



3047
3048
3049
3050
3051
# File 'lib/tdlib/client_methods.rb', line 3047

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

#get_chat_message_calendar(chat_id:, filter:, from_message_id:, saved_messages_topic_id:) ⇒ TD::Types::MessageCalendar

Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option “utc_time_offset”.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to return information about messages.

  • filter (TD::Types::SearchMessagesFilter)

    Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and Types::SearchMessagesFilter::UnreadReaction are unsupported in this function.

  • from_message_id (Integer)

    The message identifier from which to return information about messages; use 0 to get results from the last message.

  • saved_messages_topic_id (Integer)

    If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages.

Returns:



3067
3068
3069
3070
3071
3072
3073
# File 'lib/tdlib/client_methods.rb', line 3067

def get_chat_message_calendar(chat_id:, filter:, from_message_id:, saved_messages_topic_id:)
  broadcast('@type'                   => 'getChatMessageCalendar',
            'chat_id'                 => chat_id,
            'filter'                  => filter,
            'from_message_id'         => from_message_id,
            'saved_messages_topic_id' => saved_messages_topic_id)
end

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

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

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to count messages.

  • filter (TD::Types::SearchMessagesFilter)

    Filter for message content; Types::SearchMessagesFilter::Empty is unsupported in this function.

  • saved_messages_topic_id (Integer)

    If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages.

  • return_local (Boolean)

    Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally.

Returns:



3085
3086
3087
3088
3089
3090
3091
# File 'lib/tdlib/client_methods.rb', line 3085

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

#get_chat_message_position(chat_id:, message_id:, filter:, message_thread_id:, saved_messages_topic_id:) ⇒ TD::Types::Count

Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the

chat.

Cannot be used in secret chats.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to find message position.

  • message_id (Integer)

    Message identifier.

  • filter (TD::Types::SearchMessagesFilter)

    Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and Types::SearchMessagesFilter::FailedToSend are unsupported in this function.

  • message_thread_id (Integer)

    If not 0, only messages in the specified thread will be considered; supergroups only.

  • saved_messages_topic_id (Integer)

    If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages.

Returns:



3107
3108
3109
3110
3111
3112
3113
3114
# File 'lib/tdlib/client_methods.rb', line 3107

def get_chat_message_position(chat_id:, message_id:, filter:, message_thread_id:, saved_messages_topic_id:)
  broadcast('@type'                   => 'getChatMessagePosition',
            'chat_id'                 => chat_id,
            'message_id'              => message_id,
            'filter'                  => filter,
            'message_thread_id'       => message_thread_id,
            'saved_messages_topic_id' => saved_messages_topic_id)
end

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

Returns the list of chats with non-default notification settings for new messages.

Parameters:

  • scope (TD::Types::NotificationSettingsScope)

    If specified, only chats from the scope will be returned; pass null to return chats from all scopes.

  • compare_sound (Boolean)

    Pass true to include in the response chats with only non-default sound.

Returns:



3122
3123
3124
3125
3126
# File 'lib/tdlib/client_methods.rb', line 3122

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 newest pinned message in the chat.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the message belongs to.

Returns:



3132
3133
3134
3135
# File 'lib/tdlib/client_methods.rb', line 3132

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

#get_chat_posted_to_chat_page_stories(chat_id:, from_story_id:, limit:) ⇒ TD::Types::Stories

Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • from_story_id (Integer)

    Identifier of the story starting from which stories must be returned; use 0 to get results from pinned and the newest story.

  • limit (Integer)

    The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

Returns:



3148
3149
3150
3151
3152
3153
# File 'lib/tdlib/client_methods.rb', line 3148

def get_chat_posted_to_chat_page_stories(chat_id:, from_story_id:, limit:)
  broadcast('@type'         => 'getChatPostedToChatPageStories',
            'chat_id'       => chat_id,
            'from_story_id' => from_story_id,
            'limit'         => limit)
end

#get_chat_revenue_statistics(chat_id:, is_dark:) ⇒ TD::Types::ChatRevenueStatistics

Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • is_dark (Boolean)

    Pass true if a dark theme is used by the application.

Returns:



3161
3162
3163
3164
3165
# File 'lib/tdlib/client_methods.rb', line 3161

def get_chat_revenue_statistics(chat_id:, is_dark:)
  broadcast('@type'   => 'getChatRevenueStatistics',
            'chat_id' => chat_id,
            'is_dark' => is_dark)
end

#get_chat_revenue_transactions(chat_id:, offset:, limit:) ⇒ TD::Types::ChatRevenueTransactions

Returns the list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • offset (Integer)

    Number of transactions to skip.

  • limit (Integer)

    The maximum number of transactions to be returned; up to 200.

Returns:



3174
3175
3176
3177
3178
3179
# File 'lib/tdlib/client_methods.rb', line 3174

def get_chat_revenue_transactions(chat_id:, offset:, limit:)
  broadcast('@type'   => 'getChatRevenueTransactions',
            'chat_id' => chat_id,
            'offset'  => offset,
            'limit'   => limit)
end

#get_chat_revenue_withdrawal_url(chat_id:, password:) ⇒ TD::Types::HttpUrl

Returns a URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and

getOption("can_withdraw_chat_revenue").

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



3188
3189
3190
3191
3192
# File 'lib/tdlib/client_methods.rb', line 3188

def get_chat_revenue_withdrawal_url(chat_id:, password:)
  broadcast('@type'    => 'getChatRevenueWithdrawalUrl',
            'chat_id'  => chat_id,
            'password' => password)
end

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

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

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



3199
3200
3201
3202
# File 'lib/tdlib/client_methods.rb', line 3199

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

#get_chat_similar_chat_count(chat_id:, return_local:) ⇒ TD::Types::Count

Returns approximate number of chats similar to the given chat.

Parameters:

  • chat_id (Integer)

    Identifier of the target chat; must be an identifier of a channel chat.

  • return_local (Boolean)

    Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally.

Returns:



3210
3211
3212
3213
3214
# File 'lib/tdlib/client_methods.rb', line 3210

def get_chat_similar_chat_count(chat_id:, return_local:)
  broadcast('@type'        => 'getChatSimilarChatCount',
            'chat_id'      => chat_id,
            'return_local' => return_local)
end

#get_chat_similar_chats(chat_id:) ⇒ TD::Types::Chats

Returns a list of chats similar to the given chat.

Parameters:

  • chat_id (Integer)

    Identifier of the target chat; must be an identifier of a channel chat.

Returns:



3220
3221
3222
3223
# File 'lib/tdlib/client_methods.rb', line 3220

def get_chat_similar_chats(chat_id:)
  broadcast('@type'   => 'getChatSimilarChats',
            'chat_id' => chat_id)
end

#get_chat_sparse_message_positions(chat_id:, filter:, from_message_id:, limit:, saved_messages_topic_id:) ⇒ TD::Types::MessagePositions

Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll

implementation.

Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to return information about message positions.

  • filter (TD::Types::SearchMessagesFilter)

    Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and Types::SearchMessagesFilter::UnreadReaction are unsupported in this function.

  • from_message_id (Integer)

    The message identifier from which to return information about message positions.

  • limit (Integer)

    The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages.

  • saved_messages_topic_id (Integer)

    If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages.

Returns:



3240
3241
3242
3243
3244
3245
3246
3247
# File 'lib/tdlib/client_methods.rb', line 3240

def get_chat_sparse_message_positions(chat_id:, filter:, from_message_id:, limit:, saved_messages_topic_id:)
  broadcast('@type'                   => 'getChatSparseMessagePositions',
            'chat_id'                 => chat_id,
            'filter'                  => filter,
            'from_message_id'         => from_message_id,
            'limit'                   => limit,
            'saved_messages_topic_id' => saved_messages_topic_id)
end

#get_chat_sponsored_messages(chat_id:) ⇒ TD::Types::SponsoredMessages

Returns sponsored messages to be shown in a chat; for channel chats only.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

Returns:



3253
3254
3255
3256
# File 'lib/tdlib/client_methods.rb', line 3253

def get_chat_sponsored_messages(chat_id:)
  broadcast('@type'   => 'getChatSponsoredMessages',
            'chat_id' => chat_id)
end

#get_chat_statistics(chat_id:, is_dark:) ⇒ TD::Types::ChatStatistics

Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • is_dark (Boolean)

    Pass true if a dark theme is used by the application.

Returns:



3265
3266
3267
3268
3269
# File 'lib/tdlib/client_methods.rb', line 3265

def get_chat_statistics(chat_id:, is_dark:)
  broadcast('@type'   => 'getChatStatistics',
            'chat_id' => chat_id,
            'is_dark' => is_dark)
end

#get_chat_story_interactions(story_sender_chat_id:, story_id:, reaction_type:, prefer_forwards:, offset:, limit:) ⇒ TD::Types::StoryInteractions

Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the story.

  • story_id (Integer)

    Story identifier.

  • reaction_type (TD::Types::ReactionType)

    Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions; Types::ReactionType::Paid isn’t supported.

  • prefer_forwards (Boolean)

    Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of story interactions to return.

Returns:



3285
3286
3287
3288
3289
3290
3291
3292
3293
# File 'lib/tdlib/client_methods.rb', line 3285

def get_chat_story_interactions(story_sender_chat_id:, story_id:, reaction_type:, prefer_forwards:, offset:, limit:)
  broadcast('@type'                => 'getChatStoryInteractions',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id,
            'reaction_type'        => reaction_type,
            'prefer_forwards'      => prefer_forwards,
            'offset'               => offset,
            'limit'                => limit)
end

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

Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state.

Parameters:

  • chat_list (TD::Types::ChatList)

    The chat list in which to return chats; pass null to get chats from the main chat list.

  • limit (Integer)

    The maximum number of chats to be returned.

Returns:



3303
3304
3305
3306
3307
# File 'lib/tdlib/client_methods.rb', line 3303

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

Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

Returns:



3313
3314
3315
3316
# File 'lib/tdlib/client_methods.rb', line 3313

def get_chats_for_chat_folder_invite_link(chat_folder_id:)
  broadcast('@type'          => 'getChatsForChatFolderInviteLink',
            'chat_folder_id' => chat_folder_id)
end

#get_chats_to_send_storiesTD::Types::Chats

Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there.

Returns:



3322
3323
3324
# File 'lib/tdlib/client_methods.rb', line 3322

def get_chats_to_send_stories
  broadcast('@type' => 'getChatsToSendStories')
end

#get_close_friendsTD::Types::Users

Returns all close friends of the current user.

Returns:



3329
3330
3331
# File 'lib/tdlib/client_methods.rb', line 3329

def get_close_friends
  broadcast('@type' => 'getCloseFriends')
end

#get_collectible_item_info(type:) ⇒ TD::Types::CollectibleItemInfo

Returns information about a given collectible item that was purchased at fragment.com.

Parameters:

Returns:



3338
3339
3340
3341
# File 'lib/tdlib/client_methods.rb', line 3338

def get_collectible_item_info(type:)
  broadcast('@type' => 'getCollectibleItemInfo',
            'type'  => type)
end

#get_commands(scope:, language_code:) ⇒ TD::Types::BotCommands

Returns the list of commands supported by the bot for the given user scope and language; for bots only.

Parameters:

  • scope (TD::Types::BotCommandScope)

    The scope to which the commands are relevant; pass null to get commands in the default bot command scope.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code or an empty string.

Returns:



3349
3350
3351
3352
3353
# File 'lib/tdlib/client_methods.rb', line 3349

def get_commands(scope:, language_code:)
  broadcast('@type'         => 'getCommands',
            'scope'         => scope,
            'language_code' => language_code)
end

#get_connected_websitesTD::Types::ConnectedWebsites

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



3358
3359
3360
# File 'lib/tdlib/client_methods.rb', line 3358

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

#get_contactsTD::Types::Users

Returns all contacts of the user.

Returns:



3365
3366
3367
# File 'lib/tdlib/client_methods.rb', line 3365

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

#get_countriesTD::Types::Countries

Returns information about existing countries. Can be called before authorization.



3373
3374
3375
# File 'lib/tdlib/client_methods.rb', line 3373

def get_countries
  broadcast('@type' => 'getCountries')
end

#get_country_codeTD::Types::Text

Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization.

Returns:



3382
3383
3384
# File 'lib/tdlib/client_methods.rb', line 3382

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

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

Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously.

Parameters:

  • country_code (TD::Types::String)

    A two-letter ISO 3166-1 alpha-2 country code as received from getCountries.

Returns:



3392
3393
3394
3395
# File 'lib/tdlib/client_methods.rb', line 3392

def get_country_flag_emoji(country_code:)
  broadcast('@type'        => 'getCountryFlagEmoji',
            'country_code' => country_code)
end

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

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

Parameters:

Returns:



3401
3402
3403
3404
# File 'lib/tdlib/client_methods.rb', line 3401

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 useful if TDLib is run in a separate process. Can be called before initialization.

Returns:



3412
3413
3414
# File 'lib/tdlib/client_methods.rb', line 3412

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

#get_current_weather(location:) ⇒ TD::Types::CurrentWeather

Returns the current weather in the given location.

Parameters:

Returns:



3420
3421
3422
3423
# File 'lib/tdlib/client_methods.rb', line 3420

def get_current_weather(location:)
  broadcast('@type'    => 'getCurrentWeather',
            'location' => location)
end

#get_custom_emoji_reaction_animationsTD::Types::Stickers

Returns TGS stickers with generic animations for custom emoji reactions.

Returns:



3428
3429
3430
# File 'lib/tdlib/client_methods.rb', line 3428

def get_custom_emoji_reaction_animations
  broadcast('@type' => 'getCustomEmojiReactionAnimations')
end

#get_custom_emoji_stickers(custom_emoji_ids:) ⇒ TD::Types::Stickers

Returns the list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned.

Parameters:

  • custom_emoji_ids (Array<Integer>)

    Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously.

Returns:



3439
3440
3441
3442
# File 'lib/tdlib/client_methods.rb', line 3439

def get_custom_emoji_stickers(custom_emoji_ids:)
  broadcast('@type'            => 'getCustomEmojiStickers',
            'custom_emoji_ids' => custom_emoji_ids)
end

#get_database_statisticsTD::Types::DatabaseStatistics

Returns database statistics.



3447
3448
3449
# File 'lib/tdlib/client_methods.rb', line 3447

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.

Parameters:

  • link (TD::Types::String)

    The link.

Returns:



3458
3459
3460
3461
# File 'lib/tdlib/client_methods.rb', line 3458

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

#get_default_background_custom_emoji_stickersTD::Types::Stickers

Returns default list of custom emoji stickers for reply background.

Returns:



3466
3467
3468
# File 'lib/tdlib/client_methods.rb', line 3466

def get_default_background_custom_emoji_stickers
  broadcast('@type' => 'getDefaultBackgroundCustomEmojiStickers')
end

#get_default_chat_emoji_statusesTD::Types::EmojiStatuses

Returns default emoji statuses for chats.



3473
3474
3475
# File 'lib/tdlib/client_methods.rb', line 3473

def get_default_chat_emoji_statuses
  broadcast('@type' => 'getDefaultChatEmojiStatuses')
end

#get_default_chat_photo_custom_emoji_stickersTD::Types::Stickers

Returns default list of custom emoji stickers for placing on a chat photo.

Returns:



3480
3481
3482
# File 'lib/tdlib/client_methods.rb', line 3480

def get_default_chat_photo_custom_emoji_stickers
  broadcast('@type' => 'getDefaultChatPhotoCustomEmojiStickers')
end

#get_default_emoji_statusesTD::Types::EmojiStatuses

Returns default emoji statuses for self status.



3487
3488
3489
# File 'lib/tdlib/client_methods.rb', line 3487

def get_default_emoji_statuses
  broadcast('@type' => 'getDefaultEmojiStatuses')
end

#get_default_message_auto_delete_timeTD::Types::MessageAutoDeleteTime

Returns default message auto-delete time setting for new chats.



3494
3495
3496
# File 'lib/tdlib/client_methods.rb', line 3494

def get_default_message_auto_delete_time
  broadcast('@type' => 'getDefaultMessageAutoDeleteTime')
end

#get_default_profile_photo_custom_emoji_stickersTD::Types::Stickers

Returns default list of custom emoji stickers for placing on a profile photo.

Returns:



3501
3502
3503
# File 'lib/tdlib/client_methods.rb', line 3501

def get_default_profile_photo_custom_emoji_stickers
  broadcast('@type' => 'getDefaultProfilePhotoCustomEmojiStickers')
end

#get_disallowed_chat_emoji_statusesTD::Types::EmojiStatuses

Returns the list of emoji statuses, which can’t be used as chat emoji status, even they are from a sticker set with

is_allowed_as_chat_emoji_status == true.


3509
3510
3511
# File 'lib/tdlib/client_methods.rb', line 3509

def get_disallowed_chat_emoji_statuses
  broadcast('@type' => 'getDisallowedChatEmojiStatuses')
end

#get_emoji_categories(type:) ⇒ TD::Types::EmojiCategories

Returns available emoji categories.

Parameters:

Returns:



3518
3519
3520
3521
# File 'lib/tdlib/client_methods.rb', line 3518

def get_emoji_categories(type:)
  broadcast('@type' => 'getEmojiCategories',
            'type'  => type)
end

#get_emoji_reaction(emoji:) ⇒ TD::Types::EmojiReaction

Returns information about an emoji reaction. Returns a 404 error if the reaction is not found.

Parameters:

  • emoji (TD::Types::String)

    Text representation of the reaction.

Returns:



3528
3529
3530
3531
# File 'lib/tdlib/client_methods.rb', line 3528

def get_emoji_reaction(emoji:)
  broadcast('@type' => 'getEmojiReaction',
            'emoji' => emoji)
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.

Parameters:

  • language_code (TD::Types::String)

    Language code for which the emoji replacements will be suggested.

Returns:



3539
3540
3541
3542
# File 'lib/tdlib/client_methods.rb', line 3539

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

Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an

HTTP link.

Use the method getExternalLinkInfo to find whether a prior user confirmation is needed.

Parameters:

  • link (TD::Types::String)

    The HTTP link.

  • allow_write_access (Boolean)

    Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages.

Returns:



3552
3553
3554
3555
3556
# File 'lib/tdlib/client_methods.rb', line 3552

def get_external_link(link:, allow_write_access:)
  broadcast('@type'              => 'getExternalLink',
            'link'               => link,
            'allow_write_access' => allow_write_access)
end

Returns information about an action to be done when the current user clicks an external link. Don’t use this method for links from secret chats if link preview is disabled in secret chats.

Parameters:

  • link (TD::Types::String)

    The link.

Returns:



3563
3564
3565
3566
# File 'lib/tdlib/client_methods.rb', line 3563

def get_external_link_info(link:)
  broadcast('@type' => 'getExternalLinkInfo',
            'link'  => link)
end

#get_favorite_stickersTD::Types::Stickers

Returns favorite stickers.

Returns:



3571
3572
3573
# File 'lib/tdlib/client_methods.rb', line 3571

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.

Parameters:

  • file_id (Integer)

    Identifier of the file to get.

Returns:



3579
3580
3581
3582
# File 'lib/tdlib/client_methods.rb', line 3579

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

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

Returns file downloaded prefix size from a given offset, in bytes.

Parameters:

  • file_id (Integer)

    Identifier of the file.

  • offset (Integer)

    Offset from which downloaded prefix size needs to be calculated.

Returns:



3589
3590
3591
3592
3593
# File 'lib/tdlib/client_methods.rb', line 3589

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. Can be called synchronously.

Parameters:

  • mime_type (TD::Types::String)

    The MIME type of the file.

Returns:



3601
3602
3603
3604
# File 'lib/tdlib/client_methods.rb', line 3601

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. Can be called synchronously.

Parameters:

  • file_name (TD::Types::String)

    The name of the file or path to the file.

Returns:



3612
3613
3614
3615
# File 'lib/tdlib/client_methods.rb', line 3612

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

#get_forum_topic(chat_id:, message_thread_id:) ⇒ TD::Types::ForumTopic

Returns information about a forum topic.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

Returns:



3622
3623
3624
3625
3626
# File 'lib/tdlib/client_methods.rb', line 3622

def get_forum_topic(chat_id:, message_thread_id:)
  broadcast('@type'             => 'getForumTopic',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id)
end

#get_forum_topic_default_iconsTD::Types::Stickers

Returns the list of custom emoji, which can be used as forum topic icon by all users.

Returns:



3631
3632
3633
# File 'lib/tdlib/client_methods.rb', line 3631

def get_forum_topic_default_icons
  broadcast('@type' => 'getForumTopicDefaultIcons')
end

Returns an HTTPS link to a topic in a forum chat. This is an offline request.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

Returns:



3641
3642
3643
3644
3645
# File 'lib/tdlib/client_methods.rb', line 3641

def get_forum_topic_link(chat_id:, message_thread_id:)
  broadcast('@type'             => 'getForumTopicLink',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id)
end

#get_forum_topics(chat_id:, query:, offset_date:, offset_message_id:, offset_message_thread_id:, limit:) ⇒ TD::Types::ForumTopics

Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server.

Parameters:

  • chat_id (Integer)

    Identifier of the forum chat.

  • query (TD::Types::String)

    Query to search for in the forum topic’s name.

  • offset_date (Integer)

    The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic.

  • offset_message_id (Integer)

    The message identifier of the last message in the last found topic, or 0 for the first request.

  • offset_message_thread_id (Integer)

    The message thread identifier of the last found topic, or 0 for the first request.

  • limit (Integer)

    The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit.

Returns:



3662
3663
3664
3665
3666
3667
3668
3669
3670
# File 'lib/tdlib/client_methods.rb', line 3662

def get_forum_topics(chat_id:, query:, offset_date:, offset_message_id:, offset_message_thread_id:, limit:)
  broadcast('@type'                    => 'getForumTopics',
            'chat_id'                  => chat_id,
            'query'                    => query,
            'offset_date'              => offset_date,
            'offset_message_id'        => offset_message_id,
            'offset_message_thread_id' => offset_message_thread_id,
            'limit'                    => limit)
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.

Parameters:

  • chat_id (Integer)

    The chat that contains the message with the game.

  • message_id (Integer)

    Identifier of the message.

  • user_id (Integer)

    User identifier.

Returns:



3679
3680
3681
3682
3683
3684
# File 'lib/tdlib/client_methods.rb', line 3679

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_greeting_stickersTD::Types::Stickers

Returns greeting stickers from regular sticker sets that can be used for the start page of other users.

Returns:



3689
3690
3691
# File 'lib/tdlib/client_methods.rb', line 3689

def get_greeting_stickers
  broadcast('@type' => 'getGreetingStickers')
end

#get_group_call(group_call_id:) ⇒ TD::Types::GroupCall

Returns information about a group call.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



3697
3698
3699
3700
# File 'lib/tdlib/client_methods.rb', line 3697

def get_group_call(group_call_id:)
  broadcast('@type'         => 'getGroupCall',
            'group_call_id' => group_call_id)
end

Returns invite link to a video chat in a public chat.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • can_self_unmute (Boolean)

    Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag.

Returns:



3709
3710
3711
3712
3713
# File 'lib/tdlib/client_methods.rb', line 3709

def get_group_call_invite_link(group_call_id:, can_self_unmute:)
  broadcast('@type'           => 'getGroupCallInviteLink',
            'group_call_id'   => group_call_id,
            'can_self_unmute' => can_self_unmute)
end

#get_group_call_stream_segment(group_call_id:, time_offset:, scale:, channel_id:, video_quality:) ⇒ TD::Types::FilePart

Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • time_offset (Integer)

    Point in time when the stream segment begins; Unix timestamp in milliseconds.

  • scale (Integer)

    Segment duration scale; 0-1. Segment’s duration is 1000/(2**scale) milliseconds.

  • channel_id (Integer)

    Identifier of an audio/video channel to get as received from tgcalls.

  • video_quality (TD::Types::GroupCallVideoQuality)

    Video quality as received from tgcalls; pass null to get the worst available quality.

Returns:



3725
3726
3727
3728
3729
3730
3731
3732
# File 'lib/tdlib/client_methods.rb', line 3725

def get_group_call_stream_segment(group_call_id:, time_offset:, scale:, channel_id:, video_quality:)
  broadcast('@type'         => 'getGroupCallStreamSegment',
            'group_call_id' => group_call_id,
            'time_offset'   => time_offset,
            'scale'         => scale,
            'channel_id'    => channel_id,
            'video_quality' => video_quality)
end

#get_group_call_streams(group_call_id:) ⇒ TD::Types::GroupCallStreams

Returns information about available group call streams.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



3738
3739
3740
3741
# File 'lib/tdlib/client_methods.rb', line 3738

def get_group_call_streams(group_call_id:)
  broadcast('@type'         => 'getGroupCallStreams',
            'group_call_id' => group_call_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.

Parameters:

  • user_id (Integer)

    User identifier.

  • offset_chat_id (Integer)

    Chat identifier starting from which to return chats; use 0 for the first request.

  • limit (Integer)

    The maximum number of chats to be returned; up to 100.

Returns:



3750
3751
3752
3753
3754
3755
# File 'lib/tdlib/client_methods.rb', line 3750

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.

Returns:



3760
3761
3762
# File 'lib/tdlib/client_methods.rb', line 3760

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.

Also, the limit can be increased with Telegram Premium.

Returns:



3770
3771
3772
# File 'lib/tdlib/client_methods.rb', line 3770

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.

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • user_id (Integer)

    User identifier.

Returns:



3779
3780
3781
3782
3783
# File 'lib/tdlib/client_methods.rb', line 3779

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.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • chat_id (Integer)

    Identifier of the chat where the query was sent.

  • user_location (TD::Types::Location)

    Location of the user; pass null if unknown or the bot doesn’t need user’s location.

  • query (TD::Types::String)

    Text of the query.

  • offset (TD::Types::String)

    Offset of the first entry to return; use empty string to get the first chunk of results.

Returns:



3796
3797
3798
3799
3800
3801
3802
3803
# File 'lib/tdlib/client_methods.rb', line 3796

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_backgrounds(for_dark_theme:) ⇒ TD::Types::Backgrounds

Returns backgrounds installed by the user.

Parameters:

  • for_dark_theme (Boolean)

    Pass true to order returned backgrounds for a dark theme.

Returns:



3809
3810
3811
3812
# File 'lib/tdlib/client_methods.rb', line 3809

def get_installed_backgrounds(for_dark_theme:)
  broadcast('@type'          => 'getInstalledBackgrounds',
            'for_dark_theme' => for_dark_theme)
end

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

Returns a list of installed sticker sets.

Parameters:

Returns:



3818
3819
3820
3821
# File 'lib/tdlib/client_methods.rb', line 3818

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

Returns an HTTPS or a tg: link with the given type. Can be called before authorization.

Parameters:

  • type (TD::Types::InternalLinkType)

    Expected type of the link.

  • is_http (Boolean)

    Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link.

Returns:



3830
3831
3832
3833
3834
# File 'lib/tdlib/client_methods.rb', line 3830

def get_internal_link(type:, is_http:)
  broadcast('@type'   => 'getInternalLink',
            'type'    => type,
            'is_http' => is_http)
end

Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called before authorization.

Parameters:

  • link (TD::Types::String)

    The link.

Returns:



3842
3843
3844
3845
# File 'lib/tdlib/client_methods.rb', line 3842

def get_internal_link_type(link:)
  broadcast('@type' => 'getInternalLinkType',
            'link'  => link)
end

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

Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously.

Parameters:

Returns:



3852
3853
3854
3855
# File 'lib/tdlib/client_methods.rb', line 3852

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. Can be called synchronously.

Parameters:

  • json (TD::Types::String)

    The JSON-serialized string.

Returns:



3862
3863
3864
3865
# File 'lib/tdlib/client_methods.rb', line 3862

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

#get_keyword_emojis(text:, input_language_codes: nil) ⇒ TD::Types::Emojis

Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified.

Parameters:

  • text (TD::Types::String)

    Text to search for.

  • input_language_codes (Array<TD::Types::String>, nil) (defaults to: nil)

    List of possible IETF language tags of the user’s input language; may be empty if unknown.

Returns:



3875
3876
3877
3878
3879
# File 'lib/tdlib/client_methods.rb', line 3875

def get_keyword_emojis(text:, input_language_codes: nil)
  broadcast('@type'                => 'getKeywordEmojis',
            'text'                 => text,
            'input_language_codes' => input_language_codes)
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.

Parameters:

  • language_pack_id (TD::Types::String)

    Language pack identifier.

Returns:



3887
3888
3889
3890
# File 'lib/tdlib/client_methods.rb', line 3887

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. Can be called synchronously.

Parameters:

  • language_pack_database_path (TD::Types::String)

    Path to the language pack database in which strings are stored.

  • localization_target (TD::Types::String)

    Localization target to which the language pack belongs.

  • language_pack_id (TD::Types::String)

    Language pack identifier.

  • key (TD::Types::String)

    Language pack key of the string to be returned.

Returns:



3902
3903
3904
3905
3906
3907
3908
# File 'lib/tdlib/client_methods.rb', line 3902

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.

Parameters:

  • language_pack_id (TD::Types::String)

    Language pack identifier of the strings to be returned.

  • keys (Array<TD::Types::String>)

    Language pack keys of the strings to be returned; leave empty to request all available strings.

Returns:



3917
3918
3919
3920
3921
# File 'lib/tdlib/client_methods.rb', line 3917

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

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

Parameters:

Returns:



3931
3932
3933
3934
3935
# File 'lib/tdlib/client_methods.rb', line 3931

def get_link_preview(text:, link_preview_options:)
  broadcast('@type'                => 'getLinkPreview',
            'text'                 => text,
            'link_preview_options' => link_preview_options)
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.

Parameters:

  • only_local (Boolean)

    Pass true to get only locally available information without sending network requests.

Returns:



3943
3944
3945
3946
# File 'lib/tdlib/client_methods.rb', line 3943

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. Can be called synchronously.



3952
3953
3954
# File 'lib/tdlib/client_methods.rb', line 3952

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. Can be called synchronously.

Parameters:

  • tag (TD::Types::String)

    Logging tag to change verbosity level.

Returns:



3961
3962
3963
3964
# File 'lib/tdlib/client_methods.rb', line 3961

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

#get_log_tagsTD::Types::LogTags

Returns the list of available TDLib internal log tags, for example, [“actor”, “binlog”, “connections”,

"notifications", "proxy"].

Can be called synchronously.

Returns:



3971
3972
3973
# File 'lib/tdlib/client_methods.rb', line 3971

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

#get_log_verbosity_levelTD::Types::LogVerbosityLevel

Returns current verbosity level of the internal logging of TDLib. Can be called synchronously.



3979
3980
3981
# File 'lib/tdlib/client_methods.rb', line 3979

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.

Parameters:

  • chat_id (Integer)

    Chat identifier of the message with the button.

  • message_id (Integer)

    Message identifier of the message with the button.

  • button_id (Integer)

    Button identifier.

  • allow_write_access (Boolean)

    Pass true to allow the bot to send messages to the current user.

Returns:



3993
3994
3995
3996
3997
3998
3999
# File 'lib/tdlib/client_methods.rb', line 3993

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.

Parameters:

  • chat_id (Integer)

    Chat identifier of the message with the button.

  • message_id (Integer)

    Message identifier of the message with the button. The message must not be scheduled.

  • button_id (Integer)

    Button identifier.

Returns:



4009
4010
4011
4012
4013
4014
# File 'lib/tdlib/client_methods.rb', line 4009

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

#get_main_web_app(chat_id:, bot_user_id:, start_parameter:, theme:, application_name:) ⇒ TD::Types::MainWebApp

Returns information needed to open the main Web App of a bot.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which the Web App is opened; pass 0 if none.

  • bot_user_id (Integer)

    Identifier of the target bot.

  • start_parameter (TD::Types::String)

    Start parameter from internalLinkTypeMainWebApp.

  • theme (TD::Types::ThemeParameters)

    Preferred Web App theme; pass null to use the default theme.

  • application_name (TD::Types::String)

    Short name of the current application; 0-64 English letters, digits, and underscores.

Returns:



4025
4026
4027
4028
4029
4030
4031
4032
# File 'lib/tdlib/client_methods.rb', line 4025

def get_main_web_app(chat_id:, bot_user_id:, start_parameter:, theme:, application_name:)
  broadcast('@type'            => 'getMainWebApp',
            'chat_id'          => chat_id,
            'bot_user_id'      => bot_user_id,
            'start_parameter'  => start_parameter,
            'theme'            => theme,
            'application_name' => application_name)
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.

Parameters:

  • location (TD::Types::Location)

    Location of the map center.

  • zoom (Integer)

    Map zoom level; 13-20.

  • width (Integer)

    Map width in pixels before applying scale; 16-1024.

  • height (Integer)

    Map height in pixels before applying scale; 16-1024.

  • scale (Integer)

    Map scale; 1-3.

  • chat_id (Integer)

    Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown.

Returns:



4045
4046
4047
4048
4049
4050
4051
4052
4053
# File 'lib/tdlib/client_methods.rb', line 4045

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_markdown_text(text:) ⇒ TD::Types::FormattedText

Replaces text entities with Markdown formatting in a human-friendly format. Entities that can’t be represented in Markdown unambiguously are kept as is. Can be called synchronously.

Parameters:

Returns:



4061
4062
4063
4064
# File 'lib/tdlib/client_methods.rb', line 4061

def get_markdown_text(text:)
  broadcast('@type' => 'getMarkdownText',
            'text'  => text)
end

#get_meTD::Types::User

Returns the current user.

Returns:



4069
4070
4071
# File 'lib/tdlib/client_methods.rb', line 4069

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

#get_menu_button(user_id:) ⇒ TD::Types::BotMenuButton

Returns menu button set by the bot for the given user; for bots only.

Parameters:

  • user_id (Integer)

    Identifier of the user or 0 to get the default menu button.

Returns:



4077
4078
4079
4080
# File 'lib/tdlib/client_methods.rb', line 4077

def get_menu_button(user_id:)
  broadcast('@type'   => 'getMenuButton',
            'user_id' => user_id)
end

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

Returns information about a message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the message belongs to.

  • message_id (Integer)

    Identifier of the message to get.

Returns:



4087
4088
4089
4090
4091
# File 'lib/tdlib/client_methods.rb', line 4087

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

#get_message_added_reactions(chat_id:, message_id:, reaction_type:, offset:, limit:) ⇒ TD::Types::AddedReactions

Returns reactions added for a message, along with their sender.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message. Use message.interaction_info.reactions.can_get_added_reactions to check whether added reactions can be received for the message.

  • reaction_type (TD::Types::ReactionType)

    Type of the reactions to return; pass null to return all added reactions; Types::ReactionType::Paid isn’t supported.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of reactions to be returned; must be positive and can’t be greater than 100.

Returns:



4106
4107
4108
4109
4110
4111
4112
4113
# File 'lib/tdlib/client_methods.rb', line 4106

def get_message_added_reactions(chat_id:, message_id:, reaction_type:, offset:, limit:)
  broadcast('@type'         => 'getMessageAddedReactions',
            'chat_id'       => chat_id,
            'message_id'    => message_id,
            'reaction_type' => reaction_type,
            'offset'        => offset,
            'limit'         => limit)
end

#get_message_available_reactions(chat_id:, message_id:, row_size:) ⇒ TD::Types::AvailableReactions

Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or

updateMessageInteractionInfo for the message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • row_size (Integer)

    Number of reaction per row, 5-25.

Returns:



4123
4124
4125
4126
4127
4128
# File 'lib/tdlib/client_methods.rb', line 4123

def get_message_available_reactions(chat_id:, message_id:, row_size:)
  broadcast('@type'      => 'getMessageAvailableReactions',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'row_size'   => row_size)
end

#get_message_effect(effect_id:) ⇒ TD::Types::MessageEffect

Returns information about a message effect. Returns a 404 error if the effect is not found.

Parameters:

  • effect_id (Integer)

    Unique identifier of the effect.

Returns:



4135
4136
4137
4138
# File 'lib/tdlib/client_methods.rb', line 4135

def get_message_effect(effect_id:)
  broadcast('@type'     => 'getMessageEffect',
            'effect_id' => effect_id)
end

#get_message_embedding_code(chat_id:, message_id:, for_album:) ⇒ TD::Types::Text

Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • for_album (Boolean)

    Pass true to return an HTML code for embedding of the whole media album.

Returns:



4147
4148
4149
4150
4151
4152
# File 'lib/tdlib/client_methods.rb', line 4147

def get_message_embedding_code(chat_id:, message_id:, for_album:)
  broadcast('@type'      => 'getMessageEmbeddingCode',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'for_album'  => for_album)
end

#get_message_file_type(message_file_head:) ⇒ TD::Types::MessageFileType

Returns information about a file with messages exported from another application.

Parameters:

  • message_file_head (TD::Types::String)

    Beginning of the message file; up to 100 first lines.

Returns:



4158
4159
4160
4161
# File 'lib/tdlib/client_methods.rb', line 4158

def get_message_file_type(message_file_head:)
  broadcast('@type'             => 'getMessageFileType',
            'message_file_head' => message_file_head)
end

#get_message_import_confirmation_text(chat_id:) ⇒ TD::Types::Text

Returns a confirmation text to be shown to the user before starting message import.

Parameters:

  • chat_id (Integer)

    Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right.

Returns:



4169
4170
4171
4172
# File 'lib/tdlib/client_methods.rb', line 4169

def get_message_import_confirmation_text(chat_id:)
  broadcast('@type'   => 'getMessageImportConfirmationText',
            'chat_id' => chat_id)
end

Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media

timestamp link is generated.

This is an offline request.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • media_timestamp (Integer)

    If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview.

  • for_album (Boolean)

    Pass true to create a link for the whole media album.

  • in_message_thread (Boolean)

    Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic.

Returns:



4188
4189
4190
4191
4192
4193
4194
4195
# File 'lib/tdlib/client_methods.rb', line 4188

def get_message_link(chat_id:, message_id:, media_timestamp:, for_album:, in_message_thread:)
  broadcast('@type'             => 'getMessageLink',
            'chat_id'           => chat_id,
            'message_id'        => message_id,
            'media_timestamp'   => media_timestamp,
            'for_album'         => for_album,
            'in_message_thread' => in_message_thread)
end

Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage.

Parameters:

  • url (TD::Types::String)

    The message link.

Returns:



4202
4203
4204
4205
# File 'lib/tdlib/client_methods.rb', line 4202

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 without sending network request. This is an offline request.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the message belongs to.

  • message_id (Integer)

    Identifier of the message to get.

Returns:



4213
4214
4215
4216
4217
# File 'lib/tdlib/client_methods.rb', line 4213

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

#get_message_properties(chat_id:, message_id:) ⇒ TD::Types::MessageProperties

Returns properties of a message; this is an offline request.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Identifier of the message.

Returns:



4224
4225
4226
4227
4228
# File 'lib/tdlib/client_methods.rb', line 4224

def get_message_properties(chat_id:, message_id:)
  broadcast('@type'      => 'getMessageProperties',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_message_public_forwards(chat_id:, message_id:, offset:, limit:) ⇒ TD::Types::PublicForwards

Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if messageProperties.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib.

Parameters:

  • chat_id (Integer)

    Chat identifier of the message.

  • message_id (Integer)

    Message identifier.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages and stories to be returned; must be positive and can’t be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit.

Returns:



4243
4244
4245
4246
4247
4248
4249
# File 'lib/tdlib/client_methods.rb', line 4243

def get_message_public_forwards(chat_id:, message_id:, offset:, limit:)
  broadcast('@type'      => 'getMessagePublicForwards',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'offset'     => offset,
            'limit'      => limit)
end

#get_message_read_date(chat_id:, message_id:) ⇒ TD::Types::MessageReadDate

Returns read date of a recent outgoing message in a private chat. The method can be called if messageProperties.can_get_read_date == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Identifier of the message.

Returns:



4257
4258
4259
4260
4261
# File 'lib/tdlib/client_methods.rb', line 4257

def get_message_read_date(chat_id:, message_id:)
  broadcast('@type'      => 'getMessageReadDate',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_message_statistics(chat_id:, message_id:, is_dark:) ⇒ TD::Types::MessageStatistics

Returns detailed statistics about a message. Can be used only if messageProperties.can_get_statistics == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Message identifier.

  • is_dark (Boolean)

    Pass true if a dark theme is used by the application.

Returns:



4270
4271
4272
4273
4274
4275
# File 'lib/tdlib/client_methods.rb', line 4270

def get_message_statistics(chat_id:, message_id:, is_dark:)
  broadcast('@type'      => 'getMessageStatistics',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'is_dark'    => is_dark)
end

#get_message_thread(chat_id:, message_id:) ⇒ TD::Types::MessageThreadInfo

Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Identifier of the message.

Returns:



4283
4284
4285
4286
4287
# File 'lib/tdlib/client_methods.rb', line 4283

def get_message_thread(chat_id:, message_id:)
  broadcast('@type'      => 'getMessageThread',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, limit:) ⇒ TD::Types::Messages

Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel’s linked supergroup. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Message identifier, which thread history needs to be returned.

  • from_message_id (Integer)

    Identifier of the message starting from which history must be fetched; use 0 to get results from the last message.

  • offset (Integer)

    Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages.

  • limit (Integer)

    The maximum number of messages to be returned; must be positive and can’t be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

Returns:



4307
4308
4309
4310
4311
4312
4313
4314
# File 'lib/tdlib/client_methods.rb', line 4307

def get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, limit:)
  broadcast('@type'           => 'getMessageThreadHistory',
            'chat_id'         => chat_id,
            'message_id'      => message_id,
            'from_message_id' => from_message_id,
            'offset'          => offset,
            'limit'           => limit)
end

#get_message_viewers(chat_id:, message_id:) ⇒ TD::Types::MessageViewers

Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Identifier of the message.

Returns:



4323
4324
4325
4326
4327
# File 'lib/tdlib/client_methods.rb', line 4323

def get_message_viewers(chat_id:, message_id:)
  broadcast('@type'      => 'getMessageViewers',
            '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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the messages belong to.

  • message_ids (Array<Integer>)

    Identifiers of the messages to get.

Returns:



4335
4336
4337
4338
4339
# File 'lib/tdlib/client_methods.rb', line 4335

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.

Parameters:

  • only_current (Boolean)

    Pass true to get statistics only for the current library launch.

Returns:



4346
4347
4348
4349
# File 'lib/tdlib/client_methods.rb', line 4346

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

#get_new_chat_privacy_settingsTD::Types::NewChatPrivacySettings

Returns privacy settings for new chat creation.



4354
4355
4356
# File 'lib/tdlib/client_methods.rb', line 4354

def get_new_chat_privacy_settings
  broadcast('@type' => 'getNewChatPrivacySettings')
end

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

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

authorization.

Can be called synchronously for options “version” and “commit_hash”.

Parameters:

  • name (TD::Types::String)

    The name of the option.

Returns:



4365
4366
4367
4368
# File 'lib/tdlib/client_methods.rb', line 4365

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

#get_owned_sticker_sets(offset_sticker_set_id:, limit:) ⇒ TD::Types::StickerSets

Returns sticker sets owned by the current user.

Parameters:

  • offset_sticker_set_id (Integer)

    Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning.

  • limit (Integer)

    The maximum number of sticker sets to be returned; must be positive and can’t be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit.

Returns:



4379
4380
4381
4382
4383
# File 'lib/tdlib/client_methods.rb', line 4379

def get_owned_sticker_sets(offset_sticker_set_id:, limit:)
  broadcast('@type'                 => 'getOwnedStickerSets',
            'offset_sticker_set_id' => offset_sticker_set_id,
            'limit'                 => limit)
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.

Parameters:

  • bot_user_id (Integer)

    User identifier of the service’s bot.

  • scope (TD::Types::String)

    Telegram Passport element types requested by the service.

  • public_key (TD::Types::String)

    Service’s public key.

  • nonce (TD::Types::String)

    Unique request identifier provided by the service.

Returns:



4392
4393
4394
4395
4396
4397
4398
# File 'lib/tdlib/client_methods.rb', line 4392

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(authorization_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.

Parameters:

  • authorization_form_id (Integer)

    Authorization form identifier.

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



4407
4408
4409
4410
4411
# File 'lib/tdlib/client_methods.rb', line 4407

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

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

Returns one of the available Telegram Passport elements.

Parameters:

  • type (TD::Types::PassportElementType)

    Telegram Passport element type.

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



4418
4419
4420
4421
4422
# File 'lib/tdlib/client_methods.rb', line 4418

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.



4427
4428
4429
# File 'lib/tdlib/client_methods.rb', line 4427

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

#get_payment_form(input_invoice:, theme:) ⇒ TD::Types::PaymentForm

Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy, or wants to

buy access to media in a messagePaidMedia message.

Parameters:

Returns:



4438
4439
4440
4441
4442
# File 'lib/tdlib/client_methods.rb', line 4438

def get_payment_form(input_invoice:, theme:)
  broadcast('@type'         => 'getPaymentForm',
            'input_invoice' => input_invoice,
            'theme'         => theme)
end

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

Returns information about a successful payment.

Parameters:

Returns:



4449
4450
4451
4452
4453
# File 'lib/tdlib/client_methods.rb', line 4449

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

#get_phone_number_info(phone_number_prefix:) ⇒ TD::Types::PhoneNumberInfo

Returns information about a phone number by its prefix. Can be called before authorization.

Parameters:

  • phone_number_prefix (TD::Types::String)

    The phone number prefix.

Returns:



4460
4461
4462
4463
# File 'lib/tdlib/client_methods.rb', line 4460

def get_phone_number_info(phone_number_prefix:)
  broadcast('@type'               => 'getPhoneNumberInfo',
            'phone_number_prefix' => phone_number_prefix)
end

#get_phone_number_info_sync(language_code:, phone_number_prefix:) ⇒ TD::Types::PhoneNumberInfo

Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly

localized country information is expected.

Can be called synchronously.

Parameters:

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code for country information localization.

  • phone_number_prefix (TD::Types::String)

    The phone number prefix.

Returns:



4473
4474
4475
4476
4477
# File 'lib/tdlib/client_methods.rb', line 4473

def get_phone_number_info_sync(language_code:, phone_number_prefix:)
  broadcast('@type'               => 'getPhoneNumberInfoSync',
            'language_code'       => language_code,
            'phone_number_prefix' => phone_number_prefix)
end

#get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:) ⇒ TD::Types::MessageSenders

Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the poll belongs.

  • message_id (Integer)

    Identifier of the message containing the poll.

  • option_id (Integer)

    0-based identifier of the answer option.

  • offset (Integer)

    Number of voters to skip in the result; must be non-negative.

  • limit (Integer)

    The maximum number of voters to be returned; must be positive and can’t be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached.

Returns:



4490
4491
4492
4493
4494
4495
4496
4497
# File 'lib/tdlib/client_methods.rb', line 4490

def get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:)
  broadcast('@type'      => 'getPollVoters',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'option_id'  => option_id,
            'offset'     => offset,
            'limit'      => limit)
end

Returns popular Web App bots.

Parameters:

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of bots to be returned; up to 100.

Returns:



4505
4506
4507
4508
4509
# File 'lib/tdlib/client_methods.rb', line 4505

def get_popular_web_app_bots(offset:, limit:)
  broadcast('@type'  => 'getPopularWebAppBots',
            'offset' => offset,
            'limit'  => limit)
end

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

Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in

Telegram Passport personal details.

Returns a 404 error if unknown.

Parameters:

  • country_code (TD::Types::String)

    A two-letter ISO 3166-1 alpha-2 country code.

Returns:



4517
4518
4519
4520
# File 'lib/tdlib/client_methods.rb', line 4517

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

#get_premium_features(source:) ⇒ TD::Types::PremiumFeatures

Returns information about features, available to Premium users.

Parameters:

  • source (TD::Types::PremiumSource)

    Source of the request; pass null if the method is called from some non-standard source.

Returns:



4527
4528
4529
4530
# File 'lib/tdlib/client_methods.rb', line 4527

def get_premium_features(source:)
  broadcast('@type'  => 'getPremiumFeatures',
            'source' => source)
end

#get_premium_gift_code_payment_options(boosted_chat_id:) ⇒ TD::Types::PremiumGiftCodePaymentOptions

Returns available options for Telegram Premium gift code or giveaway creation.

Parameters:

  • boosted_chat_id (Integer)

    Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none.

Returns:



4537
4538
4539
4540
# File 'lib/tdlib/client_methods.rb', line 4537

def get_premium_gift_code_payment_options(boosted_chat_id:)
  broadcast('@type'           => 'getPremiumGiftCodePaymentOptions',
            'boosted_chat_id' => boosted_chat_id)
end

#get_premium_giveaway_info(chat_id:, message_id:) ⇒ TD::Types::PremiumGiveawayInfo

Returns information about a Telegram Premium giveaway.

Parameters:

  • chat_id (Integer)

    Identifier of the channel chat which started the giveaway.

  • message_id (Integer)

    Identifier of the giveaway or a giveaway winners message in the chat.

Returns:



4547
4548
4549
4550
4551
# File 'lib/tdlib/client_methods.rb', line 4547

def get_premium_giveaway_info(chat_id:, message_id:)
  broadcast('@type'      => 'getPremiumGiveawayInfo',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#get_premium_limit(limit_type:) ⇒ TD::Types::PremiumLimit

Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown.

Parameters:

Returns:



4558
4559
4560
4561
# File 'lib/tdlib/client_methods.rb', line 4558

def get_premium_limit(limit_type:)
  broadcast('@type'      => 'getPremiumLimit',
            'limit_type' => limit_type)
end

#get_premium_stateTD::Types::PremiumState

Returns state of Telegram Premium subscription and promotion videos for Premium features.



4566
4567
4568
# File 'lib/tdlib/client_methods.rb', line 4566

def get_premium_state
  broadcast('@type' => 'getPremiumState')
end

#get_premium_sticker_examplesTD::Types::Stickers

Returns examples of premium stickers for demonstration purposes.

Returns:



4573
4574
4575
# File 'lib/tdlib/client_methods.rb', line 4573

def get_premium_sticker_examples
  broadcast('@type' => 'getPremiumStickerExamples')
end

#get_premium_stickers(limit:) ⇒ TD::Types::Stickers

Returns premium stickers from regular sticker sets.

Parameters:

  • limit (Integer)

    The maximum number of stickers to be returned; 0-100.

Returns:



4581
4582
4583
4584
# File 'lib/tdlib/client_methods.rb', line 4581

def get_premium_stickers(limit:)
  broadcast('@type' => 'getPremiumStickers',
            'limit' => limit)
end

#get_proxiesTD::Types::Proxies

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

Returns:



4590
4591
4592
# File 'lib/tdlib/client_methods.rb', line 4590

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.

Parameters:

  • proxy_id (Integer)

    Proxy identifier.

Returns:



4600
4601
4602
4603
# File 'lib/tdlib/client_methods.rb', line 4600

def get_proxy_link(proxy_id:)
  broadcast('@type'    => 'getProxyLink',
            'proxy_id' => proxy_id)
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.

Can be called synchronously.

Parameters:

  • payload (TD::Types::String)

    JSON-encoded push notification payload.

Returns:



4611
4612
4613
4614
# File 'lib/tdlib/client_methods.rb', line 4611

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

#get_read_date_privacy_settingsTD::Types::ReadDatePrivacySettings

Returns privacy settings for message read date.



4619
4620
4621
# File 'lib/tdlib/client_methods.rb', line 4619

def get_read_date_privacy_settings
  broadcast('@type' => 'getReadDatePrivacySettings')
end

#get_recent_emoji_statusesTD::Types::EmojiStatuses

Returns recent emoji statuses for self status.



4626
4627
4628
# File 'lib/tdlib/client_methods.rb', line 4626

def get_recent_emoji_statuses
  broadcast('@type' => 'getRecentEmojiStatuses')
end

#get_recent_inline_botsTD::Types::Users

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

Returns:



4633
4634
4635
# File 'lib/tdlib/client_methods.rb', line 4633

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

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

Returns a list of recently used stickers.

Parameters:

  • is_attached (Boolean)

    Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers.

Returns:



4642
4643
4644
4645
# File 'lib/tdlib/client_methods.rb', line 4642

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

#get_recently_opened_chats(limit:) ⇒ TD::Types::Chats

Returns recently opened chats; this is an offline request. Returns chats in the order of last opening.

Parameters:

  • limit (Integer)

    The maximum number of chats to be returned.

Returns:



4652
4653
4654
4655
# File 'lib/tdlib/client_methods.rb', line 4652

def get_recently_opened_chats(limit:)
  broadcast('@type' => 'getRecentlyOpenedChats',
            'limit' => limit)
end

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

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

Parameters:

  • referrer (TD::Types::String)

    Google Play referrer to identify the user.

Returns:



4661
4662
4663
4664
# File 'lib/tdlib/client_methods.rb', line 4661

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

Returns recommended chat folders for the current user.



4669
4670
4671
# File 'lib/tdlib/client_methods.rb', line 4669

def get_recommended_chat_folders
  broadcast('@type' => 'getRecommendedChatFolders')
end

Returns a list of channel chats recommended to the current user.

Returns:



4676
4677
4678
# File 'lib/tdlib/client_methods.rb', line 4676

def get_recommended_chats
  broadcast('@type' => 'getRecommendedChats')
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.

Parameters:

  • password (TD::Types::String)

    The 2-step verification password for the current user.

Returns:



4685
4686
4687
4688
# File 'lib/tdlib/client_methods.rb', line 4685

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 identifier; 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 application.

Parameters:

  • remote_file_id (TD::Types::String)

    Remote identifier of the file to get.

  • file_type (TD::Types::FileType)

    File type; pass null if unknown.

Returns:



4699
4700
4701
4702
4703
# File 'lib/tdlib/client_methods.rb', line 4699

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 non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same

background, the giveaway message, and the topic creation message for messages of the types messagePinMessage,
messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic
messages without non-bundled replied message respectively.

Parameters:

  • chat_id (Integer)

    Identifier of the chat the message belongs to.

  • message_id (Integer)

    Identifier of the reply message.

Returns:



4714
4715
4716
4717
4718
# File 'lib/tdlib/client_methods.rb', line 4714

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.



4723
4724
4725
# File 'lib/tdlib/client_methods.rb', line 4723

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

#get_saved_messages_tags(saved_messages_topic_id:) ⇒ TD::Types::SavedMessagesTags

Returns tags used in Saved Messages or a Saved Messages topic.

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic which tags will be returned; pass 0 to get all Saved Messages tags.

Returns:



4732
4733
4734
4735
# File 'lib/tdlib/client_methods.rb', line 4732

def get_saved_messages_tags(saved_messages_topic_id:)
  broadcast('@type'                   => 'getSavedMessagesTags',
            'saved_messages_topic_id' => saved_messages_topic_id)
end

#get_saved_messages_topic_history(saved_messages_topic_id:, from_message_id:, offset:, limit:) ⇒ TD::Types::Messages

Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id).

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic which messages will be fetched.

  • from_message_id (Integer)

    Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message.

  • offset (Integer)

    Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages.

  • limit (Integer)

    The maximum number of messages to be returned; must be positive and can’t be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

Returns:



4751
4752
4753
4754
4755
4756
4757
# File 'lib/tdlib/client_methods.rb', line 4751

def get_saved_messages_topic_history(saved_messages_topic_id:, from_message_id:, offset:, limit:)
  broadcast('@type'                   => 'getSavedMessagesTopicHistory',
            'saved_messages_topic_id' => saved_messages_topic_id,
            'from_message_id'         => from_message_id,
            'offset'                  => offset,
            'limit'                   => limit)
end

#get_saved_messages_topic_message_by_date(saved_messages_topic_id:, date:) ⇒ TD::Types::Message

Returns the last message sent in a Saved Messages topic no later than the specified date.

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic which message will be returned.

  • date (Integer)

    Point in time (Unix timestamp) relative to which to search for messages.

Returns:



4764
4765
4766
4767
4768
# File 'lib/tdlib/client_methods.rb', line 4764

def get_saved_messages_topic_message_by_date(saved_messages_topic_id:, date:)
  broadcast('@type'                   => 'getSavedMessagesTopicMessageByDate',
            'saved_messages_topic_id' => saved_messages_topic_id,
            'date'                    => date)
end

#get_saved_notification_sound(notification_sound_id:) ⇒ TD::Types::NotificationSounds

Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier.

Parameters:

  • notification_sound_id (Integer)

    Identifier of the notification sound.

Returns:



4775
4776
4777
4778
# File 'lib/tdlib/client_methods.rb', line 4775

def get_saved_notification_sound(notification_sound_id:)
  broadcast('@type'                 => 'getSavedNotificationSound',
            'notification_sound_id' => notification_sound_id)
end

#get_saved_notification_soundsTD::Types::NotificationSounds

Returns the list of saved notification sounds. If a sound isn’t in the list, then default sound needs to be used.



4784
4785
4786
# File 'lib/tdlib/client_methods.rb', line 4784

def get_saved_notification_sounds
  broadcast('@type' => 'getSavedNotificationSounds')
end

#get_saved_order_infoTD::Types::OrderInfo

Returns saved order information. Returns a 404 error if there is no saved order information.



4792
4793
4794
# File 'lib/tdlib/client_methods.rb', line 4792

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.

Parameters:

Returns:



4801
4802
4803
4804
# File 'lib/tdlib/client_methods.rb', line 4801

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

#get_searched_for_tags(tag_prefix:, limit:) ⇒ TD::Types::Hashtags

Returns recently searched for hashtags or cashtags by their prefix.

Parameters:

  • tag_prefix (TD::Types::String)

    Prefix of hashtags or cashtags to return.

  • limit (Integer)

    The maximum number of items to be returned.

Returns:



4811
4812
4813
4814
4815
# File 'lib/tdlib/client_methods.rb', line 4811

def get_searched_for_tags(tag_prefix:, limit:)
  broadcast('@type'      => 'getSearchedForTags',
            'tag_prefix' => tag_prefix,
            'limit'      => limit)
end

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

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

Parameters:

  • secret_chat_id (Integer)

    Secret chat identifier.

Returns:



4822
4823
4824
4825
# File 'lib/tdlib/client_methods.rb', line 4822

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

#get_star_ad_account_url(owner_id:) ⇒ TD::Types::HttpUrl

Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the

owned Telegram Stars.

Parameters:

  • owner_id (TD::Types::MessageSender)

    Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat.

Returns:



4833
4834
4835
4836
# File 'lib/tdlib/client_methods.rb', line 4833

def (owner_id:)
  broadcast('@type'    => 'getStarAdAccountUrl',
            'owner_id' => owner_id)
end

#get_star_gift_payment_options(user_id:) ⇒ TD::Types::StarPaymentOptions

Returns available options for Telegram Stars gifting.

Parameters:

  • user_id (Integer)

    Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user.

Returns:



4843
4844
4845
4846
# File 'lib/tdlib/client_methods.rb', line 4843

def get_star_gift_payment_options(user_id:)
  broadcast('@type'   => 'getStarGiftPaymentOptions',
            'user_id' => user_id)
end

#get_star_payment_optionsTD::Types::StarPaymentOptions

Returns available options for Telegram Stars purchase.



4851
4852
4853
# File 'lib/tdlib/client_methods.rb', line 4851

def get_star_payment_options
  broadcast('@type' => 'getStarPaymentOptions')
end

#get_star_revenue_statistics(owner_id:, is_dark:) ⇒ TD::Types::StarRevenueStatistics

Returns detailed Telegram Star revenue statistics.

Parameters:

  • owner_id (TD::Types::MessageSender)

    Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true.

  • is_dark (Boolean)

    Pass true if a dark theme is used by the application.

Returns:



4861
4862
4863
4864
4865
# File 'lib/tdlib/client_methods.rb', line 4861

def get_star_revenue_statistics(owner_id:, is_dark:)
  broadcast('@type'    => 'getStarRevenueStatistics',
            'owner_id' => owner_id,
            'is_dark'  => is_dark)
end

#get_star_subscriptions(only_expiring:, offset:) ⇒ TD::Types::StarSubscriptions

Returns the list of Telegram Star subscriptions for the current user.

Parameters:

  • only_expiring (Boolean)

    Pass true to receive only expiring subscriptions for which there are no enough Telegram Stars to extend.

  • offset (TD::Types::String)

    Offset of the first subscription to return as received from the previous request; use empty string to get the first chunk of results.

Returns:



4874
4875
4876
4877
4878
# File 'lib/tdlib/client_methods.rb', line 4874

def get_star_subscriptions(only_expiring:, offset:)
  broadcast('@type'         => 'getStarSubscriptions',
            'only_expiring' => only_expiring,
            'offset'        => offset)
end

#get_star_transactions(owner_id:, subscription_id:, direction:, offset:, limit:) ⇒ TD::Types::StarTransactions

Returns the list of Telegram Star transactions for the specified owner.

Parameters:

  • owner_id (TD::Types::MessageSender)

    Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true.

  • subscription_id (TD::Types::String)

    If non-empty, only transactions related to the Star Subscription will be returned.

  • direction (TD::Types::StarTransactionDirection)

    Direction of the transactions to receive; pass null to get all transactions.

  • offset (TD::Types::String)

    Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of transactions to return.

Returns:



4893
4894
4895
4896
4897
4898
4899
4900
# File 'lib/tdlib/client_methods.rb', line 4893

def get_star_transactions(owner_id:, subscription_id:, direction:, offset:, limit:)
  broadcast('@type'           => 'getStarTransactions',
            'owner_id'        => owner_id,
            'subscription_id' => subscription_id,
            'direction'       => direction,
            'offset'          => offset,
            'limit'           => limit)
end

#get_star_withdrawal_url(owner_id:, star_count:, password:) ⇒ TD::Types::HttpUrl

Returns a URL for Telegram Star withdrawal.

Parameters:

  • owner_id (TD::Types::MessageSender)

    Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat.

  • star_count (Integer)

    The number of Telegram Stars to withdraw. Must be at least getOption(“star_withdrawal_count_min”).

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



4910
4911
4912
4913
4914
4915
# File 'lib/tdlib/client_methods.rb', line 4910

def get_star_withdrawal_url(owner_id:, star_count:, password:)
  broadcast('@type'      => 'getStarWithdrawalUrl',
            'owner_id'   => owner_id,
            'star_count' => star_count,
            'password'   => password)
end

#get_statistical_graph(chat_id:, token:, x:) ⇒ TD::Types::StatisticalGraph

Loads an asynchronous or a zoomed in statistical graph.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • token (TD::Types::String)

    The token for graph loading.

  • x (Integer)

    X-value for zoomed in graph or 0 otherwise.

Returns:



4923
4924
4925
4926
4927
4928
# File 'lib/tdlib/client_methods.rb', line 4923

def get_statistical_graph(chat_id:, token:, x:)
  broadcast('@type'   => 'getStatisticalGraph',
            'chat_id' => chat_id,
            'token'   => token,
            'x'       => x)
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.

Parameters:

Returns:



4936
4937
4938
4939
# File 'lib/tdlib/client_methods.rb', line 4936

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.

Parameters:

  • set_id (Integer)

    Identifier of the sticker set.

Returns:



4945
4946
4947
4948
# File 'lib/tdlib/client_methods.rb', line 4945

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

#get_stickers(sticker_type:, query: nil, limit:, chat_id:) ⇒ TD::Types::Stickers

Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by

sticker-specific keywords.

If the query is non-empty, then favorite, recently used or trending stickers may also be returned.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the stickers to return.

  • query (TD::Types::String, nil) (defaults to: nil)

    Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers.

  • limit (Integer)

    The maximum number of stickers to be returned.

  • chat_id (Integer)

    Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats.

Returns:



4961
4962
4963
4964
4965
4966
4967
# File 'lib/tdlib/client_methods.rb', line 4961

def get_stickers(sticker_type:, query: nil, limit:, chat_id:)
  broadcast('@type'        => 'getStickers',
            'sticker_type' => sticker_type,
            'query'        => query,
            'limit'        => limit,
            'chat_id'      => chat_id)
end

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

Returns storage usage statistics. Can be called before authorization.

Parameters:

  • chat_limit (Integer)

    The maximum number of chats with the largest storage usage for which separate statistics need to be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0.

Returns:



4977
4978
4979
4980
# File 'lib/tdlib/client_methods.rb', line 4977

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.



4986
4987
4988
# File 'lib/tdlib/client_methods.rb', line 4986

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

#get_story(story_sender_chat_id:, story_id:, only_local:) ⇒ TD::Types::Story

Returns a story.

Parameters:

  • story_sender_chat_id (Integer)

    Identifier of the chat that posted the story.

  • story_id (Integer)

    Story identifier.

  • only_local (Boolean)

    Pass true to get only locally available information without sending network requests.

Returns:



4996
4997
4998
4999
5000
5001
# File 'lib/tdlib/client_methods.rb', line 4996

def get_story(story_sender_chat_id:, story_id:, only_local:)
  broadcast('@type'                => 'getStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id,
            'only_local'           => only_local)
end

#get_story_available_reactions(row_size:) ⇒ TD::Types::AvailableReactions

Returns reactions, which can be chosen for a story.

Parameters:

  • row_size (Integer)

    Number of reaction per row, 5-25.

Returns:



5007
5008
5009
5010
# File 'lib/tdlib/client_methods.rb', line 5007

def get_story_available_reactions(row_size:)
  broadcast('@type'    => 'getStoryAvailableReactions',
            'row_size' => row_size)
end

#get_story_interactions(story_id:, query: nil, only_contacts:, prefer_forwards:, prefer_with_reaction:, offset:, limit:) ⇒ TD::Types::StoryInteractions

Returns interactions with a story. The method can be called only for stories posted on behalf of the current user.

Parameters:

  • story_id (Integer)

    Story identifier.

  • query (TD::Types::String, nil) (defaults to: nil)

    Query to search for in names, usernames and titles; may be empty to get all relevant interactions.

  • only_contacts (Boolean)

    Pass true to get only interactions by contacts; pass false to get all relevant interactions.

  • prefer_forwards (Boolean)

    Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date.

  • prefer_with_reaction (Boolean)

    Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of story interactions to return.

Returns:



5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
# File 'lib/tdlib/client_methods.rb', line 5029

def get_story_interactions(story_id:, query: nil, only_contacts:, prefer_forwards:, prefer_with_reaction:, offset:,
                           limit:)
  broadcast('@type'                => 'getStoryInteractions',
            'story_id'             => story_id,
            'query'                => query,
            'only_contacts'        => only_contacts,
            'prefer_forwards'      => prefer_forwards,
            'prefer_with_reaction' => prefer_with_reaction,
            'offset'               => offset,
            'limit'                => limit)
end

#get_story_notification_settings_exceptionsTD::Types::Chats

Returns the list of chats with non-default notification settings for stories.

Returns:



5044
5045
5046
# File 'lib/tdlib/client_methods.rb', line 5044

def get_story_notification_settings_exceptions
  broadcast('@type' => 'getStoryNotificationSettingsExceptions')
end

#get_story_public_forwards(story_sender_chat_id:, story_id:, offset:, limit:) ⇒ TD::Types::PublicForwards

Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the story.

  • story_id (Integer)

    The identifier of the story.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages and stories to be returned; must be positive and can’t be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit.

Returns:



5061
5062
5063
5064
5065
5066
5067
# File 'lib/tdlib/client_methods.rb', line 5061

def get_story_public_forwards(story_sender_chat_id:, story_id:, offset:, limit:)
  broadcast('@type'                => 'getStoryPublicForwards',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id,
            'offset'               => offset,
            'limit'                => limit)
end

#get_story_statistics(chat_id:, story_id:, is_dark:) ⇒ TD::Types::StoryStatistics

Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • story_id (Integer)

    Story identifier.

  • is_dark (Boolean)

    Pass true if a dark theme is used by the application.

Returns:



5076
5077
5078
5079
5080
5081
# File 'lib/tdlib/client_methods.rb', line 5076

def get_story_statistics(chat_id:, story_id:, is_dark:)
  broadcast('@type'    => 'getStoryStatistics',
            'chat_id'  => chat_id,
            'story_id' => story_id,
            'is_dark'  => is_dark)
end

#get_suggested_file_name(file_id:, directory:) ⇒ TD::Types::Text

Returns suggested name for saving a file in a given directory.

Parameters:

  • file_id (Integer)

    Identifier of the file.

  • directory (TD::Types::String)

    Directory in which the file is supposed to be saved.

Returns:



5088
5089
5090
5091
5092
# File 'lib/tdlib/client_methods.rb', line 5088

def get_suggested_file_name(file_id:, directory:)
  broadcast('@type'     => 'getSuggestedFileName',
            'file_id'   => file_id,
            'directory' => directory)
end

#get_suggested_sticker_set_name(title:) ⇒ TD::Types::Text

Returns a suggested name for a new sticker set with a given title.

Parameters:

  • title (TD::Types::String)

    Sticker set title; 1-64 characters.

Returns:



5098
5099
5100
5101
# File 'lib/tdlib/client_methods.rb', line 5098

def get_suggested_sticker_set_name(title:)
  broadcast('@type' => 'getSuggestedStickerSetName',
            'title' => title)
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. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using

toggleSupergroupIsAllHistoryAvailable first.

Returns:



5109
5110
5111
# File 'lib/tdlib/client_methods.rb', line 5109

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

#get_suitable_personal_chatsTD::Types::Chats

Returns a list of channel chats, which can be used as a personal chat.

Returns:



5116
5117
5118
# File 'lib/tdlib/client_methods.rb', line 5116

def get_suitable_personal_chats
  broadcast('@type' => 'getSuitablePersonalChats')
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.

Parameters:

  • supergroup_id (Integer)

    Supergroup or channel identifier.

Returns:



5125
5126
5127
5128
# File 'lib/tdlib/client_methods.rb', line 5125

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.

Parameters:

  • supergroup_id (Integer)

    Supergroup or channel identifier.

Returns:



5134
5135
5136
5137
# File 'lib/tdlib/client_methods.rb', line 5134

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.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup or channel.

  • filter (TD::Types::SupergroupMembersFilter)

    The type of users to return; pass null to use supergroupMembersFilterRecent.

  • offset (Integer)

    Number of users to skip.

  • limit (Integer)

    The maximum number of users to be returned; up to 200.

Returns:



5149
5150
5151
5152
5153
5154
5155
# File 'lib/tdlib/client_methods.rb', line 5149

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_nameTD::Types::Text

Returns localized name of the Telegram support user; for Telegram support only.

Returns:



5160
5161
5162
# File 'lib/tdlib/client_methods.rb', line 5160

def get_support_name
  broadcast('@type' => 'getSupportName')
end

#get_support_userTD::Types::User

Returns a user that can be contacted to get support.

Returns:



5167
5168
5169
# File 'lib/tdlib/client_methods.rb', line 5167

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

#get_temporary_password_stateTD::Types::TemporaryPasswordState

Returns information about the current temporary password.



5174
5175
5176
# File 'lib/tdlib/client_methods.rb', line 5174

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

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

Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses)

found in the text.

Can be called synchronously.

Parameters:

  • text (TD::Types::String)

    The text in which to look for entities.

Returns:



5184
5185
5186
5187
# File 'lib/tdlib/client_methods.rb', line 5184

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

#get_theme_parameters_json_string(theme:) ⇒ TD::Types::Text

Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously.

Parameters:

Returns:



5194
5195
5196
5197
# File 'lib/tdlib/client_methods.rb', line 5194

def get_theme_parameters_json_string(theme:)
  broadcast('@type' => 'getThemeParametersJsonString',
            'theme' => theme)
end

#get_themed_chat_emoji_statusesTD::Types::EmojiStatuses

Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats.



5202
5203
5204
# File 'lib/tdlib/client_methods.rb', line 5202

def get_themed_chat_emoji_statuses
  broadcast('@type' => 'getThemedChatEmojiStatuses')
end

#get_themed_emoji_statusesTD::Types::EmojiStatuses

Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list

for self status.


5210
5211
5212
# File 'lib/tdlib/client_methods.rb', line 5210

def get_themed_emoji_statuses
  broadcast('@type' => 'getThemedEmojiStatuses')
end

#get_time_zonesTD::Types::TimeZones

Returns the list of supported time zones.



5217
5218
5219
# File 'lib/tdlib/client_methods.rb', line 5217

def get_time_zones
  broadcast('@type' => 'getTimeZones')
end

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

Returns a list of frequently used chats.

Parameters:

  • category (TD::Types::TopChatCategory)

    Category of chats to be returned.

  • limit (Integer)

    The maximum number of chats to be returned; up to 30.

Returns:



5226
5227
5228
5229
5230
# File 'lib/tdlib/client_methods.rb', line 5226

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

Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the sticker sets to return.

  • offset (Integer)

    The offset from which to return the sticker sets; must be non-negative.

  • limit (Integer)

    The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached.

Returns:



5241
5242
5243
5244
5245
5246
# File 'lib/tdlib/client_methods.rb', line 5241

def get_trending_sticker_sets(sticker_type:, offset:, limit:)
  broadcast('@type'        => 'getTrendingStickerSets',
            'sticker_type' => sticker_type,
            'offset'       => offset,
            'limit'        => limit)
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.

Parameters:

  • user_id (Integer)

    User identifier.

Returns:



5253
5254
5255
5256
# File 'lib/tdlib/client_methods.rb', line 5253

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

#get_user_chat_boosts(chat_id:, user_id:) ⇒ TD::Types::FoundChatBoosts

Returns the list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots

only.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • user_id (Integer)

    Identifier of the user.

Returns:



5264
5265
5266
5267
5268
# File 'lib/tdlib/client_methods.rb', line 5264

def get_user_chat_boosts(chat_id:, user_id:)
  broadcast('@type'   => 'getUserChatBoosts',
            'chat_id' => chat_id,
            'user_id' => user_id)
end

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

Returns full information about a user by their identifier.

Parameters:

  • user_id (Integer)

    User identifier.

Returns:



5274
5275
5276
5277
# File 'lib/tdlib/client_methods.rb', line 5274

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

Returns an HTTPS link, which can be used to get information about the current user.

Returns:



5282
5283
5284
# File 'lib/tdlib/client_methods.rb', line 5282

def get_user_link
  broadcast('@type' => 'getUserLink')
end

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

Returns the current privacy settings.

Parameters:

Returns:



5290
5291
5292
5293
# File 'lib/tdlib/client_methods.rb', line 5290

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

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

Returns the profile photos of a user. Personal and public photo aren’t returned.

Parameters:

  • user_id (Integer)

    User identifier.

  • offset (Integer)

    The number of photos to skip; must be non-negative.

  • limit (Integer)

    The maximum number of photos to be returned; up to 100.

Returns:



5302
5303
5304
5305
5306
5307
# File 'lib/tdlib/client_methods.rb', line 5302

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

#get_user_support_info(user_id:) ⇒ TD::Types::UserSupportInfo

Returns support information for the given user; for Telegram support only.

Parameters:

  • user_id (Integer)

    User identifier.

Returns:



5313
5314
5315
5316
# File 'lib/tdlib/client_methods.rb', line 5313

def get_user_support_info(user_id:)
  broadcast('@type'   => 'getUserSupportInfo',
            'user_id' => user_id)
end

#get_video_chat_available_participants(chat_id:) ⇒ TD::Types::MessageSenders

Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5322
5323
5324
5325
# File 'lib/tdlib/client_methods.rb', line 5322

def get_video_chat_available_participants(chat_id:)
  broadcast('@type'   => 'getVideoChatAvailableParticipants',
            'chat_id' => chat_id)
end

#get_video_chat_rtmp_url(chat_id:) ⇒ TD::Types::RtmpUrl

Returns RTMP URL for streaming to the chat; requires owner privileges.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5331
5332
5333
5334
# File 'lib/tdlib/client_methods.rb', line 5331

def get_video_chat_rtmp_url(chat_id:)
  broadcast('@type'   => 'getVideoChatRtmpUrl',
            'chat_id' => chat_id)
end

Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which the link was clicked; pass 0 if none.

  • bot_user_id (Integer)

    Identifier of the target bot.

  • web_app_short_name (TD::Types::String)

    Short name of the Web App.

  • start_parameter (TD::Types::String)

    Start parameter from internalLinkTypeWebApp.

  • theme (TD::Types::ThemeParameters)

    Preferred Web App theme; pass null to use the default theme.

  • application_name (TD::Types::String)

    Short name of the current application; 0-64 English letters, digits, and underscores.

  • allow_write_access (Boolean)

    Pass true if the current user allowed the bot to send them messages.

Returns:



5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
# File 'lib/tdlib/client_methods.rb', line 5347

def get_web_app_link_url(chat_id:, bot_user_id:, web_app_short_name:, start_parameter:, theme:, application_name:,
                         allow_write_access:)
  broadcast('@type'              => 'getWebAppLinkUrl',
            'chat_id'            => chat_id,
            'bot_user_id'        => bot_user_id,
            'web_app_short_name' => web_app_short_name,
            'start_parameter'    => start_parameter,
            'theme'              => theme,
            'application_name'   => application_name,
            'allow_write_access' => allow_write_access)
end

#get_web_app_url(bot_user_id:, url:, theme:, application_name:) ⇒ TD::Types::HttpUrl

Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an

inlineQueryResultsButtonTypeWebApp button.

Parameters:

Returns:



5369
5370
5371
5372
5373
5374
5375
# File 'lib/tdlib/client_methods.rb', line 5369

def get_web_app_url(bot_user_id:, url:, theme:, application_name:)
  broadcast('@type'            => 'getWebAppUrl',
            'bot_user_id'      => bot_user_id,
            'url'              => url,
            'theme'            => theme,
            'application_name' => application_name)
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.

Parameters:

  • url (TD::Types::String)

    The web page URL.

  • force_full (Boolean)

    Pass true to get full instant view for the web page.

Returns:



5383
5384
5385
5386
5387
# File 'lib/tdlib/client_methods.rb', line 5383

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

#hide_contact_close_birthdaysTD::Types::Ok

Hides the list of contacts that have close birthdays for 24 hours.

Returns:



5392
5393
5394
# File 'lib/tdlib/client_methods.rb', line 5392

def hide_contact_close_birthdays
  broadcast('@type' => 'hideContactCloseBirthdays')
end

#hide_suggested_action(action:) ⇒ TD::Types::Ok

Hides a suggested action.

Parameters:

Returns:



5400
5401
5402
5403
# File 'lib/tdlib/client_methods.rb', line 5400

def hide_suggested_action(action:)
  broadcast('@type'  => 'hideSuggestedAction',
            'action' => action)
end

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

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

Parameters:

  • contacts (Array<TD::Types::Contact>)

    The list of contacts to import or edit; contacts’ vCard are ignored and are not imported.

Returns:



5410
5411
5412
5413
# File 'lib/tdlib/client_methods.rb', line 5410

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

#import_messages(chat_id:, message_file:, attached_files:) ⇒ TD::Types::Ok

Imports messages exported from another app.

Parameters:

Returns:



5427
5428
5429
5430
5431
5432
# File 'lib/tdlib/client_methods.rb', line 5427

def import_messages(chat_id:, message_file:, attached_files:)
  broadcast('@type'          => 'importMessages',
            'chat_id'        => chat_id,
            'message_file'   => message_file,
            'attached_files' => attached_files)
end

#invite_group_call_participants(group_call_id:, user_ids:) ⇒ TD::Types::Ok

Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • user_ids (Array<Integer>)

    User identifiers. At most 10 users can be invited simultaneously.

Returns:



5441
5442
5443
5444
5445
# File 'lib/tdlib/client_methods.rb', line 5441

def invite_group_call_participants(group_call_id:, user_ids:)
  broadcast('@type'         => 'inviteGroupCallParticipants',
            'group_call_id' => group_call_id,
            'user_ids'      => user_ids)
end

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

Adds the current user as a new member to a chat. Private and secret chats can’t be joined using this method. May return an error with a message “INVITE_REQUEST_SENT” if only a join request was created.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5453
5454
5455
5456
# File 'lib/tdlib/client_methods.rb', line 5453

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. May return an error with a message “INVITE_REQUEST_SENT” if only a join request was created.

Parameters:

  • invite_link (TD::Types::String)

    Invite link to use.

Returns:



5463
5464
5465
5466
# File 'lib/tdlib/client_methods.rb', line 5463

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

#join_group_call(group_call_id:, participant_id:, audio_source_id:, payload:, is_muted:, is_my_video_enabled:, invite_hash:) ⇒ TD::Types::Text

Joins an active group call. Returns join response payload for tgcalls.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • participant_id (TD::Types::MessageSender)

    Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only.

  • audio_source_id (Integer)

    Caller audio channel synchronization source identifier; received from tgcalls.

  • payload (TD::Types::String)

    Group call join payload; received from tgcalls.

  • is_muted (Boolean)

    Pass true to join the call with muted microphone.

  • is_my_video_enabled (Boolean)

    Pass true if the user’s video is enabled.

  • invite_hash (TD::Types::String)

    If non-empty, invite hash to be used to join the group call without being muted by administrators.

Returns:



5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
# File 'lib/tdlib/client_methods.rb', line 5481

def join_group_call(group_call_id:, participant_id:, audio_source_id:, payload:, is_muted:, is_my_video_enabled:,
                    invite_hash:)
  broadcast('@type'               => 'joinGroupCall',
            'group_call_id'       => group_call_id,
            'participant_id'      => participant_id,
            'audio_source_id'     => audio_source_id,
            'payload'             => payload,
            'is_muted'            => is_muted,
            'is_my_video_enabled' => is_my_video_enabled,
            'invite_hash'         => invite_hash)
end

#launch_prepaid_premium_giveaway(giveaway_id:, parameters:) ⇒ TD::Types::Ok

Launches a prepaid Telegram Premium giveaway.

Parameters:

Returns:



5498
5499
5500
5501
5502
# File 'lib/tdlib/client_methods.rb', line 5498

def launch_prepaid_premium_giveaway(giveaway_id:, parameters:)
  broadcast('@type'       => 'launchPrepaidPremiumGiveaway',
            'giveaway_id' => giveaway_id,
            'parameters'  => parameters)
end

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

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

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5509
5510
5511
5512
# File 'lib/tdlib/client_methods.rb', line 5509

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

#leave_group_call(group_call_id:) ⇒ TD::Types::Ok

Leaves a group call.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



5518
5519
5520
5521
# File 'lib/tdlib/client_methods.rb', line 5518

def leave_group_call(group_call_id:)
  broadcast('@type'         => 'leaveGroupCall',
            'group_call_id' => group_call_id)
end

#load_active_stories(story_list:) ⇒ TD::Types::Ok

Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending

order.

Returns a 404 error if all active stories have been loaded.

Parameters:

Returns:



5531
5532
5533
5534
# File 'lib/tdlib/client_methods.rb', line 5531

def load_active_stories(story_list:)
  broadcast('@type'      => 'loadActiveStories',
            'story_list' => story_list)
end

#load_chats(chat_list:, limit:) ⇒ TD::Types::Ok

Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded.

Parameters:

  • chat_list (TD::Types::ChatList)

    The chat list in which to load chats; pass null to load chats from the main chat list.

  • limit (Integer)

    The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached.

Returns:



5547
5548
5549
5550
5551
# File 'lib/tdlib/client_methods.rb', line 5547

def load_chats(chat_list:, limit:)
  broadcast('@type'     => 'loadChats',
            'chat_list' => chat_list,
            'limit'     => limit)
end

#load_group_call_participants(group_call_id:, limit:) ⇒ TD::Types::Ok

Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded.

Parameters:

  • group_call_id (Integer)

    Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined.

  • limit (Integer)

    The maximum number of participants to load; up to 100.

Returns:



5561
5562
5563
5564
5565
# File 'lib/tdlib/client_methods.rb', line 5561

def load_group_call_participants(group_call_id:, limit:)
  broadcast('@type'         => 'loadGroupCallParticipants',
            'group_call_id' => group_call_id,
            'limit'         => limit)
end

#load_quick_reply_shortcut_messages(shortcut_id:) ⇒ TD::Types::Ok

Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages.

Parameters:

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut.

Returns:



5572
5573
5574
5575
# File 'lib/tdlib/client_methods.rb', line 5572

def load_quick_reply_shortcut_messages(shortcut_id:)
  broadcast('@type'       => 'loadQuickReplyShortcutMessages',
            'shortcut_id' => shortcut_id)
end

#load_quick_reply_shortcutsTD::Types::Ok

Loads quick reply shortcuts created by the current user. The loaded topics will be sent through updateQuickReplyShortcuts.

Returns:



5581
5582
5583
# File 'lib/tdlib/client_methods.rb', line 5581

def load_quick_reply_shortcuts
  broadcast('@type' => 'loadQuickReplyShortcuts')
end

#load_saved_messages_topics(limit:) ⇒ TD::Types::Ok

Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded.

Parameters:

  • limit (Integer)

    The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached.

Returns:



5594
5595
5596
5597
# File 'lib/tdlib/client_methods.rb', line 5594

def load_saved_messages_topics(limit:)
  broadcast('@type' => 'loadSavedMessagesTopics',
            'limit' => limit)
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.

Returns:



5605
5606
5607
# File 'lib/tdlib/client_methods.rb', line 5605

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).

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5615
5616
5617
5618
# File 'lib/tdlib/client_methods.rb', line 5615

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

#open_chat_similar_chat(chat_id:, opened_chat_id:) ⇒ TD::Types::Ok

Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat methods.

Parameters:

  • chat_id (Integer)

    Identifier of the original chat, which similar chats were requested.

  • opened_chat_id (Integer)

    Identifier of the opened chat.

Returns:



5626
5627
5628
5629
5630
# File 'lib/tdlib/client_methods.rb', line 5626

def open_chat_similar_chat(chat_id:, opened_chat_id:)
  broadcast('@type'          => 'openChatSimilarChat',
            'chat_id'        => chat_id,
            'opened_chat_id' => opened_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.

Parameters:

  • chat_id (Integer)

    Chat identifier of the message.

  • message_id (Integer)

    Identifier of the message with the opened content.

Returns:



5639
5640
5641
5642
5643
# File 'lib/tdlib/client_methods.rb', line 5639

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

#open_story(story_sender_chat_id:, story_id:) ⇒ TD::Types::Ok

Informs TDLib that a story is opened and is being viewed by the user.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the opened story.

  • story_id (Integer)

    The identifier of the story.

Returns:



5650
5651
5652
5653
5654
# File 'lib/tdlib/client_methods.rb', line 5650

def open_story(story_sender_chat_id:, story_id:)
  broadcast('@type'                => 'openStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id)
end

#open_web_app(chat_id:, bot_user_id:, url:, theme:, application_name:, message_thread_id:, reply_to:) ⇒ TD::Types::WebAppInfo

Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an

internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button.

For each bot, a confirmation alert about data sent to the bot must be shown once.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which the Web App is opened. The Web App can’t be opened in secret chats.

  • bot_user_id (Integer)

    Identifier of the bot, providing the Web App.

  • url (TD::Types::String)

    The URL from an Types::InlineKeyboardButtonType::WebApp button, a Types::BotMenuButton button, an Types::InternalLinkType::AttachmentMenuBot link, or an empty string otherwise.

  • theme (TD::Types::ThemeParameters)

    Preferred Web App theme; pass null to use the default theme.

  • application_name (TD::Types::String)

    Short name of the current application; 0-64 English letters, digits, and underscores.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the message will be sent.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message or story to be replied in the message sent by the Web App; pass null if none.

Returns:



5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
# File 'lib/tdlib/client_methods.rb', line 5673

def open_web_app(chat_id:, bot_user_id:, url:, theme:, application_name:, message_thread_id:, reply_to:)
  broadcast('@type'             => 'openWebApp',
            'chat_id'           => chat_id,
            'bot_user_id'       => bot_user_id,
            'url'               => url,
            'theme'             => theme,
            'application_name'  => application_name,
            'message_thread_id' => message_thread_id,
            'reply_to'          => reply_to)
end

#optimize_storage(size:, ttl:, count:, immunity_delay:, file_types:, chat_ids:, exclude_chat_ids:, return_deleted_file_statistics:, 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.

Parameters:

  • size (Integer)

    Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.

  • ttl (Integer)

    Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit.

  • count (Integer)

    Limit on the total number of files after deletion. Pass -1 to use the default limit.

  • immunity_delay (Integer)

    The amount of time after the creation of a file during which it can’t be deleted, in seconds. Pass -1 to use the default value.

  • file_types (Array<TD::Types::FileType>)

    If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.

  • chat_ids (Array<Integer>)

    If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos).

  • exclude_chat_ids (Array<Integer>)

    If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos).

  • return_deleted_file_statistics (Boolean)

    Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.

  • chat_limit (Integer)

    Same as in getStorageStatistics. Affects only returned statistics.

Returns:



5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
# File 'lib/tdlib/client_methods.rb', line 5710

def optimize_storage(size:, ttl:, count:, immunity_delay:, file_types:, chat_ids:, exclude_chat_ids:,
                     return_deleted_file_statistics:, 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,
            'return_deleted_file_statistics' => return_deleted_file_statistics,
            'chat_limit'                     => chat_limit)
end

#parse_markdown(text:) ⇒ TD::Types::FormattedText

Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously.

Parameters:

  • text (TD::Types::FormattedText)

    The text to parse. For example, “__italic__ ~~strikethrough~~ ||spoiler|| bold ‘code` “`pre“` [italic text_url](telegram.org) __italic**bold italic__bold**”.

Returns:



5731
5732
5733
5734
# File 'lib/tdlib/client_methods.rb', line 5731

def parse_markdown(text:)
  broadcast('@type' => 'parseMarkdown',
            'text'  => text)
end

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

Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre,

PreCode, TextUrl and MentionName entities from a marked-up text.

Can be called synchronously.

Parameters:

Returns:



5743
5744
5745
5746
5747
# File 'lib/tdlib/client_methods.rb', line 5743

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:, only_for_self:) ⇒ TD::Types::Ok

Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_id (Integer)

    Identifier of the new pinned message.

  • disable_notification (Boolean)

    Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats.

  • only_for_self (Boolean)

    Pass true to pin the message only for self; private chats only.

Returns:



5758
5759
5760
5761
5762
5763
5764
# File 'lib/tdlib/client_methods.rb', line 5758

def pin_chat_message(chat_id:, message_id:, disable_notification:, only_for_self:)
  broadcast('@type'                => 'pinChatMessage',
            'chat_id'              => chat_id,
            'message_id'           => message_id,
            'disable_notification' => disable_notification,
            'only_for_self'        => only_for_self)
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.

Parameters:

  • proxy_id (Integer)

    Proxy identifier. Use 0 to ping a Telegram server without a proxy.

Returns:



5772
5773
5774
5775
# File 'lib/tdlib/client_methods.rb', line 5772

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

#preliminary_upload_file(file:, file_type:, priority:) ⇒ TD::Types::File

Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being

recorded voice and video notes.

In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message.

Parameters:

  • file (TD::Types::InputFile)

    File to upload.

  • file_type (TD::Types::FileType)

    File type; pass null if unknown.

  • priority (Integer)

    Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first.

Returns:



5790
5791
5792
5793
5794
5795
# File 'lib/tdlib/client_methods.rb', line 5790

def preliminary_upload_file(file:, file_type:, priority:)
  broadcast('@type'     => 'preliminaryUploadFile',
            'file'      => file,
            'file_type' => file_type,
            'priority'  => priority)
end

#process_chat_folder_new_chats(chat_folder_id:, added_chat_ids:) ⇒ TD::Types::Ok

Process new chats added to a shareable chat folder by its owner.

Parameters:

  • chat_folder_id (Integer)

    Chat folder identifier.

  • added_chat_ids (Array<Integer>)

    Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren’t joined yet.

Returns:



5803
5804
5805
5806
5807
# File 'lib/tdlib/client_methods.rb', line 5803

def process_chat_folder_new_chats(chat_folder_id:, added_chat_ids:)
  broadcast('@type'          => 'processChatFolderNewChats',
            'chat_folder_id' => chat_folder_id,
            'added_chat_ids' => added_chat_ids)
end

#process_chat_join_request(chat_id:, user_id:, approve:) ⇒ TD::Types::Ok

Handles a pending join request in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • user_id (Integer)

    Identifier of the user that sent the request.

  • approve (Boolean)

    Pass true to approve the request; pass false to decline it.

Returns:



5815
5816
5817
5818
5819
5820
# File 'lib/tdlib/client_methods.rb', line 5815

def process_chat_join_request(chat_id:, user_id:, approve:)
  broadcast('@type'   => 'processChatJoinRequest',
            'chat_id' => chat_id,
            'user_id' => user_id,
            'approve' => approve)
end

#process_chat_join_requests(chat_id:, invite_link:, approve:) ⇒ TD::Types::Ok

Handles all pending join requests for a given link in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.

  • approve (Boolean)

    Pass true to approve all requests; pass false to decline them.

Returns:



5831
5832
5833
5834
5835
5836
# File 'lib/tdlib/client_methods.rb', line 5831

def process_chat_join_requests(chat_id:, invite_link:, approve:)
  broadcast('@type'       => 'processChatJoinRequests',
            'chat_id'     => chat_id,
            'invite_link' => invite_link,
            'approve'     => approve)
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.

Parameters:

  • payload (TD::Types::String)

    JSON-encoded push notification payload with all fields sent by the server, and “google.sent_time” and “google.notification.sound” fields added.

Returns:



5846
5847
5848
5849
# File 'lib/tdlib/client_methods.rb', line 5846

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

#rate_speech_recognition(chat_id:, message_id:, is_good:) ⇒ TD::Types::Ok

Rates recognized speech in a video note or a voice note message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • is_good (Boolean)

    Pass true if the speech recognition is good.

Returns:



5857
5858
5859
5860
5861
5862
# File 'lib/tdlib/client_methods.rb', line 5857

def rate_speech_recognition(chat_id:, message_id:, is_good:)
  broadcast('@type'      => 'rateSpeechRecognition',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'is_good'    => is_good)
end

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

Marks all mentions in a chat as read.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5868
5869
5870
5871
# File 'lib/tdlib/client_methods.rb', line 5868

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

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

Marks all reactions in a chat or a forum topic as read.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



5877
5878
5879
5880
# File 'lib/tdlib/client_methods.rb', line 5877

def read_all_chat_reactions(chat_id:)
  broadcast('@type'   => 'readAllChatReactions',
            'chat_id' => chat_id)
end

#read_all_message_thread_mentions(chat_id:, message_thread_id:) ⇒ TD::Types::Ok

Marks all mentions in a forum topic as read.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    Message thread identifier in which mentions are marked as read.

Returns:



5887
5888
5889
5890
5891
# File 'lib/tdlib/client_methods.rb', line 5887

def read_all_message_thread_mentions(chat_id:, message_thread_id:)
  broadcast('@type'             => 'readAllMessageThreadMentions',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id)
end

#read_all_message_thread_reactions(chat_id:, message_thread_id:) ⇒ TD::Types::Ok

Marks all reactions in a forum topic as read.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    Message thread identifier in which reactions are marked as read.

Returns:



5898
5899
5900
5901
5902
# File 'lib/tdlib/client_methods.rb', line 5898

def read_all_message_thread_reactions(chat_id:, message_thread_id:)
  broadcast('@type'             => 'readAllMessageThreadReactions',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id)
end

#read_chat_list(chat_list:) ⇒ TD::Types::Ok

Traverse all chats in a chat list and marks all messages in the chats as read.

Parameters:

Returns:



5908
5909
5910
5911
# File 'lib/tdlib/client_methods.rb', line 5908

def read_chat_list(chat_list:)
  broadcast('@type'     => 'readChatList',
            'chat_list' => chat_list)
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 application has no direct access to TDLib’s file system, because it

is usually slower than a direct read from the file.

Parameters:

  • file_id (Integer)

    Identifier of the file. The file must be located in the TDLib file cache.

  • offset (Integer)

    The offset from which to read the file.

  • count (Integer)

    Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position.

Returns:



5924
5925
5926
5927
5928
5929
# File 'lib/tdlib/client_methods.rb', line 5924

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

#readd_quick_reply_shortcut_messages(shortcut_name:, message_ids:) ⇒ TD::Types::QuickReplyMessages

Readds quick reply messages which failed to add. 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 readded, 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 readded, null will be returned instead of the message.

Parameters:

  • shortcut_name (TD::Types::String)

    Name of the target shortcut.

  • message_ids (Array<Integer>)

    Identifiers of the quick reply messages to readd. Message identifiers must be in a strictly increasing order.

Returns:



5942
5943
5944
5945
5946
# File 'lib/tdlib/client_methods.rb', line 5942

def readd_quick_reply_shortcut_messages(shortcut_name:, message_ids:)
  broadcast('@type'         => 'readdQuickReplyShortcutMessages',
            'shortcut_name' => shortcut_name,
            'message_ids'   => message_ids)
end

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

Recognizes speech in a video note or a voice note message.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable.

Returns:



5954
5955
5956
5957
5958
# File 'lib/tdlib/client_methods.rb', line 5954

def recognize_speech(chat_id:, message_id:)
  broadcast('@type'      => 'recognizeSpeech',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

#recover_authentication_password(recovery_code:, new_password: nil, new_hint: nil) ⇒ TD::Types::Ok

Recovers the 2-step verification 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.

Parameters:

  • recovery_code (TD::Types::String)

    Recovery code to check.

  • new_password (TD::Types::String, nil) (defaults to: nil)

    New 2-step verification password of the user; may be empty to remove the password.

  • new_hint (TD::Types::String, nil) (defaults to: nil)

    New password hint; may be empty.

Returns:



5969
5970
5971
5972
5973
5974
# File 'lib/tdlib/client_methods.rb', line 5969

def recover_authentication_password(recovery_code:, new_password: nil, new_hint: nil)
  broadcast('@type'         => 'recoverAuthenticationPassword',
            'recovery_code' => recovery_code,
            'new_password'  => new_password,
            'new_hint'      => new_hint)
end

#recover_password(recovery_code:, new_password: nil, new_hint: nil) ⇒ TD::Types::PasswordState

Recovers the 2-step verification password using a recovery code sent to an email address that was previously set

up.

Parameters:

  • recovery_code (TD::Types::String)

    Recovery code to check.

  • new_password (TD::Types::String, nil) (defaults to: nil)

    New 2-step verification password of the user; may be empty to remove the password.

  • new_hint (TD::Types::String, nil) (defaults to: nil)

    New password hint; may be empty.

Returns:



5984
5985
5986
5987
5988
5989
# File 'lib/tdlib/client_methods.rb', line 5984

def recover_password(recovery_code:, new_password: nil, new_hint: nil)
  broadcast('@type'         => 'recoverPassword',
            'recovery_code' => recovery_code,
            'new_password'  => new_password,
            'new_hint'      => new_hint)
end

#refund_star_payment(user_id:, telegram_payment_charge_id:) ⇒ TD::Types::Ok

Refunds a previously done payment in Telegram Stars.

Parameters:

  • user_id (Integer)

    Identifier of the user that did the payment.

  • telegram_payment_charge_id (TD::Types::String)

    Telegram payment identifier.

Returns:



5996
5997
5998
5999
6000
# File 'lib/tdlib/client_methods.rb', line 5996

def refund_star_payment(user_id:, telegram_payment_charge_id:)
  broadcast('@type'                      => 'refundStarPayment',
            'user_id'                    => user_id,
            'telegram_payment_charge_id' => telegram_payment_charge_id)
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.

Parameters:

  • device_token (TD::Types::DeviceToken)

    Device token.

  • other_user_ids (Array<Integer>)

    List of user identifiers of other users currently using the application.

Returns:



6008
6009
6010
6011
6012
# File 'lib/tdlib/client_methods.rb', line 6008

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:, disable_notification:) ⇒ TD::Types::Ok

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

Parameters:

  • first_name (TD::Types::String)

    The first name of the user; 1-64 characters.

  • last_name (TD::Types::String)

    The last name of the user; 0-64 characters.

  • disable_notification (Boolean)

    Pass true to disable notification about the current user joining Telegram for other users that added them to contact list.

Returns:



6022
6023
6024
6025
6026
6027
# File 'lib/tdlib/client_methods.rb', line 6022

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

#remove_all_files_from_downloads(only_active:, only_completed:, delete_from_cache:) ⇒ TD::Types::Ok

Removes all files from the file download list.

Parameters:

  • only_active (Boolean)

    Pass true to remove only active downloads, including paused.

  • only_completed (Boolean)

    Pass true to remove only completed downloads.

  • delete_from_cache (Boolean)

    Pass true to delete the file from the TDLib file cache.

Returns:



6035
6036
6037
6038
6039
6040
# File 'lib/tdlib/client_methods.rb', line 6035

def remove_all_files_from_downloads(only_active:, only_completed:, delete_from_cache:)
  broadcast('@type'             => 'removeAllFilesFromDownloads',
            'only_active'       => only_active,
            'only_completed'    => only_completed,
            'delete_from_cache' => delete_from_cache)
end

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

Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



6046
6047
6048
6049
# File 'lib/tdlib/client_methods.rb', line 6046

def remove_business_connected_bot_from_chat(chat_id:)
  broadcast('@type'   => 'removeBusinessConnectedBotFromChat',
            'chat_id' => chat_id)
end

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

Removes a chat action bar without any other action.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



6055
6056
6057
6058
# File 'lib/tdlib/client_methods.rb', line 6055

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.

Parameters:

  • user_ids (Array<Integer>)

    Identifiers of users to be deleted.

Returns:



6064
6065
6066
6067
# File 'lib/tdlib/client_methods.rb', line 6064

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.

Parameters:

Returns:



6073
6074
6075
6076
# File 'lib/tdlib/client_methods.rb', line 6073

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

#remove_file_from_downloads(file_id:, delete_from_cache:) ⇒ TD::Types::Ok

Removes a file from the file download list.

Parameters:

  • file_id (Integer)

    Identifier of the downloaded file.

  • delete_from_cache (Boolean)

    Pass true to delete the file from the TDLib file cache.

Returns:



6083
6084
6085
6086
6087
# File 'lib/tdlib/client_methods.rb', line 6083

def remove_file_from_downloads(file_id:, delete_from_cache:)
  broadcast('@type'             => 'removeFileFromDownloads',
            'file_id'           => file_id,
            'delete_from_cache' => delete_from_cache)
end

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

Removes background from the list of installed backgrounds.

Parameters:

  • background_id (Integer)

    The background identifier.

Returns:



6093
6094
6095
6096
# File 'lib/tdlib/client_methods.rb', line 6093

def remove_installed_background(background_id:)
  broadcast('@type'         => 'removeInstalledBackground',
            'background_id' => background_id)
end

#remove_message_reaction(chat_id:, message_id:, reaction_type:) ⇒ TD::Types::Ok

Removes a reaction from a message. A chosen reaction can always be removed.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • reaction_type (TD::Types::ReactionType)

    Type of the reaction to remove. The paid reaction can’t be removed.

Returns:



6106
6107
6108
6109
6110
6111
# File 'lib/tdlib/client_methods.rb', line 6106

def remove_message_reaction(chat_id:, message_id:, reaction_type:)
  broadcast('@type'         => 'removeMessageReaction',
            'chat_id'       => chat_id,
            'message_id'    => message_id,
            'reaction_type' => reaction_type)
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.

Parameters:

  • notification_group_id (Integer)

    Identifier of notification group to which the notification belongs.

  • notification_id (Integer)

    Identifier of removed notification.

Returns:



6119
6120
6121
6122
6123
# File 'lib/tdlib/client_methods.rb', line 6119

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.

Parameters:

  • notification_group_id (Integer)

    Notification group identifier.

  • max_notification_id (Integer)

    The maximum identifier of removed notifications.

Returns:



6131
6132
6133
6134
6135
# File 'lib/tdlib/client_methods.rb', line 6131

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_pending_paid_message_reactions(chat_id:, message_id:) ⇒ TD::Types::Ok

Removes all pending paid reactions on a message. Can be called within 5 seconds after the last addPaidMessageReaction call.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

Returns:



6143
6144
6145
6146
6147
# File 'lib/tdlib/client_methods.rb', line 6143

def remove_pending_paid_message_reactions(chat_id:, message_id:)
  broadcast('@type'      => 'removePendingPaidMessageReactions',
            'chat_id'    => chat_id,
            'message_id' => message_id)
end

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

Removes a proxy server. Can be called before authorization.

Parameters:

  • proxy_id (Integer)

    Proxy identifier.

Returns:



6154
6155
6156
6157
# File 'lib/tdlib/client_methods.rb', line 6154

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.

Parameters:

  • hashtag (TD::Types::String)

    Hashtag to delete.

Returns:



6163
6164
6165
6166
# File 'lib/tdlib/client_methods.rb', line 6163

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.

Parameters:

  • is_attached (Boolean)

    Pass true to remove the sticker from the list of stickers recently attached to photo or video files; pass false to remove the sticker from the list of recently sent stickers.

  • sticker (TD::Types::InputFile)

    Sticker file to delete.

Returns:



6174
6175
6176
6177
6178
# File 'lib/tdlib/client_methods.rb', line 6174

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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to be removed.

Returns:



6184
6185
6186
6187
# File 'lib/tdlib/client_methods.rb', line 6184

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.

Parameters:

Returns:



6193
6194
6195
6196
# File 'lib/tdlib/client_methods.rb', line 6193

def remove_saved_animation(animation:)
  broadcast('@type'     => 'removeSavedAnimation',
            'animation' => animation)
end

#remove_saved_notification_sound(notification_sound_id:) ⇒ TD::Types::Ok

Removes a notification sound from the list of saved notification sounds.

Parameters:

  • notification_sound_id (Integer)

    Identifier of the notification sound.

Returns:



6202
6203
6204
6205
# File 'lib/tdlib/client_methods.rb', line 6202

def remove_saved_notification_sound(notification_sound_id:)
  broadcast('@type'                 => 'removeSavedNotificationSound',
            'notification_sound_id' => notification_sound_id)
end

#remove_searched_for_tag(tag:) ⇒ TD::Types::Ok

Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags.

Parameters:

  • tag (TD::Types::String)

    Hashtag or cashtag to delete.

Returns:



6211
6212
6213
6214
# File 'lib/tdlib/client_methods.rb', line 6211

def remove_searched_for_tag(tag:)
  broadcast('@type' => 'removeSearchedForTag',
            'tag'   => tag)
end

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

Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user.

Parameters:

Returns:



6221
6222
6223
6224
# File 'lib/tdlib/client_methods.rb', line 6221

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.

Parameters:

Returns:



6232
6233
6234
6235
6236
# File 'lib/tdlib/client_methods.rb', line 6232

def remove_top_chat(category:, chat_id:)
  broadcast('@type'    => 'removeTopChat',
            'category' => category,
            'chat_id'  => chat_id)
end

#reorder_active_usernames(usernames:) ⇒ TD::Types::Ok

Changes order of active usernames of the current user.

Parameters:

  • usernames (Array<TD::Types::String>)

    The new order of active usernames. All currently active usernames must be specified.

Returns:



6243
6244
6245
6246
# File 'lib/tdlib/client_methods.rb', line 6243

def reorder_active_usernames(usernames:)
  broadcast('@type'     => 'reorderActiveUsernames',
            'usernames' => usernames)
end

#reorder_bot_active_usernames(bot_user_id:, usernames:) ⇒ TD::Types::Ok

Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • usernames (Array<TD::Types::String>)

    The new order of active usernames. All currently active usernames must be specified.

Returns:



6255
6256
6257
6258
6259
# File 'lib/tdlib/client_methods.rb', line 6255

def reorder_bot_active_usernames(bot_user_id:, usernames:)
  broadcast('@type'       => 'reorderBotActiveUsernames',
            'bot_user_id' => bot_user_id,
            'usernames'   => usernames)
end

#reorder_bot_media_previews(bot_user_id:, language_code:, file_ids:) ⇒ TD::Types::Ok

Changes order of media previews in the list of media previews of a bot.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot. The bot must be owned and must have the main Web App.

  • language_code (TD::Types::String)

    Language code of the media previews to reorder.

  • file_ids (Array<Integer>)

    File identifiers of the media in the new order.

Returns:



6268
6269
6270
6271
6272
6273
# File 'lib/tdlib/client_methods.rb', line 6268

def reorder_bot_media_previews(bot_user_id:, language_code:, file_ids:)
  broadcast('@type'         => 'reorderBotMediaPreviews',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'file_ids'      => file_ids)
end

#reorder_chat_folders(chat_folder_ids:, main_chat_list_position:) ⇒ TD::Types::Ok

Changes the order of chat folders.

Parameters:

  • chat_folder_ids (Array<Integer>)

    Identifiers of chat folders in the new correct order.

  • main_chat_list_position (Integer)

    Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users.

Returns:



6281
6282
6283
6284
6285
# File 'lib/tdlib/client_methods.rb', line 6281

def reorder_chat_folders(chat_folder_ids:, main_chat_list_position:)
  broadcast('@type'                   => 'reorderChatFolders',
            'chat_folder_ids'         => chat_folder_ids,
            'main_chat_list_position' => main_chat_list_position)
end

#reorder_installed_sticker_sets(sticker_type:, sticker_set_ids:) ⇒ TD::Types::Ok

Changes the order of installed sticker sets.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the sticker sets to reorder.

  • sticker_set_ids (Array<Integer>)

    Identifiers of installed sticker sets in the new correct order.

Returns:



6292
6293
6294
6295
6296
# File 'lib/tdlib/client_methods.rb', line 6292

def reorder_installed_sticker_sets(sticker_type:, sticker_set_ids:)
  broadcast('@type'           => 'reorderInstalledStickerSets',
            'sticker_type'    => sticker_type,
            'sticker_set_ids' => sticker_set_ids)
end

#reorder_quick_reply_shortcuts(shortcut_ids:) ⇒ TD::Types::Ok

Changes the order of quick reply shortcuts.

Parameters:

  • shortcut_ids (Array<Integer>)

    The new order of quick reply shortcuts.

Returns:



6302
6303
6304
6305
# File 'lib/tdlib/client_methods.rb', line 6302

def reorder_quick_reply_shortcuts(shortcut_ids:)
  broadcast('@type'        => 'reorderQuickReplyShortcuts',
            'shortcut_ids' => shortcut_ids)
end

#reorder_supergroup_active_usernames(supergroup_id:, usernames:) ⇒ TD::Types::Ok

Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or

channel.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup or channel.

  • usernames (Array<TD::Types::String>)

    The new order of active usernames. All currently active usernames must be specified.

Returns:



6314
6315
6316
6317
6318
# File 'lib/tdlib/client_methods.rb', line 6314

def reorder_supergroup_active_usernames(supergroup_id:, usernames:)
  broadcast('@type'         => 'reorderSupergroupActiveUsernames',
            'supergroup_id' => supergroup_id,
            'usernames'     => usernames)
end

Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



6326
6327
6328
6329
# File 'lib/tdlib/client_methods.rb', line 6326

def replace_primary_chat_invite_link(chat_id:)
  broadcast('@type'   => 'replacePrimaryChatInviteLink',
            'chat_id' => chat_id)
end

#replace_sticker_in_set(user_id:, name:, old_sticker:, new_sticker:) ⇒ TD::Types::Ok

Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet.

Parameters:

  • user_id (Integer)

    Sticker set owner; ignored for regular users.

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user.

  • old_sticker (TD::Types::InputFile)

    Sticker to remove from the set.

  • new_sticker (TD::Types::InputSticker)

    Sticker to add to the set.

Returns:



6340
6341
6342
6343
6344
6345
6346
# File 'lib/tdlib/client_methods.rb', line 6340

def replace_sticker_in_set(user_id:, name:, old_sticker:, new_sticker:)
  broadcast('@type'       => 'replaceStickerInSet',
            'user_id'     => user_id,
            'name'        => name,
            'old_sticker' => old_sticker,
            'new_sticker' => new_sticker)
end

#replace_video_chat_rtmp_url(chat_id:) ⇒ TD::Types::RtmpUrl

Replaces the current RTMP URL for streaming to the chat; requires owner privileges.

Parameters:

  • chat_id (Integer)

    Chat identifier.

Returns:



6352
6353
6354
6355
# File 'lib/tdlib/client_methods.rb', line 6352

def replace_video_chat_rtmp_url(chat_id:)
  broadcast('@type'   => 'replaceVideoChatRtmpUrl',
            'chat_id' => chat_id)
end

#report_authentication_code_missing(mobile_network_code:) ⇒ TD::Types::Ok

Reports that authentication code wasn’t delivered via SMS; for official mobile applications only. Works only when the current authorization state is authorizationStateWaitCode.

Parameters:

  • mobile_network_code (TD::Types::String)

    Current mobile network code.

Returns:



6362
6363
6364
6365
# File 'lib/tdlib/client_methods.rb', line 6362

def report_authentication_code_missing(mobile_network_code:)
  broadcast('@type'               => 'reportAuthenticationCodeMissing',
            'mobile_network_code' => mobile_network_code)
end

#report_chat(chat_id:, message_ids: nil, reason:, text:) ⇒ TD::Types::Ok

Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_ids (Array<Integer>, nil) (defaults to: nil)

    Identifiers of reported messages; may be empty to report the whole chat. Use messageProperties.can_be_reported to check whether the message can be reported.

  • reason (TD::Types::ReportReason)

    The reason for reporting the chat.

  • text (TD::Types::String)

    Additional report details; 0-1024 characters.

Returns:



6376
6377
6378
6379
6380
6381
6382
# File 'lib/tdlib/client_methods.rb', line 6376

def report_chat(chat_id:, message_ids: nil, reason:, text:)
  broadcast('@type'       => 'reportChat',
            'chat_id'     => chat_id,
            'message_ids' => message_ids,
            'reason'      => reason,
            'text'        => text)
end

#report_chat_photo(chat_id:, file_id:, reason:, text:) ⇒ TD::Types::Ok

Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • file_id (Integer)

    Identifier of the photo to report. Only full photos from Types::ChatPhoto can be reported.

  • reason (TD::Types::ReportReason)

    The reason for reporting the chat photo.

  • text (TD::Types::String)

    Additional report details; 0-1024 characters.

Returns:



6393
6394
6395
6396
6397
6398
6399
# File 'lib/tdlib/client_methods.rb', line 6393

def report_chat_photo(chat_id:, file_id:, reason:, text:)
  broadcast('@type'   => 'reportChatPhoto',
            'chat_id' => chat_id,
            'file_id' => file_id,
            'reason'  => reason,
            'text'    => text)
end

#report_chat_sponsored_message(chat_id:, message_id:, option_id: nil) ⇒ TD::Types::ReportChatSponsoredMessageResult

Reports a sponsored message to Telegram moderators.

Parameters:

  • chat_id (Integer)

    Chat identifier of the sponsored message.

  • message_id (Integer)

    Identifier of the sponsored message.

  • option_id (String, nil) (defaults to: nil)

    Option identifier chosen by the user; leave empty for the initial request.

Returns:



6407
6408
6409
6410
6411
6412
# File 'lib/tdlib/client_methods.rb', line 6407

def report_chat_sponsored_message(chat_id:, message_id:, option_id: nil)
  broadcast('@type'      => 'reportChatSponsoredMessage',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'option_id'  => option_id)
end

#report_message_reactions(chat_id:, message_id:, sender_id:) ⇒ TD::Types::Ok

Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if messageProperties.can_report_reactions.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_id (Integer)

    Message identifier.

  • sender_id (TD::Types::MessageSender)

    Identifier of the sender, which added the reaction.

Returns:



6421
6422
6423
6424
6425
6426
# File 'lib/tdlib/client_methods.rb', line 6421

def report_message_reactions(chat_id:, message_id:, sender_id:)
  broadcast('@type'      => 'reportMessageReactions',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'sender_id'  => sender_id)
end

#report_phone_number_code_missing(mobile_network_code:) ⇒ TD::Types::Ok

Reports that authentication code wasn’t delivered via SMS to the specified phone number; for official mobile

applications only.

Parameters:

  • mobile_network_code (TD::Types::String)

    Current mobile network code.

Returns:



6433
6434
6435
6436
# File 'lib/tdlib/client_methods.rb', line 6433

def report_phone_number_code_missing(mobile_network_code:)
  broadcast('@type'               => 'reportPhoneNumberCodeMissing',
            'mobile_network_code' => mobile_network_code)
end

#report_story(story_sender_chat_id:, story_id:, reason:, text:) ⇒ TD::Types::Ok

Reports a story to the Telegram moderators.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the story to report.

  • story_id (Integer)

    The identifier of the story to report.

  • reason (TD::Types::ReportReason)

    The reason for reporting the story.

  • text (TD::Types::String)

    Additional report details; 0-1024 characters.

Returns:



6445
6446
6447
6448
6449
6450
6451
# File 'lib/tdlib/client_methods.rb', line 6445

def report_story(story_sender_chat_id:, story_id:, reason:, text:)
  broadcast('@type'                => 'reportStory',
            'story_sender_chat_id' => story_sender_chat_id,
            'story_id'             => story_id,
            'reason'               => reason,
            'text'                 => text)
end

#report_supergroup_anti_spam_false_positive(supergroup_id:, message_id:) ⇒ TD::Types::Ok

Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the

supergroup.

Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true.

Parameters:

  • supergroup_id (Integer)

    Supergroup identifier.

  • message_id (Integer)

    Identifier of the erroneously deleted message from chatEventMessageDeleted.

Returns:



6460
6461
6462
6463
6464
# File 'lib/tdlib/client_methods.rb', line 6460

def report_supergroup_anti_spam_false_positive(supergroup_id:, message_id:)
  broadcast('@type'         => 'reportSupergroupAntiSpamFalsePositive',
            'supergroup_id' => supergroup_id,
            'message_id'    => message_id)
end

#report_supergroup_spam(supergroup_id:, message_ids:) ⇒ TD::Types::Ok

Reports messages in a supergroup as spam; requires administrator rights in the supergroup.

Parameters:

  • supergroup_id (Integer)

    Supergroup identifier.

  • message_ids (Array<Integer>)

    Identifiers of messages to report. Use messageProperties.can_be_reported to check whether the message can be reported.

Returns:



6472
6473
6474
6475
6476
# File 'lib/tdlib/client_methods.rb', line 6472

def report_supergroup_spam(supergroup_id:, message_ids:)
  broadcast('@type'         => 'reportSupergroupSpam',
            'supergroup_id' => supergroup_id,
            'message_ids'   => message_ids)
end

#request_authentication_password_recoveryTD::Types::Ok

Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword.

Returns:



6482
6483
6484
# File 'lib/tdlib/client_methods.rb', line 6482

def request_authentication_password_recovery
  broadcast('@type' => 'requestAuthenticationPasswordRecovery')
end

#request_password_recoveryTD::Types::EmailAddressAuthenticationCodeInfo

Requests to send a 2-step verification password recovery code to an email address that was previously set up.



6489
6490
6491
# File 'lib/tdlib/client_methods.rb', line 6489

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, or if there is no pending

authentication query and the current authorization state is authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or
authorizationStateWaitPassword.

Parameters:

  • other_user_ids (Array<Integer>)

    List of user identifiers of other users currently using the application.

Returns:



6501
6502
6503
6504
# File 'lib/tdlib/client_methods.rb', line 6501

def request_qr_code_authentication(other_user_ids:)
  broadcast('@type'          => 'requestQrCodeAuthentication',
            'other_user_ids' => other_user_ids)
end

#resend_authentication_code(reason:) ⇒ TD::Types::Ok

Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is

not null and the server-specified timeout has passed, or when the current authorization state is
authorizationStateWaitEmailCode.

Parameters:

Returns:



6513
6514
6515
6516
# File 'lib/tdlib/client_methods.rb', line 6513

def resend_authentication_code(reason:)
  broadcast('@type'  => 'resendAuthenticationCode',
            'reason' => reason)
end

#resend_email_address_verification_codeTD::Types::EmailAddressAuthenticationCodeInfo

Resends the code to verify an email address to be added to a user’s Telegram Passport.



6521
6522
6523
# File 'lib/tdlib/client_methods.rb', line 6521

def resend_email_address_verification_code
  broadcast('@type' => 'resendEmailAddressVerificationCode')
end

#resend_login_email_address_codeTD::Types::EmailAddressAuthenticationCodeInfo

Resends the login email address verification code.



6528
6529
6530
# File 'lib/tdlib/client_methods.rb', line 6528

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

#resend_messages(chat_id:, message_ids:, quote:) ⇒ 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.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to send messages.

  • message_ids (Array<Integer>)

    Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order.

  • quote (TD::Types::InputTextQuote)

    New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false.

Returns:



6546
6547
6548
6549
6550
6551
# File 'lib/tdlib/client_methods.rb', line 6546

def resend_messages(chat_id:, message_ids:, quote:)
  broadcast('@type'       => 'resendMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids,
            'quote'       => quote)
end

#resend_phone_number_code(reason:) ⇒ TD::Types::AuthenticationCodeInfo

Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified

timeout has passed.

Parameters:

Returns:



6559
6560
6561
6562
# File 'lib/tdlib/client_methods.rb', line 6559

def resend_phone_number_code(reason:)
  broadcast('@type'  => 'resendPhoneNumberCode',
            'reason' => reason)
end

#resend_recovery_email_address_codeTD::Types::PasswordState

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



6567
6568
6569
# File 'lib/tdlib/client_methods.rb', line 6567

def resend_recovery_email_address_code
  broadcast('@type' => 'resendRecoveryEmailAddressCode')
end

#reset_all_notification_settingsTD::Types::Ok

Resets all chat and scope notification settings to their default values. By default, all chats are unmuted and message previews are shown.

Returns:



6575
6576
6577
# File 'lib/tdlib/client_methods.rb', line 6575

def reset_all_notification_settings
  broadcast('@type' => 'resetAllNotificationSettings')
end

#reset_authentication_email_addressTD::Types::Ok

Resets the login email address. May return an error with a message “TASK_ALREADY_EXISTS” if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and

authorization_state.can_reset_email_address == true.

Returns:



6585
6586
6587
# File 'lib/tdlib/client_methods.rb', line 6585

def reset_authentication_email_address
  broadcast('@type' => 'resetAuthenticationEmailAddress')
end

#reset_installed_backgroundsTD::Types::Ok

Resets list of installed backgrounds to its default value.

Returns:



6592
6593
6594
# File 'lib/tdlib/client_methods.rb', line 6592

def reset_installed_backgrounds
  broadcast('@type' => 'resetInstalledBackgrounds')
end

#reset_network_statisticsTD::Types::Ok

Resets all network data usage statistics to zero. Can be called before authorization.

Returns:



6600
6601
6602
# File 'lib/tdlib/client_methods.rb', line 6600

def reset_network_statistics
  broadcast('@type' => 'resetNetworkStatistics')
end

#reset_passwordTD::Types::ResetPasswordResult

Removes 2-step verification password without previous password and access to recovery email address. The password can’t be reset immediately and the request needs to be repeated after the specified time.



6608
6609
6610
# File 'lib/tdlib/client_methods.rb', line 6608

def reset_password
  broadcast('@type' => 'resetPassword')
end

#reuse_star_subscription(subscription_id:) ⇒ TD::Types::Ok

Reuses an active subscription and joins the subscribed chat again.

Parameters:

  • subscription_id (TD::Types::String)

    Identifier of the subscription.

Returns:



6616
6617
6618
6619
# File 'lib/tdlib/client_methods.rb', line 6616

def reuse_star_subscription(subscription_id:)
  broadcast('@type'           => 'reuseStarSubscription',
            'subscription_id' => subscription_id)
end

Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for

other links.

If a primary link is revoked, then additionally to the revoked link returns new primary link.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • invite_link (TD::Types::String)

    Invite link to be revoked.

Returns:



6630
6631
6632
6633
6634
# File 'lib/tdlib/client_methods.rb', line 6630

def revoke_chat_invite_link(chat_id:, invite_link:)
  broadcast('@type'       => 'revokeChatInviteLink',
            'chat_id'     => chat_id,
            'invite_link' => invite_link)
end

Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



6641
6642
6643
6644
# File 'lib/tdlib/client_methods.rb', line 6641

def revoke_group_call_invite_link(group_call_id:)
  broadcast('@type'         => 'revokeGroupCallInviteLink',
            'group_call_id' => group_call_id)
end

#save_application_log_event(type:, chat_id:, data:) ⇒ TD::Types::Ok

Saves application log event on the server. Can be called before authorization.

Parameters:

  • type (TD::Types::String)

    Event type.

  • chat_id (Integer)

    Optional chat identifier, associated with the event.

  • data (TD::Types::JsonValue)

    The log event data.

Returns:



6653
6654
6655
6656
6657
6658
# File 'lib/tdlib/client_methods.rb', line 6653

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.

Parameters:

  • name (TD::Types::String)

    The name of the background.

Returns:



6664
6665
6666
6667
# File 'lib/tdlib/client_methods.rb', line 6664

def search_background(name:)
  broadcast('@type' => 'searchBackground',
            'name'  => name)
end

#search_call_messages(offset:, limit:, only_missed:) ⇒ TD::Types::FoundMessages

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 TDLib.

Parameters:

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

  • only_missed (Boolean)

    Pass true to search only for messages with missed/declined calls.

Returns:



6680
6681
6682
6683
6684
6685
# File 'lib/tdlib/client_methods.rb', line 6680

def search_call_messages(offset:, limit:, only_missed:)
  broadcast('@type'       => 'searchCallMessages',
            'offset'      => offset,
            '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 usernames of the members of a specified chat. Requires administrator rights if the chat is a channel.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • query (TD::Types::String)

    Query to search for.

  • limit (Integer)

    The maximum number of users to be returned; up to 200.

  • filter (TD::Types::ChatMembersFilter)

    The type of users to search for; pass null to search among all chat members.

Returns:



6696
6697
6698
6699
6700
6701
6702
# File 'lib/tdlib/client_methods.rb', line 6696

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_id:, from_message_id:, offset:, limit:, filter:, message_thread_id:, saved_messages_topic_id:) ⇒ TD::Types::FoundChatMessages

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 must be used instead), or without an

enabled message database.

For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified

limit.

A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only

if it is required for Telegram official application implementation.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to search messages.

  • query (TD::Types::String)

    Query to search for.

  • sender_id (TD::Types::MessageSender)

    Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats.

  • from_message_id (Integer)

    Identifier of the message starting from which history must be fetched; use 0 to get results from the last message.

  • offset (Integer)

    Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages.

  • limit (Integer)

    The maximum number of messages to be returned; must be positive and can’t be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

  • filter (TD::Types::SearchMessagesFilter)

    Additional filter for messages to search; pass null to search for all messages.

  • message_thread_id (Integer)

    If not 0, only messages in the specified thread will be returned; supergroups only.

  • saved_messages_topic_id (Integer)

    If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages.

Returns:



6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
# File 'lib/tdlib/client_methods.rb', line 6735

def search_chat_messages(chat_id:, query:, sender_id:, from_message_id:, offset:, limit:, filter:, message_thread_id:,
                         saved_messages_topic_id:)
  broadcast('@type'                   => 'searchChatMessages',
            'chat_id'                 => chat_id,
            'query'                   => query,
            'sender_id'               => sender_id,
            'from_message_id'         => from_message_id,
            'offset'                  => offset,
            'limit'                   => limit,
            'filter'                  => filter,
            'message_thread_id'       => message_thread_id,
            'saved_messages_topic_id' => saved_messages_topic_id)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • limit (Integer)

    The maximum number of messages to be returned.

Returns:



6755
6756
6757
6758
6759
# File 'lib/tdlib/client_methods.rb', line 6755

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 main chat list.

Parameters:

  • query (TD::Types::String)

    Query to search for. If the query is empty, returns up to 50 recently found chats.

  • limit (Integer)

    The maximum number of chats to be returned.

Returns:



6768
6769
6770
6771
6772
# File 'lib/tdlib/client_methods.rb', line 6768

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 must be sent again every 25 seconds with adjusted location to not miss new chats.

Parameters:

Returns:



6780
6781
6782
6783
# File 'lib/tdlib/client_methods.rb', line 6780

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 main chat list.

Parameters:

  • query (TD::Types::String)

    Query to search for.

  • limit (Integer)

    The maximum number of chats to be returned.

Returns:



6791
6792
6793
6794
6795
# File 'lib/tdlib/client_methods.rb', line 6791

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.

Parameters:

  • query (TD::Types::String, nil) (defaults to: nil)

    Query to search for; may be empty to return all contacts.

  • limit (Integer)

    The maximum number of users to be returned.

Returns:



6802
6803
6804
6805
6806
# File 'lib/tdlib/client_methods.rb', line 6802

def search_contacts(query: nil, limit:)
  broadcast('@type' => 'searchContacts',
            'query' => query,
            'limit' => limit)
end

#search_emojis(text:, input_language_codes: nil) ⇒ TD::Types::EmojiKeywords

Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified.

Parameters:

  • text (TD::Types::String)

    Text to search for.

  • input_language_codes (Array<TD::Types::String>, nil) (defaults to: nil)

    List of possible IETF language tags of the user’s input language; may be empty if unknown.

Returns:



6816
6817
6818
6819
6820
# File 'lib/tdlib/client_methods.rb', line 6816

def search_emojis(text:, input_language_codes: nil)
  broadcast('@type'                => 'searchEmojis',
            'text'                 => text,
            'input_language_codes' => input_language_codes)
end

#search_file_downloads(query: nil, only_active:, only_completed:, offset:, limit:) ⇒ TD::Types::FoundFileDownloads

Searches for files in the file download list or recently downloaded files from the list.

Parameters:

  • query (TD::Types::String, nil) (defaults to: nil)

    Query to search for; may be empty to return all downloaded files.

  • only_active (Boolean)

    Pass true to search only for active downloads, including paused.

  • only_completed (Boolean)

    Pass true to search only for completed downloads.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of files to be returned.

Returns:



6831
6832
6833
6834
6835
6836
6837
6838
# File 'lib/tdlib/client_methods.rb', line 6831

def search_file_downloads(query: nil, only_active:, only_completed:, offset:, limit:)
  broadcast('@type'          => 'searchFileDownloads',
            'query'          => query,
            'only_active'    => only_active,
            'only_completed' => only_completed,
            'offset'         => offset,
            'limit'          => limit)
end

#search_hashtags(prefix:, limit:) ⇒ TD::Types::Hashtags

Searches for recently used hashtags by their prefix.

Parameters:

  • prefix (TD::Types::String)

    Hashtag prefix to search for.

  • limit (Integer)

    The maximum number of hashtags to be returned.

Returns:



6845
6846
6847
6848
6849
# File 'lib/tdlib/client_methods.rb', line 6845

def search_hashtags(prefix:, limit:)
  broadcast('@type'  => 'searchHashtags',
            'prefix' => prefix,
            'limit'  => limit)
end

#search_installed_sticker_sets(sticker_type:, query:, limit:) ⇒ TD::Types::StickerSets

Searches for installed sticker sets by looking for specified query in their title and name.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the sticker sets to search for.

  • query (TD::Types::String)

    Query to search for.

  • limit (Integer)

    The maximum number of sticker sets to return.

Returns:



6857
6858
6859
6860
6861
6862
# File 'lib/tdlib/client_methods.rb', line 6857

def search_installed_sticker_sets(sticker_type:, query:, limit:)
  broadcast('@type'        => 'searchInstalledStickerSets',
            'sticker_type' => sticker_type,
            'query'        => query,
            'limit'        => limit)
end

#search_messages(chat_list:, only_in_channels:, query:, offset:, limit:, filter:, min_date:, max_date:) ⇒ TD::Types::FoundMessages

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 TDLib and can be smaller than the specified

limit.

Parameters:

  • chat_list (TD::Types::ChatList)

    Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported.

  • only_in_channels (Boolean)

    Pass true to search only for messages in channels.

  • query (TD::Types::String)

    Query to search for.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

  • filter (TD::Types::SearchMessagesFilter)

    Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and Types::SearchMessagesFilter::Pinned are unsupported in this function.

  • min_date (Integer)

    If not 0, the minimum date of the messages to return.

  • max_date (Integer)

    If not 0, the maximum date of the messages to return.

Returns:



6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
# File 'lib/tdlib/client_methods.rb', line 6886

def search_messages(chat_list:, only_in_channels:, query:, offset:, limit:, filter:, min_date:, max_date:)
  broadcast('@type'            => 'searchMessages',
            'chat_list'        => chat_list,
            'only_in_channels' => only_in_channels,
            'query'            => query,
            'offset'           => offset,
            'limit'            => limit,
            'filter'           => filter,
            'min_date'         => min_date,
            'max_date'         => max_date)
end

#search_outgoing_document_messages(query:, limit:) ⇒ TD::Types::FoundMessages

Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order.

Parameters:

  • query (TD::Types::String)

    Query to search for in document file name and message caption.

  • limit (Integer)

    The maximum number of messages to be returned; up to 100.

Returns:



6904
6905
6906
6907
6908
# File 'lib/tdlib/client_methods.rb', line 6904

def search_outgoing_document_messages(query:, limit:)
  broadcast('@type' => 'searchOutgoingDocumentMessages',
            'query' => query,
            '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.

Parameters:

  • username (TD::Types::String)

    Username to be resolved.

Returns:



6916
6917
6918
6919
# File 'lib/tdlib/client_methods.rb', line 6916

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. Excludes private chats with contacts and chats from the chat list from the results.

Parameters:

  • query (TD::Types::String)

    Query to search for.

Returns:



6928
6929
6930
6931
# File 'lib/tdlib/client_methods.rb', line 6928

def search_public_chats(query:)
  broadcast('@type' => 'searchPublicChats',
            'query' => query)
end

#search_public_messages_by_tag(tag:, offset:, limit:) ⇒ TD::Types::FoundMessages

Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified

limit.

Parameters:

  • tag (TD::Types::String)

    Hashtag or cashtag to search for.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

Returns:



6944
6945
6946
6947
6948
6949
# File 'lib/tdlib/client_methods.rb', line 6944

def search_public_messages_by_tag(tag:, offset:, limit:)
  broadcast('@type'  => 'searchPublicMessagesByTag',
            'tag'    => tag,
            'offset' => offset,
            'limit'  => limit)
end

#search_public_stories_by_location(address:, offset:, limit:) ⇒ TD::Types::FoundStories

Searches for public stories by the given address location. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified

limit.

Parameters:

  • address (TD::Types::LocationAddress)

    Address of the location.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

Returns:



6962
6963
6964
6965
6966
6967
# File 'lib/tdlib/client_methods.rb', line 6962

def search_public_stories_by_location(address:, offset:, limit:)
  broadcast('@type'   => 'searchPublicStoriesByLocation',
            'address' => address,
            'offset'  => offset,
            'limit'   => limit)
end

#search_public_stories_by_tag(tag:, offset:, limit:) ⇒ TD::Types::FoundStories

Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified

limit.

Parameters:

  • tag (TD::Types::String)

    Hashtag or cashtag to search for.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

Returns:



6980
6981
6982
6983
6984
6985
# File 'lib/tdlib/client_methods.rb', line 6980

def search_public_stories_by_tag(tag:, offset:, limit:)
  broadcast('@type'  => 'searchPublicStoriesByTag',
            'tag'    => tag,
            'offset' => offset,
            'limit'  => limit)
end

#search_public_stories_by_venue(venue_provider:, venue_id:, offset:, limit:) ⇒ TD::Types::FoundStories

Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified

limit.

Parameters:

  • venue_provider (TD::Types::String)

    Provider of the venue.

  • venue_id (TD::Types::String)

    Identifier of the venue in the provider database.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

Returns:



6999
7000
7001
7002
7003
7004
7005
# File 'lib/tdlib/client_methods.rb', line 6999

def search_public_stories_by_venue(venue_provider:, venue_id:, offset:, limit:)
  broadcast('@type'          => 'searchPublicStoriesByVenue',
            'venue_provider' => venue_provider,
            'venue_id'       => venue_id,
            'offset'         => offset,
            'limit'          => limit)
end

#search_quote(text:, quote:, quote_position:) ⇒ TD::Types::FoundPosition

Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously.

Parameters:

Returns:



7016
7017
7018
7019
7020
7021
# File 'lib/tdlib/client_methods.rb', line 7016

def search_quote(text:, quote:, quote_position:)
  broadcast('@type'          => 'searchQuote',
            'text'           => text,
            'quote'          => quote,
            'quote_position' => quote_position)
end

#search_recently_found_chats(query:, limit:) ⇒ TD::Types::Chats

Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline

request.

Parameters:

  • query (TD::Types::String)

    Query to search for.

  • limit (Integer)

    The maximum number of chats to be returned.

Returns:



7029
7030
7031
7032
7033
# File 'lib/tdlib/client_methods.rb', line 7029

def search_recently_found_chats(query:, limit:)
  broadcast('@type' => 'searchRecentlyFoundChats',
            'query' => query,
            'limit' => limit)
end

#search_saved_messages(saved_messages_topic_id:, tag:, query:, from_message_id:, offset:, limit:) ⇒ TD::Types::FoundChatMessages

Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for

Telegram Premium users only.

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 TDLib and

can be smaller than the specified limit.

Parameters:

  • saved_messages_topic_id (Integer)

    If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages.

  • tag (TD::Types::ReactionType)

    Tag to search for; pass null to return all suitable messages.

  • query (TD::Types::String)

    Query to search for.

  • from_message_id (Integer)

    Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message.

  • offset (Integer)

    Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages.

  • limit (Integer)

    The maximum number of messages to be returned; must be positive and can’t be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

Returns:



7055
7056
7057
7058
7059
7060
7061
7062
7063
# File 'lib/tdlib/client_methods.rb', line 7055

def search_saved_messages(saved_messages_topic_id:, tag:, query:, from_message_id:, offset:, limit:)
  broadcast('@type'                   => 'searchSavedMessages',
            'saved_messages_topic_id' => saved_messages_topic_id,
            'tag'                     => tag,
            'query'                   => query,
            'from_message_id'         => from_message_id,
            'offset'                  => offset,
            'limit'                   => limit)
end

#search_secret_messages(chat_id:, query:, offset:, 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 TDLib.

Parameters:

  • chat_id (Integer)

    Identifier of the chat in which to search. Specify 0 to search in all secret chats.

  • query (TD::Types::String)

    Query to search for. If empty, searchChatMessages must be used instead.

  • offset (TD::Types::String)

    Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (Integer)

    The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

  • filter (TD::Types::SearchMessagesFilter)

    Additional filter for messages to search; pass null to search for all messages.

Returns:



7081
7082
7083
7084
7085
7086
7087
7088
# File 'lib/tdlib/client_methods.rb', line 7081

def search_secret_messages(chat_id:, query:, offset:, limit:, filter:)
  broadcast('@type'   => 'searchSecretMessages',
            'chat_id' => chat_id,
            'query'   => query,
            'offset'  => offset,
            'limit'   => limit,
            'filter'  => filter)
end

#search_sticker_set(name:) ⇒ TD::Types::StickerSet

Searches for a sticker set by its name.

Parameters:

  • name (TD::Types::String)

    Name of the sticker set.

Returns:



7094
7095
7096
7097
# File 'lib/tdlib/client_methods.rb', line 7094

def search_sticker_set(name:)
  broadcast('@type' => 'searchStickerSet',
            'name'  => name)
end

#search_sticker_sets(sticker_type:, query:) ⇒ TD::Types::StickerSets

Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results.

Parameters:

  • sticker_type (TD::Types::StickerType)

    Type of the sticker sets to return.

  • query (TD::Types::String)

    Query to search for.

Returns:



7105
7106
7107
7108
7109
# File 'lib/tdlib/client_methods.rb', line 7105

def search_sticker_sets(sticker_type:, query:)
  broadcast('@type'        => 'searchStickerSets',
            'sticker_type' => sticker_type,
            'query'        => query)
end

#search_stickers(sticker_type: nil, emojis:, limit: nil) ⇒ TD::Types::Stickers

Searches for stickers from public sticker sets that correspond to any of the given emoji.

Parameters:

  • sticker_type (TD::Types::StickerType, nil) (defaults to: nil)

    Type of the stickers to return.

  • emojis (TD::Types::String)

    Space-separated list of emojis to search for; must be non-empty.

  • limit (Integer, nil) (defaults to: nil)

    The maximum number of stickers to be returned; 0-100.

Returns:



7117
7118
7119
7120
7121
7122
# File 'lib/tdlib/client_methods.rb', line 7117

def search_stickers(sticker_type: nil, emojis:, limit: nil)
  broadcast('@type'        => 'searchStickers',
            'sticker_type' => sticker_type,
            'emojis'       => emojis,
            'limit'        => limit)
end

#search_strings_by_prefix(strings:, query:, limit:, return_none_for_empty_query:) ⇒ TD::Types::FoundPositions

Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously.

Parameters:

  • strings (Array<TD::Types::String>)

    The strings to search in for the query.

  • query (TD::Types::String)

    Query to search for.

  • limit (Integer)

    The maximum number of objects to return.

  • return_none_for_empty_query (Boolean)

    Pass true to receive no results for an empty query.

Returns:



7133
7134
7135
7136
7137
7138
7139
# File 'lib/tdlib/client_methods.rb', line 7133

def search_strings_by_prefix(strings:, query:, limit:, return_none_for_empty_query:)
  broadcast('@type'                       => 'searchStringsByPrefix',
            'strings'                     => strings,
            'query'                       => query,
            'limit'                       => limit,
            'return_none_for_empty_query' => return_none_for_empty_query)
end

#search_user_by_phone_number(phone_number:, only_local:) ⇒ TD::Types::User

Searches a user by their phone number. Returns a 404 error if the user can’t be found.

Parameters:

  • phone_number (TD::Types::String)

    Phone number to search for.

  • only_local (Boolean)

    Pass true to get only locally available information without sending network requests.

Returns:



7147
7148
7149
7150
7151
# File 'lib/tdlib/client_methods.rb', line 7147

def search_user_by_phone_number(phone_number:, only_local:)
  broadcast('@type'        => 'searchUserByPhoneNumber',
            'phone_number' => phone_number,
            'only_local'   => only_local)
end

#search_user_by_token(token:) ⇒ TD::Types::User

Searches a user by a token from the user’s link.

Parameters:

  • token (TD::Types::String)

    Token to search for.

Returns:



7157
7158
7159
7160
# File 'lib/tdlib/client_methods.rb', line 7157

def search_user_by_token(token:)
  broadcast('@type' => 'searchUserByToken',
            'token' => token)
end

#search_web_app(bot_user_id:, web_app_short_name:) ⇒ TD::Types::FoundWebApp

Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • web_app_short_name (TD::Types::String)

    Short name of the Web App.

Returns:



7168
7169
7170
7171
7172
# File 'lib/tdlib/client_methods.rb', line 7168

def search_web_app(bot_user_id:, web_app_short_name:)
  broadcast('@type'              => 'searchWebApp',
            'bot_user_id'        => bot_user_id,
            'web_app_short_name' => web_app_short_name)
end

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

Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the

type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos.

Parameters:

  • token (TD::Types::String)

    Play Integrity API or SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application.

Returns:



7181
7182
7183
7184
# File 'lib/tdlib/client_methods.rb', line 7181

def send_authentication_firebase_sms(token:)
  broadcast('@type' => 'sendAuthenticationFirebaseSms',
            'token' => token)
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; requires can_invite_users

member right.

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.

Parameters:

  • bot_user_id (Integer)

    Identifier of the bot.

  • chat_id (Integer)

    Identifier of the target chat.

  • parameter (TD::Types::String)

    A hidden parameter sent to the bot for deep linking purposes (core.telegram.org/bots#deep-linking).

Returns:



7197
7198
7199
7200
7201
7202
# File 'lib/tdlib/client_methods.rb', line 7197

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_business_message(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:, effect_id:, reply_markup:, input_message_content:) ⇒ TD::Types::BusinessMessage

Sends a message on behalf of a business account; for bots only. Returns the message after it was sent.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which to send the request.

  • chat_id (Integer)

    Target chat.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message to be replied; pass null if none.

  • disable_notification (Boolean)

    Pass true to disable notification for the message.

  • protect_content (Boolean)

    Pass true if the content of the message must be protected from forwarding and saving.

  • effect_id (Integer)

    Identifier of the effect to apply to the message.

  • reply_markup (TD::Types::ReplyMarkup)

    Markup for replying to the message; pass null if none.

  • input_message_content (TD::Types::InputMessageContent)

    The content of the message to be sent.

Returns:



7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
# File 'lib/tdlib/client_methods.rb', line 7218

def send_business_message(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:,
                          effect_id:, reply_markup:, input_message_content:)
  broadcast('@type'                  => 'sendBusinessMessage',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'reply_to'               => reply_to,
            'disable_notification'   => disable_notification,
            'protect_content'        => protect_content,
            'effect_id'              => effect_id,
            'reply_markup'           => reply_markup,
            'input_message_content'  => input_message_content)
end

#send_business_message_album(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:, effect_id:, input_message_contents:) ⇒ TD::Types::BusinessMessages

Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which to send the request.

  • chat_id (Integer)

    Target chat.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message to be replied; pass null if none.

  • disable_notification (Boolean)

    Pass true to disable notification for the message.

  • protect_content (Boolean)

    Pass true if the content of the message must be protected from forwarding and saving.

  • effect_id (Integer)

    Identifier of the effect to apply to the message.

  • input_message_contents (Array<TD::Types::InputMessageContent>)

    Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media.

Returns:



7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
# File 'lib/tdlib/client_methods.rb', line 7248

def send_business_message_album(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:,
                                effect_id:, input_message_contents:)
  broadcast('@type'                  => 'sendBusinessMessageAlbum',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'reply_to'               => reply_to,
            'disable_notification'   => disable_notification,
            'protect_content'        => protect_content,
            'effect_id'              => effect_id,
            'input_message_contents' => input_message_contents)
end

#send_call_debug_information(call_id:, debug_information:) ⇒ TD::Types::Ok

Sends debug information for a call to Telegram servers.

Parameters:

  • call_id (Integer)

    Call identifier.

  • debug_information (TD::Types::String)

    Debug information in application-specific format.

Returns:



7265
7266
7267
7268
7269
# File 'lib/tdlib/client_methods.rb', line 7265

def send_call_debug_information(call_id:, debug_information:)
  broadcast('@type'             => 'sendCallDebugInformation',
            'call_id'           => call_id,
            'debug_information' => debug_information)
end

#send_call_log(call_id:, log_file:) ⇒ TD::Types::Ok

Sends log file for a call to Telegram servers.

Parameters:

Returns:



7277
7278
7279
7280
7281
# File 'lib/tdlib/client_methods.rb', line 7277

def send_call_log(call_id:, log_file:)
  broadcast('@type'    => 'sendCallLog',
            'call_id'  => call_id,
            'log_file' => log_file)
end

#send_call_rating(call_id:, rating:, comment:, problems:) ⇒ TD::Types::Ok

Sends a call rating.

Parameters:

  • call_id (Integer)

    Call identifier.

  • rating (Integer)

    Call rating; 1-5.

  • comment (TD::Types::String)

    An optional user comment if the rating is less than 5.

  • problems (Array<TD::Types::CallProblem>)

    List of the exact types of problems with the call, specified by the user.

Returns:



7291
7292
7293
7294
7295
7296
7297
# File 'lib/tdlib/client_methods.rb', line 7291

def send_call_rating(call_id:, rating:, comment:, problems:)
  broadcast('@type'    => 'sendCallRating',
            'call_id'  => call_id,
            'rating'   => rating,
            'comment'  => comment,
            'problems' => problems)
end

#send_call_signaling_data(call_id:, data:) ⇒ TD::Types::Ok

Sends call signaling data.

Parameters:

  • call_id (Integer)

    Call identifier.

  • data (String)

    The data.

Returns:



7304
7305
7306
7307
7308
# File 'lib/tdlib/client_methods.rb', line 7304

def send_call_signaling_data(call_id:, data:)
  broadcast('@type'   => 'sendCallSignalingData',
            'call_id' => call_id,
            'data'    => data)
end

#send_chat_action(chat_id:, message_thread_id:, business_connection_id:, action:) ⇒ TD::Types::Ok

Sends a notification about user activity in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the action was performed.

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which to send the request; for bots only.

  • action (TD::Types::ChatAction)

    The action description; pass null to cancel the currently active action.

Returns:



7318
7319
7320
7321
7322
7323
7324
# File 'lib/tdlib/client_methods.rb', line 7318

def send_chat_action(chat_id:, message_thread_id:, business_connection_id:, action:)
  broadcast('@type'                  => 'sendChatAction',
            'chat_id'                => chat_id,
            'message_thread_id'      => message_thread_id,
            'business_connection_id' => business_connection_id,
            'action'                 => action)
end

#send_custom_request(method:, parameters:) ⇒ TD::Types::CustomRequestResult

Sends a custom request; for bots only.

Parameters:

  • method (TD::Types::String)

    The method name.

  • parameters (TD::Types::String)

    JSON-serialized method parameters.

Returns:



7331
7332
7333
7334
7335
# File 'lib/tdlib/client_methods.rb', line 7331

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.

Parameters:

  • email_address (TD::Types::String)

    Email address.

Returns:



7341
7342
7343
7344
# File 'lib/tdlib/client_methods.rb', line 7341

def send_email_address_verification_code(email_address:)
  broadcast('@type'         => 'sendEmailAddressVerificationCode',
            'email_address' => email_address)
end

#send_inline_query_result_message(chat_id:, message_thread_id:, reply_to:, 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.

Parameters:

  • chat_id (Integer)

    Target chat.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the message will be sent.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message or story to be replied; pass null if none.

  • options (TD::Types::MessageSendOptions)

    Options to be used to send the message; pass null to use default options.

  • query_id (Integer)

    Identifier of the inline query.

  • result_id (TD::Types::String)

    Identifier of the inline query result.

  • hide_via_bot (Boolean)

    Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption(“animation_search_bot_username”), getOption(“photo_search_bot_username”), and getOption(“venue_search_bot_username”).

Returns:



7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
# File 'lib/tdlib/client_methods.rb', line 7362

def send_inline_query_result_message(chat_id:, message_thread_id:, reply_to:, options:, query_id:, result_id:,
                                     hide_via_bot:)
  broadcast('@type'             => 'sendInlineQueryResultMessage',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id,
            'reply_to'          => reply_to,
            'options'           => options,
            'query_id'          => query_id,
            'result_id'         => result_id,
            'hide_via_bot'      => hide_via_bot)
end

#send_message(chat_id:, message_thread_id:, reply_to:, options:, reply_markup:, input_message_content:) ⇒ TD::Types::Message

Sends a message. Returns the sent message.

Parameters:

  • chat_id (Integer)

    Target chat.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the message will be sent.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message or story to be replied; pass null if none.

  • options (TD::Types::MessageSendOptions)

    Options to be used to send the message; pass null to use default options.

  • reply_markup (TD::Types::ReplyMarkup)

    Markup for replying to the message; pass null if none; for bots only.

  • input_message_content (TD::Types::InputMessageContent)

    The content of the message to be sent.

Returns:



7386
7387
7388
7389
7390
7391
7392
7393
7394
# File 'lib/tdlib/client_methods.rb', line 7386

def send_message(chat_id:, message_thread_id:, reply_to:, options:, reply_markup:, input_message_content:)
  broadcast('@type'                 => 'sendMessage',
            'chat_id'               => chat_id,
            'message_thread_id'     => message_thread_id,
            'reply_to'              => reply_to,
            'options'               => options,
            'reply_markup'          => reply_markup,
            'input_message_content' => input_message_content)
end

#send_message_album(chat_id:, message_thread_id:, reply_to:, options:, input_message_contents:) ⇒ TD::Types::Messages

Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages.

Parameters:

  • chat_id (Integer)

    Target chat.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the messages will be sent.

  • reply_to (TD::Types::InputMessageReplyTo)

    Information about the message or story to be replied; pass null if none.

  • options (TD::Types::MessageSendOptions)

    Options to be used to send the messages; pass null to use default options.

  • input_message_contents (Array<TD::Types::InputMessageContent>)

    Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media.

Returns:



7411
7412
7413
7414
7415
7416
7417
7418
# File 'lib/tdlib/client_methods.rb', line 7411

def send_message_album(chat_id:, message_thread_id:, reply_to:, options:, input_message_contents:)
  broadcast('@type'                  => 'sendMessageAlbum',
            'chat_id'                => chat_id,
            'message_thread_id'      => message_thread_id,
            'reply_to'               => reply_to,
            'options'                => options,
            'input_message_contents' => input_message_contents)
end

#send_passport_authorization_form(authorization_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 are going to be reused.

Parameters:

  • authorization_form_id (Integer)

    Authorization form identifier.

  • types (Array<TD::Types::PassportElementType>)

    Types of Telegram Passport elements chosen by user to complete the authorization form.

Returns:



7428
7429
7430
7431
7432
# File 'lib/tdlib/client_methods.rb', line 7428

def send_passport_authorization_form(authorization_form_id:, types:)
  broadcast('@type'                 => 'sendPassportAuthorizationForm',
            'authorization_form_id' => authorization_form_id,
            'types'                 => types)
end

#send_payment_form(input_invoice:, payment_form_id:, order_info_id:, shipping_option_id:, credentials:, tip_amount:) ⇒ TD::Types::PaymentResult

Sends a filled-out payment form to the bot for final verification.

Parameters:

  • input_invoice (TD::Types::InputInvoice)

    The invoice.

  • payment_form_id (Integer)

    Payment form identifier returned by getPaymentForm.

  • order_info_id (TD::Types::String)

    Identifier returned by validateOrderInfo, or an empty string.

  • shipping_option_id (TD::Types::String)

    Identifier of a chosen shipping option, if applicable.

  • credentials (TD::Types::InputCredentials)

    The credentials chosen by user for payment; pass null for a payment in Telegram Stars.

  • tip_amount (Integer)

    Chosen by the user amount of tip in the smallest units of the currency.

Returns:



7444
7445
7446
7447
7448
7449
7450
7451
7452
# File 'lib/tdlib/client_methods.rb', line 7444

def send_payment_form(input_invoice:, payment_form_id:, order_info_id:, shipping_option_id:, credentials:, tip_amount:)
  broadcast('@type'              => 'sendPaymentForm',
            'input_invoice'      => input_invoice,
            'payment_form_id'    => payment_form_id,
            'order_info_id'      => order_info_id,
            'shipping_option_id' => shipping_option_id,
            'credentials'        => credentials,
            'tip_amount'         => tip_amount)
end

#send_phone_number_code(phone_number:, settings:, type:) ⇒ TD::Types::AuthenticationCodeInfo

Sends a code to the specified phone number. Aborts previous phone number verification if there was one. On success, returns information about the sent code.

Parameters:

Returns:



7463
7464
7465
7466
7467
7468
# File 'lib/tdlib/client_methods.rb', line 7463

def send_phone_number_code(phone_number:, settings:, type:)
  broadcast('@type'        => 'sendPhoneNumberCode',
            'phone_number' => phone_number,
            'settings'     => settings,
            'type'         => type)
end

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

Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or

authenticationCodeTypeFirebaseIos.

Parameters:

  • token (TD::Types::String)

    Play Integrity API or SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application.

Returns:



7477
7478
7479
7480
# File 'lib/tdlib/client_methods.rb', line 7477

def send_phone_number_firebase_sms(token:)
  broadcast('@type' => 'sendPhoneNumberFirebaseSms',
            'token' => token)
end

#send_quick_reply_shortcut_messages(chat_id:, shortcut_id:, sending_id:) ⇒ TD::Types::Messages

Sends messages from a quick reply shortcut. Requires Telegram Business subscription.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which to send messages. The chat must be a private chat with a regular user.

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut.

  • sending_id (Integer)

    Non-persistent identifier, which will be returned back in Types::MessageSendingState::Pending object and can be used to match sent messages and corresponding Types::Update::NewMessage updates.

Returns:



7492
7493
7494
7495
7496
7497
# File 'lib/tdlib/client_methods.rb', line 7492

def send_quick_reply_shortcut_messages(chat_id:, shortcut_id:, sending_id:)
  broadcast('@type'       => 'sendQuickReplyShortcutMessages',
            'chat_id'     => chat_id,
            'shortcut_id' => shortcut_id,
            'sending_id'  => sending_id)
end

#send_story(chat_id:, content:, areas:, caption:, privacy_settings:, active_period:, from_story_full_id:, is_posted_to_chat_page:, protect_content:) ⇒ TD::Types::Story

Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story.

Parameters:

  • chat_id (Integer)

    Identifier of the chat that will post the story. Pass Saved Messages chat identifier when posting a story on behalf of the current user.

  • content (TD::Types::InputStoryContent)

    Content of the story.

  • areas (TD::Types::InputStoryAreas)

    Clickable rectangle areas to be shown on the story media; pass null if none.

  • caption (TD::Types::FormattedText)

    Story caption; pass null to use an empty caption; 0-getOption(“story_caption_length_max”) characters; can have entities only if getOption(“can_use_text_entities_in_story_caption”).

  • privacy_settings (TD::Types::StoryPrivacySettings)

    The privacy settings for the story; ignored for stories sent to supergroup and channel chats.

  • active_period (Integer)

    Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise.

  • from_story_full_id (TD::Types::StoryFullId)

    Full identifier of the original story, which content was used to create the story; pass null if the story isn’t repost of another story.

  • is_posted_to_chat_page (Boolean)

    Pass true to keep the story accessible after expiration.

  • protect_content (Boolean)

    Pass true if the content of the story must be protected from forwarding and screenshotting.

Returns:



7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
# File 'lib/tdlib/client_methods.rb', line 7520

def send_story(chat_id:, content:, areas:, caption:, privacy_settings:, active_period:, from_story_full_id:,
               is_posted_to_chat_page:, protect_content:)
  broadcast('@type'                  => 'sendStory',
            'chat_id'                => chat_id,
            'content'                => content,
            'areas'                  => areas,
            'caption'                => caption,
            'privacy_settings'       => privacy_settings,
            'active_period'          => active_period,
            'from_story_full_id'     => from_story_full_id,
            'is_posted_to_chat_page' => is_posted_to_chat_page,
            'protect_content'        => protect_content)
end

#send_web_app_custom_request(bot_user_id:, method:, parameters:) ⇒ TD::Types::CustomRequestResult

Sends a custom request from a Web App.

Parameters:

  • bot_user_id (Integer)

    Identifier of the bot.

  • method (TD::Types::String)

    The method name.

  • parameters (TD::Types::String)

    JSON-serialized method parameters.

Returns:



7540
7541
7542
7543
7544
7545
# File 'lib/tdlib/client_methods.rb', line 7540

def send_web_app_custom_request(bot_user_id:, method:, parameters:)
  broadcast('@type'       => 'sendWebAppCustomRequest',
            'bot_user_id' => bot_user_id,
            'method'      => method,
            'parameters'  => parameters)
end

#send_web_app_data(bot_user_id:, button_text:, data:) ⇒ TD::Types::Ok

Sends data received from a keyboardButtonTypeWebApp Web App to a bot.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • button_text (TD::Types::String)

    Text of the Types::KeyboardButtonType::WebApp button, which opened the Web App.

  • data (TD::Types::String)

    The data.

Returns:



7554
7555
7556
7557
7558
7559
# File 'lib/tdlib/client_methods.rb', line 7554

def send_web_app_data(bot_user_id:, button_text:, data:)
  broadcast('@type'       => 'sendWebAppData',
            'bot_user_id' => bot_user_id,
            'button_text' => button_text,
            'data'        => data)
end

#set_accent_color(accent_color_id:, background_custom_emoji_id:) ⇒ TD::Types::Ok

Changes accent color and background custom emoji for the current user; for Telegram Premium users only.

Parameters:

  • accent_color_id (Integer)

    Identifier of the accent color to use.

  • background_custom_emoji_id (Integer)

    Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none.

Returns:



7567
7568
7569
7570
7571
# File 'lib/tdlib/client_methods.rb', line 7567

def set_accent_color(accent_color_id:, background_custom_emoji_id:)
  broadcast('@type'                      => 'setAccentColor',
            'accent_color_id'            => accent_color_id,
            'background_custom_emoji_id' => background_custom_emoji_id)
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.

Parameters:

Returns:



7577
7578
7579
7580
# File 'lib/tdlib/client_methods.rb', line 7577

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 initialization.

Parameters:

  • seconds (Float)

    Number of seconds before the function returns.

Returns:



7587
7588
7589
7590
# File 'lib/tdlib/client_methods.rb', line 7587

def set_alarm(seconds:)
  broadcast('@type'   => 'setAlarm',
            'seconds' => seconds)
end

#set_application_verification_token(verification_id:, token:) ⇒ TD::Types::Ok

Application verification has been completed. Can be called before authorization.

Parameters:

  • verification_id (Integer)

    Unique identifier for the verification process as received from updateApplicationVerificationRequired.

  • token (TD::Types::String)

    Play Integrity API token for the Android application, or secret from push notification for the iOS application;.

Returns:



7600
7601
7602
7603
7604
# File 'lib/tdlib/client_methods.rb', line 7600

def set_application_verification_token(verification_id:, token:)
  broadcast('@type'           => 'setApplicationVerificationToken',
            'verification_id' => verification_id,
            'token'           => token)
end

#set_archive_chat_list_settings(settings:) ⇒ TD::Types::Ok

Changes settings for automatic moving of chats to and from the Archive chat lists.

Parameters:

Returns:



7610
7611
7612
7613
# File 'lib/tdlib/client_methods.rb', line 7610

def set_archive_chat_list_settings(settings:)
  broadcast('@type'    => 'setArchiveChatListSettings',
            'settings' => settings)
end

#set_authentication_email_address(email_address:) ⇒ TD::Types::Ok

Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress.

Parameters:

  • email_address (TD::Types::String)

    The email address of the user.

Returns:



7620
7621
7622
7623
# File 'lib/tdlib/client_methods.rb', line 7620

def set_authentication_email_address(email_address:)
  broadcast('@type'         => 'setAuthenticationEmailAddress',
            'email_address' => email_address)
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 authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or
authorizationStateWaitPassword.

Parameters:

  • phone_number (TD::Types::String)

    The phone number of the user, in international format.

  • settings (TD::Types::PhoneNumberAuthenticationSettings)

    Settings for the authentication of the user’s phone number; pass null to use default settings.

Returns:



7635
7636
7637
7638
7639
# File 'lib/tdlib/client_methods.rb', line 7635

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.

Parameters:

Returns:



7646
7647
7648
7649
7650
# File 'lib/tdlib/client_methods.rb', line 7646

def set_auto_download_settings(settings:, type:)
  broadcast('@type'    => 'setAutoDownloadSettings',
            'settings' => settings,
            'type'     => type)
end

#set_autosave_settings(scope:, settings:) ⇒ TD::Types::Ok

Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings.

Parameters:

Returns:



7659
7660
7661
7662
7663
# File 'lib/tdlib/client_methods.rb', line 7659

def set_autosave_settings(scope:, settings:)
  broadcast('@type'    => 'setAutosaveSettings',
            'scope'    => scope,
            'settings' => settings)
end

#set_bio(bio:) ⇒ TD::Types::Ok

Changes the bio of the current user.

Parameters:

  • bio (TD::Types::String)

    The new value of the user bio; 0-getOption(“bio_length_max”) characters without line feeds.

Returns:



7670
7671
7672
7673
# File 'lib/tdlib/client_methods.rb', line 7670

def set_bio(bio:)
  broadcast('@type' => 'setBio',
            'bio'   => bio)
end

#set_birthdate(birthdate:) ⇒ TD::Types::Ok

Changes the birthdate of the current user.

Parameters:

  • birthdate (TD::Types::Birthdate)

    The new value of the current user’s birthdate; pass null to remove the birthdate.

Returns:



7680
7681
7682
7683
# File 'lib/tdlib/client_methods.rb', line 7680

def set_birthdate(birthdate:)
  broadcast('@type'     => 'setBirthdate',
            'birthdate' => birthdate)
end

#set_bot_info_description(bot_user_id:, language_code:, description:) ⇒ TD::Types::Ok

Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description.

  • description (TD::Types::String)

    New bot’s description on the specified language.

Returns:



7693
7694
7695
7696
7697
7698
# File 'lib/tdlib/client_methods.rb', line 7693

def set_bot_info_description(bot_user_id:, language_code:, description:)
  broadcast('@type'         => 'setBotInfoDescription',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'description'   => description)
end

#set_bot_info_short_description(bot_user_id:, language_code:, short_description:) ⇒ TD::Types::Ok

Sets the text shown on a bot’s profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description.

  • short_description (TD::Types::String)

    New bot’s short description on the specified language.

Returns:



7708
7709
7710
7711
7712
7713
# File 'lib/tdlib/client_methods.rb', line 7708

def set_bot_info_short_description(bot_user_id:, language_code:, short_description:)
  broadcast('@type'             => 'setBotInfoShortDescription',
            'bot_user_id'       => bot_user_id,
            'language_code'     => language_code,
            'short_description' => short_description)
end

#set_bot_name(bot_user_id: nil, language_code: nil, name:) ⇒ TD::Types::Ok

Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer, nil) (defaults to: nil)

    Identifier of the target bot.

  • language_code (TD::Types::String, nil) (defaults to: nil)

    A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name.

  • name (TD::Types::String)

    New bot’s name on the specified language; 0-64 characters; must be non-empty if language code is empty.

Returns:



7724
7725
7726
7727
7728
7729
# File 'lib/tdlib/client_methods.rb', line 7724

def set_bot_name(bot_user_id: nil, language_code: nil, name:)
  broadcast('@type'         => 'setBotName',
            'bot_user_id'   => bot_user_id,
            'language_code' => language_code,
            'name'          => name)
end

#set_bot_profile_photo(bot_user_id:, photo:) ⇒ TD::Types::Ok

Changes a profile photo for a bot.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • photo (TD::Types::InputChatPhoto)

    Profile photo to set; pass null to delete the chat photo.

Returns:



7736
7737
7738
7739
7740
# File 'lib/tdlib/client_methods.rb', line 7736

def set_bot_profile_photo(bot_user_id:, photo:)
  broadcast('@type'       => 'setBotProfilePhoto',
            'bot_user_id' => bot_user_id,
            'photo'       => photo)
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.

Parameters:

  • pending_update_count (Integer)

    The number of pending updates.

  • error_message (TD::Types::String)

    The last error message.

Returns:



7748
7749
7750
7751
7752
# File 'lib/tdlib/client_methods.rb', line 7748

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_business_away_message_settings(away_message_settings:) ⇒ TD::Types::Ok

Changes the business away message settings of the current user. Requires Telegram Business subscription.

Parameters:

Returns:



7760
7761
7762
7763
# File 'lib/tdlib/client_methods.rb', line 7760

def set_business_away_message_settings(away_message_settings:)
  broadcast('@type'                 => 'setBusinessAwayMessageSettings',
            'away_message_settings' => away_message_settings)
end

#set_business_connected_bot(bot:) ⇒ TD::Types::Ok

Adds or changes business bot that is connected to the current user account.

Parameters:

Returns:



7769
7770
7771
7772
# File 'lib/tdlib/client_methods.rb', line 7769

def set_business_connected_bot(bot:)
  broadcast('@type' => 'setBusinessConnectedBot',
            'bot'   => bot)
end

#set_business_greeting_message_settings(greeting_message_settings:) ⇒ TD::Types::Ok

Changes the business greeting message settings of the current user. Requires Telegram Business subscription.

Parameters:

Returns:



7780
7781
7782
7783
# File 'lib/tdlib/client_methods.rb', line 7780

def set_business_greeting_message_settings(greeting_message_settings:)
  broadcast('@type'                     => 'setBusinessGreetingMessageSettings',
            'greeting_message_settings' => greeting_message_settings)
end

#set_business_location(location:) ⇒ TD::Types::Ok

Changes the business location of the current user. Requires Telegram Business subscription.

Parameters:

Returns:



7790
7791
7792
7793
# File 'lib/tdlib/client_methods.rb', line 7790

def set_business_location(location:)
  broadcast('@type'    => 'setBusinessLocation',
            'location' => location)
end

#set_business_message_is_pinned(business_connection_id:, chat_id:, message_id:, is_pinned:) ⇒ TD::Types::Ok

Pins or unpins a message sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • is_pinned (Boolean)

    Pass true to pin the message, pass false to unpin it.

Returns:



7803
7804
7805
7806
7807
7808
7809
# File 'lib/tdlib/client_methods.rb', line 7803

def set_business_message_is_pinned(business_connection_id:, chat_id:, message_id:, is_pinned:)
  broadcast('@type'                  => 'setBusinessMessageIsPinned',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'is_pinned'              => is_pinned)
end

#set_business_opening_hours(opening_hours:) ⇒ TD::Types::Ok

Changes the business opening hours of the current user. Requires Telegram Business subscription.

Parameters:

  • opening_hours (TD::Types::BusinessOpeningHours)

    The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified.

Returns:



7817
7818
7819
7820
# File 'lib/tdlib/client_methods.rb', line 7817

def set_business_opening_hours(opening_hours:)
  broadcast('@type'         => 'setBusinessOpeningHours',
            'opening_hours' => opening_hours)
end

#set_business_start_page(start_page:) ⇒ TD::Types::Ok

Changes the business start page of the current user. Requires Telegram Business subscription.

Parameters:

Returns:



7828
7829
7830
7831
# File 'lib/tdlib/client_methods.rb', line 7828

def set_business_start_page(start_page:)
  broadcast('@type'      => 'setBusinessStartPage',
            'start_page' => start_page)
end

#set_chat_accent_color(chat_id:, accent_color_id:, background_custom_emoji_id:) ⇒ TD::Types::Ok

Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • accent_color_id (Integer)

    Identifier of the accent color to use. The chat must have at least accentColor.min_channel_chat_boost_level boost level to pass the corresponding color.

  • background_custom_emoji_id (Integer)

    Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set.

Returns:



7843
7844
7845
7846
7847
7848
# File 'lib/tdlib/client_methods.rb', line 7843

def set_chat_accent_color(chat_id:, accent_color_id:, background_custom_emoji_id:)
  broadcast('@type'                      => 'setChatAccentColor',
            'chat_id'                    => chat_id,
            'accent_color_id'            => accent_color_id,
            'background_custom_emoji_id' => background_custom_emoji_id)
end

#set_chat_active_stories_list(chat_id:, story_list:) ⇒ TD::Types::Ok

Changes story list in which stories from the chat are shown.

Parameters:

  • chat_id (Integer)

    Identifier of the chat that posted stories.

  • story_list (TD::Types::StoryList)

    New list for active stories posted by the chat.

Returns:



7855
7856
7857
7858
7859
# File 'lib/tdlib/client_methods.rb', line 7855

def set_chat_active_stories_list(chat_id:, story_list:)
  broadcast('@type'      => 'setChatActiveStoriesList',
            'chat_id'    => chat_id,
            'story_list' => story_list)
end

#set_chat_available_reactions(chat_id:, available_reactions:) ⇒ TD::Types::Ok

Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • available_reactions (TD::Types::ChatAvailableReactions)

    Reactions available in the chat. All explicitly specified emoji reactions must be active. In channel chats up to the chat’s boost level custom emoji reactions can be explicitly specified.

Returns:



7870
7871
7872
7873
7874
# File 'lib/tdlib/client_methods.rb', line 7870

def set_chat_available_reactions(chat_id:, available_reactions:)
  broadcast('@type'               => 'setChatAvailableReactions',
            'chat_id'             => chat_id,
            'available_reactions' => available_reactions)
end

#set_chat_background(chat_id:, background:, type:, dark_theme_dimming:, only_for_self:) ⇒ TD::Types::Ok

Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and

can_change_info administrator right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • background (TD::Types::InputBackground)

    The input background to use; pass null to create a new filled or chat theme background.

  • type (TD::Types::BackgroundType)

    Background type; pass null to use default background type for the chosen background; Types::BackgroundType::ChatTheme isn’t supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat.

  • dark_theme_dimming (Integer)

    Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background.

  • only_for_self (Boolean)

    Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn’t of the type inputBackgroundPrevious.

Returns:



7895
7896
7897
7898
7899
7900
7901
7902
# File 'lib/tdlib/client_methods.rb', line 7895

def set_chat_background(chat_id:, background:, type:, dark_theme_dimming:, only_for_self:)
  broadcast('@type'              => 'setChatBackground',
            'chat_id'            => chat_id,
            'background'         => background,
            'type'               => type,
            'dark_theme_dimming' => dark_theme_dimming,
            'only_for_self'      => only_for_self)
end

#set_chat_client_data(chat_id:, client_data:) ⇒ TD::Types::Ok

Changes application-specific data associated with a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • client_data (TD::Types::String)

    New value of client_data.

Returns:



7909
7910
7911
7912
7913
# File 'lib/tdlib/client_methods.rb', line 7909

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 member right.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • description (TD::Types::String)

    New chat description; 0-255 characters.

Returns:



7922
7923
7924
7925
7926
# File 'lib/tdlib/client_methods.rb', line 7922

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 administrator right in the channel if it

is specified.

Parameters:

  • chat_id (Integer)

    Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages member right in the supergroup).

  • discussion_chat_id (Integer)

    Identifier of a new channel’s discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don’t have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that.

Returns:



7941
7942
7943
7944
7945
# File 'lib/tdlib/client_methods.rb', line 7941

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:, message_thread_id:, draft_message:) ⇒ TD::Types::Ok

Changes the draft message in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    If not 0, the message thread identifier in which the draft was changed.

  • draft_message (TD::Types::DraftMessage)

    New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored.

Returns:



7955
7956
7957
7958
7959
7960
# File 'lib/tdlib/client_methods.rb', line 7955

def set_chat_draft_message(chat_id:, message_thread_id:, draft_message:)
  broadcast('@type'             => 'setChatDraftMessage',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id,
            'draft_message'     => draft_message)
end

#set_chat_emoji_status(chat_id:, emoji_status:) ⇒ TD::Types::Ok

Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • emoji_status (TD::Types::EmojiStatus)

    New emoji status; pass null to remove emoji status.

Returns:



7969
7970
7971
7972
7973
# File 'lib/tdlib/client_methods.rb', line 7969

def set_chat_emoji_status(chat_id:, emoji_status:)
  broadcast('@type'        => 'setChatEmojiStatus',
            'chat_id'      => chat_id,
            'emoji_status' => emoji_status)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • location (TD::Types::ChatLocation)

    New location for the chat; must be valid and not null.

Returns:



7982
7983
7984
7985
7986
# File 'lib/tdlib/client_methods.rb', line 7982

def set_chat_location(chat_id:, location:)
  broadcast('@type'    => 'setChatLocation',
            'chat_id'  => chat_id,
            'location' => location)
end

#set_chat_member_status(chat_id:, member_id:, status:) ⇒ TD::Types::Ok

Changes the status of a chat member; requires can_invite_users member right to add a chat member,

can_promote_members administrator right to change administrator rights of the member, and can_restrict_members
administrator right to change restrictions of a user.

This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed.

Parameters:

Returns:



7999
8000
8001
8002
8003
8004
# File 'lib/tdlib/client_methods.rb', line 7999

def set_chat_member_status(chat_id:, member_id:, status:)
  broadcast('@type'     => 'setChatMemberStatus',
            'chat_id'   => chat_id,
            'member_id' => member_id,
            'status'    => status)
end

#set_chat_message_auto_delete_time(chat_id:, message_auto_delete_time:) ⇒ TD::Types::Ok

Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can’t

be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)..

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_auto_delete_time (Integer)

    New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren’t deleted automatically.

Returns:



8015
8016
8017
8018
8019
# File 'lib/tdlib/client_methods.rb', line 8015

def set_chat_message_auto_delete_time(chat_id:, message_auto_delete_time:)
  broadcast('@type'                    => 'setChatMessageAutoDeleteTime',
            'chat_id'                  => chat_id,
            'message_auto_delete_time' => message_auto_delete_time)
end

#set_chat_message_sender(chat_id:, message_sender_id:) ⇒ TD::Types::Ok

Selects a message sender to send messages in a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_sender_id (TD::Types::MessageSender)

    New message sender for the chat.

Returns:



8026
8027
8028
8029
8030
# File 'lib/tdlib/client_methods.rb', line 8026

def set_chat_message_sender(chat_id:, message_sender_id:)
  broadcast('@type'             => 'setChatMessageSender',
            'chat_id'           => chat_id,
            'message_sender_id' => message_sender_id)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • notification_settings (TD::Types::ChatNotificationSettings)

    New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever.

Returns:



8039
8040
8041
8042
8043
# File 'lib/tdlib/client_methods.rb', line 8039

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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • permissions (TD::Types::ChatPermissions)

    New non-administrator members permissions in the chat.

Returns:



8052
8053
8054
8055
8056
# File 'lib/tdlib/client_methods.rb', line 8052

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 member right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • photo (TD::Types::InputChatPhoto)

    New chat photo; pass null to delete the chat photo.

Returns:



8065
8066
8067
8068
8069
# File 'lib/tdlib/client_methods.rb', line 8065

def set_chat_photo(chat_id:, photo:)
  broadcast('@type'   => 'setChatPhoto',
            'chat_id' => chat_id,
            'photo'   => photo)
end

#set_chat_pinned_stories(chat_id:, story_ids:) ⇒ TD::Types::Ok

Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat.

Parameters:

  • chat_id (Integer)

    Identifier of the chat that posted the stories.

  • story_ids (Array<Integer>)

    New list of pinned stories. All stories must be posted to the chat page first. There can be up to getOption(“pinned_story_count_max”) pinned stories on a chat page.

Returns:



8078
8079
8080
8081
8082
# File 'lib/tdlib/client_methods.rb', line 8078

def set_chat_pinned_stories(chat_id:, story_ids:)
  broadcast('@type'     => 'setChatPinnedStories',
            'chat_id'   => chat_id,
            'story_ids' => story_ids)
end

#set_chat_profile_accent_color(chat_id:, profile_accent_color_id:, profile_background_custom_emoji_id:) ⇒ TD::Types::Ok

Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • profile_accent_color_id (Integer)

    Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color.

  • profile_background_custom_emoji_id (Integer)

    Identifier of a custom emoji to be shown on the chat’s profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set.

Returns:



8095
8096
8097
8098
8099
8100
# File 'lib/tdlib/client_methods.rb', line 8095

def set_chat_profile_accent_color(chat_id:, profile_accent_color_id:, profile_background_custom_emoji_id:)
  broadcast('@type'                              => 'setChatProfileAccentColor',
            'chat_id'                            => chat_id,
            'profile_accent_color_id'            => profile_accent_color_id,
            'profile_background_custom_emoji_id' => profile_background_custom_emoji_id)
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 right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • slow_mode_delay (Integer)

    New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600.

Returns:



8109
8110
8111
8112
8113
# File 'lib/tdlib/client_methods.rb', line 8109

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_theme(chat_id:, theme_name:) ⇒ TD::Types::Ok

Changes the chat theme. Supported only in private and secret chats.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • theme_name (TD::Types::String)

    Name of the new chat theme; pass an empty string to return the default theme.

Returns:



8121
8122
8123
8124
8125
# File 'lib/tdlib/client_methods.rb', line 8121

def set_chat_theme(chat_id:, theme_name:)
  broadcast('@type'      => 'setChatTheme',
            'chat_id'    => chat_id,
            'theme_name' => theme_name)
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 member right.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • title (TD::Types::String)

    New title of the chat; 1-128 characters.

Returns:



8134
8135
8136
8137
8138
# File 'lib/tdlib/client_methods.rb', line 8134

def set_chat_title(chat_id:, title:)
  broadcast('@type'   => 'setChatTitle',
            'chat_id' => chat_id,
            'title'   => title)
end

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

Changes the list of close friends of the current user.

Parameters:

  • user_ids (Array<Integer>)

    User identifiers of close friends; the users must be contacts of the current user.

Returns:



8144
8145
8146
8147
# File 'lib/tdlib/client_methods.rb', line 8144

def set_close_friends(user_ids:)
  broadcast('@type'    => 'setCloseFriends',
            'user_ids' => user_ids)
end

#set_commands(scope:, language_code:, commands:) ⇒ TD::Types::Ok

Sets the list of commands supported by the bot for the given user scope and language; for bots only.

Parameters:

  • scope (TD::Types::BotCommandScope)

    The scope to which the commands are relevant; pass null to change commands in the default bot command scope.

  • language_code (TD::Types::String)

    A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands.

  • commands (Array<TD::Types::BotCommand>)

    List of the bot’s commands.

Returns:



8158
8159
8160
8161
8162
8163
# File 'lib/tdlib/client_methods.rb', line 8158

def set_commands(scope:, language_code:, commands:)
  broadcast('@type'         => 'setCommands',
            'scope'         => scope,
            'language_code' => language_code,
            'commands'      => commands)
end

#set_custom_emoji_sticker_set_thumbnail(name:, custom_emoji_id:) ⇒ TD::Types::Ok

Sets a custom emoji sticker set thumbnail.

Parameters:

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user.

  • custom_emoji_id (Integer)

    Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail.

Returns:



8172
8173
8174
8175
8176
# File 'lib/tdlib/client_methods.rb', line 8172

def set_custom_emoji_sticker_set_thumbnail(name:, custom_emoji_id:)
  broadcast('@type'           => 'setCustomEmojiStickerSetThumbnail',
            'name'            => name,
            'custom_emoji_id' => custom_emoji_id)
end

#set_custom_language_pack(info:, strings:) ⇒ TD::Types::Ok

Adds or changes a custom local language pack to the current localization target.

Parameters:

  • info (TD::Types::LanguagePackInfo)

    Information about the language pack. Language pack identifier must start with ‘X’, consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization.

  • strings (Array<TD::Types::LanguagePackString>)

    Strings of the new language pack.

Returns:



8186
8187
8188
8189
8190
# File 'lib/tdlib/client_methods.rb', line 8186

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.

Parameters:

  • language_pack_id (TD::Types::String)

    Identifier of a previously added custom local language pack in the current localization target.

  • new_string (TD::Types::LanguagePackString)

    New language pack string.

Returns:



8199
8200
8201
8202
8203
# File 'lib/tdlib/client_methods.rb', line 8199

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.

Parameters:

  • new_encryption_key (String)

    New encryption key.

Returns:



8210
8211
8212
8213
# File 'lib/tdlib/client_methods.rb', line 8210

def set_database_encryption_key(new_encryption_key:)
  broadcast('@type'              => 'setDatabaseEncryptionKey',
            'new_encryption_key' => new_encryption_key)
end

#set_default_background(background:, type:, for_dark_theme:) ⇒ TD::Types::Background

Sets default background for chats; adds the background to the list of installed backgrounds.

Parameters:

Returns:



8223
8224
8225
8226
8227
8228
# File 'lib/tdlib/client_methods.rb', line 8223

def set_default_background(background:, type:, for_dark_theme:)
  broadcast('@type'          => 'setDefaultBackground',
            'background'     => background,
            'type'           => type,
            'for_dark_theme' => for_dark_theme)
end

#set_default_channel_administrator_rights(default_channel_administrator_rights:) ⇒ TD::Types::Ok

Sets default administrator rights for adding the bot to channel chats; for bots only.

Parameters:

  • default_channel_administrator_rights (TD::Types::ChatAdministratorRights)

    Default administrator rights for adding the bot to channels; pass null to remove default rights.

Returns:



8235
8236
8237
8238
# File 'lib/tdlib/client_methods.rb', line 8235

def set_default_channel_administrator_rights(default_channel_administrator_rights:)
  broadcast('@type'                                => 'setDefaultChannelAdministratorRights',
            'default_channel_administrator_rights' => default_channel_administrator_rights)
end

#set_default_group_administrator_rights(default_group_administrator_rights:) ⇒ TD::Types::Ok

Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only.

Parameters:

  • default_group_administrator_rights (TD::Types::ChatAdministratorRights)

    Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights.

Returns:



8245
8246
8247
8248
# File 'lib/tdlib/client_methods.rb', line 8245

def set_default_group_administrator_rights(default_group_administrator_rights:)
  broadcast('@type'                              => 'setDefaultGroupAdministratorRights',
            'default_group_administrator_rights' => default_group_administrator_rights)
end

#set_default_message_auto_delete_time(message_auto_delete_time:) ⇒ TD::Types::Ok

Changes the default message auto-delete time for new chats.

Parameters:

  • message_auto_delete_time (TD::Types::MessageAutoDeleteTime)

    New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren’t deleted automatically.

Returns:



8256
8257
8258
8259
# File 'lib/tdlib/client_methods.rb', line 8256

def set_default_message_auto_delete_time(message_auto_delete_time:)
  broadcast('@type'                    => 'setDefaultMessageAutoDeleteTime',
            'message_auto_delete_time' => message_auto_delete_time)
end

#set_default_reaction_type(reaction_type:) ⇒ TD::Types::Ok

Changes type of default reaction for the current user.

Parameters:

  • reaction_type (TD::Types::ReactionType)

    New type of the default reaction. The paid reaction can’t be set as default.

Returns:



8266
8267
8268
8269
# File 'lib/tdlib/client_methods.rb', line 8266

def set_default_reaction_type(reaction_type:)
  broadcast('@type'         => 'setDefaultReactionType',
            'reaction_type' => reaction_type)
end

#set_emoji_status(emoji_status:) ⇒ TD::Types::Ok

Changes the emoji status of the current user; for Telegram Premium users only.

Parameters:

Returns:



8275
8276
8277
8278
# File 'lib/tdlib/client_methods.rb', line 8275

def set_emoji_status(emoji_status:)
  broadcast('@type'        => 'setEmojiStatus',
            'emoji_status' => emoji_status)
end

#set_file_generation_progress(generation_id:, expected_size:, local_prefix_size:) ⇒ TD::Types::Ok

Informs TDLib on a file generation progress.

Parameters:

  • generation_id (Integer)

    The identifier of the generation process.

  • expected_size (Integer)

    Expected size of the generated file, in bytes; 0 if unknown.

  • local_prefix_size (Integer)

    The number of bytes already generated.

Returns:



8286
8287
8288
8289
8290
8291
# File 'lib/tdlib/client_methods.rb', line 8286

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_forum_topic_notification_settings(chat_id:, message_thread_id:, notification_settings:) ⇒ TD::Types::Ok

Changes the notification settings of a forum topic.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

  • notification_settings (TD::Types::ChatNotificationSettings)

    New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever.

Returns:



8300
8301
8302
8303
8304
8305
# File 'lib/tdlib/client_methods.rb', line 8300

def set_forum_topic_notification_settings(chat_id:, message_thread_id:, notification_settings:)
  broadcast('@type'                 => 'setForumTopicNotificationSettings',
            'chat_id'               => chat_id,
            'message_thread_id'     => message_thread_id,
            'notification_settings' => notification_settings)
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.

Parameters:

  • chat_id (Integer)

    The chat to which the message with the game belongs.

  • message_id (Integer)

    Identifier of the message.

  • edit_message (Boolean)

    Pass true to edit the game message to include the current scoreboard.

  • user_id (Integer)

    User identifier.

  • score (Integer)

    The new score.

  • force (Boolean)

    Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table.

Returns:



8317
8318
8319
8320
8321
8322
8323
8324
8325
# File 'lib/tdlib/client_methods.rb', line 8317

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_group_call_participant_is_speaking(group_call_id:, audio_source:, is_speaking:) ⇒ TD::Types::Ok

Informs TDLib that speaking state of a participant of an active group has changed.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • audio_source (Integer)

    Group call participant’s synchronization audio source identifier, or 0 for the current user.

  • is_speaking (Boolean)

    Pass true if the user is speaking.

Returns:



8334
8335
8336
8337
8338
8339
# File 'lib/tdlib/client_methods.rb', line 8334

def set_group_call_participant_is_speaking(group_call_id:, audio_source:, is_speaking:)
  broadcast('@type'         => 'setGroupCallParticipantIsSpeaking',
            'group_call_id' => group_call_id,
            'audio_source'  => audio_source,
            'is_speaking'   => is_speaking)
end

#set_group_call_participant_volume_level(group_call_id:, participant_id:, volume_level:) ⇒ TD::Types::Ok

Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant’s volume level will be changed for all users

with the default volume level.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • participant_id (TD::Types::MessageSender)

    Participant identifier.

  • volume_level (Integer)

    New participant’s volume level; 1-20000 in hundreds of percents.

Returns:



8349
8350
8351
8352
8353
8354
# File 'lib/tdlib/client_methods.rb', line 8349

def set_group_call_participant_volume_level(group_call_id:, participant_id:, volume_level:)
  broadcast('@type'          => 'setGroupCallParticipantVolumeLevel',
            'group_call_id'  => group_call_id,
            'participant_id' => participant_id,
            'volume_level'   => volume_level)
end

#set_group_call_title(group_call_id:, title:) ⇒ TD::Types::Ok

Sets group call title. Requires groupCall.can_be_managed group call flag.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • title (TD::Types::String)

    New group call title; 1-64 characters.

Returns:



8362
8363
8364
8365
8366
# File 'lib/tdlib/client_methods.rb', line 8362

def set_group_call_title(group_call_id:, title:)
  broadcast('@type'         => 'setGroupCallTitle',
            'group_call_id' => group_call_id,
            'title'         => title)
end

#set_inactive_session_ttl(inactive_session_ttl_days:) ⇒ TD::Types::Ok

Changes the period of inactivity after which sessions will automatically be terminated.

Parameters:

  • inactive_session_ttl_days (Integer)

    New number of days of inactivity before sessions will be automatically terminated; 1-366 days.

Returns:



8373
8374
8375
8376
# File 'lib/tdlib/client_methods.rb', line 8373

def set_inactive_session_ttl(inactive_session_ttl_days:)
  broadcast('@type'                     => 'setInactiveSessionTtl',
            'inactive_session_ttl_days' => inactive_session_ttl_days)
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.

Parameters:

  • inline_message_id (TD::Types::String)

    Inline message identifier.

  • edit_message (Boolean)

    Pass true to edit the game message to include the current scoreboard.

  • user_id (Integer)

    User identifier.

  • score (Integer)

    The new score.

  • force (Boolean)

    Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table.

Returns:



8387
8388
8389
8390
8391
8392
8393
8394
# File 'lib/tdlib/client_methods.rb', line 8387

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_location(location:) ⇒ TD::Types::Ok

Changes the location of the current user. Needs to be called if getOption(“is_location_visible”) is true and location changes for more than 1 kilometer. Must not be called if the user has a business location.

Parameters:

Returns:



8402
8403
8404
8405
# File 'lib/tdlib/client_methods.rb', line 8402

def set_location(location:)
  broadcast('@type'    => 'setLocation',
            'location' => location)
end

#set_log_stream(log_stream:) ⇒ TD::Types::Ok

Sets new log stream for internal logging of TDLib. Can be called synchronously.

Parameters:

Returns:



8412
8413
8414
8415
# File 'lib/tdlib/client_methods.rb', line 8412

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. Can be called synchronously.

Parameters:

  • tag (TD::Types::String)

    Logging tag to change verbosity level.

  • new_verbosity_level (Integer)

    New verbosity level; 1-1024.

Returns:



8423
8424
8425
8426
8427
# File 'lib/tdlib/client_methods.rb', line 8423

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. Can be called synchronously.

Parameters:

  • new_verbosity_level (Integer)

    New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging.

Returns:



8437
8438
8439
8440
# File 'lib/tdlib/client_methods.rb', line 8437

def set_log_verbosity_level(new_verbosity_level:)
  broadcast('@type'               => 'setLogVerbosityLevel',
            'new_verbosity_level' => new_verbosity_level)
end

#set_login_email_address(new_login_email_address:) ⇒ TD::Types::EmailAddressAuthenticationCodeInfo

Changes the login email address of the user. The email address can be changed only if the current user already has login email and

passwordState. is non-empty.

The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly.

Parameters:

  • new_login_email_address (TD::Types::String)

    New login email address.

Returns:



8450
8451
8452
8453
# File 'lib/tdlib/client_methods.rb', line 8450

def (new_login_email_address:)
  broadcast('@type'                   => 'setLoginEmailAddress',
            'new_login_email_address' => )
end

#set_menu_button(user_id:, menu_button:) ⇒ TD::Types::Ok

Sets menu button for the given user or for all users; for bots only.

Parameters:

  • user_id (Integer)

    Identifier of the user or 0 to set menu button for all users.

  • menu_button (TD::Types::BotMenuButton)

    New menu button.

Returns:



8460
8461
8462
8463
8464
# File 'lib/tdlib/client_methods.rb', line 8460

def set_menu_button(user_id:, menu_button:)
  broadcast('@type'       => 'setMenuButton',
            'user_id'     => user_id,
            'menu_button' => menu_button)
end

#set_message_fact_check(chat_id:, message_id:, text:) ⇒ TD::Types::Ok

Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true.

Parameters:

  • chat_id (Integer)

    The channel chat the message belongs to.

  • message_id (Integer)

    Identifier of the message.

  • text (TD::Types::FormattedText)

    New text of the fact-check; 0-getOption(“fact_check_length_max”) characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with t.me/ links are supported.

Returns:



8475
8476
8477
8478
8479
8480
# File 'lib/tdlib/client_methods.rb', line 8475

def set_message_fact_check(chat_id:, message_id:, text:)
  broadcast('@type'      => 'setMessageFactCheck',
            'chat_id'    => chat_id,
            'message_id' => message_id,
            'text'       => text)
end

#set_message_reactions(chat_id:, message_id:, reaction_types:, is_big:) ⇒ TD::Types::Ok

Sets reactions on a message; for bots only.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • reaction_types (Array<TD::Types::ReactionType>)

    Types of the reaction to set.

  • is_big (Boolean)

    Pass true if the reactions are added with a big animation.

Returns:



8489
8490
8491
8492
8493
8494
8495
# File 'lib/tdlib/client_methods.rb', line 8489

def set_message_reactions(chat_id:, message_id:, reaction_types:, is_big:)
  broadcast('@type'          => 'setMessageReactions',
            'chat_id'        => chat_id,
            'message_id'     => message_id,
            'reaction_types' => reaction_types,
            'is_big'         => is_big)
end

#set_message_sender_block_list(sender_id:, block_list:) ⇒ TD::Types::Ok

Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked.

Parameters:

Returns:



8504
8505
8506
8507
8508
# File 'lib/tdlib/client_methods.rb', line 8504

def set_message_sender_block_list(sender_id:, block_list:)
  broadcast('@type'      => 'setMessageSenderBlockList',
            'sender_id'  => sender_id,
            'block_list' => block_list)
end

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

Changes the first and last name of the current user.

Parameters:

  • first_name (TD::Types::String)

    The new value of the first name for the current user; 1-64 characters.

  • last_name (TD::Types::String)

    The new value of the optional last name for the current user; 0-64 characters.

Returns:



8515
8516
8517
8518
8519
# File 'lib/tdlib/client_methods.rb', line 8515

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 must be called whenever the network is changed, even if the network type remains the same.

Network type is used to check whether the library can use the network at all and also for collecting detailed

network data usage statistics.

Parameters:

Returns:



8530
8531
8532
8533
# File 'lib/tdlib/client_methods.rb', line 8530

def set_network_type(type:)
  broadcast('@type' => 'setNetworkType',
            'type'  => type)
end

#set_new_chat_privacy_settings(settings:) ⇒ TD::Types::Ok

Changes privacy settings for new chat creation; can be used only if getOption(“can_set_new_chat_privacy_settings”).

Parameters:

Returns:



8539
8540
8541
8542
# File 'lib/tdlib/client_methods.rb', line 8539

def set_new_chat_privacy_settings(settings:)
  broadcast('@type'    => 'setNewChatPrivacySettings',
            'settings' => settings)
end

#set_option(name:, value:) ⇒ TD::Types::Ok

Sets the value of an option. (Check the list of available options on core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization.

Parameters:

  • name (TD::Types::String)

    The name of the option.

  • value (TD::Types::OptionValue)

    The new value of the option; pass null to reset option value to a default value.

Returns:



8552
8553
8554
8555
8556
# File 'lib/tdlib/client_methods.rb', line 8552

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.

Parameters:

  • element (TD::Types::InputPassportElement)

    Input Telegram Passport element.

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



8565
8566
8567
8568
8569
# File 'lib/tdlib/client_methods.rb', line 8565

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.

Parameters:

Returns:



8577
8578
8579
8580
8581
# File 'lib/tdlib/client_methods.rb', line 8577

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 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email

address is confirmed.

Parameters:

  • old_password (TD::Types::String)

    Previous 2-step verification password of the user.

  • new_password (TD::Types::String, nil) (defaults to: nil)

    New 2-step verification password of the user; may be empty to remove the password.

  • new_hint (TD::Types::String, nil) (defaults to: nil)

    New password hint; may be empty.

  • set_recovery_email_address (Boolean) (defaults to: false)

    Pass true to change also the recovery email address.

  • new_recovery_email_address (TD::Types::String, nil) (defaults to: nil)

    New recovery email address; may be empty.

Returns:



8594
8595
8596
8597
8598
8599
8600
8601
8602
# File 'lib/tdlib/client_methods.rb', line 8594

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_personal_chat(chat_id:) ⇒ TD::Types::Ok

Changes the personal chat of the current user.

Parameters:

  • chat_id (Integer)

    Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats.

Returns:



8609
8610
8611
8612
# File 'lib/tdlib/client_methods.rb', line 8609

def set_personal_chat(chat_id:)
  broadcast('@type'   => 'setPersonalChat',
            'chat_id' => chat_id)
end

#set_pinned_chats(chat_list:, chat_ids:) ⇒ TD::Types::Ok

Changes the order of pinned chats.

Parameters:

  • chat_list (TD::Types::ChatList)

    Chat list in which to change the order of pinned chats.

  • chat_ids (Array<Integer>)

    The new list of pinned chats.

Returns:



8619
8620
8621
8622
8623
# File 'lib/tdlib/client_methods.rb', line 8619

def set_pinned_chats(chat_list:, chat_ids:)
  broadcast('@type'     => 'setPinnedChats',
            'chat_list' => chat_list,
            'chat_ids'  => chat_ids)
end

#set_pinned_forum_topics(chat_id:, message_thread_ids:) ⇒ TD::Types::Ok

Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_ids (Array<Integer>)

    The new list of pinned forum topics.

Returns:



8630
8631
8632
8633
8634
# File 'lib/tdlib/client_methods.rb', line 8630

def set_pinned_forum_topics(chat_id:, message_thread_ids:)
  broadcast('@type'              => 'setPinnedForumTopics',
            'chat_id'            => chat_id,
            'message_thread_ids' => message_thread_ids)
end

#set_pinned_saved_messages_topics(saved_messages_topic_ids:) ⇒ TD::Types::Ok

Changes the order of pinned Saved Messages topics.

Parameters:

  • saved_messages_topic_ids (Array<Integer>)

    Identifiers of the new pinned Saved Messages topics.

Returns:



8640
8641
8642
8643
# File 'lib/tdlib/client_methods.rb', line 8640

def set_pinned_saved_messages_topics(saved_messages_topic_ids:)
  broadcast('@type'                    => 'setPinnedSavedMessagesTopics',
            'saved_messages_topic_ids' => saved_messages_topic_ids)
end

#set_poll_answer(chat_id:, message_id:, option_ids:) ⇒ TD::Types::Ok

Changes the user answer to a poll. A poll in quiz mode can be answered only once.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the poll belongs.

  • message_id (Integer)

    Identifier of the message containing the poll.

  • option_ids (Array<Integer>)

    0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers.

Returns:



8653
8654
8655
8656
8657
8658
# File 'lib/tdlib/client_methods.rb', line 8653

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_accent_color(profile_accent_color_id:, profile_background_custom_emoji_id:) ⇒ TD::Types::Ok

Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only.

Parameters:

  • profile_accent_color_id (Integer)

    Identifier of the accent color to use for profile; pass -1 if none.

  • profile_background_custom_emoji_id (Integer)

    Identifier of a custom emoji to be shown on the user’s profile photo background; 0 if none.

Returns:



8666
8667
8668
8669
8670
# File 'lib/tdlib/client_methods.rb', line 8666

def set_profile_accent_color(profile_accent_color_id:, profile_background_custom_emoji_id:)
  broadcast('@type'                              => 'setProfileAccentColor',
            'profile_accent_color_id'            => profile_accent_color_id,
            'profile_background_custom_emoji_id' => profile_background_custom_emoji_id)
end

#set_profile_photo(photo:, is_public:) ⇒ TD::Types::Ok

Changes a profile photo for the current user.

Parameters:

  • photo (TD::Types::InputChatPhoto)

    Profile photo to set.

  • is_public (Boolean)

    Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings.

Returns:



8678
8679
8680
8681
8682
# File 'lib/tdlib/client_methods.rb', line 8678

def set_profile_photo(photo:, is_public:)
  broadcast('@type'     => 'setProfilePhoto',
            'photo'     => photo,
            'is_public' => is_public)
end

#set_quick_reply_shortcut_name(shortcut_id:, name:) ⇒ TD::Types::Ok

Changes name of a quick reply shortcut.

Parameters:

  • shortcut_id (Integer)

    Unique identifier of the quick reply shortcut.

  • name (TD::Types::String)

    New name for the shortcut. Use checkQuickReplyShortcutName to check its validness.

Returns:



8690
8691
8692
8693
8694
# File 'lib/tdlib/client_methods.rb', line 8690

def set_quick_reply_shortcut_name(shortcut_id:, name:)
  broadcast('@type'       => 'setQuickReplyShortcutName',
            'shortcut_id' => shortcut_id,
            'name'        => name)
end

#set_reaction_notification_settings(notification_settings:) ⇒ TD::Types::Ok

Changes notification settings for reactions.

Parameters:

Returns:



8700
8701
8702
8703
# File 'lib/tdlib/client_methods.rb', line 8700

def set_reaction_notification_settings(notification_settings:)
  broadcast('@type'                 => 'setReactionNotificationSettings',
            'notification_settings' => notification_settings)
end

#set_read_date_privacy_settings(settings:) ⇒ TD::Types::Ok

Changes privacy settings for message read date.

Parameters:

Returns:



8709
8710
8711
8712
# File 'lib/tdlib/client_methods.rb', line 8709

def set_read_date_privacy_settings(settings:)
  broadcast('@type'    => 'setReadDatePrivacySettings',
            'settings' => settings)
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.

Parameters:

  • password (TD::Types::String)

    The 2-step verification password of the current user.

  • new_recovery_email_address (TD::Types::String)

    New recovery email address.

Returns:



8723
8724
8725
8726
8727
# File 'lib/tdlib/client_methods.rb', line 8723

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_saved_messages_tag_label(tag:, label:) ⇒ TD::Types::Ok

Changes label of a Saved Messages tag; for Telegram Premium users only.

Parameters:

  • tag (TD::Types::ReactionType)

    The tag which label will be changed.

  • label (TD::Types::String)

    New label for the tag; 0-12 characters.

Returns:



8734
8735
8736
8737
8738
# File 'lib/tdlib/client_methods.rb', line 8734

def set_saved_messages_tag_label(tag:, label:)
  broadcast('@type' => 'setSavedMessagesTagLabel',
            'tag'   => tag,
            'label' => label)
end

#set_scope_notification_settings(scope:, notification_settings:) ⇒ TD::Types::Ok

Changes notification settings for chats of a given type.

Parameters:

Returns:



8746
8747
8748
8749
8750
# File 'lib/tdlib/client_methods.rb', line 8746

def set_scope_notification_settings(scope:, notification_settings:)
  broadcast('@type'                 => 'setScopeNotificationSettings',
            'scope'                 => scope,
            'notification_settings' => notification_settings)
end

#set_sticker_emojis(sticker:, emojis:) ⇒ TD::Types::Ok

Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user.

Parameters:

  • sticker (TD::Types::InputFile)

    Sticker.

  • emojis (TD::Types::String)

    New string with 1-20 emoji corresponding to the sticker.

Returns:



8758
8759
8760
8761
8762
# File 'lib/tdlib/client_methods.rb', line 8758

def set_sticker_emojis(sticker:, emojis:)
  broadcast('@type'   => 'setStickerEmojis',
            'sticker' => sticker,
            'emojis'  => emojis)
end

#set_sticker_keywords(sticker:, keywords:) ⇒ TD::Types::Ok

Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user.

Parameters:

  • sticker (TD::Types::InputFile)

    Sticker.

  • keywords (Array<TD::Types::String>)

    List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker.

Returns:



8771
8772
8773
8774
8775
# File 'lib/tdlib/client_methods.rb', line 8771

def set_sticker_keywords(sticker:, keywords:)
  broadcast('@type'    => 'setStickerKeywords',
            'sticker'  => sticker,
            'keywords' => keywords)
end

#set_sticker_mask_position(sticker:, mask_position:) ⇒ TD::Types::Ok

Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user.

Parameters:

Returns:



8784
8785
8786
8787
8788
# File 'lib/tdlib/client_methods.rb', line 8784

def set_sticker_mask_position(sticker:, mask_position:)
  broadcast('@type'         => 'setStickerMaskPosition',
            'sticker'       => sticker,
            'mask_position' => mask_position)
end

#set_sticker_position_in_set(sticker:, position:) ⇒ TD::Types::Ok

Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user.

Parameters:

  • sticker (TD::Types::InputFile)

    Sticker.

  • position (Integer)

    New position of the sticker in the set, 0-based.

Returns:



8796
8797
8798
8799
8800
# File 'lib/tdlib/client_methods.rb', line 8796

def set_sticker_position_in_set(sticker:, position:)
  broadcast('@type'    => 'setStickerPositionInSet',
            'sticker'  => sticker,
            'position' => position)
end

#set_sticker_set_thumbnail(user_id:, name:, thumbnail:, format:) ⇒ TD::Types::Ok

Sets a sticker set thumbnail.

Parameters:

  • user_id (Integer)

    Sticker set owner; ignored for regular users.

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user.

  • thumbnail (TD::Types::InputFile)

    Thumbnail to set; pass null to remove the sticker set thumbnail.

  • format (TD::Types::StickerFormat)

    Format of the thumbnail; pass null if thumbnail is removed.

Returns:



8810
8811
8812
8813
8814
8815
8816
# File 'lib/tdlib/client_methods.rb', line 8810

def set_sticker_set_thumbnail(user_id:, name:, thumbnail:, format:)
  broadcast('@type'     => 'setStickerSetThumbnail',
            'user_id'   => user_id,
            'name'      => name,
            'thumbnail' => thumbnail,
            'format'    => format)
end

#set_sticker_set_title(name:, title:) ⇒ TD::Types::Ok

Sets a sticker set title.

Parameters:

  • name (TD::Types::String)

    Sticker set name. The sticker set must be owned by the current user.

  • title (TD::Types::String)

    New sticker set title.

Returns:



8824
8825
8826
8827
8828
# File 'lib/tdlib/client_methods.rb', line 8824

def set_sticker_set_title(name:, title:)
  broadcast('@type' => 'setStickerSetTitle',
            'name'  => name,
            'title' => title)
end

#set_story_privacy_settings(story_id:, privacy_settings:) ⇒ TD::Types::Ok

Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true.

Parameters:

Returns:



8836
8837
8838
8839
8840
# File 'lib/tdlib/client_methods.rb', line 8836

def set_story_privacy_settings(story_id:, privacy_settings:)
  broadcast('@type'            => 'setStoryPrivacySettings',
            'story_id'         => story_id,
            'privacy_settings' => privacy_settings)
end

#set_story_reaction(story_sender_chat_id:, story_id:, reaction_type:, update_recent_reactions:) ⇒ TD::Types::Ok

Changes chosen reaction on a story that has already been sent.

Parameters:

  • story_sender_chat_id (Integer)

    The identifier of the sender of the story.

  • story_id (Integer)

    The identifier of the story.

  • reaction_type (TD::Types::ReactionType)

    Type of the reaction to set; pass null to remove the reaction. Custom emoji reactions can be used only by Telegram Premium users. Paid reactions can’t be set.

  • update_recent_reactions (Boolean)

    Pass true if the reaction needs to be added to recent reactions.

Returns:



8851
8852
8853
8854
8855
8856
8857
# File 'lib/tdlib/client_methods.rb', line 8851

def set_story_reaction(story_sender_chat_id:, story_id:, reaction_type:, update_recent_reactions:)
  broadcast('@type'                   => 'setStoryReaction',
            'story_sender_chat_id'    => story_sender_chat_id,
            'story_id'                => story_id,
            'reaction_type'           => reaction_type,
            'update_recent_reactions' => update_recent_reactions)
end

#set_supergroup_custom_emoji_sticker_set(supergroup_id:, custom_emoji_sticker_set_id:) ⇒ TD::Types::Ok

Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the

corresponding color.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

  • custom_emoji_sticker_set_id (Integer)

    New value of the custom emoji sticker set identifier for the supergroup. Use 0 to remove the custom emoji sticker set in the supergroup.

Returns:



8868
8869
8870
8871
8872
# File 'lib/tdlib/client_methods.rb', line 8868

def set_supergroup_custom_emoji_sticker_set(supergroup_id:, custom_emoji_sticker_set_id:)
  broadcast('@type'                       => 'setSupergroupCustomEmojiStickerSet',
            'supergroup_id'               => supergroup_id,
            'custom_emoji_sticker_set_id' => custom_emoji_sticker_set_id)
end

#set_supergroup_sticker_set(supergroup_id:, sticker_set_id:) ⇒ TD::Types::Ok

Changes the sticker set of a supergroup; requires can_change_info administrator right.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

  • sticker_set_id (Integer)

    New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set.

Returns:



8880
8881
8882
8883
8884
# File 'lib/tdlib/client_methods.rb', line 8880

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_unrestrict_boost_count(supergroup_id:, unrestrict_boost_count:) ⇒ TD::Types::Ok

Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission

restrictions; requires can_restrict_members administrator right.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

  • unrestrict_boost_count (Integer)

    New value of the unrestrict_boost_count supergroup setting; 0-8. Use 0 to remove the setting.

Returns:



8893
8894
8895
8896
8897
# File 'lib/tdlib/client_methods.rb', line 8893

def set_supergroup_unrestrict_boost_count(supergroup_id:, unrestrict_boost_count:)
  broadcast('@type'                  => 'setSupergroupUnrestrictBoostCount',
            'supergroup_id'          => supergroup_id,
            'unrestrict_boost_count' => unrestrict_boost_count)
end

#set_supergroup_username(supergroup_id:, username:) ⇒ TD::Types::Ok

Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup or channel.

  • username (TD::Types::String)

    New value of the username. Use an empty string to remove the username. The username can’t be completely removed if there is another active or disabled username.

Returns:



8906
8907
8908
8909
8910
# File 'lib/tdlib/client_methods.rb', line 8906

def set_supergroup_username(supergroup_id:, username:)
  broadcast('@type'         => 'setSupergroupUsername',
            'supergroup_id' => supergroup_id,
            'username'      => username)
end

#set_tdlib_parameters(use_test_dc: nil, database_directory: nil, files_directory: nil, database_encryption_key: nil, use_file_database: nil, use_chat_info_database: nil, use_message_database: nil, use_secret_chats: nil, api_id: nil, api_hash: nil, system_language_code:, device_model:, system_version: nil, application_version:) ⇒ TD::Types::Ok

Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters.

Parameters:

  • use_test_dc (Boolean, nil) (defaults to: nil)

    Pass true to use Telegram test environment instead of the production environment.

  • database_directory (TD::Types::String, nil) (defaults to: nil)

    The path to the directory for the persistent database; if empty, the current working directory will be used.

  • files_directory (TD::Types::String, nil) (defaults to: nil)

    The path to the directory for storing files; if empty, database_directory will be used.

  • database_encryption_key (String, nil) (defaults to: nil)

    Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned.

  • use_file_database (Boolean, nil) (defaults to: nil)

    Pass true to keep information about downloaded and uploaded files between application restarts.

  • use_chat_info_database (Boolean, nil) (defaults to: nil)

    Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database.

  • use_message_database (Boolean, nil) (defaults to: nil)

    Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database.

  • use_secret_chats (Boolean, nil) (defaults to: nil)

    Pass true to enable support for secret chats.

  • api_id (Integer, nil) (defaults to: nil)

    Application identifier for Telegram API access, which can be obtained at my.telegram.org.

  • api_hash (TD::Types::String, nil) (defaults to: nil)

    Application identifier hash for Telegram API access, which can be obtained at my.telegram.org.

  • system_language_code (TD::Types::String)

    IETF language tag of the user’s operating system language; must be non-empty.

  • device_model (TD::Types::String)

    Model of the device the application is being run on; must be non-empty.

  • system_version (TD::Types::String, nil) (defaults to: nil)

    Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib.

  • application_version (TD::Types::String)

    Application version; must be non-empty.

Returns:



8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
# File 'lib/tdlib/client_methods.rb', line 8941

def set_tdlib_parameters(use_test_dc: nil, database_directory: nil, files_directory: nil, database_encryption_key:
                         nil, use_file_database: nil, use_chat_info_database: nil, use_message_database: nil,
                         use_secret_chats: nil, api_id: nil, api_hash: nil, system_language_code:, device_model:,
                         system_version: nil, application_version:)
  broadcast('@type'                   => 'setTdlibParameters',
            'use_test_dc'             => use_test_dc,
            'database_directory'      => database_directory,
            'files_directory'         => files_directory,
            'database_encryption_key' => database_encryption_key,
            'use_file_database'       => use_file_database,
            'use_chat_info_database'  => use_chat_info_database,
            'use_message_database'    => use_message_database,
            'use_secret_chats'        => use_secret_chats,
            'api_id'                  => api_id,
            'api_hash'                => api_hash,
            'system_language_code'    => system_language_code,
            'device_model'            => device_model,
            'system_version'          => system_version,
            'application_version'     => application_version)
end

#set_user_personal_profile_photo(user_id:, photo:) ⇒ TD::Types::Ok

Changes a personal profile photo of a contact user.

Parameters:

Returns:



8968
8969
8970
8971
8972
# File 'lib/tdlib/client_methods.rb', line 8968

def set_user_personal_profile_photo(user_id:, photo:)
  broadcast('@type'   => 'setUserPersonalProfilePhoto',
            'user_id' => user_id,
            'photo'   => photo)
end

#set_user_privacy_setting_rules(setting:, rules:) ⇒ TD::Types::Ok

Changes user privacy settings.

Parameters:

Returns:



8979
8980
8981
8982
8983
# File 'lib/tdlib/client_methods.rb', line 8979

def set_user_privacy_setting_rules(setting:, rules:)
  broadcast('@type'   => 'setUserPrivacySettingRules',
            'setting' => setting,
            'rules'   => rules)
end

#set_user_support_info(user_id:, message:) ⇒ TD::Types::UserSupportInfo

Sets support information for the given user; for Telegram support only.

Parameters:

Returns:



8990
8991
8992
8993
8994
# File 'lib/tdlib/client_methods.rb', line 8990

def set_user_support_info(user_id:, message:)
  broadcast('@type'   => 'setUserSupportInfo',
            'user_id' => user_id,
            'message' => message)
end

#set_username(username:) ⇒ TD::Types::Ok

Changes the editable username of the current user.

Parameters:

  • username (TD::Types::String)

    The new value of the username. Use an empty string to remove the username. The username can’t be completely removed if there is another active or disabled username.

Returns:



9002
9003
9004
9005
# File 'lib/tdlib/client_methods.rb', line 9002

def set_username(username:)
  broadcast('@type'    => 'setUsername',
            'username' => username)
end

#set_video_chat_default_participant(chat_id:, default_participant_id:) ⇒ TD::Types::Ok

Changes default participant identifier, on whose behalf a video chat in the chat will be joined.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • default_participant_id (TD::Types::MessageSender)

    Default group call participant identifier to join the video chats.

Returns:



9013
9014
9015
9016
9017
# File 'lib/tdlib/client_methods.rb', line 9013

def set_video_chat_default_participant(chat_id:, default_participant_id:)
  broadcast('@type'                  => 'setVideoChatDefaultParticipant',
            'chat_id'                => chat_id,
            'default_participant_id' => default_participant_id)
end

#share_chat_with_bot(chat_id:, message_id:, button_id:, shared_chat_id:, only_check:) ⇒ TD::Types::Ok

Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot.

Parameters:

  • chat_id (Integer)

    Identifier of the chat with the bot.

  • message_id (Integer)

    Identifier of the message with the button.

  • button_id (Integer)

    Identifier of the button.

  • shared_chat_id (Integer)

    Identifier of the shared chat.

  • only_check (Boolean)

    Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn’t check bot_is_member and bot_administrator_rights restrictions. If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights.

Returns:



9035
9036
9037
9038
9039
9040
9041
9042
# File 'lib/tdlib/client_methods.rb', line 9035

def share_chat_with_bot(chat_id:, message_id:, button_id:, shared_chat_id:, only_check:)
  broadcast('@type'          => 'shareChatWithBot',
            'chat_id'        => chat_id,
            'message_id'     => message_id,
            'button_id'      => button_id,
            'shared_chat_id' => shared_chat_id,
            'only_check'     => only_check)
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.

Parameters:

  • user_id (Integer)

    Identifier of the user with whom to share the phone number. The user must be a mutual contact.

Returns:



9050
9051
9052
9053
# File 'lib/tdlib/client_methods.rb', line 9050

def share_phone_number(user_id:)
  broadcast('@type'   => 'sharePhoneNumber',
            'user_id' => user_id)
end

#share_users_with_bot(chat_id:, message_id:, button_id:, shared_user_ids:, only_check:) ⇒ TD::Types::Ok

Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot.

Parameters:

  • chat_id (Integer)

    Identifier of the chat with the bot.

  • message_id (Integer)

    Identifier of the message with the button.

  • button_id (Integer)

    Identifier of the button.

  • shared_user_ids (Array<Integer>)

    Identifiers of the shared users.

  • only_check (Boolean)

    Pass true to check that the users can be shared by the button instead of actually sharing them.

Returns:



9064
9065
9066
9067
9068
9069
9070
9071
# File 'lib/tdlib/client_methods.rb', line 9064

def share_users_with_bot(chat_id:, message_id:, button_id:, shared_user_ids:, only_check:)
  broadcast('@type'           => 'shareUsersWithBot',
            'chat_id'         => chat_id,
            'message_id'      => message_id,
            'button_id'       => button_id,
            'shared_user_ids' => shared_user_ids,
            'only_check'      => only_check)
end

#start_group_call_recording(group_call_id:, title:, record_video:, use_portrait_orientation:) ⇒ TD::Types::Ok

Starts recording of an active group call. Requires groupCall.can_be_managed group call flag.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • title (TD::Types::String)

    Group call recording title; 0-64 characters.

  • record_video (Boolean)

    Pass true to record a video file instead of an audio file.

  • use_portrait_orientation (Boolean)

    Pass true to use portrait orientation for video instead of landscape one.

Returns:



9081
9082
9083
9084
9085
9086
9087
# File 'lib/tdlib/client_methods.rb', line 9081

def start_group_call_recording(group_call_id:, title:, record_video:, use_portrait_orientation:)
  broadcast('@type'                    => 'startGroupCallRecording',
            'group_call_id'            => group_call_id,
            'title'                    => title,
            'record_video'             => record_video,
            'use_portrait_orientation' => use_portrait_orientation)
end

#start_group_call_screen_sharing(group_call_id:, audio_source_id:, payload:) ⇒ TD::Types::Text

Starts screen sharing in a joined group call. Returns join response payload for tgcalls.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • audio_source_id (Integer)

    Screen sharing audio channel synchronization source identifier; received from tgcalls.

  • payload (TD::Types::String)

    Group call join payload; received from tgcalls.

Returns:



9097
9098
9099
9100
9101
9102
# File 'lib/tdlib/client_methods.rb', line 9097

def start_group_call_screen_sharing(group_call_id:, audio_source_id:, payload:)
  broadcast('@type'           => 'startGroupCallScreenSharing',
            'group_call_id'   => group_call_id,
            'audio_source_id' => audio_source_id,
            'payload'         => payload)
end

#start_scheduled_group_call(group_call_id:) ⇒ TD::Types::Ok

Starts a scheduled group call.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

Returns:



9108
9109
9110
9111
# File 'lib/tdlib/client_methods.rb', line 9108

def start_scheduled_group_call(group_call_id:)
  broadcast('@type'         => 'startScheduledGroupCall',
            'group_call_id' => group_call_id)
end

#stop_business_poll(business_connection_id:, chat_id:, message_id:, reply_markup:) ⇒ TD::Types::BusinessMessage

Stops a poll sent on behalf of a business account; for bots only.

Parameters:

  • business_connection_id (TD::Types::String)

    Unique identifier of business connection on behalf of which the message with the poll was sent.

  • chat_id (Integer)

    The chat the message belongs to.

  • message_id (Integer)

    Identifier of the message containing the poll.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none.

Returns:



9121
9122
9123
9124
9125
9126
9127
# File 'lib/tdlib/client_methods.rb', line 9121

def stop_business_poll(business_connection_id:, chat_id:, message_id:, reply_markup:)
  broadcast('@type'                  => 'stopBusinessPoll',
            'business_connection_id' => business_connection_id,
            'chat_id'                => chat_id,
            'message_id'             => message_id,
            'reply_markup'           => reply_markup)
end

#stop_poll(chat_id:, message_id:, reply_markup:) ⇒ TD::Types::Ok

Stops a poll.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the poll belongs.

  • message_id (Integer)

    Identifier of the message containing the poll. Use messageProperties.can_be_edited to check whether the poll can be stopped.

  • reply_markup (TD::Types::ReplyMarkup)

    The new message reply markup; pass null if none; for bots only.

Returns:



9136
9137
9138
9139
9140
9141
# File 'lib/tdlib/client_methods.rb', line 9136

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

#suggest_user_profile_photo(user_id:, photo:) ⇒ TD::Types::Ok

Suggests a profile photo to another regular user with common messages.

Parameters:

Returns:



9149
9150
9151
9152
9153
# File 'lib/tdlib/client_methods.rb', line 9149

def (user_id:, photo:)
  broadcast('@type'   => 'suggestUserProfilePhoto',
            'user_id' => user_id,
            'photo'   => photo)
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.

Parameters:

  • language_pack_id (TD::Types::String)

    Language pack identifier.

Returns:



9161
9162
9163
9164
# File 'lib/tdlib/client_methods.rb', line 9161

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.

Returns:



9169
9170
9171
# File 'lib/tdlib/client_methods.rb', line 9169

def terminate_all_other_sessions
  broadcast('@type' => 'terminateAllOtherSessions')
end

#terminate_session(session_id:) ⇒ TD::Types::Ok

Terminates a session of the current user.

Parameters:

  • session_id (Integer)

    Session identifier.

Returns:



9177
9178
9179
9180
# File 'lib/tdlib/client_methods.rb', line 9177

def terminate_session(session_id:)
  broadcast('@type'      => 'terminateSession',
            'session_id' => session_id)
end

#toggle_all_downloads_are_paused(are_paused:) ⇒ TD::Types::Ok

Changes pause state of all files in the file download list.

Parameters:

  • are_paused (Boolean)

    Pass true to pause all downloads; pass false to unpause them.

Returns:



9186
9187
9188
9189
# File 'lib/tdlib/client_methods.rb', line 9186

def toggle_all_downloads_are_paused(are_paused:)
  broadcast('@type'      => 'toggleAllDownloadsArePaused',
            'are_paused' => are_paused)
end

#toggle_bot_is_added_to_attachment_menu(bot_user_id:, is_added:, allow_write_access:) ⇒ TD::Types::Ok

Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true.

Parameters:

  • bot_user_id (Integer)

    Bot’s user identifier.

  • is_added (Boolean)

    Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu.

  • allow_write_access (Boolean)

    Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false.

Returns:



9200
9201
9202
9203
9204
9205
# File 'lib/tdlib/client_methods.rb', line 9200

def toggle_bot_is_added_to_attachment_menu(bot_user_id:, is_added:, allow_write_access:)
  broadcast('@type'              => 'toggleBotIsAddedToAttachmentMenu',
            'bot_user_id'        => bot_user_id,
            'is_added'           => is_added,
            'allow_write_access' => allow_write_access)
end

#toggle_bot_username_is_active(bot_user_id:, username:, is_active:) ⇒ TD::Types::Ok

Changes active state for a username of a bot. The editable username can’t be disabled. May return an error with a message “USERNAMES_ACTIVE_TOO_MUCH” if the maximum number of active usernames has been

reached.

Can be called only if userTypeBot.can_be_edited == true.

Parameters:

  • bot_user_id (Integer)

    Identifier of the target bot.

  • username (TD::Types::String)

    The username to change.

  • is_active (Boolean)

    Pass true to activate the username; pass false to disable it.

Returns:



9217
9218
9219
9220
9221
9222
# File 'lib/tdlib/client_methods.rb', line 9217

def toggle_bot_username_is_active(bot_user_id:, username:, is_active:)
  broadcast('@type'       => 'toggleBotUsernameIsActive',
            'bot_user_id' => bot_user_id,
            'username'    => username,
            'is_active'   => is_active)
end

#toggle_business_connected_bot_chat_is_paused(chat_id:, is_paused:) ⇒ TD::Types::Ok

Pauses or resumes the connected business bot in a specific chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • is_paused (Boolean)

    Pass true to pause the connected bot in the chat; pass false to resume the bot.

Returns:



9229
9230
9231
9232
9233
# File 'lib/tdlib/client_methods.rb', line 9229

def toggle_business_connected_bot_chat_is_paused(chat_id:, is_paused:)
  broadcast('@type'     => 'toggleBusinessConnectedBotChatIsPaused',
            'chat_id'   => chat_id,
            'is_paused' => is_paused)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • default_disable_notification (Boolean)

    New value of default_disable_notification.

Returns:



9240
9241
9242
9243
9244
# File 'lib/tdlib/client_methods.rb', line 9240

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_folder_tags(are_tags_enabled:) ⇒ TD::Types::Ok

Toggles whether chat folder tags are enabled.

Parameters:

  • are_tags_enabled (Boolean)

    Pass true to enable folder tags; pass false to disable them.

Returns:



9250
9251
9252
9253
# File 'lib/tdlib/client_methods.rb', line 9250

def toggle_chat_folder_tags(are_tags_enabled:)
  broadcast('@type'            => 'toggleChatFolderTags',
            'are_tags_enabled' => are_tags_enabled)
end

#toggle_chat_has_protected_content(chat_id:, has_protected_content:) ⇒ TD::Types::Ok

Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • has_protected_content (Boolean)

    New value of has_protected_content.

Returns:



9262
9263
9264
9265
9266
# File 'lib/tdlib/client_methods.rb', line 9262

def toggle_chat_has_protected_content(chat_id:, has_protected_content:)
  broadcast('@type'                 => 'toggleChatHasProtectedContent',
            'chat_id'               => chat_id,
            'has_protected_content' => has_protected_content)
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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • is_marked_as_unread (Boolean)

    New value of is_marked_as_unread.

Returns:



9273
9274
9275
9276
9277
# File 'lib/tdlib/client_methods.rb', line 9273

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_list:, chat_id:, is_pinned:) ⇒ TD::Types::Ok

Changes the pinned state of a chat. There can be up to getOption(“pinned_chat_count_max”)/getOption(“pinned_archived_chat_count_max”) pinned non-secret

chats and the same number of secret chats in the main/archive chat list.

The limit can be increased with Telegram Premium.

Parameters:

  • chat_list (TD::Types::ChatList)

    Chat list in which to change the pinned state of the chat.

  • chat_id (Integer)

    Chat identifier.

  • is_pinned (Boolean)

    Pass true to pin the chat; pass false to unpin it.

Returns:



9288
9289
9290
9291
9292
9293
# File 'lib/tdlib/client_methods.rb', line 9288

def toggle_chat_is_pinned(chat_list:, chat_id:, is_pinned:)
  broadcast('@type'     => 'toggleChatIsPinned',
            'chat_list' => chat_list,
            'chat_id'   => chat_id,
            'is_pinned' => is_pinned)
end

#toggle_chat_is_translatable(chat_id:, is_translatable:) ⇒ TD::Types::Ok

Changes the translatable state of a chat.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • is_translatable (Boolean)

    New value of is_translatable.

Returns:



9300
9301
9302
9303
9304
# File 'lib/tdlib/client_methods.rb', line 9300

def toggle_chat_is_translatable(chat_id:, is_translatable:)
  broadcast('@type'           => 'toggleChatIsTranslatable',
            'chat_id'         => chat_id,
            'is_translatable' => is_translatable)
end

#toggle_chat_view_as_topics(chat_id:, view_as_topics:) ⇒ TD::Types::Ok

Changes the view_as_topics setting of a forum chat or Saved Messages.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • view_as_topics (Boolean)

    New value of view_as_topics.

Returns:



9311
9312
9313
9314
9315
# File 'lib/tdlib/client_methods.rb', line 9311

def toggle_chat_view_as_topics(chat_id:, view_as_topics:)
  broadcast('@type'          => 'toggleChatViewAsTopics',
            'chat_id'        => chat_id,
            'view_as_topics' => view_as_topics)
end

#toggle_download_is_paused(file_id:, is_paused:) ⇒ TD::Types::Ok

Changes pause state of a file in the file download list.

Parameters:

  • file_id (Integer)

    Identifier of the downloaded file.

  • is_paused (Boolean)

    Pass true if the download is paused.

Returns:



9322
9323
9324
9325
9326
# File 'lib/tdlib/client_methods.rb', line 9322

def toggle_download_is_paused(file_id:, is_paused:)
  broadcast('@type'     => 'toggleDownloadIsPaused',
            'file_id'   => file_id,
            'is_paused' => is_paused)
end

#toggle_forum_topic_is_closed(chat_id:, message_thread_id:, is_closed:) ⇒ TD::Types::Ok

Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup

unless the user is creator of the topic.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

  • is_closed (Boolean)

    Pass true to close the topic; pass false to reopen it.

Returns:



9335
9336
9337
9338
9339
9340
# File 'lib/tdlib/client_methods.rb', line 9335

def toggle_forum_topic_is_closed(chat_id:, message_thread_id:, is_closed:)
  broadcast('@type'             => 'toggleForumTopicIsClosed',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id,
            'is_closed'         => is_closed)
end

#toggle_forum_topic_is_pinned(chat_id:, message_thread_id:, is_pinned:) ⇒ TD::Types::Ok

Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption(“pinned_forum_topic_count_max”) pinned forum topics.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_thread_id (Integer)

    Message thread identifier of the forum topic.

  • is_pinned (Boolean)

    Pass true to pin the topic; pass false to unpin it.

Returns:



9349
9350
9351
9352
9353
9354
# File 'lib/tdlib/client_methods.rb', line 9349

def toggle_forum_topic_is_pinned(chat_id:, message_thread_id:, is_pinned:)
  broadcast('@type'             => 'toggleForumTopicIsPinned',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id,
            'is_pinned'         => is_pinned)
end

#toggle_general_forum_topic_is_hidden(chat_id:, is_hidden:) ⇒ TD::Types::Ok

Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the

supergroup.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • is_hidden (Boolean)

    Pass true to hide and close the General topic; pass false to unhide it.

Returns:



9362
9363
9364
9365
9366
# File 'lib/tdlib/client_methods.rb', line 9362

def toggle_general_forum_topic_is_hidden(chat_id:, is_hidden:)
  broadcast('@type'     => 'toggleGeneralForumTopicIsHidden',
            'chat_id'   => chat_id,
            'is_hidden' => is_hidden)
end

#toggle_group_call_enabled_start_notification(group_call_id:, enabled_start_notification:) ⇒ TD::Types::Ok

Toggles whether the current user will receive a notification when the group call starts; scheduled group calls

only.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • enabled_start_notification (Boolean)

    New value of the enabled_start_notification setting.

Returns:



9374
9375
9376
9377
9378
# File 'lib/tdlib/client_methods.rb', line 9374

def toggle_group_call_enabled_start_notification(group_call_id:, enabled_start_notification:)
  broadcast('@type'                      => 'toggleGroupCallEnabledStartNotification',
            'group_call_id'              => group_call_id,
            'enabled_start_notification' => enabled_start_notification)
end

#toggle_group_call_is_my_video_enabled(group_call_id:, is_my_video_enabled:) ⇒ TD::Types::Ok

Toggles whether current user’s video is enabled.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • is_my_video_enabled (Boolean)

    Pass true if the current user’s video is enabled.

Returns:



9385
9386
9387
9388
9389
# File 'lib/tdlib/client_methods.rb', line 9385

def toggle_group_call_is_my_video_enabled(group_call_id:, is_my_video_enabled:)
  broadcast('@type'               => 'toggleGroupCallIsMyVideoEnabled',
            'group_call_id'       => group_call_id,
            'is_my_video_enabled' => is_my_video_enabled)
end

#toggle_group_call_is_my_video_paused(group_call_id:, is_my_video_paused:) ⇒ TD::Types::Ok

Toggles whether current user’s video is paused.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • is_my_video_paused (Boolean)

    Pass true if the current user’s video is paused.

Returns:



9396
9397
9398
9399
9400
# File 'lib/tdlib/client_methods.rb', line 9396

def toggle_group_call_is_my_video_paused(group_call_id:, is_my_video_paused:)
  broadcast('@type'              => 'toggleGroupCallIsMyVideoPaused',
            'group_call_id'      => group_call_id,
            'is_my_video_paused' => is_my_video_paused)
end

#toggle_group_call_mute_new_participants(group_call_id:, mute_new_participants:) ⇒ TD::Types::Ok

Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • mute_new_participants (Boolean)

    New value of the mute_new_participants setting.

Returns:



9408
9409
9410
9411
9412
# File 'lib/tdlib/client_methods.rb', line 9408

def toggle_group_call_mute_new_participants(group_call_id:, mute_new_participants:)
  broadcast('@type'                 => 'toggleGroupCallMuteNewParticipants',
            'group_call_id'         => group_call_id,
            'mute_new_participants' => mute_new_participants)
end

#toggle_group_call_participant_is_hand_raised(group_call_id:, participant_id:, is_hand_raised:) ⇒ TD::Types::Ok

Toggles whether a group call participant hand is rased.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • participant_id (TD::Types::MessageSender)

    Participant identifier.

  • is_hand_raised (Boolean)

    Pass true if the user’s hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other’s hand.

Returns:



9422
9423
9424
9425
9426
9427
# File 'lib/tdlib/client_methods.rb', line 9422

def toggle_group_call_participant_is_hand_raised(group_call_id:, participant_id:, is_hand_raised:)
  broadcast('@type'          => 'toggleGroupCallParticipantIsHandRaised',
            'group_call_id'  => group_call_id,
            'participant_id' => participant_id,
            'is_hand_raised' => is_hand_raised)
end

#toggle_group_call_participant_is_muted(group_call_id:, participant_id:, is_muted:) ⇒ TD::Types::Ok

Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • participant_id (TD::Types::MessageSender)

    Participant identifier.

  • is_muted (Boolean)

    Pass true to mute the user; pass false to unmute them.

Returns:



9435
9436
9437
9438
9439
9440
# File 'lib/tdlib/client_methods.rb', line 9435

def toggle_group_call_participant_is_muted(group_call_id:, participant_id:, is_muted:)
  broadcast('@type'          => 'toggleGroupCallParticipantIsMuted',
            'group_call_id'  => group_call_id,
            'participant_id' => participant_id,
            'is_muted'       => is_muted)
end

#toggle_group_call_screen_sharing_is_paused(group_call_id:, is_paused:) ⇒ TD::Types::Ok

Pauses or unpauses screen sharing in a joined group call.

Parameters:

  • group_call_id (Integer)

    Group call identifier.

  • is_paused (Boolean)

    Pass true to pause screen sharing; pass false to unpause it.

Returns:



9447
9448
9449
9450
9451
# File 'lib/tdlib/client_methods.rb', line 9447

def toggle_group_call_screen_sharing_is_paused(group_call_id:, is_paused:)
  broadcast('@type'         => 'toggleGroupCallScreenSharingIsPaused',
            'group_call_id' => group_call_id,
            'is_paused'     => is_paused)
end

#toggle_has_sponsored_messages_enabled(has_sponsored_messages_enabled:) ⇒ TD::Types::Ok

Toggles whether the current user has sponsored messages enabled. The setting has no effect for users without Telegram Premium for which sponsored messages are always enabled.

Parameters:

  • has_sponsored_messages_enabled (Boolean)

    Pass true to enable sponsored messages for the current user; false to disable them.

Returns:



9459
9460
9461
9462
# File 'lib/tdlib/client_methods.rb', line 9459

def toggle_has_sponsored_messages_enabled(has_sponsored_messages_enabled:)
  broadcast('@type'                          => 'toggleHasSponsoredMessagesEnabled',
            'has_sponsored_messages_enabled' => has_sponsored_messages_enabled)
end

#toggle_paid_message_reaction_is_anonymous(chat_id:, message_id:, is_anonymous:) ⇒ TD::Types::Ok

Changes whether the paid message reaction of the user to a message is anonymous. The message must have paid reaction added by the user.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • is_anonymous (Boolean)

    Pass true to make paid reaction of the user on the message anonymous; pass false to make the user’s profile visible among top reactors.

Returns:



9472
9473
9474
9475
9476
9477
# File 'lib/tdlib/client_methods.rb', line 9472

def toggle_paid_message_reaction_is_anonymous(chat_id:, message_id:, is_anonymous:)
  broadcast('@type'        => 'togglePaidMessageReactionIsAnonymous',
            'chat_id'      => chat_id,
            'message_id'   => message_id,
            'is_anonymous' => is_anonymous)
end

#toggle_saved_messages_topic_is_pinned(saved_messages_topic_id:, is_pinned:) ⇒ TD::Types::Ok

Changes the pinned state of a Saved Messages topic. There can be up to getOption(“pinned_saved_messages_topic_count_max”) pinned topics. The limit can be increased with Telegram Premium.

Parameters:

  • saved_messages_topic_id (Integer)

    Identifier of Saved Messages topic to pin or unpin.

  • is_pinned (Boolean)

    Pass true to pin the topic; pass false to unpin it.

Returns:



9486
9487
9488
9489
9490
# File 'lib/tdlib/client_methods.rb', line 9486

def toggle_saved_messages_topic_is_pinned(saved_messages_topic_id:, is_pinned:)
  broadcast('@type'                   => 'toggleSavedMessagesTopicIsPinned',
            'saved_messages_topic_id' => saved_messages_topic_id,
            'is_pinned'               => is_pinned)
end

#toggle_session_can_accept_calls(session_id:, can_accept_calls:) ⇒ TD::Types::Ok

Toggles whether a session can accept incoming calls.

Parameters:

  • session_id (Integer)

    Session identifier.

  • can_accept_calls (Boolean)

    Pass true to allow accepting incoming calls by the session; pass false otherwise.

Returns:



9497
9498
9499
9500
9501
# File 'lib/tdlib/client_methods.rb', line 9497

def toggle_session_can_accept_calls(session_id:, can_accept_calls:)
  broadcast('@type'            => 'toggleSessionCanAcceptCalls',
            'session_id'       => session_id,
            'can_accept_calls' => can_accept_calls)
end

#toggle_session_can_accept_secret_chats(session_id:, can_accept_secret_chats:) ⇒ TD::Types::Ok

Toggles whether a session can accept incoming secret chats.

Parameters:

  • session_id (Integer)

    Session identifier.

  • can_accept_secret_chats (Boolean)

    Pass true to allow accepting secret chats by the session; pass false otherwise.

Returns:



9509
9510
9511
9512
9513
# File 'lib/tdlib/client_methods.rb', line 9509

def toggle_session_can_accept_secret_chats(session_id:, can_accept_secret_chats:)
  broadcast('@type'                   => 'toggleSessionCanAcceptSecretChats',
            'session_id'              => session_id,
            'can_accept_secret_chats' => can_accept_secret_chats)
end

#toggle_story_is_posted_to_chat_page(story_sender_chat_id:, story_id:, is_posted_to_chat_page:) ⇒ TD::Types::Ok

Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_posted_to_chat_page == true.

Parameters:

  • story_sender_chat_id (Integer)

    Identifier of the chat that posted the story.

  • story_id (Integer)

    Identifier of the story.

  • is_posted_to_chat_page (Boolean)

    Pass true to make the story accessible after expiration; pass false to make it private.

Returns:



9523
9524
9525
9526
9527
9528
# File 'lib/tdlib/client_methods.rb', line 9523

def toggle_story_is_posted_to_chat_page(story_sender_chat_id:, story_id:, is_posted_to_chat_page:)
  broadcast('@type'                  => 'toggleStoryIsPostedToChatPage',
            'story_sender_chat_id'   => story_sender_chat_id,
            'story_id'               => story_id,
            'is_posted_to_chat_page' => is_posted_to_chat_page)
end

#toggle_supergroup_can_have_sponsored_messages(supergroup_id:, can_have_sponsored_messages:) ⇒ TD::Types::Ok

Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable

sponsored messages.

Parameters:

  • supergroup_id (Integer)

    The identifier of the channel.

  • can_have_sponsored_messages (Boolean)

    The new value of can_have_sponsored_messages.

Returns:



9537
9538
9539
9540
9541
# File 'lib/tdlib/client_methods.rb', line 9537

def toggle_supergroup_can_have_sponsored_messages(supergroup_id:, can_have_sponsored_messages:)
  broadcast('@type'                       => 'toggleSupergroupCanHaveSponsoredMessages',
            'supergroup_id'               => supergroup_id,
            'can_have_sponsored_messages' => can_have_sponsored_messages)
end

#toggle_supergroup_has_aggressive_anti_spam_enabled(supergroup_id:, has_aggressive_anti_spam_enabled:) ⇒ TD::Types::Ok

Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true.

Parameters:

  • supergroup_id (Integer)

    The identifier of the supergroup, which isn’t a broadcast group.

  • has_aggressive_anti_spam_enabled (Boolean)

    The new value of has_aggressive_anti_spam_enabled.

Returns:



9549
9550
9551
9552
9553
# File 'lib/tdlib/client_methods.rb', line 9549

def toggle_supergroup_has_aggressive_anti_spam_enabled(supergroup_id:, has_aggressive_anti_spam_enabled:)
  broadcast('@type'                            => 'toggleSupergroupHasAggressiveAntiSpamEnabled',
            'supergroup_id'                    => supergroup_id,
            'has_aggressive_anti_spam_enabled' => has_aggressive_anti_spam_enabled)
end

#toggle_supergroup_has_hidden_members(supergroup_id:, has_hidden_members:) ⇒ TD::Types::Ok

Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or

searchChatMembers.

Can be called only if supergroupFullInfo.can_hide_members == true.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

  • has_hidden_members (Boolean)

    New value of has_hidden_members.

Returns:



9562
9563
9564
9565
9566
# File 'lib/tdlib/client_methods.rb', line 9562

def toggle_supergroup_has_hidden_members(supergroup_id:, has_hidden_members:)
  broadcast('@type'              => 'toggleSupergroupHasHiddenMembers',
            'supergroup_id'      => supergroup_id,
            'has_hidden_members' => has_hidden_members)
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 member

right.

Parameters:

  • supergroup_id (Integer)

    The identifier of the supergroup.

  • is_all_history_available (Boolean)

    The new value of is_all_history_available.

Returns:



9574
9575
9576
9577
9578
# File 'lib/tdlib/client_methods.rb', line 9574

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_is_broadcast_group(supergroup_id:) ⇒ TD::Types::Ok

Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

Returns:



9584
9585
9586
9587
# File 'lib/tdlib/client_methods.rb', line 9584

def toggle_supergroup_is_broadcast_group(supergroup_id:)
  broadcast('@type'         => 'toggleSupergroupIsBroadcastGroup',
            'supergroup_id' => supergroup_id)
end

#toggle_supergroup_is_forum(supergroup_id:, is_forum:) ⇒ TD::Types::Ok

Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can’t be converted to forums.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup.

  • is_forum (Boolean)

    New value of is_forum.

Returns:



9595
9596
9597
9598
9599
# File 'lib/tdlib/client_methods.rb', line 9595

def toggle_supergroup_is_forum(supergroup_id:, is_forum:)
  broadcast('@type'         => 'toggleSupergroupIsForum',
            'supergroup_id' => supergroup_id,
            'is_forum'      => is_forum)
end

#toggle_supergroup_join_by_request(supergroup_id:, join_by_request:) ⇒ TD::Types::Ok

Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators;

requires can_restrict_members administrator right.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup that isn’t a broadcast group.

  • join_by_request (Boolean)

    New value of join_by_request.

Returns:



9607
9608
9609
9610
9611
# File 'lib/tdlib/client_methods.rb', line 9607

def toggle_supergroup_join_by_request(supergroup_id:, join_by_request:)
  broadcast('@type'           => 'toggleSupergroupJoinByRequest',
            'supergroup_id'   => supergroup_id,
            'join_by_request' => join_by_request)
end

#toggle_supergroup_join_to_send_messages(supergroup_id:, join_to_send_messages:) ⇒ TD::Types::Ok

Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members

administrator right.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup that isn’t a broadcast group.

  • join_to_send_messages (Boolean)

    New value of join_to_send_messages.

Returns:



9619
9620
9621
9622
9623
# File 'lib/tdlib/client_methods.rb', line 9619

def toggle_supergroup_join_to_send_messages(supergroup_id:, join_to_send_messages:)
  broadcast('@type'                 => 'toggleSupergroupJoinToSendMessages',
            'supergroup_id'         => supergroup_id,
            'join_to_send_messages' => join_to_send_messages)
end

#toggle_supergroup_sign_messages(supergroup_id:, sign_messages:, show_message_sender:) ⇒ TD::Types::Ok

Toggles whether sender signature or link to the account is added to sent messages in a channel; requires

can_change_info member right.

Parameters:

  • supergroup_id (Integer)

    Identifier of the channel.

  • sign_messages (Boolean)

    New value of sign_messages.

  • show_message_sender (Boolean)

    New value of show_message_sender.

Returns:



9632
9633
9634
9635
9636
9637
# File 'lib/tdlib/client_methods.rb', line 9632

def toggle_supergroup_sign_messages(supergroup_id:, sign_messages:, show_message_sender:)
  broadcast('@type'               => 'toggleSupergroupSignMessages',
            'supergroup_id'       => supergroup_id,
            'sign_messages'       => sign_messages,
            'show_message_sender' => show_message_sender)
end

#toggle_supergroup_username_is_active(supergroup_id:, username:, is_active:) ⇒ TD::Types::Ok

Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or

channel.

The editable username can’t be disabled. May return an error with a message “USERNAMES_ACTIVE_TOO_MUCH” if the maximum number of active usernames has been

reached.

Parameters:

  • supergroup_id (Integer)

    Identifier of the supergroup or channel.

  • username (TD::Types::String)

    The username to change.

  • is_active (Boolean)

    Pass true to activate the username; pass false to disable it.

Returns:



9649
9650
9651
9652
9653
9654
# File 'lib/tdlib/client_methods.rb', line 9649

def toggle_supergroup_username_is_active(supergroup_id:, username:, is_active:)
  broadcast('@type'         => 'toggleSupergroupUsernameIsActive',
            'supergroup_id' => supergroup_id,
            'username'      => username,
            'is_active'     => is_active)
end

#toggle_username_is_active(username:, is_active:) ⇒ TD::Types::Ok

Changes active state for a username of the current user. The editable username can’t be disabled. May return an error with a message “USERNAMES_ACTIVE_TOO_MUCH” if the maximum number of active usernames has been

reached.

Parameters:

  • username (TD::Types::String)

    The username to change.

  • is_active (Boolean)

    Pass true to activate the username; pass false to disable it.

Returns:



9664
9665
9666
9667
9668
# File 'lib/tdlib/client_methods.rb', line 9664

def toggle_username_is_active(username:, is_active:)
  broadcast('@type'     => 'toggleUsernameIsActive',
            'username'  => username,
            'is_active' => is_active)
end

#transfer_chat_ownership(chat_id:, user_id:, password:) ⇒ TD::Types::Ok

Changes the owner of a chat; requires owner privileges in 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.

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • user_id (Integer)

    Identifier of the user to which transfer the ownership. The ownership can’t be transferred to a bot or to a deleted user.

  • password (TD::Types::String)

    The 2-step verification password of the current user.

Returns:



9679
9680
9681
9682
9683
9684
# File 'lib/tdlib/client_methods.rb', line 9679

def transfer_chat_ownership(chat_id:, user_id:, password:)
  broadcast('@type'    => 'transferChatOwnership',
            'chat_id'  => chat_id,
            'user_id'  => user_id,
            'password' => password)
end

#translate_message_text(chat_id:, message_id:, to_language_code:) ⇒ TD::Types::FormattedText

Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to which the message belongs.

  • message_id (Integer)

    Identifier of the message.

  • to_language_code (TD::Types::String)

    Language code of the language to which the message is translated. Must be one of “af”, “sq”, “am”, “ar”, “hy”, “az”, “eu”, “be”, “bn”, “bs”, “bg”, “ca”, “ceb”, “zh-CN”, “zh”, “zh-Hans”, “zh-TW”, “zh-Hant”, “co”, “hr”, “cs”, “da”, “nl”, “en”, “eo”, “et”, “fi”, “fr”, “fy”, “gl”, “ka”, “de”, “el”, “gu”, “ht”, “ha”, “haw”, “he”, “iw”, “hi”, “hmn”, “hu”, “is”, “ig”, “id”, “in”, “ga”, “it”, “ja”, “jv”, “kn”, “kk”, “km”, “rw”, “ko”, “ku”, “ky”, “lo”, “la”, “lv”, “lt”, “lb”, “mk”, “mg”, “ms”, “ml”, “mt”, “mi”, “mr”, “mn”, “my”, “ne”, “no”, “ny”, “or”, “ps”, “fa”, “pl”, “pt”, “pa”, “ro”, “ru”, “sm”, “gd”, “sr”, “st”, “sn”, “sd”, “si”, “sk”, “sl”, “so”, “es”, “su”, “sw”, “sv”, “tl”, “tg”, “ta”, “tt”, “te”, “th”, “tr”, “tk”, “uk”, “ur”, “ug”, “uz”, “vi”, “cy”, “xh”, “yi”, “ji”, “yo”, “zu”.

Returns:



9700
9701
9702
9703
9704
9705
# File 'lib/tdlib/client_methods.rb', line 9700

def translate_message_text(chat_id:, message_id:, to_language_code:)
  broadcast('@type'            => 'translateMessageText',
            'chat_id'          => chat_id,
            'message_id'       => message_id,
            'to_language_code' => to_language_code)
end

#translate_text(text:, to_language_code:) ⇒ TD::Types::FormattedText

Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved.

Parameters:

  • text (TD::Types::FormattedText)

    Text to translate.

  • to_language_code (TD::Types::String)

    Language code of the language to which the message is translated. Must be one of “af”, “sq”, “am”, “ar”, “hy”, “az”, “eu”, “be”, “bn”, “bs”, “bg”, “ca”, “ceb”, “zh-CN”, “zh”, “zh-Hans”, “zh-TW”, “zh-Hant”, “co”, “hr”, “cs”, “da”, “nl”, “en”, “eo”, “et”, “fi”, “fr”, “fy”, “gl”, “ka”, “de”, “el”, “gu”, “ht”, “ha”, “haw”, “he”, “iw”, “hi”, “hmn”, “hu”, “is”, “ig”, “id”, “in”, “ga”, “it”, “ja”, “jv”, “kn”, “kk”, “km”, “rw”, “ko”, “ku”, “ky”, “lo”, “la”, “lv”, “lt”, “lb”, “mk”, “mg”, “ms”, “ml”, “mt”, “mi”, “mr”, “mn”, “my”, “ne”, “no”, “ny”, “or”, “ps”, “fa”, “pl”, “pt”, “pa”, “ro”, “ru”, “sm”, “gd”, “sr”, “st”, “sn”, “sd”, “si”, “sk”, “sl”, “so”, “es”, “su”, “sw”, “sv”, “tl”, “tg”, “ta”, “tt”, “te”, “th”, “tr”, “tk”, “uk”, “ur”, “ug”, “uz”, “vi”, “cy”, “xh”, “yi”, “ji”, “yo”, “zu”.

Returns:



9720
9721
9722
9723
9724
# File 'lib/tdlib/client_methods.rb', line 9720

def translate_text(text:, to_language_code:)
  broadcast('@type'            => 'translateText',
            'text'             => text,
            'to_language_code' => to_language_code)
end

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

Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or

supergroup, or can_edit_messages administrator right if the chat is a channel.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

Returns:



9731
9732
9733
9734
# File 'lib/tdlib/client_methods.rb', line 9731

def unpin_all_chat_messages(chat_id:)
  broadcast('@type'   => 'unpinAllChatMessages',
            'chat_id' => chat_id)
end

#unpin_all_message_thread_messages(chat_id:, message_thread_id:) ⇒ TD::Types::Ok

Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_thread_id (Integer)

    Message thread identifier in which messages will be unpinned.

Returns:



9741
9742
9743
9744
9745
# File 'lib/tdlib/client_methods.rb', line 9741

def unpin_all_message_thread_messages(chat_id:, message_thread_id:)
  broadcast('@type'             => 'unpinAllMessageThreadMessages',
            'chat_id'           => chat_id,
            'message_thread_id' => message_thread_id)
end

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

Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or

supergroup, or can_edit_messages administrator right if the chat is a channel.

Parameters:

  • chat_id (Integer)

    Identifier of the chat.

  • message_id (Integer)

    Identifier of the removed pinned message.

Returns:



9753
9754
9755
9756
9757
# File 'lib/tdlib/client_methods.rb', line 9753

def unpin_chat_message(chat_id:, message_id:)
  broadcast('@type'      => 'unpinChatMessage',
            'chat_id'    => chat_id,
            'message_id' => message_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 owner privileges.

Deactivates the original basic group.

Parameters:

  • chat_id (Integer)

    Identifier of the chat to upgrade.

Returns:



9765
9766
9767
9768
# File 'lib/tdlib/client_methods.rb', line 9765

def upgrade_basic_group_chat_to_supergroup_chat(chat_id:)
  broadcast('@type'   => 'upgradeBasicGroupChatToSupergroupChat',
            'chat_id' => chat_id)
end

#upload_sticker_file(user_id:, sticker_format:, sticker:) ⇒ TD::Types::File

Uploads a file with a sticker; returns the uploaded file.

Parameters:

Returns:



9778
9779
9780
9781
9782
9783
# File 'lib/tdlib/client_methods.rb', line 9778

def upload_sticker_file(user_id:, sticker_format:, sticker:)
  broadcast('@type'          => 'uploadStickerFile',
            'user_id'        => user_id,
            'sticker_format' => sticker_format,
            'sticker'        => sticker)
end

#validate_order_info(input_invoice:, order_info: nil, allow_save:) ⇒ TD::Types::ValidatedOrderInfo

Validates the order information provided by a user and returns the available shipping options for a flexible

invoice.

Parameters:

  • input_invoice (TD::Types::InputInvoice)

    The invoice.

  • order_info (TD::Types::OrderInfo, nil) (defaults to: nil)

    The order information, provided by the user; pass null if empty.

  • allow_save (Boolean)

    Pass true to save the order information.

Returns:



9792
9793
9794
9795
9796
9797
# File 'lib/tdlib/client_methods.rb', line 9792

def validate_order_info(input_invoice:, order_info: nil, allow_save:)
  broadcast('@type'         => 'validateOrderInfo',
            'input_invoice' => input_invoice,
            'order_info'    => order_info,
            'allow_save'    => allow_save)
end

#view_messages(chat_id:, message_ids:, source:, force_read:) ⇒ TD::Types::Ok

Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen

(excluding the button).

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).

Parameters:

  • chat_id (Integer)

    Chat identifier.

  • message_ids (Array<Integer>)

    The identifiers of the messages being viewed.

  • source (TD::Types::MessageSource)

    Source of the message view; pass null to guess the source based on chat open state.

  • force_read (Boolean)

    Pass true to mark as read the specified messages even the chat is closed.

Returns:



9811
9812
9813
9814
9815
9816
9817
# File 'lib/tdlib/client_methods.rb', line 9811

def view_messages(chat_id:, message_ids:, source:, force_read:)
  broadcast('@type'       => 'viewMessages',
            'chat_id'     => chat_id,
            'message_ids' => message_ids,
            'source'      => source,
            'force_read'  => force_read)
end

#view_premium_feature(feature:) ⇒ TD::Types::Ok

Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen.

Parameters:

Returns:



9823
9824
9825
9826
# File 'lib/tdlib/client_methods.rb', line 9823

def view_premium_feature(feature:)
  broadcast('@type'   => 'viewPremiumFeature',
            'feature' => feature)
end

Informs the server that some trending sticker sets have been viewed by the user.

Parameters:

  • sticker_set_ids (Array<Integer>)

    Identifiers of viewed trending sticker sets.

Returns:



9832
9833
9834
9835
# File 'lib/tdlib/client_methods.rb', line 9832

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 application has no direct access to TDLib’s file system, because it

is usually slower than a direct write to the destination file.

Parameters:

  • generation_id (Integer)

    The identifier of the generation process.

  • offset (Integer)

    The offset from which to write the data to the file.

  • data (String)

    The data to write.

Returns:



9845
9846
9847
9848
9849
9850
# File 'lib/tdlib/client_methods.rb', line 9845

def write_generated_file_part(generation_id:, offset:, data:)
  broadcast('@type'         => 'writeGeneratedFilePart',
            'generation_id' => generation_id,
            'offset'        => offset,
            'data'          => data)
end