Accepts an on-chain gift purchase offer received by the current user; can
be used only if getOption("can_use_ton_wallet"). The gift must not be
listed for sale. Other offers for the gift will be canceled after the gift
is sold. Returns the transaction that must be sent from the TON wallet of
the current user to accept the offer. The offer is accepted only after the
transaction is executed on the TON blockchain and the gift is transferred
to the buyer
Returns GiftOnChainPurchaseOfferTransaction
Accepts an OAuth authorization request. Returns an HTTP URL to open after
successful authorization. May return an empty link if just a toast about
successful login has to be shown
Returns HttpUrl
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 Ok
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
Returns BotMediaPreview
Adds a secondary username to a bot. Can be called only if
userTypeBot.can_be_edited, the bot has no secondary username, and the
current user has a Telegram Premium subscription. May return an error with
a message "OWNER_USERNAMES_LIMIT_EXCEEDED" if the current user already
owns at least getOption("secondary_bot_username_count_max") bots with a
secondary username
Returns Ok
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 who weren't added
Returns FailedToAddMembers
Adds multiple new members to a chat; requires can_invite_users member
right. Currently, this method is available only in 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 who weren't added
Returns FailedToAddMembers
Adds a chat to a chat list. A chat can't be simultaneously in the Main and
Archive chat lists, so it is automatically removed from the other one if
needed
Returns Ok
Adds a message to the list of welcome messages of a chat; requires
can_send_welcome_messages administrator right in the chat. There can be up
to getOption("welcome_message_count_max") welcome messages in a chat
Returns Ok
Adds a chat to a community. If the current user isn't allowed to change
the list of chats in the community, then a request to add the chat is sent
to administrators of the community instead and the method fails with the
error "COMMUNITY_REQUEST_CREATED"
Returns Ok
Adds a custom server language pack to the list of installed language packs
in the current localization target. Can be called before authorization
Returns 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
Returns Ok
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 the 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
Returns File
Adds gifts to the beginning of a previously created collection. If the
collection is owned by a channel chat, then requires can_post_messages
administrator right in the channel chat. Returns the changed collection
Returns GiftCollection
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
Returns Message
Adds a passkey allowed to be used for the login by the current user and
returns the added passkey. Call getPasskeyParameters to get parameters for
creating the passkey
Returns Passkey
Sends a suggested post based on a previously sent message in a channel
direct messages chat. Can also be used to suggest a price or time change
for an existing suggested post. Returns the sent message
Returns Message
Adds a pending paid reaction in a live story group call. Can't be used in
live stories posted by the current user. Call
commitPendingLiveStoryReactions or removePendingLiveStoryReactions to
actually send all pending reactions when the undo timer is over or abort
the sending
Returns Ok
Adds a message to a quick reply shortcut via an inline bot. If the
shortcut doesn't exist and there are fewer 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
Returns QuickReplyMessage
Adds a message to a quick reply shortcut. If the shortcut doesn't exist
and there are fewer 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
Returns QuickReplyMessage
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 only be grouped in
an album with messages of the same type. Returns the sent messages
Returns QuickReplyMessages
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
Returns Ok
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
Returns Stickers
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
Returns Ok
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
Returns NotificationSound
Adds stories to the beginning of a previously created story album. If the
album is owned by a supergroup or a channel chat, then requires
can_edit_stories administrator right in the chat. Returns the changed
album
Returns StoryAlbum
Adds a custom text composition style to the list of styles used by the
user. May return an error with a message "TONES_SAVED_TOO_MANY" if the
maximum number of added custom styles
getOption("added_text_composition_style_count_max") has been reached
Returns Ok
Sets the result of interaction with a Web App and sends the corresponding
message on behalf of the user to the chat from which the query originated;
for bots only
Returns InlineMessageId
Allows the current user to send unpaid messages to the given user, who
requires payment for incoming messages, using a token from an internal
link of the type internalLinkTypePublicChat,
internalLinkTypeUserPhoneNumber, or internalLinkTypeUserToken. The first
message sent to the user will be preceded by a
messageUnpaidMessagesAllowedByLink message. Repeated calls and calls for
the current user have no effect
Returns Ok
An authentication code is delivered by an immediately canceled call to the
specified phone number. The phone number that calls is the code that must
be entered automatically
An authentication code is delivered by an immediately canceled call to the
specified phone number. The last digits of the phone number that calls are
the code that must be entered manually by the user
A digit-only authentication code is delivered via an SMS message to the
specified phone number; unofficial applications may not receive this type
of code
An authentication code is a phrase of multiple words delivered via an SMS
message to the specified phone number; unofficial applications may not
receive this type of code
The TDLib client is in its final state. All databases are closed and all
resources are released. No other updates will be received after this. All
queries will be responded to with error code 500. To continue working, one
must create a new instance of the TDLib client
TDLib is closing; all subsequent queries will be answered with the error
500. Note that closing TDLib can take a while. All resources will be freed
only after authorizationStateClosed has been received
TDLib needs the user's email address to authorize. Call
setAuthenticationEmailAddress to provide the email address, or directly
call checkAuthenticationEmailCode with an Apple ID/Google ID token if
allowed
The user has been authorized, but needs to enter a 2-step verification
password to start using the application. Call checkAuthenticationPassword
to provide the password, or requestAuthenticationPasswordRecovery to
recover the password, or deleteAccount to delete the account after a week
TDLib needs the user's phone number to authorize. Call
setAuthenticationPhoneNumber to provide the phone number, or use
requestQrCodeAuthentication, getAuthenticationPasskeyParameters,
checkAuthenticationWebToken, or checkAuthenticationBotToken for other
authentication options
The user must buy Telegram Premium as an in-store purchase to log in. Call
checkAuthenticationPremiumPurchase and then
setAuthenticationPremiumPurchaseTransaction
The user is unregistered and needs to accept the terms of service and
enter their first name and last name to finish registration. Call
registerUser to accept the terms of service and provide the data
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
Returns Ok
Bans users from a group call not bound to a chat; requires
groupCall.is_owned. Only the owner of the group call can invite the banned
users back
Returns Ok
Callback queries are received in updateNewInlineCallbackQuery instead of
updateNewCallbackQuery if the message with the button is inaccessible to
the bot. Rarely, the message can still be inaccessible to the bot in
updateNewCallbackQuery
Describes settings for greeting messages that are automatically sent by a
Telegram Business account as a response to incoming messages in an
inactive private chat
Checks whether the specified bot can send messages to the user. Returns a
404 error if it can't and the access can be granted by a call to
allowBotToSendMessages
Returns Ok
Cancels an on-chain gift purchase offer sent by the current user; can be
used only if getOption("can_use_ton_wallet"). A fine may be charged if the
offer is canceled before it expires. Returns the transaction that must be
sent from the TON wallet of the current user to cancel the offer. The
offer is canceled only after the transaction is executed on the TON
blockchain
Returns GiftOnChainPurchaseOfferTransaction
Checks whether the current user can post a story on behalf of a chat;
requires can_post_stories administrator right for supergroup and channel
chats
Returns CanPostStoryResult
The limit for the number of active stories was exceeded. The user can buy
Telegram Premium, delete an active story, or wait for the oldest story to
expire
The chat must be boosted first by Telegram Premium subscribers to post
more stories. Call getChatBoostStatus to get the current boost status of
the chat
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. The query result depends on
the result of the previous query, so only one query is possible at the
same time
Returns ImportedContacts
The chat is a private chat with a bot to which the current user was
invited by another user. The chat can be reported as spam using the method
reportChat with an empty option_id and message_ids; the user who sent the
invitation will be reported. The bot can be blocked using the method
setMessageSenderBlockList
The chat is a private or secret chat, which can be reported using the
method reportChat, or the other user can be blocked using the method
setMessageSenderBlockList, or the other user can be added to the contact
list using the method addContact. If the chat is a private chat with a
user with an emoji status, then a notice about emoji status usage must be
shown
The chat can be reported as spam using the method reportChat with an empty
option_id and message_ids. If the chat is a private chat with a user with
an emoji status, then a notice about emoji status usage must be shown
The chat is a private or secret chat with a mutual contact and the user's
phone number can be shared with the other user using the method
sharePhoneNumber
A list of chats usually located at the top of the main chat list. Unmuted
chats are automatically moved from the Archive to the Main chat list when
a new message arrives
The user is a member of the chat and has some additional privileges. In
basic groups, administrators have all applicable rights. In supergroups
and channels, any subset of the rights can be chosen for an administrator
The user or the chat was banned (and hence is not a member of the chat).
Implies the user can't return to the chat, view messages, or be used as a
participant identifier to join a video chat of the chat
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
Returns Ok
Checks a passkey to log in to the corresponding account. Call
getAuthenticationPasskeyParameters to get parameters for the passkey.
Works only when the current authorization state is
authorizationStateWaitPhoneNumber or
authorizationStateWaitOtherDeviceConfirmation, or if there is no pending
authentication query and the current authorization state is
authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode,
authorizationStateWaitRegistration, or authorizationStateWaitPassword
Returns 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
Returns Ok
Checks whether an in-store purchase of Telegram Premium is possible before
authorization. Works only when the current authorization state is
authorizationStateWaitPremiumPurchase
Returns Ok
Checks a web token to log in to the corresponding account; for official
Telegram apps only. Works only when the current authorization state is
authorizationStateWaitPhoneNumber or
authorizationStateWaitOtherDeviceConfirmation
Returns Ok
Checks whether a username can be set for a new bot or assigned as a
secondary username to an existing bot. Use checkChatUsername to check a
username for other chat types
Returns CheckChatUsernameResult
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
Returns Ok
Checks a match-code for an OAuth authorization request. If it fails, then
the authorization request has failed. Otherwise, an authorization
confirmation dialog must be shown and the link must be processed using
acceptOauthRequest or declineOauthRequest
Returns Ok
Returns information about the balance of the current user in the bot
https://t.me/walt; can be used only if getOption("can_use_ton_wallet")
Returns WalletBotBalance
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 the
usual animation needs to be played
Returns Sticker
Informs TDLib that the user opened the sponsored chat via the button, the
name, the chat photo, a mention in the sponsored message text, or the
media in the sponsored message
Returns 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 Ok
Changes a rich message using an AI model. May return an error with a
message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send
further requests
Returns RichMessage
Changes text using an AI model; must not be used in secret chats. May
return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram
Premium is required to send further requests
Returns FormattedText
Creates a bot that will be managed by another bot. Returns the created
bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the
user already owns the maximum allowed number of bots as per
getOption("owned_bot_count_max"). An internal link
"https://t.me/BotFather?start=deletebot" can be processed to handle the
error
Returns User
Creates a business chat link for the current account. Requires a Telegram
Business subscription. There can be up to
getOption("business_chat_link_count_max") links created. Returns the
created link
Returns BusinessChatLink
Creates a 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
Returns ChatFolderInfo
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
Returns ChatFolderInviteLink
Creates a new invite link for a chat. Available in basic groups,
supergroups, and channels. Requires administrator privileges and
can_invite_users right in the chat
Returns ChatInviteLink
Creates a topic in a forum supergroup chat or a chat with a bot with
topics; requires can_manage_topics administrator or can_create_topics
member right in the supergroup
Returns ForumTopicInfo
Creates a collection from gifts on the current user's or a channel's
profile page; requires can_post_messages administrator right in the
channel chat. An owner can have up to
getOption("gift_collection_count_max") gift collections. The new
collection will be added to the end of the gift collection list of the
owner. Returns the created collection
Returns GiftCollection
Creates a new basic group and sends a corresponding
messageBasicGroupChatCreate. Returns information about the newly created
chat
Returns CreatedBasicGroupChat
Creates a new rich message using an AI model. May return an error with a
message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send
further requests
Returns RichMessage
Creates a custom text composition style. May return an error with a
message "TONES_SAVED_TOO_MANY" if the maximum number of added custom
styles has been reached
Returns TextCompositionStyle
Creates a TON wallet for the specified regular user; can be used only if
getOption("can_use_ton_wallet"). The current user must have a positive TON
wallet balance
Returns UserTonWalletAddress
Creates a video chat (a group call bound to a chat); for basic groups,
supergroups, and channels only; requires can_manage_video_chats
administrator right
Returns GroupCallId
Declines an on-chain gift purchase offer received by the current user. The
offer is declined and the buyer is refunded only after the offer is
canceled on the TON blockchain
Returns 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
Returns Ok
Deletes all recent reactions added by the specified sender in a chat.
Supported only for basic groups and supergroups; requires
can_delete_messages administrator right
Returns Ok
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
Returns 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
Returns Ok
Deletes all messages in the chat. Use the
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
Returns 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
Returns Ok
Deletes all messages sent by the specified message sender in a chat.
Supported only for supergroups; requires can_delete_messages administrator
right
Returns 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 or
dismissed
Returns Ok
Deletes all messages between the specified dates in the topic in a channel
direct messages chat administered by the current user. Messages sent in
the last 30 seconds will not be deleted
Returns Ok
Deletes all messages from a topic in a forum supergroup chat or a chat
with a bot with topics; requires can_delete_messages administrator right
in the supergroup unless the user is the creator of the topic, the topic
has no messages from other users and has at most 11 messages
Returns Ok
Deletes a gift without receiving Telegram Stars for it. Use
receivedGift.can_be_deleted or messageGift.can_be_deleted to check whether
the gift can be deleted. The gift may be deleted even if it can still be
sold using sellGift
Returns Ok
Deletes a gift collection. If the collection is owned by a channel chat,
then requires can_post_messages administrator right in the channel chat
Returns Ok
Deletes all messages sent by the specified message sender in a group call;
for live story calls only. Requires groupCall.can_delete_messages right
Returns Ok
Deletes all information about a language pack in the current localization
target. The language pack that is currently in use (including the base
language pack) or is being synchronized can't be deleted. Can be called
before authorization
Returns Ok
Deletes a revoked chat invite link. Requires administrator privileges and
can_invite_users right in the chat for own links and owner privileges for
other links
Returns Ok
Deletes a story album. If the album is owned by a supergroup or a channel
chat, then requires can_edit_stories administrator right in the chat
Returns 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 Ok
Disables backup of the TON wallet of the user using proof of wallet
ownership instead of the password. Works only if
tonWalletState.is_backup_enabled is true
Returns Ok
Disconnects an affiliate program from the given affiliate and immediately
deactivates its referral link. Returns updated information about the
disconnected affiliate program
Returns ConnectedAffiliateProgram
Shows an upgraded gift from the TON wallet of the current user on a
profile page or hides it from all profile pages; the gift remains in the
wallet
Returns Ok
Replaces a media preview in the list of media previews of a bot. Returns
the new preview after the edit is completed server-side
Returns BotMediaPreview
Edits the media content of a message with a text, an animation, an audio,
a document, a photo, or a video in a message sent on behalf of a business
account; for bots only
Returns BusinessMessage
Edits a non-primary invite link for a chat. Available in 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
Returns ChatInviteLink
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
Returns ChatInviteLink
Edits the title and icon of a topic in a forum supergroup chat or a chat
with a bot with topics; for supergroup chats, requires can_manage_topics
administrator right unless the user is the creator of the topic
Returns Ok
Edits the media content of a message with a text, an animation, an audio,
a document, a photo, or a video in an inline message sent via a bot; for
bots only
Returns Ok
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
Returns Message
Edits the media content of a message, including the message caption. If
only the caption needs to be edited, use editMessageCaption instead. The
type of message content in an album can't be changed with the exception of
replacing a photo with a video or vice versa. Returns the edited message
after the edit is completed on the server side
Returns Message
Edits the time when a scheduled message will be sent. The scheduling state
of all messages in the same album or forwarded together with the message
will also be changed
Returns 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. A media message can be edited only to a media message. Checklist
messages can be edited only to a checklist message. The type of message
content in an album can't be changed with the exception of replacing a
photo with a video or vice versa
Returns Ok
The email address can be reset after the given period. Call
resetAuthenticationEmailAddress to reset it and allow the user to
authorize with a code sent to the user's phone number
The category contains a list of similar emoji to search for in getStickers
and searchStickers for stickers, or getInlineQueryResults with the bot
getOption("animation_search_bot_username") for animations
Fixes a rich message with text received as a result of speech recognition
using an AI model by correcting recognition errors and adding punctuation.
May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram
Premium is required to send further requests
Returns RichMessage
Fixes text received as a result of speech recognition using an AI model by
correcting recognition errors and adding punctuation; must not be used in
secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM"
if Telegram Premium is required to send further requests
Returns FormattedText
Fixes a rich message using an AI model. May return an error with a message
"AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further
requests
Returns RichMessage
Fixes text using an AI model; must not be used in secret chats. May return
an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is
required to send further requests
Returns FixedText
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
Returns Messages
Returns all active sessions of the current user. Additionally,
getBusinessConnectedBot must be used to show the bot on top of active
sessions
Returns Sessions
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
Returns StickerSets
Returns the current authorization state. This is an offline method. For
informational purposes only. Use updateAuthorizationState instead to
maintain the current authorization state. Can be called before
initialization
Returns AuthorizationState
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
Returns 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
Returns Text
Returns the list of media previews for the given language and the list of
languages for which the bot has dedicated previews
Returns BotMediaPreviewInfo
Returns information about the business bot that is connected to the
current user account. Returns a 404 error if there is no connected bot
Returns BusinessConnectedBotInfo
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
Returns CallbackQueryAnswer
Returns the list of all stories posted by the given chat; requires
can_edit_stories administrator 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
Returns Stories
Returns a list of service actions taken by chat members and administrators
in the last 48 hours. Available only in supergroups and channels. Requires
administrator rights. Returns results in reverse chronological order
(i.e., in order of decreasing chatEvent.id)
Returns ChatEvents
Returns the approximate number of chats in a chat folder being created.
Main and archive chat lists must be fully preloaded for this function to
work correctly
Returns Count
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
Returns Chats
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 method if only_local is true
Returns Messages
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
Returns ChatInviteLink
Returns chat members who 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
Returns ChatInviteLinkMembers
Returns invite links for a chat created by the specified administrator.
Requires administrator privileges and can_invite_users right in the chat
to get own links and owner privileges to get other links
Returns ChatInviteLinks
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 a partial result for the last returned day. The behavior of
this method depends on the value of the option "utc_time_offset"
Returns MessageCalendar
Returns the approximate 1-based position of a message among messages that
can be found by the specified filter in the chat and topic. Cannot be used
in secret chats
Returns Count
Returns the user who will become the owner of the chat after 7 days if the
current user does not return to the supergroup or channel during that
period or immediately for basic groups; requires owner privileges in the
chat. Available only in basic groups, supergroups, and channel chats
Returns User
Returns the list of stories that were 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
Returns Stories
Returns detailed revenue statistics about a chat. Currently, this method
can be used only for channels if
supergroupFullInfo.can_get_revenue_statistics == true or bots if
userFullInfo.bot_info.can_get_revenue_statistics == true
Returns ChatRevenueStatistics
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 or bots if
userFullInfo.bot_info.can_get_revenue_statistics == true
Returns ChatRevenueTransactions
Returns a URL for chat revenue withdrawal; requires owner privileges in
the channel chat or the bot. Currently, this method can be used only if
getOption("can_withdraw_chat_revenue") for channels with
supergroupFullInfo.can_get_revenue_statistics == true or bots with
userFullInfo.bot_info.can_get_revenue_statistics == true
Returns HttpUrl
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
Returns Chats
Returns all scheduled messages in a chat. The messages are returned in
reverse chronological order (i.e., in order of decreasing message.id)
Returns Messages
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 the
searchMessagesFilterFailedToSend filter without an enabled message
database
Returns MessagePositions
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
Returns ChatStatistics
Returns supergroup and channel chats in which the current user has the
right to post stories. The chats must be rechecked with canPostStory
before actually trying to post a story there
Returns Chats
Returns interactions with a story posted in a chat. Can be used only if
the story is posted on behalf of a chat and the user is an administrator
in the chat
Returns StoryInteractions
Returns pending requests to add chats to a community. Administrators of
the community with can_edit_chat_list administrator right receive all
requests; other users receive only requests sent by them
Returns CommunityAddChatRequests
Returns chats in a community that were joined by a member of the
community; requires can_ban_members administrator right in the community.
Can be used to show chats that will be affected by the member ban
Returns CommunityMemberChats
Returns an affiliate program that was connected to the given affiliate by
the identifier of the bot that created the program
Returns ConnectedAffiliateProgram
Uses the current IP address to find the current country. Returns a
two-letter ISO 3166-1 alpha-2 country code. Can be called before
authorization
Returns Text
Returns all updates needed to restore the 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 Updates
Returns the list of custom emoji stickers by their identifiers. Stickers
are returned in arbitrary order. Only found stickers are returned
Returns Stickers
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
Returns DeepLinkInfo
Returns messages in the topic in a channel direct messages chat
administered by the current user. The messages are returned in reverse
chronological order (i.e., in order of decreasing message.id)
Returns Messages
Returns the last message sent in the topic in a channel direct messages
chat administered by the current user no later than the specified date
Returns Message
Returns the list of emoji statuses, which can't be used as chat emoji
status, even if they are from a sticker set with
is_allowed_as_chat_emoji_status == true
Returns EmojiStatusCustomEmojis
Returns an HTTP URL that 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
Returns HttpUrl
Returns an HTTP URL that 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.
May return an empty link if just a toast about successful login has to be
shown
Returns HttpUrl
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, and use getLinkWebBrowserType
directly
Returns LoginUrlInfo
Returns messages in a topic in a forum supergroup chat or a chat with a
bot with topics. 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
Returns Messages
Returns found forum topics in a forum supergroup chat or a chat with a bot
with topics. This is a temporary method for getting information about the
topic list from the server
Returns ForumTopics
Returns a URL for minting an upgraded gift as an NFT on the TON
blockchain; requires owner privileges for gifts owned by a chat. The user
must have a valid temporary password; see createTemporaryPassword
Returns HttpUrl
Returns a transaction that must be sent from the TON wallet of the current
user to cancel the on-chain sale of an upgraded gift for which
giftResaleParameters.can_be_managed is true; can be used only if
getOption("can_use_ton_wallet"). The sale is canceled only after the
transaction is executed on the TON blockchain. Then, the gift will be in
the TON wallet of the current user
Returns GiftOnChainSaleTransaction
Returns a transaction that must be sent from the TON wallet of the current
user to put an upgraded gift for which upgradedGift.uses_on_chain_resale
is true up for sale, or to change the price of a gift for which
giftResaleParameters.is_fixed_on_chain and
giftResaleParameters.can_be_managed are true; can be used only if
getOption("can_use_ton_wallet"). The type of the sale is chosen by the
server. The gift is put up for sale only after the transaction is executed
on the TON blockchain and the sale smart contract confirms that it has
received the gift. The price of the gift minus the fee specified in
upgradedGift.fee_basis_points will be received by the TON wallet of the
current user when the gift is sold. If
giftResaleParameters.is_fixed_on_chain is false, then the current sale
must be canceled first using getGiftOnChainDelistingTransaction to change
the price of the gift
Returns GiftOnChainSaleTransaction
Returns a transaction that must be sent from the TON wallet of the current
user to buy an upgraded gift for which upgradedGift.uses_on_chain_resale
is true; can be used only if getOption("can_use_ton_wallet"). Gifts for
which giftResaleParameters.is_fixed_on_chain is true can be bought only if
getOption("can_buy_on_chain_fixed_price_gifts") is true, and other gifts
can be bought only if getOption("can_buy_on_chain_gifts") is true. The
type of the returned transaction depends on the type of the sale. The gift
will be received by the new owner after the transaction is executed on the
TON blockchain. If the gift is bought for the current user, then it will
be received by the TON wallet of the current user, and will be shown on
the user's profile page if it is still in the wallet
Returns GiftOnChainSaleTransaction
Returns a URL for TON Gram withdrawal from the current user's account. The
user must have at least 10 Grams to withdraw and can withdraw up to 100000
Grams in one transaction
Returns HttpUrl
Returns a list of recently inactive supergroups and channels. Can be used
when the user reaches the limit on the number of joined supergroups and
channels and receives the error "CHANNELS_TOO_MUCH". Also, the limit can
be increased with Telegram Premium
Returns Chats
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
Returns InlineQueryResults
Returns information about the type of internal link. Returns a 404 error
if the link is not internal. Can be called before authorization
Returns InternalLinkType
Returns information about a language pack. The returned language pack
identifier may be different from the provided one. Can be called before
authorization
Returns LanguagePackInfo
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
Returns LanguagePackStringValue
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
Returns LinkPreview
Returns information about the user or the chat that streams to a live
story; for live stories that aren't an RTMP stream only
Returns GroupCallParticipant
Returns information about the current localization target. This is an
offline method if only_local is true. Can be called before authorization
Returns LocalizationTargetInfo
Returns an HTTP URL that can be used to automatically authorize the user
on a website after clicking an inline button of the 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
Returns HttpUrl
Returns information about a button of the type
inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the
user presses the button
Returns LoginUrlInfo
Returns the list of available TDLib internal log tags, for example,
"actor", "binlog", "connections", "notifications", "proxy". Can be
called synchronously
Returns LogTags
Returns information about a file with a map thumbnail in PNG format. Only
map thumbnail files with a size of less than 1 MB can be downloaded
Returns File
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
Returns FormattedText
Returns information about the actual author of a message sent on behalf of
a channel. The method can be called if messageProperties.can_get_author ==
true
Returns User
Returns reactions that can be added to a message. The list can change
after updateActiveEmojiReactions, updateChatAvailableReactions for the
chat, or updateMessageInteractionInfo for the message
Returns AvailableReactions
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 method
Returns MessageLink
Returns information about a public or private message link. Can be called
for any internal link of the type internalLinkTypeMessage
Returns MessageLinkInfo
Returns information about a message if it is available without sending a
network request. Returns a 404 error if the message isn't available
locally. This is an offline method
Returns Message
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
Returns PublicForwards
Returns the read date of a recent outgoing message in a private chat. The
method can be called if messageProperties.can_get_read_date == true
Returns MessageReadDate
Returns messages in a message thread of a message. Can be used only if
messageProperties.can_get_message_thread == true. The 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
Returns Messages
Returns viewers of a recent outgoing message in a basic group or a
supergroup chat. For video notes and voice notes, only users who opened
the content of the message are returned. The method can be called if
messageProperties.can_get_viewers == true
Returns MessageViewers
Returns information about an OAuth deep link. Use
checkOauthRequestMatchCode, acceptOauthRequest, or declineOauthRequest to
process the link
Returns OauthLinkInfo
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"
Returns OptionValue
Returns already available Telegram Passport elements suitable for
completing a Telegram Passport authorization form. The result can be
received only once for each authorization form
Returns PassportElementsWithErrors
Returns an invoice payment form. This method must be called when the user
presses an inline button of the type inlineKeyboardButtonTypeBuy, or wants
to buy access to media in a messagePaidMedia message
Returns PaymentForm
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
Returns PhoneNumberInfo
Returns message senders who voted for the specified option in a poll; use
poll.can_get_voters to check whether the method can be used. For optimal
performance, the number of returned users is chosen by TDLib
Returns PollVoters
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
Returns Text
Returns available options for creating a Telegram Premium giveaway or
manual distribution of Telegram Premium among chat members
Returns PremiumGiveawayPaymentOptions
Returns a keyboard button prepared by the bot for the user. The button
will be of the type keyboardButtonTypeRequestUsers,
keyboardButtonTypeRequestChat, or keyboardButtonTypeRequestManagedBot
Returns KeyboardButton
Returns the list of backdrops that can be used as a background of a theme
of the screen for sharing a link to a user or a chat
Returns ProfileShareThemeBackdrops
Returns a globally unique push notification subscription identifier for
identification of an account that has received a push notification. Can be
called synchronously
Returns PushReceiverId
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
Returns RecoveryEmailAddress
Returns information about a file by its remote identifier. This is an
offline method. Can be used to register a URL as a file for further
uploading or sending as a message. Even if 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 not be deleted and must
be accessible to the user. If the file database is disabled, then the
corresponding object with the file must be preloaded by the application
Returns File
Returns information about a non-bundled message that is replied to by a
given message. Also returns the pinned message for messagePinMessage, the
game message for messageGameScore, the invoice message for
messagePaymentSuccessful, the message with a previously set same
background for messageChatSetBackground, the giveaway message for
messageGiveawayCompleted, the checklist message for
messageChecklistTasksDone and messageChecklistTasksAdded, the message with
suggested post information for messageSuggestedPostApprovalFailed,
messageSuggestedPostApproved, messageSuggestedPostDeclined,
messageSuggestedPostPaid, and messageSuggestedPostRefunded, the message
with the regular gift that was upgraded for messageUpgradedGift with
origin of the type upgradedGiftOriginUpgrade, the message with the gift
purchase offer for messageUpgradedGiftPurchaseOfferRejected and
messageUpgradedGiftOnChainPurchaseOffer, the message with the request to
disable content protection for messageChatHasProtectedContentToggled, the
message with the poll for messagePollOptionAdded and
messagePollOptionDeleted, and the topic creation message for topic
messages without a non-bundled replied-to message. Returns a 404 error if
the message doesn't exist
Returns Message
Returns messages in a Saved Messages topic. The messages are returned in
reverse chronological order (i.e., in order of decreasing message.id)
Returns Messages
Returns a saved notification sound by its identifier. Returns a 404 error
if there is no saved notification sound with the specified identifier
Returns NotificationSound
Returns the newest models for on-device speech recognition supported by
the given version of the speech recognition library, including models for
speech language and voice activity detection. If the request fails or no
models are returned, then built-in models or recognizeSpeech must be used
instead. The method is supposed to be called after an application update,
before the first on-device speech recognition, and from application
settings
Returns SpeechRecognitionModels
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
Returns HttpUrl
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
Returns Emojis
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
Returns Stickers
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
Returns PublicForwards
Returns a list of basic group and supergroup chats that can be used as a
discussion group for a channel. Returned basic group chats must first be
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 Chats
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
Returns ChatMembers
Returns all entities (mentions, hashtags, cashtags, bot commands, bank
card numbers, TON blockchain addresses, URLs, and email addresses) found
in the text. Can be called synchronously
Returns TextEntities
Returns up to 8 emoji statuses that must be shown right after the default
Premium badge in the emoji status list for self status
Returns EmojiStatusCustomEmojis
Returns names of upgraded gift collections whose NFTs can be used as
background_nft_address in setTonWalletCardStickers; can be used only if
getOption("can_use_ton_wallet")
Returns UpgradedGiftCollectionNames
Returns NFTs stored on the TON wallet of the user; can be used only if
getOption("can_use_ton_wallet"). The result also includes NFTs of the user
that are put up for sale using a fixed-price sale contract
Returns TonNfts
Returns a challenge that may be used to prove ownership of a TON wallet;
can be used only if getOption("can_use_ton_wallet")
Returns TonWalletOwnershipProofChallenge
Returns information needed to deposit an upgraded gift from the TON wallet
of the current user to a Telegram account. Use sendTonWalletTransaction to
complete the transfer of the gift. The gift will be received by the new
owner with a message about the gift after the transfer is confirmed on the
blockchain
Returns UpgradedGiftDepositInfo
Returns advertisements to be shown while a video from a message is
watched. Available only if messageProperties.can_get_video_advertisements
Returns VideoMessageAdvertisements
Returns an HTTPS URL of a Web App to open from the side menu, a
keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp
button
Returns WebAppUrl
Returns an instant view version of a web page if available. This is an
offline method if only_local is true. Returns a 404 error if the web page
has no instant view page
Returns WebPageInstantView
Returns the current public data of a widget. Must be called only if the
widget is visible on the screen and asked to poll its public data
Returns WidgetPublicData
Sends a widget 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
Returns WidgetQueryAnswer
Contains information about a transaction that must be sent from the TON
wallet of the current user to send, accept, or cancel an on-chain gift
purchase offer. Use sendTonWalletTransaction with regular_transaction_data
and gasless_transaction_data created from message and gasless_message
respectively to send the transaction. Successful sending of the
transaction doesn't mean that the operation was completed; the result of
the operation must be checked in the corresponding
messageUpgradedGiftOnChainPurchaseOffer message in the chat 777000
The transaction for a gift sold on-chain using a fixed-price sale
contract. All messages must be signed and sent in one transfer in the
specified order. Use sendTonWalletTransaction with
regular_transaction_data and gasless_transaction_data created from
messages and gasless_messages respectively to send the transaction
The transaction for a gift sold on-chain on Fragment. The transaction
consists of one message, which must be sent to nft_address with
gram_amount attached and with payload as the message body. Use
sendTonWalletTransaction to send the transaction
A button to buy something. This button must be in the first column and row
of the keyboard and can be attached only to a message with content of the
type messageInvoice
A button with a game that sends a callback query to a bot. This button
must be in the first column and row of the keyboard and can be attached
only to a message with content of the type messageGame
Applies if a user chooses some previously saved payment credentials. To
use their previously saved credentials, the user must have a valid
temporary password
A file generated by the application. The application must handle updates
updateFileGenerationStart and updateFileGenerationStop to generate the
file when asked by TDLib
A file defined by its remote identifier. The remote identifier is
guaranteed to be usable only if the corresponding file is still accessible
to the user and known to TDLib. For example, if the file is from a
message, then the message must not be deleted and must be accessible to
the user. If the file database is disabled, then the corresponding object
with the file must be preloaded by the application
A message with a poll. Polls can't be sent to secret chats and channel
direct messages chats. Polls can be sent to a private chat only if the
chat is a chat with a bot or the Saved Messages chat
The media is a photo. The photo must be at most 10 MB in size. The photo's
width and height must not exceed 10000 in total. Width and height ratio
must be at most 20
One of the files containing the translation of the document contains an
error. The error is considered resolved when the file with the translation
changes
A rich message to send. Total length of all texts, including custom emoji
alternative text and formula source, must not exceed
getOption("rich_message_text_length_max"). The total number of all blocks,
list items and table rows must not exceed
getOption("rich_message_block_count_max"). The maximum allowed depth of
nested blocks and rich texts is getOption("rich_message_depth_max"). The
total number of media in all blocks must not exceed
getOption("rich_message_media_count_max"). The maximum allowed number of
table columns is getOption("rich_message_table_column_count_max")
The link is a link to an attachment menu bot to be opened in the specified
or a chosen chat. Process the given target_chat to open the chat. Then,
call searchPublicChat with the given bot username, check that the user is
a bot and can be added to the attachment menu. Then, use
getAttachmentMenuBot to receive information about the bot. If the bot
isn't added to the attachment menu, then show a disclaimer about Mini Apps
being third-party applications, ask the user to accept their terms of
service and confirm adding the bot to the side and attachment menu. If the
user accepts the terms and confirms adding, then use
toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu
bot can't be used in the opened chat, show an error to the user. If the
bot is added to the attachment menu and can be used in the chat, then use
openWebApp with the given URL
The link is a link to a background. Call searchBackground with the given
background name to process the link. If the background is found and the
user wants to apply it, then call setDefaultBackground
The link is a link to a Telegram bot, which is expected to be added to a
channel chat as an administrator. Call searchPublicChat with the given bot
username, check that the user is a bot, and ask the current user to select
a channel chat to add the bot to as an administrator. Then, call
getChatMember to receive the current bot rights in the chat, and if the
bot is already an administrator, check that the current user can edit its
administrator rights and combine the received rights with the requested
administrator rights. Then, show a confirmation box to the user and call
setChatMemberStatus with the chosen chat and confirmed rights
The link is a link to invite users to private chats with a bot. Call
searchPublicChat with the given bot username. If the chat is found, the
chat is a chat with a bot, and the bot has can_be_edited == true, then ask
the current user to select up to 10 users to invite and call
inviteUsersToBot. Otherwise, show an error message
The link is a link to a chat with a Telegram bot. Call searchPublicChat
with the given bot username, check that the user is a bot, show the START
button in the chat with the bot, and then call sendBotStartMessage with
the given start parameter after the button is pressed
The link is a link to a Telegram bot, which is expected to be added to a
group chat. Call searchPublicChat with the given bot username, check that
the user is a bot and can be added to groups, ask the current user to
select a basic group or a supergroup chat to add the bot to, taking into
account that bots can be added to a public supergroup only by
administrators of the supergroup. If administrator rights are provided by
the link, call getChatMember to receive the current bot rights in the
chat, and if the bot is already an administrator, check that the current
user can edit its administrator rights, combine the received rights with
the requested administrator rights, show a confirmation box to the user,
and call setChatMemberStatus with the chosen chat and confirmed
administrator rights. Before a call to setChatMemberStatus, it may be
required to upgrade the chosen basic group chat to a supergroup chat.
Then, if start_parameter isn't empty, call sendBotStartMessage with the
given start parameter and the chosen chat; otherwise, just send the /start
message with the bot's username added to the chat
The link is a link to a business chat. Use getBusinessChatLinkInfo with
the provided link name to get information about the link, then open the
received private chat and replace the chat draft with the provided text
The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo
with the given URL to process the link. If the chat is found, then call
getChatBoostStatus and getAvailableChatBoostSlots to get the current boost
status and check whether the chat can be boosted. If the user wants to
boost the chat and the chat can be boosted, then call boostChat
The link is an invite link to a chat folder. Call
checkChatFolderInviteLink with the given invite link to process the link.
If the link is valid and the user wants to join the chat folder, then call
addChatFolderByInviteLink
The link is a chat invite link. Call checkChatInviteLink with the given
invite link to process the link. If the link is valid and the user wants
to join the chat, then call joinChatByInviteLink
The link is a link to a channel direct messages chat by the username of
the channel. Call searchPublicChat with the given chat username to process
the link. If the chat is found and is a channel, open the direct messages
chat of the channel
The link is a link to a game. Call searchPublicChat with the given bot
username, check that the user is a bot, ask the current user to select a
chat to send the game to, and then call sendMessage with inputMessageGame
The link is a link to a gift collection. Call searchPublicChat with the
given username, then call getReceivedGifts with the received gift owner
identifier and the given collection identifier, then show the collection
if received
The link is a link to a group call that isn't bound to a chat. Use
getGroupCallParticipants to get the list of group call participants and
show them on the join group call screen. Call joinGroupCall with the given
invite_link to join the call
The link must be opened in an Instant View. Call getWebPageInstantView
with the given URL to process the link. If Instant View is found, then
show it; otherwise, open the fallback URL in an external browser
The link is a link to a language pack. Call getLanguagePackInfo with the
given language pack identifier to process the link. If the language pack
is found and the user wants to apply it, then call setOption for the
option "language_pack_id"
The link is a link to a live story. Call searchPublicChat with the given
chat username, then getChatActiveStories to get active stories in the
chat, then find a live story among active stories of the chat, and then
joinLiveStory to join the live story
The link is a link to the main Web App of a bot. Call searchPublicChat
with the given bot username, check that the user is a bot and has the main
Web App. If the bot can be added to the attachment menu, then use
getAttachmentMenuBot to receive information about the bot, then if the bot
isn't added to the side menu, show a disclaimer about Mini Apps being
third-party applications, ask the user to accept their terms of service
and confirm adding the bot to the side and attachment menu, then if the
user accepts the terms and confirms adding, use
toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp
with the given start parameter and mode and open the returned URL as a Web
App
The link is a link to a Telegram message or a forum topic. Call
getMessageLinkInfo with the given URL to process the link, and then open
the received forum topic or chat and show the message there
The link contains a message draft text. A share screen needs to be shown
to the user; then the chosen chat must be opened and the text must be
added to the input field
The link is an OAuth link. Call getOauthLinkInfo with the given URL to
process the link if the link was received from outside of the application;
otherwise, ignore it. After getOauthLinkInfo, show the user a confirmation
dialog and process it with checkOauthRequestMatchCode, acceptOauthRequest,
or declineOauthRequest
The link contains a request for Telegram Passport data. Call
getPassportAuthorizationForm with the given parameters to process the link
if the link was received from outside of the application; otherwise,
ignore it
The link can be used to confirm ownership of a phone number to prevent
account deletion. Call sendPhoneNumberCode with the given phone number and
with phoneNumberCodeTypeConfirmOwnership with the given hash to process
the link. If succeeded, call checkPhoneNumberCode to check the code
entered by the user, or resendPhoneNumberCode to resend it
The link is a link to the Premium features screen of the application from
which the user can subscribe to Telegram Premium. Call getPremiumFeatures
with the given referrer to process the link
The link is a link with a Telegram Premium gift code. Call
checkPremiumGiftCode with the given code to process the link. If the code
is valid and the user wants to apply it, then call applyPremiumGiftCode
The link is a link to the screen for gifting Telegram Premium
subscriptions to friends via inputInvoiceTelegram with
telegramPaymentPurposePremiumGift payments or in-store purchases
The link is a link to a chat by its username. Call searchPublicChat with
the given chat username to process the link. If the chat is found, open
its profile information screen or the chat itself. If the draft text isn't
empty and the chat is a private chat with a regular user, then put the
draft text in the input field
The link can be used to log in the current user on another device, but it
must be scanned from a QR code using the in-app camera. An alert similar
to "This code can be used to allow someone to log in to your Telegram
account. To confirm Telegram login, please go to Settings
The link is a link to create a managed bot. Call searchPublicChat with the
given manager bot username. If the chat is found, the chat is a chat with
a bot, and the bot has can_manage_bots == true, then show a bot creation
confirmation dialog with the given suggested_bot_username and
suggested_bot_name. If the user agrees, call createBot with via_link ==
true to create the bot
The link is a link to a sticker set. Call searchStickerSet with the given
sticker set name to process the link and show the sticker set. If the
sticker set is found and the user wants to add it, then call
changeStickerSet
The link is a link to a story. Call searchPublicChat with the given poster
username, then call getStory with the received chat identifier and the
given story identifier, then show the story if received
The link is a link to an album of stories. Call searchPublicChat with the
given username, then call getStoryAlbumStories with the received chat
identifier and the given story album identifier, then show the story album
if received
The link is a link to a text composition style. Call
searchTextCompositionStyle with the given style name to get information
about the style. If the style is found and the user wants to add it, then
call addTextCompositionStyle
The link is a link to a user by their phone number. Call
searchUserByPhoneNumber with the given phone number to process the link.
If the user is found, then call createPrivateChat and open the user's
profile information screen or the chat itself. If the draft text isn't
empty, then put the draft text in the input field
The link is a link to a user by a temporary token. Call searchUserByToken
with the given token to process the link. If the user is found, then call
createPrivateChat and open the chat
The link is a link to a video chat. Call searchPublicChat with the given
chat username, and then joinVideoChat with the given invite hash to
process the link
The link is a link to a Web App. Call searchPublicChat with the given bot
username and check that the user is a bot. If the bot is restricted for
the current user, then show an error message. Otherwise, call searchWebApp
with the received bot and the given web_app_short_name. Process the
received foundWebApp by showing a confirmation dialog if needed. If the
bot can be added to the attachment or side menu, but isn't added yet, then
show a disclaimer about Mini Apps being third-party applications instead
of the dialog and ask the user to accept their terms of service. If the
user accepts the terms and confirms adding, then use
toggleBotIsAddedToAttachmentMenu to add the bot. Then, call
getWebAppLinkUrl and open the returned URL as a Web App
Invites a user to an active group call; for group calls not bound to a
chat only. Sends a service message of the type messageGroupCall. The group
call can have at most getOption("group_call_participant_count_max")
participants
Returns InviteGroupCallParticipantResult
The user was invited and a service message of the type messageGroupCall
was sent; the message can be used in declineGroupCallInvitation to cancel
the invitation
Invites users to private chats with a bot owned by the current user. Can
be called only if userTypeBot.can_be_edited == true. Each invited user
will receive a message of the type messageBotInvite, and the bot will be
able to send messages to that user. The request succeeds if at least one
user was invited
Returns Ok
Invites users to an active video chat. Sends a service message of the type
messageInviteVideoChatParticipants to the chat bound to the group call
Returns Ok
A button that requests a chat to be shared by the current user; available
only in private chats. Use the method shareChatWithBot to complete the
request
A button that requests creation of a managed bot by the current user;
available only in private chats. Use the method createBot to complete the
request
A button that requests users to be shared by the current user; available
only in private chats. Use the method shareUsersWithBot to complete the
request
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.chat_id) in descending order.
Returns a 404 error if all active stories have been loaded
Returns 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
(chatPosition.order, chat.id) in descending order. Returns a 404 error if
all chats have been loaded
Returns Ok
Loads welcome messages of a chat; requires can_send_welcome_messages
administrator right in the chat. The loaded messages will be sent through
updateChatWelcomeMessages
Returns Ok
Loads more topics in a channel direct messages chat administered by the
current user. The loaded topics will be sent through
updateDirectMessagesChatTopic. Topics are sorted by their topic.order in
descending order. Returns a 404 error if all topics have been loaded
Returns Ok
Loads more participants of a group call; not supported in live stories.
The loaded participants will be received through updates. Use the field
groupCall.loaded_all_participants to check whether all participants have
already been loaded
Returns Ok
Loads quick reply messages that can be sent by a given quick reply
shortcut. The loaded messages will be sent through
updateQuickReplyShortcutMessages
Returns Ok
Loads quick reply shortcuts created by the current user. The loaded data
will be sent through updateQuickReplyShortcut and
updateQuickReplyShortcuts
Returns 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
Returns 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 Ok
Options to be used when message content is copied without reference to the
original sender. Service messages, messages with messageInvoice,
messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't
be copied
A giveaway was created for the chat. Use
telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway,
telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to
create a giveaway
A message with information about a group call not bound to a chat. If the
message is incoming, the call isn't active, isn't missed, and has no
duration, and getOption("can_accept_calls") is true, then the incoming
call screen must be shown to the user. Use getGroupCallParticipants to
show current group call participants on the screen. Use joinGroupCall to
accept the call or declineGroupCallInvitation to decline it. If the call
becomes active or missed, then the call screen must be hidden
Mints an upgraded gift as an NFT on the TON blockchain and sends the NFT
directly to the TON wallet of the current user, which is created
automatically if the user has no wallet yet; requires owner privileges for
gifts owned by a chat. The user must have a valid temporary password; see
createTemporaryPassword. Minting is irreversible. The NFT will be received
by the wallet in a few seconds after the request succeeds
Returns Ok
A group containing notifications of the types notificationTypeNewMessage
and notificationTypeNewPushMessage with unread mentions of the current
user, replies to their messages, or a pinned message
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)
Returns 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
Returns Ok
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
Returns WebAppInfo
Optimizes storage usage, i.e., deletes some files and returns new storage
usage statistics. Secret thumbnails can't be deleted
Returns StorageStatistics
Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji,
BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl,
MentionName, and DateTime entities from a marked-up text. Can be called
synchronously
Returns FormattedText
Posts a new story on behalf of a chat; requires can_post_stories
administrator right for supergroup and channel chats. Returns a temporary
story
Returns Story
Preliminarily uploads a file to the cloud before sending it in a message,
which can be useful for uploading voice and video notes that are being
recorded. In all other cases, there is no need to upload a file in
advance. Updates updateFile will be used to notify about upload progress.
The upload will not be completed until the file is sent in a message
Returns File
Ability to change the position of the main chat list, archive and mute all
new chats from non-contacts, and completely disable notifications about
the user's contacts joining Telegram
The ability to disallow incoming voice and video note messages in private
chats using setUserPrivacySettingRules with
userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict
incoming messages from non-contacts using setNewChatPrivacySettings
Describes an option for gifting Telegram Premium to a user. Use
telegramPaymentPurposePremiumGift for out-of-store payments or payments in
Telegram Stars
Describes an option for creating a Telegram Premium giveaway or manual
distribution of Telegram Premium among chat members. Use
telegramPaymentPurposePremiumGiftCodes or
telegramPaymentPurposePremiumGiveaway for out-of-store payments
Handles a push notification. Returns an error with code 406 if the push
notification is not supported and a connection to the server is required
to fetch new data. Can be called before authorization
Returns Ok
Passes a message, which the page of a web proxy carrier passed to
postMessage of the bridge object, to TDLib. Must be called in the order in
which the messages were passed. Can be called before authorization
Returns Ok
A web proxy server. MTProto traffic goes through an HTTPS relay page
hosted by the application in a hidden web view; see
updateWebProxyCarrierOpened. The proxy server must be a domain name and
the port must be 443
Contains privacy settings for message read date in private chats. Read
dates are always shown to the users who can see the online status of the
current user regardless of this setting
Re-adds quick reply messages that failed to add. Can be called only for
messages for which messageSendingStateFailed.can_retry is true and after
the time specified in messageSendingStateFailed.retry_after has passed. If
a message is re-added, the corresponding message that failed to send 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-added, null
will be returned instead of the message
Returns QuickReplyMessages
Reads a part of a file from the TDLib file cache and returns the 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
Returns Data
Recognizes speech in an audio file and returns the recognized text; can be
used only if getOption("can_recognize_speech") or speech recognition trial
is available; must not be used in secret chats. The file must be in OGG
format with the Opus codec and must have a size of up to 1 MB
Returns Text
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
Returns Ok
Registers the currently used device for receiving push notifications.
Returns a globally unique identifier of the push notification subscription
Returns PushReceiverId
Removes a chat from a community. Members of the chat who aren't members of
other chats in the community will be removed from the community. Requires
owner privileges in the supergroup or channel chat, or ownership of the
bot for chats with bots, or can_edit_chat_list administrator right in the
community
Returns Ok
Removes gifts from a collection. If the collection is owned by a channel
chat, then requires can_post_messages administrator right in the channel
chat. Returns the changed collection
Returns GiftCollection
Removes stories from an album. If the album is owned by a supergroup or a
channel chat, then requires can_edit_stories administrator right in the
chat. Returns the changed album
Returns StoryAlbum
Removes a custom text composition style from the list of styles used by
the user. If the style was created by the current user, then it can only
be deleted
Returns Ok
Changes the order of gifts in a collection. If the collection is owned by
a channel chat, then requires can_post_messages administrator right in the
channel chat. Returns the changed collection
Returns GiftCollection
Changes the order of gift collections. If the collections are owned by a
channel chat, then requires can_post_messages administrator right in the
channel chat
Returns Ok
Changes the order of story albums. If the albums are owned by a supergroup
or a channel chat, then requires can_edit_stories administrator right in
the chat
Returns Ok
Changes the order of stories in an album. If the album is owned by a
supergroup or a channel chat, then requires can_edit_stories administrator
right in the chat. Returns the changed album
Returns StoryAlbum
Replaces the current primary invite link for a chat with a new primary
invite link. Available in basic groups, supergroups, and channels.
Requires administrator privileges and can_invite_users right
Returns ChatInviteLink
Replaces an existing sticker in a set. The function is equivalent to
removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet
Returns Ok
Replaces the current TON wallet with another existing v6r2 wallet or
changes the private key of the current TON wallet; can be used only if
getOption("can_use_ton_wallet")
Returns Ok
Instructs the application to remove the keyboard once this message has
been received. This kind of keyboard can't be received in an incoming
message; instead, updateChatReplyMarkup with reply_markup_message == null
will be sent
Reports that the authentication code wasn't delivered via SMS; for
official mobile applications only. Works only when the current
authorization state is authorizationStateWaitCode
Returns Ok
Reports a chat to the Telegram moderators. A chat can be reported only
from the chat action bar, if chat.can_be_reported, or if
messageProperties.can_report_chat
Returns ReportChatResult
Reports reactions set on a message to the Telegram moderators. Reactions
on a message can be reported only if
messageProperties.can_report_reactions
Returns 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
Returns Ok
Reports that a web proxy carrier failed. TDLib closes the carrier and
decides whether and when to request a new one. Can be called before
authorization
Returns 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 Ok
Requests to send a 2-step verification password recovery code to an email
address that was previously set up
Returns EmailAddressAuthenticationCodeInfo
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
authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode,
authorizationStateWaitRegistration, or authorizationStateWaitPassword
Returns Ok
Resends an authentication code to the user. Works only when the current
authorization state is authorizationStateWaitCode,
authorization_state.code_info.next_type is not null, and the
server-specified timeout has passed, or when the current authorization
state is authorizationStateWaitEmailCode
Returns Ok
Resends messages that failed to send. Can be called only for messages for
which messageSendingStateFailed.can_retry is true and after the time
specified in messageSendingStateFailed.retry_after has passed. If a
message is re-sent, the corresponding message that failed to send 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
Returns Messages
Resends the authentication code sent to a phone number. Works only if the
previously received authenticationCodeInfo.next_type was not null and the
server-specified timeout has passed
Returns AuthenticationCodeInfo
Resets the login email address. May return an error with a message
"TASK_ALREADY_EXISTS" if the reset is still pending. Works only when the
current authorization state is authorizationStateWaitEmailCode and
authorization_state.email_address_reset_state != null
Returns Ok
Removes the 2-step verification password without the previous password and
access to the recovery email address. The password can't be reset
immediately and the request needs to be repeated after the specified time
Returns ResetPasswordResult
Revokes an invite link for a chat. Available in 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, in addition to the revoked link, the new
primary link is returned
Returns ChatInviteLinks
Searches for call and group 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
Returns FoundMessages
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
Returns ChatMembers
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 topic_id search criteria is expected to
be supported only if it is required for the official Telegram application
implementation
Returns FoundChatMessages
Returns information about the recent live locations of chat members that
were sent to the chat. Returns at most one live location message per user
Returns Messages
Searches for the specified query in the title and username of already
known chats. This is an offline method. Returns chats in the order seen in
the main chat list
Returns Chats
Searches for the specified query in the title and username of already
known chats via a request to the server. Returns chats in the order seen
in the main chat list
Returns Chats
Searches for messages in all chats except secret chats. Returns the
results in reverse chronological order (i.e., in order of decreasing
(message.date, message.chat_id, message.id)). For optimal performance, the
number of returned messages is chosen by TDLib and can be smaller than the
specified limit
Returns FoundMessages
Returns only messages with unread mentions of the current user, or
messages that are replies to their messages. When using this filter, the
results can't be additionally filtered by a query or by the sending user
Returns only messages with unread poll votes for the current user. When
using this filter, the results can't be additionally filtered by a query
or by the sending user
Returns only messages with unread reactions for the current user. When
using this filter, the results can't be additionally filtered by a query
or by the sending user
Searches for outgoing messages with content of the type messageDocument in
all chats except secret chats. Returns the results in reverse
chronological order
Returns FoundMessages
Searches for 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
Returns Chat
Searches for public chats by looking for the 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
Returns Chats
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
Returns FoundMessages
Searches for public channel posts using the given query. For optimal
performance, the number of returned messages is chosen by TDLib and can be
smaller than the specified limit
Returns FoundPublicPosts
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
Returns 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
Returns 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
Returns FoundStories
Searches for a given quote in a text. Returns the start position of the
found quote in UTF-16 code units. Returns a 404 error if the quote is not
found. Can be called synchronously
Returns FoundPosition
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
Returns FoundChatMessages
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
Returns FoundMessages
Searches for sticker sets by looking for the specified query in their
title and name. Excludes installed sticker sets from the results
Returns StickerSets
Searches for the specified query by word prefixes in the provided strings.
Returns 0-based positions of strings that matched. Can be called
synchronously
Returns FoundPositions
Sells a gift for Telegram Stars. Use receivedGift.sell_star_count or
messageGift.sell_star_count to check whether the gift is sellable. A gift
can be sold if it is sellable and not more than
getOption("gift_sell_period") seconds have passed since the gift was sent
Returns Ok
Sends a Firebase Authentication SMS to the phone number of the user. Works
only when the current authorization state is authorizationStateWaitCode
and the server returned a code of the type
authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos
Returns Ok
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
Returns Message
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 only
be grouped in an album with messages of the same type. Returns the sent
messages
Returns BusinessMessages
Sends an ephemeral message that will be received only by one bot in a
chat. Currently, only ephemeral bot commands and replies to bot ephemeral
messages can be sent using the method. The message is persistent across
application restarts only if the message database is used. Returns the
sent message
Returns Message
Sends an on-chain offer to purchase an upgraded gift for TON Grams; can be
used only if getOption("can_use_ton_wallet"). Returns the transaction that
must be sent from the TON wallet of the current user to create the offer.
The offer is created only after the transaction is executed on the TON
blockchain
Returns GiftOnChainPurchaseOfferTransaction
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 only be grouped in an album with messages of
the same type. Returns the sent messages
Returns Messages
Informs TDLib about details of a message view by the user from a chat, a
message thread, or a forum topic history. The method must be called if the
message wasn't seen for more than 300 milliseconds, the viewport was
destroyed, or the total view duration exceeded 5 minutes
Returns 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
Returns Ok
Sends a code to the specified phone number. Aborts the previous phone
number verification if there was one. On success, returns information
about the sent code
Returns AuthenticationCodeInfo
Sends a Firebase Authentication SMS to the specified phone number. Works
only after receiving a code of the type
authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos
Returns Ok
Sends an upgraded gift that is available for resale to another user or
channel chat; gifts already owned by the current user must be transferred
using transferGift and can't be passed to the method. Gifts for which
upgradedGift.uses_on_chain_resale is true must be bought using
getGiftOnChainPurchaseTransaction
Returns GiftResaleResult
Sends a transaction signed by the application from the TON wallet of the
current user without adding a message about it to any chat; can be used
only if getOption("can_use_ton_wallet"). Use the method to send
transactions described by upgradedGiftDepositInfo,
giftOnChainPurchaseOfferTransaction, and GiftOnChainSaleTransaction
objects
Returns TonWalletTransferResult
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
Returns 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
authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode,
authorizationStateWaitRegistration, or authorizationStateWaitPassword
Returns Ok
Informs the server about an in-store purchase of Telegram Premium before
authorization. Works only when the current authorization state is
authorizationStateWaitPremiumPurchase
Returns 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
Returns Ok
Sets the background in a specific chat. Supported only in private and
secret chats with non-deleted users, and in chats with a sufficient boost
level and can_change_info administrator right
Returns 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
Returns 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 need to be passed
Returns Ok
Changes the tag or custom title of a chat member; requires can_manage_tags
administrator right to change the tag of other users; for basic groups and
supergroups only
Returns Ok
Changes the message auto-delete or self-destruct (for secret chats) time
in a chat. Requires can_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).
Returns Ok
Changes the Telegram Star amount that must be paid to send a message to a
supergroup chat; requires can_restrict_members administrator right and
supergroupFullInfo.can_enable_paid_messages
Returns Ok
Changes the accent color and background custom emoji for the profile of a
supergroup or channel chat. Requires can_change_info administrator right
Returns Ok
Changes the name of a gift collection. If the collection is owned by a
channel chat, then requires can_post_messages administrator right in the
channel chat. Returns the changed collection
Returns GiftCollection
Changes the resale price of a unique gift owned by the current user; can
be used only for gifts for which upgradedGift.uses_on_chain_resale is
false
Returns Ok
Changes the minimum number of Telegram Stars that must be paid by a
general participant for each sent message to a live story call. Requires
groupCall.can_be_managed right
Returns Ok
Informs TDLib that the speaking state of a participant of an active group
call has changed. Returns the identifier of the participant if it is found
Returns MessageSender
Changes the volume level of a participant of an active group call; not
supported for live stories. If the current user can manage the group call
or is the owner of the group call, then the participant's volume level
will be changed for all users with the default volume level
Returns Ok
Changes the login email address of the user. The email address can be
changed only if the current user already has a login email and
passwordState.login_email_address_pattern is non-empty, or the user
received suggestedActionSetLoginEmailAddress and
isLoginEmailAddressRequired succeeds. 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
Returns EmailAddressAuthenticationCodeInfo
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. The network
type is used to check whether the library can use the network at all and
also for collecting detailed network data usage statistics
Returns Ok
Sets the value of an option. (Check the list of available options on
https://core.telegram.org/tdlib/options.) Only writable options can be
set. Can be called before authorization
Returns Ok
Changes the type of the paid message reaction of the current user on a
message. The message must have a paid reaction added by the current user
Returns Ok
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
Returns PassportElement
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
Returns Ok
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
Returns PasswordState
Changes the order of pinned topics in a forum supergroup chat or a chat
with a bot with topics; requires can_manage_topics administrator right in
the supergroup
Returns Ok
Changes the list of pinned gifts on the current user's or the channel's
profile page; requires can_post_messages administrator right in the
channel chat
Returns Ok
Changes the theme of the screen for sharing a link to the current user or
a chat. The chat must have a username. Requires can_change_info
administrator right in supergroups and channels
Returns Ok
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
Returns PasswordState
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
Returns 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
Returns Ok
Changes the name of an album of stories. If the album is owned by a
supergroup or a channel chat, then requires can_edit_stories administrator
right in the chat. Returns the changed album
Returns StoryAlbum
Changes the privacy settings of a story. The method can be called only for
stories posted on behalf of the current user and if
story.can_set_privacy_settings == true
Returns 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
set a custom emoji sticker set
Returns 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
Returns Ok
Sets wallet_client_id for a pending TON Connect session. Then,
sendTonConnectSessionConnectResult must be used to accept or reject the
session. If the session was created for an OAuth request, then
acceptOauthRequest must be used instead
Returns TonConnectChallenge
Changes the list of stickers on the TON wallet card of the current user;
can be used only if getOption("can_use_ton_wallet"). The whole list of
stickers is replaced. The request can take up to 20 seconds to complete,
so it must be called only on an explicit user action. Stickers are removed
automatically if the corresponding NFT leaves the wallet or the wallet is
replaced. Returns the updated card
Returns TonWalletCard
Shares the phone number of the current user with a mutual contact.
Supposed to be called when the user clicks on
chatActionBarSharePhoneNumber
Returns Ok
Suggests that the user extend their expiring Telegram Star subscriptions.
Call getStarSubscriptions with only_expiring == true to get the number of
expiring subscriptions and the number of Telegram Stars that must be
bought
Suggests that the user add a login email address. Call
isLoginEmailAddressRequired, and then setLoginEmailAddress or
checkLoginEmailAddressCode to change the login email address
Contains information about a suggested post. If the post can be approved
or declined, then changes to the post can also be suggested. Use
sendMessage with a reply to the message and suggested post information to
suggest message changes. Use addOffer to suggest price or time changes
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 currently used/base language packs. Can be
called before authorization
Returns Ok
Terminates all other sessions of the current user. Additionally, the
application must suggest deleting the connected business bot using
deleteBusinessConnectedBot if there is any
Returns Ok
Returns the received vector of objects containing a number; for testing
only. This is an offline method. Can be called before authorization
Returns TestVectorIntObject
Returns the received vector of objects containing a string; for testing
only. This is an offline method. Can be called before authorization
Returns TestVectorStringObject
Does nothing and ensures that the Update object is used; for testing only.
This is an offline method. Can be called before authorization
Returns Update
Text that must be formatted as if inside a blockquote HTML tag and
collapsed by default to 3 lines with the ability to show the full text;
not supported in secret chats
Adds a bot to or removes it from the attachment and side menus. The bot
can be added to the menus only if
userTypeBot.can_be_added_to_attachment_menu == true
Returns Ok
Changes the active state for a username of a bot. The editable username
can be disabled only if there are other active usernames. 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
Returns Ok
Toggles whether notifications for new gifts received by a channel chat are
sent to the current user; requires can_post_messages administrator right
in the chat
Returns Ok
Changes the ability of users to save, forward, or copy chat content.
Requires owner privileges in basic groups, supergroups, and channels.
Requires Telegram Premium to enable protected content in private chats.
Not available in Saved Messages and private chats with bots or support
accounts
Returns 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
Returns Ok
Changes whether all chats of a community are collapsed into one entry in
the chat list. If the chats are expanded, then the community is removed
from all chat folders
Returns Ok
Bans or unbans a member of a community; requires can_ban_members
administrator right in the community. A banned member is banned in all
chats of the community. Administrators of the community can be banned only
by the owner of the community and administrators who can edit
administrator rights of the member. If an owner of a chat in the community
is banned, then the chat is removed from the community; in this case,
can_edit_chat_list administrator right is also required
Returns Ok
Toggles whether a topic is closed in a forum supergroup chat; requires
can_manage_topics administrator right in the supergroup unless the user is
the creator of the topic
Returns Ok
Changes the pinned state of a topic in a forum supergroup chat or a chat
with a bot with topics; requires can_manage_topics administrator right in
the supergroup. There can be up to
getOption("pinned_forum_topic_count_max") pinned forum topics
Returns Ok
Toggles whether a gift is shown on the current user's or the channel's
profile page; requires can_post_messages administrator right in the
channel chat
Returns Ok
Toggles whether the current user has sponsored messages enabled. The
setting has no effect for users without Telegram Premium for whom
sponsored messages are always enabled
Returns 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
Returns 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
Returns Ok
Toggles whether aggressive anti-spam checks are enabled in the supergroup.
Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam
== true
Returns Ok
Toggles whether messages are automatically translated in the channel chat;
requires can_change_info administrator right in the channel. The chat must
have at least chatBoostFeatures.min_automatic_translation_boost_level
boost level to enable automatic translation
Returns 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
Returns Ok
Toggles whether all users directly joining the supergroup need to be
approved by supergroup administrators; requires can_restrict_members
administrator right
Returns Ok
Changes the 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
Returns Ok
Changes the 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
Returns Ok
Toggles whether new participants of a video chat can be unmuted only by
administrators of the video chat. Requires
groupCall.can_toggle_mute_new_participants right
Returns Ok
A Telegram gift was minted as a TON NFT directly to the wallet, or a
minted gift was linked to or unlinked from a Telegram account. Information
about the other user isn't available
Changes the owner of a chat; for basic groups, supergroups, and channel
chats only; requires owner privileges in the chat. Use the method
canTransferOwnership to check whether the ownership can be transferred
from the current session
Returns Ok
Extracts the text or caption of the given message and translates it to the
given language; must not be used in secret chats. If the current user is a
Telegram Premium user, then text formatting is preserved
Returns FormattedText
Translates a text to the given language; must not be used in secret chats.
If the current user is a Telegram Premium user, then text formatting is
preserved
Returns FormattedText
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
Returns Ok
Removes all pinned messages from a topic in a forum supergroup chat or a
chat with a bot with topics; requires can_pin_messages member right in the
supergroup
Returns 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
Returns Ok
The list of messages with an active live location that need to be updated
by the application has changed. The list is persistent across application
restarts only if the message database is used
Contains active notifications that were shown on previous application
launches. This update is sent only if the message database is used. In
that case, it comes once before any updateNotification and
updateNotificationGroup updates
Lists of suffixes allowed in secondary bot usernames, which can be added
in addition to the main username if the bot's owner has a Telegram Premium
subscription
Some animated emoji message was clicked and a big animated sticker must be
played if the message is visible on the screen.
chatActionWatchingAnimations with the text of the message needs to be sent
if the sticker is played
A request can't be completed unless reCAPTCHA verification is performed;
for official mobile applications only. The method
setApplicationVerificationToken must be called once the verification is
completed or failed
A request can't be completed unless application verification is performed;
for official mobile applications only. The method
setApplicationVerificationToken must be called once the verification is
completed or failed
A chat draft has changed. Be aware that the update may come in the
currently opened chat but with old content of the draft. If the user has
changed the content of the draft, this update mustn't be applied
The number of online group members has changed. This update with a
non-zero number of online group members is sent only for currently opened
chats. There is no guarantee that it is sent just after the number of
online users has changed
The revenue earned from sponsored messages in a chat has changed. If the
chat revenue screen is opened, then getChatRevenueTransactions may be
called to fetch new transactions
Basic information about a topic in a channel direct messages chat
administered by the current user has changed. This update is guaranteed to
come before the topic identifier is returned to the application
The TON Gram revenue earned by the current user has changed. If the Gram
transaction screen of the chat is opened, then getTonTransactions may be
called to fetch new transactions
Information about a group call participant was changed. The updates are
sent only after the group call is received through getGroupCall and only
if the call is joined or being joined
Describes whether there are some pending notification updates. Can be used
to prevent the application from being killed while there are some pending
notifications
A request to send a message has reached the Telegram server. This doesn't
mean that the message will be sent successfully. This update is sent only
if the option "use_quick_ack" is set to true. This update may be sent
multiple times for the same message
A message failed to send. Be aware that some messages being sent can be
irrecoverably deleted, in which case updateDeleteMessages will be received
instead of this update
A new chat has been loaded/created. This update is guaranteed to come
before the chat identifier is returned to the application. The chat field
changes will be reported through separate updates
A new pending text or rich message was received in a chat with a bot. The
message must be shown in the chat for at most
getOption("pending_text_message_period") seconds, replace any other
pending message with the same draft_id with animation, and be deleted
whenever any incoming message or a pending message with another draft_id
is received in the message thread
Basic information about a quick reply shortcut has changed. This update is
guaranteed to come before the quick shortcut name is returned to the
application
Basic information about a Saved Messages topic has changed. This update is
guaranteed to come before the topic identifier is returned to the
application
The list of saved notification sounds was updated. This update may not be
sent until information about a notification sound was requested for the
first time
Download or upload file speed for the user was limited, but it can be
restored by subscription to Telegram Premium. The notification can be
postponed until a file being downloaded or uploaded is visible to the
user. Use getOption("premium_download_speedup") or
getOption("premium_upload_speedup") to get the expected speedup after
subscription to Telegram Premium
The Telegram Star revenue earned by a user or a chat has changed. If the
Telegram Star transaction screen of the chat is opened, then
getStarTransactions may be called to fetch new transactions
New terms of service must be accepted by the user. If the terms of service
are declined, then the deleteAccount method must be called with the reason
"Decline ToS update"
A web proxy carrier must be closed. If the page has passed any message to
the bridge object, then the application must deliver the string
{"t":"close"} to the page, so that it can end its relay session, and
destroy the web view shortly after, for example, in 200 milliseconds;
otherwise, the web view must be destroyed immediately. Messages from the
carrier received after this update must be ignored
Data must be delivered as an ArrayBuffer to the page of a web proxy
carrier through the onmessage function of the bridge object, in the order
of the updates
A web proxy carrier must be opened as described in webProxyCarrier.
Messages passed by the page to the bridge object must be passed to
processWebProxyCarrierMessage. Failures of the carrier must be reported
with reportWebProxyCarrierError
Creates a new supergroup from an existing basic group and sends a
corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires
owner privileges. Deactivates the original basic group
Returns Chat
Contains a list of names of upgraded gift collections. The name of the
collection of an upgraded gift is the part of upgradedGift.name before the
last "-"
Contains information needed to deposit an upgraded gift from the TON
wallet of the current user to a Telegram account. The gift must be
transferred by an internal message from the wallet to nft_address with
gram_amount attached and with payload as the message body. Use
sendTonWalletTransaction to send the message
A privacy setting for managing whether the user can be found by their
phone number. Checked only if the phone number is not known to the other
user. Can be set only to "Allow contacts" or "Allow all"
A list of privacy rules. Rules are matched in the specified order. The
first matched rule defines the privacy setting for a given user. If no
rule matches, the action is not allowed
A deleted user or deleted bot. No information on the user besides the user
identifier is available. It is not possible to perform any active actions
on this type of user
No information on the user besides the user identifier is available, yet
this user has not been deleted. This object is extremely rare and must be
handled like a deleted user. It is not possible to perform any actions on
users of this type
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)
Returns Ok
Describes a web proxy carrier: an HTTPS relay page, which carries traffic
of a web proxy and must be loaded by the application as the top-level
document of a hidden web view. Before loading the page, the application
must arrange for an object named carrier.bridge_object_name to be defined
in the top-level document whenever its origin is exactly carrier.origin,
and in no other document or frame. The object must be read-only and must
have two members: a method postMessage(value), which passes an ArrayBuffer
or a typed array to processWebProxyCarrierMessage as
webProxyCarrierMessageBinary, passes a string as
webProxyCarrierMessageText, and rejects any other value; and a property
onmessage, which the page sets to a function. The application delivers
data to the page by calling that function with an object {data: value},
where value is an ArrayBuffer for binary data and a string for text. Each
carrier needs its own web view
The application can't open the carrier now, for example, because it is in
the background; TDLib will request it again after the next call to
setNetworkType or after a delay
The application can't open the carrier because the platform can't create
hidden web views or define the bridge object; TDLib will not retry until
the proxy is enabled again
Withdraws all available TON Grams of the current user directly to the TON
wallet of the current user, which is created automatically if the user has
no wallet yet. The user must have a valid temporary password; see
createTemporaryPassword. If the wallet is being created, then the request
fails with the error "WALLET_CREATING" and must be repeated later. The
withdrawal is completed only after the transaction is confirmed on the TON
blockchain
Returns 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
Returns Ok