Module functions

Source

Functions§

accept_call
Accepts an incoming call
accept_terms_of_service
Accepts Telegram terms of services
activate_story_stealth_mode
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
add_application_changelog
Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed
add_chat_folder_by_invite_link
Adds a chat folder by an invite link
add_chat_member
Adds a new member to a chat. Members can’t be added to private or secret chats
add_chat_members
Adds multiple new members to a chat. 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
add_chat_to_list
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
add_contact
Adds a user to the contact list or edits an existing contact by their user identifier
add_custom_server_language_pack
Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization
add_favorite_sticker
Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can’t be added to favorite stickers
add_file_to_downloads
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 from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file
add_local_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
add_log_message
Adds a message to TDLib internal log. Can be called synchronously
add_message_reaction
Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message
add_network_statistics
Adds the specified data to data usage statistics. Can be called before authorization
add_proxy
Adds a proxy server for network requests. Can be called before authorization
add_recent_sticker
Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can’t be added to recent stickers
add_recently_found_chat
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
add_saved_animation
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
add_saved_notification_sound
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
add_sticker_to_set
Adds a new sticker to a set; for bots only
allow_bot_to_send_messages
Allows the specified bot to send messages to the user
answer_callback_query
Sets the result of a callback query; for bots only
answer_custom_query
Answers a custom query; for bots only
answer_inline_query
Sets the result of an inline query; for bots only
answer_pre_checkout_query
Sets the result of a pre-checkout query; for bots only
answer_shipping_query
Sets the result of a shipping query; for bots only
answer_web_app_query
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
assign_app_store_transaction
Informs server about a purchase through App Store. For official applications only
assign_google_play_transaction
Informs server about a purchase through Google Play. For official applications only
ban_chat_member
Bans a member in a chat. Members can’t be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first
block_message_sender_from_replies
Blocks an original sender of a message in the Replies chat
boost_chat
Boosts a chat
can_boost_chat
Checks whether the current user can boost a chat
can_bot_send_messages
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
can_purchase_premium
Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase
can_send_story
Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats
can_transfer_ownership
Checks whether the current session can be used to transfer a chat ownership to another user
cancel_download_file
Stops the downloading of a file. If a file has already been downloaded, does nothing
cancel_password_reset
Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0
cancel_preliminary_upload_file
Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined
change_imported_contacts
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
change_phone_number
Changes the phone number of the user and sends an authentication code to the user’s new phone number; for official Android and iOS applications only. On success, returns information about the sent code
change_sticker_set
Installs/uninstalls or activates/archives a sticker set
check_authentication_bot_token
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
check_authentication_code
Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode
check_authentication_email_code
Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode
check_authentication_password
Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword
check_authentication_password_recovery_code
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
check_change_phone_number_code
Checks the authentication code sent to confirm a new phone number of the user
check_chat_folder_invite_link
Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder
check_chat_invite_link
Checks the validity of an invite link for a chat and returns information about the corresponding chat
check_chat_username
Checks whether a username can be set for a chat
check_created_public_chats_limit
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
check_email_address_verification_code
Checks the email address verification code for Telegram Passport
check_login_email_address_code
Checks the login email address authentication
check_password_recovery_code
Checks whether a 2-step verification password recovery code sent to an email address is valid
check_phone_number_confirmation_code
Checks phone number confirmation code
check_phone_number_verification_code
Checks the phone number verification code for Telegram Passport
check_recovery_email_address_code
Checks the 2-step verification recovery email address verification code
check_sticker_set_name
Checks whether a name can be used for a new sticker set
clean_file_name
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
clear_all_draft_messages
Clears message drafts in all chats
clear_autosave_settings_exceptions
Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings
clear_imported_contacts
Clears all imported contacts, contact list remains unchanged
clear_recent_emoji_statuses
Clears the list of recently used emoji statuses
clear_recent_reactions
Clears the list of recently used reactions
clear_recent_stickers
Clears the list of recently used stickers
clear_recently_found_chats
Clears the list of recently found chats
click_animated_emoji_message
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
click_chat_sponsored_message
Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message
click_premium_subscription_button
Informs TDLib that the user clicked Premium subscription button on the Premium features screen
close
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
close_chat
Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed
close_secret_chat
Closes a secret chat, effectively transferring its state to secretChatStateClosed
close_story
Informs TDLib that a story is closed by the user
close_web_app
Informs TDLib that a previously opened Web App was closed
confirm_qr_code_authentication
Confirms QR code authentication on another device. Returns created session on success
confirm_session
Confirms an unconfirmed session of the current user from another device
create_basic_group_chat
Returns an existing chat corresponding to a known basic group
create_call
Creates a new call
create_chat_folder
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
create_chat_folder_invite_link
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
create_chat_invite_link
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
create_forum_topic
Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
create_invoice_link
Creates a link for the given invoice; for bots only
create_new_basic_group_chat
Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
create_new_secret_chat
Creates a new secret chat. Returns the newly created chat
create_new_sticker_set
Creates a new sticker set. Returns the newly created sticker set
create_new_supergroup_chat
Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
create_private_chat
Returns an existing chat corresponding to a given user
create_secret_chat
Returns an existing chat corresponding to a known secret chat
create_supergroup_chat
Returns an existing chat corresponding to a known supergroup or channel
create_temporary_password
Creates a new temporary password for processing payments
create_video_chat
Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights
delete_account
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
delete_all_call_messages
Deletes all call messages
delete_all_revoked_chat_invite_links
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
delete_chat
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
delete_chat_folder
Deletes existing chat folder
delete_chat_folder_invite_link
Deletes an invite link for a chat folder
delete_chat_history
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
delete_chat_messages_by_date
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
delete_chat_messages_by_sender
Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges
delete_chat_reply_markup
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
delete_commands
Deletes commands supported by the bot for the given user scope and language; for bots only
delete_file
Deletes a file from the TDLib file cache
delete_forum_topic
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
delete_language_pack
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
delete_messages
Deletes messages
delete_passport_element
Deletes a Telegram Passport element
delete_profile_photo
Deletes a profile photo
delete_revoked_chat_invite_link
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
delete_saved_credentials
Deletes saved credentials for all payment provider bots
delete_saved_order_info
Deletes saved order information
delete_sticker_set
Deleted a sticker set; for bots only
delete_story
Deletes a previously sent story. Can be called only if story.can_be_deleted == true
destroy
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
disable_all_supergroup_usernames
Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
disable_proxy
Disables the currently enabled proxy. Can be called before authorization
discard_call
Discards a call
disconnect_all_websites
Disconnects all websites from the current user’s Telegram account
disconnect_website
Disconnects website from the current user’s Telegram account
download_file
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
edit_chat_folder
Edits existing chat folder. Returns information about the edited chat folder
edit_chat_folder_invite_link
Edits an invite link for a chat folder
edit_chat_invite_link
Edits a non-primary 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
edit_custom_language_pack_info
Edits information about a custom local language pack in the current localization target. Can be called before authorization
edit_forum_topic
Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic
edit_inline_message_caption
Edits the caption of an inline message sent via a bot; for bots only
edit_inline_message_live_location
Edits the content of a live location in an inline message sent via a bot; for bots only
edit_inline_message_media
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
edit_inline_message_reply_markup
Edits the reply markup of an inline message sent via a bot; for bots only
edit_inline_message_text
Edits the text of an inline text or game message sent via a bot; for bots only
edit_message_caption
Edits the message content caption. Returns the edited message after the edit is completed on the server side
edit_message_live_location
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
edit_message_media
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
edit_message_reply_markup
Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
edit_message_scheduling_state
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
edit_message_text
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
edit_proxy
Edits an existing proxy server for network requests. Can be called before authorization
edit_story
Changes content and caption of a story. Can be called only if story.can_be_edited == true
enable_proxy
Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization
end_group_call
Ends a group call. Requires groupCall.can_be_managed
end_group_call_recording
Ends recording of an active group call. Requires groupCall.can_be_managed group call flag
end_group_call_screen_sharing
Ends screen sharing in a joined group call
finish_file_generation
Finishes the file generation
forward_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
get_account_ttl
Returns the period of inactivity after which the account of the current user will automatically be deleted
get_active_live_location_messages
Returns all active live locations that need to be updated by the application. The list is persistent across application restarts only if the message database is used
get_active_sessions
Returns all active sessions of the current user
get_all_passport_elements
Returns all available Telegram Passport elements
get_all_sticker_emojis
Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id)
get_animated_emoji
Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji
get_application_config
Returns application config, provided by the server. Can be called before authorization
get_application_download_link
Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram
get_archive_chat_list_settings
Returns settings for automatic moving of chats to and from the Archive chat lists
get_archived_sticker_sets
Returns a list of archived sticker sets
get_attached_sticker_sets
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
get_attachment_menu_bot
Returns information about a bot that can be added to attachment or side menu
get_authorization_state
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
get_auto_download_settings_presets
Returns auto-download settings presets for the current user
get_autosave_settings
Returns autosave settings for the current user
get_background_url
Constructs a persistent HTTP URL for a background
get_backgrounds
Returns backgrounds installed by the user
get_bank_card_info
Returns information about a bank card
get_basic_group
Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot
get_basic_group_full_info
Returns full information about a basic group by its identifier
get_blocked_message_senders
Returns users and chats that were blocked by the current user
get_bot_info_description
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
get_bot_info_short_description
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
get_bot_name
Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true
get_callback_query_answer
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
get_callback_query_message
Returns information about a message with the callback button that originated a callback query; for bots only
get_chat
Returns information about a chat by its identifier; this is an offline request if the current user is not a bot
get_chat_active_stories
Returns the list of active stories posted by the given chat
get_chat_administrators
Returns a list of administrators of the chat with their custom titles
get_chat_archived_stories
Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib
get_chat_available_message_senders
Returns list of message sender identifiers, which can be used to send messages in a chat
get_chat_boost_link
Returns an HTTPS link to boost the specified channel chat
get_chat_boost_link_info
Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost
get_chat_boost_status
Returns the current boost status for a channel chat
get_chat_boosts
Returns list of boosts applied to a chat. The user must be an administrator in the channel chat to get the list of boosts
get_chat_event_log
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)
get_chat_folder
Returns information about a chat folder by its identifier
get_chat_folder_chat_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
get_chat_folder_chats_to_leave
Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted
get_chat_folder_default_icon_name
Returns default icon name for a folder. Can be called synchronously
get_chat_folder_invite_links
Returns invite links created by the current user for a shareable chat folder
get_chat_folder_new_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
get_chat_history
Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true
get_chat_invite_link
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
get_chat_invite_link_counts
Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat
get_chat_invite_link_members
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
get_chat_invite_links
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
get_chat_join_requests
Returns pending join requests in a chat
get_chat_lists_to_add_chat
Returns chat lists to which the chat can be added. This is an offline request
get_chat_member
Returns information about a single member of a chat
get_chat_message_by_date
Returns the last message sent in a chat no later than the specified date
get_chat_message_calendar
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”
get_chat_message_count
Returns approximate number of messages of the specified type in the chat
get_chat_message_position
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
get_chat_notification_settings_exceptions
Returns list of chats with non-default notification settings for new messages
get_chat_pinned_message
Returns information about a newest pinned message in the chat
get_chat_pinned_stories
Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib
get_chat_scheduled_messages
Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
get_chat_sparse_message_positions
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
get_chat_sponsored_messages
Returns sponsored messages to be shown in a chat; for channel chats only
get_chat_statistics
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
get_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
get_chats_for_chat_folder_invite_link
Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link
get_chats_to_send_stories
Returns 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
get_close_friends
Returns all close friends of the current user
get_commands
Returns list of commands supported by the bot for the given user scope and language; for bots only
get_connected_websites
Returns all website where the current user used Telegram to log in
get_contacts
Returns all contacts of the user
get_countries
Returns information about existing countries. Can be called before authorization
get_country_code
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
get_created_public_chats
Returns a list of public chats of the specified type, owned by the user
get_current_state
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
get_custom_emoji_reaction_animations
Returns TGS stickers with generic animations for custom emoji reactions
get_custom_emoji_stickers
Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned
get_database_statistics
Returns database statistics
get_deep_link_info
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
get_default_chat_photo_custom_emoji_stickers
Returns default list of custom emoji stickers for placing on a chat photo
get_default_emoji_statuses
Returns default emoji statuses
get_default_message_auto_delete_time
Returns default message auto-delete time setting for new chats
get_default_profile_photo_custom_emoji_stickers
Returns default list of custom emoji stickers for placing on a profile photo
get_emoji_categories
Returns available emojis categories
get_emoji_reaction
Returns information about a emoji reaction. Returns a 404 error if the reaction is not found
get_emoji_suggestions_url
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
get_external_link
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
get_external_link_info
Returns information about an action to be done when the current user clicks an external link. Don’t use this method for links from secret chats if web page preview is disabled in secret chats
get_favorite_stickers
Returns favorite stickers
get_file
Returns information about a file; this is an offline request
get_file_downloaded_prefix_size
Returns file downloaded prefix size from a given offset, in bytes
get_file_extension
Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously
get_file_mime_type
Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously
get_forum_topic
Returns information about a forum topic
get_forum_topic_default_icons
Returns list of custom emojis, which can be used as forum topic icon by all users
get_forum_topic_link
Returns an HTTPS link to a topic in a forum chat. This is an offline request
get_forum_topics
Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server
get_game_high_scores
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
get_group_call
Returns information about a group call
get_group_call_invite_link
Returns invite link to a video chat in a public chat
get_group_call_stream_segment
Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video
get_group_call_streams
Returns information about available group call streams
get_groups_in_common
Returns a list of common group chats with a given user. Chats are sorted by their type and creation date
get_imported_contact_count
Returns the total number of imported contacts
get_inactive_supergroup_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
get_inline_game_high_scores
Returns game high scores and some part of the high score table in the range of the specified user; for bots only
get_inline_query_results
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
get_installed_sticker_sets
Returns a list of installed sticker sets
get_internal_link
Returns an HTTPS or a tg: link with the given type. Can be called before authorization
get_internal_link_type
Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization
get_json_string
Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously
get_json_value
Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously
get_language_pack_info
Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization
get_language_pack_string
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
get_language_pack_strings
Returns strings from a language pack in the current localization target by their keys. Can be called before authorization
get_localization_target_info
Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization
get_log_stream
Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
get_log_tag_verbosity_level
Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously
get_log_tags
Returns list of available TDLib internal log tags, for example, [“actor”, “binlog”, “connections”, “notifications”, “proxy”]. Can be called synchronously
get_log_verbosity_level
Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
get_login_url
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
get_login_url_info
Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button
get_map_thumbnail_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
get_markdown_text
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
get_me
Returns the current user
get_menu_button
Returns menu button set by the bot for the given user; for bots only
get_message
Returns information about a message
get_message_added_reactions
Returns reactions added for a message, along with their sender
get_message_available_reactions
Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
get_message_embedding_code
Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username
get_message_file_type
Returns information about a file with messages exported from another application
get_message_import_confirmation_text
Returns a confirmation text to be shown to the user before starting message import
get_message_link
Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request
get_message_link_info
Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage
get_message_locally
Returns information about a message, if it is available without sending network request. This is an offline request
get_message_public_forwards
Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib
get_message_statistics
Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true
get_message_thread
Returns information about a message thread. Can be used only if message.can_get_message_thread == true
get_message_thread_history
Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel’s linked supergroup. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
get_message_viewers
Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true
get_messages
Returns information about messages. If a message is not found, returns null on the corresponding position of the result
get_network_statistics
Returns network data usage statistics. Can be called before authorization
get_option
Returns the value of an option by its name. (Check the list of available options on https:core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options “version” and “commit_hash”
get_passport_authorization_form
Returns a Telegram Passport authorization form for sharing data with a service
get_passport_authorization_form_available_elements
Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form
get_passport_element
Returns one of the available Telegram Passport elements
get_password_state
Returns the current state of 2-step verification
get_payment_form
Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy
get_payment_receipt
Returns information about a successful payment
get_phone_number_info
Returns information about a phone number by its prefix. Can be called before authorization
get_phone_number_info_sync
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
get_poll_voters
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
get_preferred_country_language
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
get_premium_features
Returns information about features, available to Premium users
get_premium_limit
Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown
get_premium_state
Returns state of Telegram Premium subscription and promotion videos for Premium features
get_premium_sticker_examples
Returns examples of premium stickers for demonstration purposes
get_premium_stickers
Returns premium stickers from regular sticker sets
get_proxies
Returns list of proxies that are currently set up. Can be called before authorization
get_proxy_link
Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization
get_push_receiver_id
Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously
get_recent_emoji_statuses
Returns recent emoji statuses
get_recent_inline_bots
Returns up to 20 recently used inline bots in the order of their last usage
get_recent_stickers
Returns a list of recently used stickers
get_recently_opened_chats
Returns recently opened chats; this is an offline request. Returns chats in the order of last opening
get_recently_visited_t_me_urls
Returns t.me URLs recently visited by a newly registered user
get_recommended_chat_folders
Returns recommended chat folders for the current user
get_recovery_email_address
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
get_remote_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
get_replied_message
Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively
get_saved_animations
Returns saved animations
get_saved_notification_sound
Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier
get_saved_notification_sounds
Returns list of saved notification sounds. If a sound isn’t in the list, then default sound needs to be used
get_saved_order_info
Returns saved order information. Returns a 404 error if there is no saved order information
get_scope_notification_settings
Returns the notification settings for chats of a given type
get_secret_chat
Returns information about a secret chat by its identifier. This is an offline request
get_statistical_graph
Loads an asynchronous or a zoomed in statistical graph
get_sticker_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
get_sticker_set
Returns information about a sticker set by its identifier
get_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
get_storage_statistics
Returns storage usage statistics. Can be called before authorization
get_storage_statistics_fast
Quickly returns approximate storage usage statistics. Can be called before authorization
get_story
Returns a story
get_story_available_reactions
Returns reactions, which can be chosen for a story
get_story_notification_settings_exceptions
Returns list of chats with non-default notification settings for stories
get_story_viewers
Returns viewers of a story. The method can be called only for stories posted on behalf of the current user
get_suggested_file_name
Returns suggested name for saving a file in a given directory
get_suggested_sticker_set_name
Returns a suggested name for a new sticker set with a given title
get_suitable_discussion_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
get_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
get_supergroup_full_info
Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute
get_supergroup_members
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
get_support_name
Returns localized name of the Telegram support user; for Telegram support only
get_support_user
Returns a user that can be contacted to get support
get_temporary_password_state
Returns information about the current temporary password
get_text_entities
Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously
get_theme_parameters_json_string
Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously
get_themed_emoji_statuses
Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list
get_top_chats
Returns a list of frequently used chats
get_trending_sticker_sets
Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib
get_user
Returns information about a user by their identifier. This is an offline request if the current user is not a bot
get_user_full_info
Returns full information about a user by their identifier
get_user_link
Returns an HTTPS link, which can be used to get information about the current user
get_user_privacy_setting_rules
Returns the current privacy settings
get_user_profile_photos
Returns the profile photos of a user. Personal and public photo aren’t returned
get_user_support_info
Returns support information for the given user; for Telegram support only
get_video_chat_available_participants
Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined
get_video_chat_rtmp_url
Returns RTMP URL for streaming to the chat; requires creator privileges
get_web_app_link_url
Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked
get_web_app_url
Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link
get_web_page_instant_view
Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page
get_web_page_preview
Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview
hide_suggested_action
Hides a suggested action
import_contacts
Adds new contacts or edits existing contacts by their phone numbers; contacts’ user identifiers are ignored
import_messages
Imports messages exported from another app
invite_group_call_participants
Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats
join_chat
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
join_chat_by_invite_link
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
join_group_call
Joins an active group call. Returns join response payload for tgcalls
leave_chat
Removes the current user from chat members. Private and secret chats can’t be left using this method
leave_group_call
Leaves a group call
load_active_stories
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
load_chats
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
load_group_call_participants
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
log_out
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
open_chat
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)
open_message_content
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
open_story
Informs TDLib that a story is opened and is being viewed by the user
open_web_app
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
optimize_storage
Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can’t be deleted
parse_markdown
Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
parse_text_entities
Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously
pin_chat_message
Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel
ping_proxy
Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization
preliminary_upload_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. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message
process_chat_folder_new_chats
Process new chats added to a shareable chat folder by its owner
process_chat_join_request
Handles a pending join request in a chat
process_chat_join_requests
Handles all pending join requests for a given link in a chat
process_push_notification
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
rate_speech_recognition
Rates recognized speech in a video note or a voice note message
read_all_chat_mentions
Marks all mentions in a chat as read
read_all_chat_reactions
Marks all reactions in a chat or a forum topic as read
read_all_message_thread_mentions
Marks all mentions in a forum topic as read
read_all_message_thread_reactions
Marks all reactions in a forum topic as read
read_chat_list
Traverse all chats in a chat list and marks all messages in the chats as read
read_file_part
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
recognize_speech
Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message “MSG_VOICE_TOO_LONG” if media duration is too big to be recognized
recover_authentication_password
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
recover_password
Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up
register_device
Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription
register_user
Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration
remove_all_files_from_downloads
Removes all files from the file download list
remove_background
Removes background from the list of installed backgrounds
remove_chat_action_bar
Removes a chat action bar without any other action
remove_contacts
Removes users from the contact list
remove_favorite_sticker
Removes a sticker from the list of favorite stickers
remove_file_from_downloads
Removes a file from the file download list
remove_message_reaction
Removes a reaction from a message. A chosen reaction can always be removed
remove_notification
Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user
remove_notification_group
Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user
remove_proxy
Removes a proxy server. Can be called before authorization
remove_recent_hashtag
Removes a hashtag from the list of recently used hashtags
remove_recent_sticker
Removes a sticker from the list of recently used stickers
remove_recently_found_chat
Removes a chat from the list of recently found chats
remove_saved_animation
Removes an animation from the list of saved animations
remove_saved_notification_sound
Removes a notification sound from the list of saved notification sounds
remove_sticker_from_set
Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot
remove_top_chat
Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled
reorder_active_usernames
Changes order of active usernames of the current user
reorder_bot_active_usernames
Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true
reorder_chat_folders
Changes the order of chat folders
reorder_installed_sticker_sets
Changes the order of installed sticker sets
reorder_supergroup_active_usernames
Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
replace_primary_chat_invite_link
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
replace_video_chat_rtmp_url
Replaces the current RTMP URL for streaming to the chat; requires creator privileges
report_chat
Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported
report_chat_photo
Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported
report_message_reactions
Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions
report_story
Reports a story to the Telegram moderators
report_supergroup_anti_spam_false_positive
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
report_supergroup_spam
Reports messages in a supergroup as spam; requires administrator rights in the supergroup
request_authentication_password_recovery
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
request_password_recovery
Requests to send a 2-step verification password recovery code to an email address that was previously set up
request_qr_code_authentication
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
resend_authentication_code
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
resend_change_phone_number_code
Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed
resend_email_address_verification_code
Resends the code to verify an email address to be added to a user’s Telegram Passport
resend_login_email_address_code
Resends the login email address verification code
resend_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
resend_phone_number_confirmation_code
Resends phone number confirmation code
resend_phone_number_verification_code
Resends the code to verify a phone number to be added to a user’s Telegram Passport
resend_recovery_email_address_code
Resends the 2-step verification recovery email address verification code
reset_all_notification_settings
Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown
reset_authentication_email_address
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
reset_backgrounds
Resets list of installed backgrounds to its default value
reset_network_statistics
Resets all network data usage statistics to zero. Can be called before authorization
reset_password
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
revoke_chat_invite_link
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
revoke_group_call_invite_link
Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag
save_application_log_event
Saves application log event on the server. Can be called before authorization
search_background
Searches for a background by its name
search_call_messages
Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
search_chat_members
Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels
search_chat_messages
Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages 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
search_chat_recent_location_messages
Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user
search_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
search_chats_nearby
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
search_chats_on_server
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
search_contacts
Searches for the specified query in the first names, last names and usernames of the known user contacts
search_emojis
Searches for emojis by keywords. Supported only if the file database is enabled
search_file_downloads
Searches for files in the file download list or recently downloaded files from the list
search_hashtags
Searches for recently used hashtags by their prefix
search_installed_sticker_sets
Searches for installed sticker sets by looking for specified query in their title and name
search_messages
Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
search_outgoing_document_messages
Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order
search_public_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
search_public_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
search_recently_found_chats
Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request
search_secret_messages
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
search_sticker_set
Searches for a sticker set by its name
search_sticker_sets
Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results
search_stickers
Searches for stickers from public sticker sets that correspond to any of the given emoji
search_strings_by_prefix
Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously
search_user_by_phone_number
Searches a user by their phone number. Returns a 404 error if the user can’t be found
search_user_by_token
Searches a user by a token from the user’s link
search_web_app
Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found
send_authentication_firebase_sms
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
send_bot_start_message
Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can’t be invited to a private chat other than the chat with the bot. Bots can’t be invited to channels (although they can be added as admins) and secret chats. Returns the sent message
send_call_debug_information
Sends debug information for a call to Telegram servers
send_call_log
Sends log file for a call to Telegram servers
send_call_rating
Sends a call rating
send_call_signaling_data
Sends call signaling data
send_chat_action
Sends a notification about user activity in a chat
send_custom_request
Sends a custom request; for bots only
send_email_address_verification_code
Sends a code to verify an email address to be added to a user’s Telegram Passport
send_inline_query_result_message
Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
send_message
Sends a message. Returns the sent message
send_message_album
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
send_passport_authorization_form
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
send_payment_form
Sends a filled-out payment form to the bot for final verification
send_phone_number_confirmation_code
Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation
send_phone_number_verification_code
Sends a code to verify a phone number to be added to a user’s Telegram Passport
send_story
Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story
send_web_app_custom_request
Sends a custom request from a Web App
send_web_app_data
Sends data received from a keyboardButtonTypeWebApp Web App to a bot
set_account_ttl
Changes the period of inactivity after which the account of the current user will automatically be deleted
set_alarm
Succeeds after a specified amount of time has passed. Can be called before initialization
set_archive_chat_list_settings
Changes settings for automatic moving of chats to and from the Archive chat lists
set_authentication_email_address
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
set_authentication_phone_number
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
set_auto_download_settings
Sets auto-download settings
set_autosave_settings
Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings
set_background
Changes the background selected by the user; adds background to the list of installed backgrounds
set_bio
Changes the bio of the current user
set_bot_info_description
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
set_bot_info_short_description
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
set_bot_name
Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true
set_bot_profile_photo
Changes a profile photo for a bot
set_bot_updates_status
Informs the server about the number of pending bot updates if they haven’t been processed for a long time; for bots only
set_chat_active_stories_list
Changes story list in which stories from the chat are shown
set_chat_available_reactions
Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right
set_chat_background
Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users
set_chat_client_data
Changes application-specific data associated with a chat
set_chat_description
Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right
set_chat_discussion_group
Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified
set_chat_draft_message
Changes the draft message in a chat
set_chat_location
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
set_chat_member_status
Changes the status of a chat member, needs appropriate privileges. 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
set_chat_message_auto_delete_time
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).
set_chat_message_sender
Selects a message sender to send messages in a chat
set_chat_notification_settings
Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can’t be changed
set_chat_permissions
Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right
set_chat_photo
Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
set_chat_slow_mode_delay
Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights
set_chat_theme
Changes the chat theme. Supported only in private and secret chats
set_chat_title
Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
set_close_friends
Changes the list of close friends of the current user
set_commands
Sets the list of commands supported by the bot for the given user scope and language; for bots only
set_custom_emoji_sticker_set_thumbnail
Sets a custom emoji sticker set thumbnail; for bots only
set_custom_language_pack
Adds or changes a custom local language pack to the current localization target
set_custom_language_pack_string
Adds, edits or deletes a string in a custom local language pack. Can be called before authorization
set_database_encryption_key
Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain
set_default_channel_administrator_rights
Sets default administrator rights for adding the bot to channel chats; for bots only
set_default_group_administrator_rights
Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only
set_default_message_auto_delete_time
Changes the default message auto-delete time for new chats
set_default_reaction_type
Changes type of default reaction for the current user
set_emoji_status
Changes the emoji status of the current user; for Telegram Premium users only
set_file_generation_progress
Informs TDLib on a file generation progress
set_forum_topic_notification_settings
Changes the notification settings of a forum topic
set_game_score
Updates the game score of the specified user in the game; for bots only
set_group_call_participant_is_speaking
Informs TDLib that speaking state of a participant of an active group has changed
set_group_call_participant_volume_level
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
set_group_call_title
Sets group call title. Requires groupCall.can_be_managed group call flag
set_inactive_session_ttl
Changes the period of inactivity after which sessions will automatically be terminated
set_inline_game_score
Updates the game score of the specified user in a game; for bots only
set_location
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
set_log_stream
Sets new log stream for internal logging of TDLib. Can be called synchronously
set_log_tag_verbosity_level
Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously
set_log_verbosity_level
Sets the verbosity level of the internal logging of TDLib. Can be called synchronously
set_login_email_address
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.login_email_address_pattern 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 a email address, call checkLoginEmailAddressCode directly
set_menu_button
Sets menu button for the given user or for all users; for bots only
set_message_sender_block_list
Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked
set_name
Changes the first and last name of the current user
set_network_type
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
set_option
Sets the value of an option. (Check the list of available options on https:core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization
set_passport_element
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
set_passport_element_errors
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
set_password
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
set_pinned_chats
Changes the order of pinned chats
set_pinned_forum_topics
Changes the order of pinned forum topics
set_poll_answer
Changes the user answer to a poll. A poll in quiz mode can be answered only once
set_profile_photo
Changes a profile photo for the current user
set_recovery_email_address
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
set_scope_notification_settings
Changes notification settings for chats of a given type
set_sticker_emojis
Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot
set_sticker_keywords
Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot
set_sticker_mask_position
Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot
set_sticker_position_in_set
Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
set_sticker_set_thumbnail
Sets a sticker set thumbnail; for bots only
set_sticker_set_title
Sets a sticker set title; for bots only
set_story_privacy_settings
Changes privacy settings of a story. Can be called only if story.can_be_edited == true
set_story_reaction
Changes chosen reaction on a story
set_supergroup_sticker_set
Changes the sticker set of a supergroup; requires can_change_info administrator right
set_supergroup_username
Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel
set_tdlib_parameters
Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
set_user_personal_profile_photo
Changes a personal profile photo of a contact user
set_user_privacy_setting_rules
Changes user privacy settings
set_user_support_info
Sets support information for the given user; for Telegram support only
set_username
Changes the editable username of the current user
set_video_chat_default_participant
Changes default participant identifier, on whose behalf a video chat in the chat will be joined
share_chat_with_bot
Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot
share_phone_number
Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber
share_user_with_bot
Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot
start_group_call_recording
Starts recording of an active group call. Requires groupCall.can_be_managed group call flag
start_group_call_screen_sharing
Starts screen sharing in a joined group call. Returns join response payload for tgcalls
start_scheduled_group_call
Starts a scheduled group call
stop_poll
Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set
suggest_user_profile_photo
Suggests a profile photo to another regular user with common messages
synchronize_language_pack
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
terminate_all_other_sessions
Terminates all other sessions of the current user
terminate_session
Terminates a session of the current user
test_call_bytes
Returns the received bytes; for testing only. This is an offline method. Can be called before authorization
test_call_empty
Does nothing; for testing only. This is an offline method. Can be called before authorization
test_call_string
Returns the received string; for testing only. This is an offline method. Can be called before authorization
test_call_vector_int
Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization
test_call_vector_int_object
Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization
test_call_vector_string
Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization
test_call_vector_string_object
Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization
test_get_difference
Forces an updates.getDifference call to the Telegram servers; for testing only
test_network
Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization
test_proxy
Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization
test_return_error
Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously
test_square_int
Returns the squared received number; for testing only. This is an offline method. Can be called before authorization
test_use_update
Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
toggle_all_downloads_are_paused
Changes pause state of all files in the file download list
toggle_bot_is_added_to_attachment_menu
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
toggle_bot_username_is_active
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
toggle_chat_default_disable_notification
Changes the value of the default disable_notification parameter, used when a message is sent to a chat
toggle_chat_has_protected_content
Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
toggle_chat_is_marked_as_unread
Changes the marked as unread state of a chat
toggle_chat_is_pinned
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
toggle_chat_is_translatable
Changes the translatable state of a chat; for Telegram Premium users only
toggle_download_is_paused
Changes pause state of a file in the file download list
toggle_forum_topic_is_closed
Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic
toggle_forum_topic_is_pinned
Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption(“pinned_forum_topic_count_max”) pinned forum topics
toggle_general_forum_topic_is_hidden
Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup
toggle_group_call_enabled_start_notification
Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only
toggle_group_call_is_my_video_enabled
Toggles whether current user’s video is enabled
toggle_group_call_is_my_video_paused
Toggles whether current user’s video is paused
toggle_group_call_mute_new_participants
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
toggle_group_call_participant_is_hand_raised
Toggles whether a group call participant hand is rased
toggle_group_call_participant_is_muted
Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves
toggle_group_call_screen_sharing_is_paused
Pauses or unpauses screen sharing in a joined group call
toggle_session_can_accept_calls
Toggles whether a session can accept incoming calls
toggle_session_can_accept_secret_chats
Toggles whether a session can accept incoming secret chats
toggle_story_is_pinned
Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true
toggle_supergroup_has_aggressive_anti_spam_enabled
Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true
toggle_supergroup_has_hidden_members
Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true
toggle_supergroup_is_all_history_available
Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right
toggle_supergroup_is_broadcast_group
Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup
toggle_supergroup_is_forum
Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can’t be converted to forums
toggle_supergroup_join_by_request
Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right
toggle_supergroup_join_to_send_messages
Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right
toggle_supergroup_sign_messages
Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right
toggle_supergroup_username_is_active
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
toggle_username_is_active
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
transfer_chat_ownership
Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
translate_message_text
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
translate_text
Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved
unpin_all_chat_messages
Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
unpin_all_message_thread_messages
Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup
unpin_chat_message
Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
upgrade_basic_group_chat_to_supergroup_chat
Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group
upload_sticker_file
Uploads a file with a sticker; returns the uploaded file
validate_order_info
Validates the order information provided by a user and returns the available shipping options for a flexible invoice
view_messages
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)
view_premium_feature
Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen
view_trending_sticker_sets
Informs the server that some trending sticker sets have been viewed by the user
write_generated_file_part
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