Module methods

Module methods 

Source

Structs§

AcceptCall
Accepts an incoming call
AcceptTermsOfService
Accepts Telegram terms of services
AddChatMember
Adds a new member to a chat. Members can’t be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server
AddChatMembers
Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can’t be used to join a chat. Members can’t be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server
AddFavoriteSticker
Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list
AddLocalMessage
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
AddNetworkStatistics
Adds the specified data to data usage statistics. Can be called before authorization
AddProxy
Adds a proxy server for network requests. Can be called before authorization
AddRecentSticker
Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list
AddRecentlyFoundChat
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
AddSavedAnimation
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
AddStickerToSet
Adds a new sticker to a set; for bots only. Returns the sticker set
AnswerCallbackQuery
Sets the result of a callback query; for bots only
AnswerCustomQuery
Answers a custom query; for bots only
AnswerInlineQuery
Sets the result of an inline query; for bots only
AnswerPreCheckoutQuery
Sets the result of a pre-checkout query; for bots only
AnswerShippingQuery
Sets the result of a shipping query; for bots only
BlockUser
Adds a user to the blacklist
CancelDownloadFile
Stops the downloading of a file. If a file has already been downloaded, does nothing
CancelUploadFile
Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined
ChangeChatReportSpamState
Used to let the server know whether a chat is spam or not. Can be used only if ChatReportSpamState.can_report_spam is true. After this request, ChatReportSpamState.can_report_spam becomes false forever
ChangeImportedContacts
Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time
ChangePhoneNumber
Changes the phone number of the user and sends an authentication code to the user’s new phone number. On success, returns information about the sent code
ChangeStickerSet
Installs/uninstalls or activates/archives a sticker set
CheckAuthenticationBotToken
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
CheckAuthenticationCode
Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode
CheckAuthenticationPassword
Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword
CheckChangePhoneNumberCode
Checks the authentication code sent to confirm a new phone number of the user
CheckChatInviteLink
Checks the validity of an invite link for a chat and returns information about the corresponding chat
CheckChatUsername
Checks whether a username can be set for a chat
CheckDatabaseEncryptionKey
Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey
CheckEmailAddressVerificationCode
Checks the email address verification code for Telegram Passport
CheckPhoneNumberConfirmationCode
Checks phone number confirmation code
CheckPhoneNumberVerificationCode
Checks the phone number verification code for Telegram Passport
CleanFileName
Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously
ClearAllDraftMessages
Clears draft messages in all chats
ClearImportedContacts
Clears all imported contacts, contacts list remains unchanged
ClearRecentStickers
Clears the list of recently used stickers
ClearRecentlyFoundChats
Clears the list of recently found chats
Close
Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent
CloseChat
This method should be called if the chat is closed by the user. Many useful activities depend on the chat being opened or closed
CloseSecretChat
Closes a secret chat, effectively transfering its state to secretChatStateClosed
CreateBasicGroupChat
Returns an existing chat corresponding to a known basic group
CreateCall
Creates a new call
CreateNewBasicGroupChat
Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
CreateNewSecretChat
Creates a new secret chat. Returns the newly created chat
CreateNewStickerSet
Creates a new sticker set; for bots only. Returns the newly created sticker set
CreateNewSupergroupChat
Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
CreatePrivateChat
Returns an existing chat corresponding to a given user
CreateSecretChat
Returns an existing chat corresponding to a known secret chat
CreateSupergroupChat
Returns an existing chat corresponding to a known supergroup or channel
CreateTemporaryPassword
Creates a new temporary password for processing payments
DeleteAccount
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
DeleteChatHistory
Deletes all messages in the chat only for the user. Cannot be used in channels and public supergroups
DeleteChatMessagesFromUser
Deletes all messages sent by the specified user to a chat. Supported only in supergroups; requires can_delete_messages administrator privileges
DeleteChatReplyMarkup
Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed
DeleteFile
Deletes a file from the TDLib file cache
DeleteLanguagePack
Deletes all information about a language pack in the current localization target. The language pack that is currently in use can’t be deleted
DeleteMessages
Deletes messages
DeletePassportElement
Deletes a Telegram Passport element
DeleteProfilePhoto
Deletes a profile photo. If something changes, updateUser will be sent
DeleteSavedCredentials
Deletes saved credentials for all payment provider bots
DeleteSavedOrderInfo
Deletes saved order info
DeleteSupergroup
Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires creator privileges in the supergroup or channel. Chats with more than 1000 members can’t be deleted using this method
Destroy
Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent
DisableProxy
Disables the currently enabled proxy. Can be called before authorization
DiscardCall
Discards a call
DisconnectAllWebsites
Disconnects all websites from the current user’s Telegram account
DisconnectWebsite
Disconnects website from the current user’s Telegram account
DownloadFile
Asynchronously downloads a file from the cloud. updateFile will be used to notify about the download progress and successful completion of the download. Returns file state just after the download has been started
EditCustomLanguagePackInfo
Edits information about a custom language pack in the current localization target
EditInlineMessageCaption
Edits the caption of an inline message sent via a bot; for bots only
EditInlineMessageLiveLocation
Edits the content of a live location in an inline message sent via a bot; for bots only
EditInlineMessageMedia
Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
EditInlineMessageReplyMarkup
Edits the reply markup of an inline message sent via a bot; for bots only
EditInlineMessageText
Edits the text of an inline text or game message sent via a bot; for bots only
EditMessageCaption
Edits the message content caption. Returns the edited message after the edit is completed on the server side
EditMessageLiveLocation
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
EditMessageMedia
Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can’t be replaced if the message was set to self-destruct. Media can’t be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side
EditMessageReplyMarkup
Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
EditMessageText
Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side
EditProxy
Edits an existing proxy server for network requests. Can be called before authorization
EnableProxy
Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization
FinishFileGeneration
Finishes the file generation
ForwardMessages
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
GenerateChatInviteLink
Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. In basic groups this can be called only by the group’s creator; in supergroups and channels this requires appropriate administrator rights
GetAccountTtl
Returns the period of inactivity after which the account of the current user will automatically be deleted
GetActiveLiveLocationMessages
Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used
GetActiveSessions
Returns all active sessions of the current user
GetAllPassportElements
Returns all available Telegram Passport elements
GetArchivedStickerSets
Returns a list of archived sticker sets
GetAttachedStickerSets
Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets
GetAuthorizationState
Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state
GetBasicGroup
Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot
GetBasicGroupFullInfo
Returns full information about a basic group by its identifier
GetBlockedUsers
Returns users that were blocked by the current user
GetCallbackQueryAnswer
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
GetChat
Returns information about a chat by its identifier, this is an offline request if the current user is not a bot
GetChatAdministrators
Returns a list of users who are administrators of the chat
GetChatEventLog
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 event_id)
GetChatHistory
Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library. This is an offline request if only_local is true
GetChatMember
Returns information about a single member of a chat
GetChatMessageByDate
Returns the last message sent in a chat no later than the specified date
GetChatMessageCount
Returns approximate number of messages of the specified type in the chat
GetChatPinnedMessage
Returns information about a pinned chat message
GetChatReportSpamState
Returns information on whether the current chat can be reported as spam
GetChats
Returns an ordered list of chats. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to 2^63 - 1). For optimal performance the number of returned chats is chosen by the library.
GetConnectedWebsites
Returns all website where the current user used Telegram to log in
GetContacts
Returns all user contacts
GetCountryCode
Uses current user IP to found his country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization
GetCreatedPublicChats
Returns a list of public chats created by the user
GetDeepLinkInfo
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
GetFavoriteStickers
Returns favorite stickers
GetFile
Returns information about a file; this is an offline request
GetFileExtension
Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously
GetFileMimeType
Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously
GetGameHighScores
Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only
GetGroupsInCommon
Returns a list of common chats with a given user. Chats are sorted by their type and creation date
GetImportedContactCount
Returns the total number of imported contacts
GetInlineGameHighScores
Returns game high scores and some part of the high score table in the range of the specified user; for bots only
GetInlineQueryResults
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
GetInstalledStickerSets
Returns a list of installed sticker sets
GetInviteText
Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram
GetLanguagePackString
Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously
GetLanguagePackStrings
Returns strings from a language pack in the current localization target by their keys
GetLocalizationTargetInfo
Returns information about the current localization target. This is an offline request if only_local is true
GetMapThumbnailFile
Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded
GetMe
Returns the current user
GetMessage
Returns information about a message
GetMessages
Returns information about messages. If a message is not found, returns null on the corresponding position of the result
GetNetworkStatistics
Returns network data usage statistics. Can be called before authorization
GetOption
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
GetPassportAuthorizationForm
Returns a Telegram Passport authorization form for sharing data with a service
GetPassportElement
Returns one of the available Telegram Passport elements
GetPasswordState
Returns the current state of 2-step verification
GetPaymentForm
Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy
GetPaymentReceipt
Returns information about a successful payment
GetPreferredCountryLanguage
Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown
GetProxies
Returns list of proxies that are currently set up. Can be called before authorization
GetProxyLink
Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization
GetPublicMessageLink
Returns a public HTTPS link to a message. Available only for messages in public supergroups and channels
GetRecentInlineBots
Returns up to 20 recently used inline bots in the order of their last usage
GetRecentStickers
Returns a list of recently used stickers
GetRecentlyVisitedTMeUrls
Returns t.me URLs recently visited by a newly registered user
GetRecoveryEmailAddress
Returns a recovery email address that was previously set up. This method can be used to verify a password provided by the user
GetRemoteFile
Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message
GetRepliedMessage
Returns information about a message that is replied by given message
GetSavedAnimations
Returns saved animations
GetSavedOrderInfo
Returns saved order info, if any
GetScopeNotificationSettings
Returns the notification settings for chats of a given type
GetSecretChat
Returns information about a secret chat by its identifier. This is an offline request
GetStickerEmojis
Returns emoji corresponding to a sticker
GetStickerSet
Returns information about a sticker set by its identifier
GetStickers
Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned
GetStorageStatistics
Returns storage usage statistics
GetStorageStatisticsFast
Quickly returns approximate storage usage statistics
GetSupergroup
Returns information about a supergroup or channel by its identifier. This is an offline request if the current user is not a bot
GetSupergroupFullInfo
Returns full information about a supergroup or channel by its identifier, cached for up to 1 minute
GetSupergroupMembers
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
GetSupportUser
Returns a user that can be contacted to get support
GetTemporaryPasswordState
Returns information about the current temporary password
GetTextEntities
Returns all entities (mentions, hashtags, cashtags, bot commands, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously
GetTopChats
Returns a list of frequently used chats. Supported only if the chat info database is enabled
GetTrendingStickerSets
Returns a list of trending sticker sets
GetUser
Returns information about a user by their identifier. This is an offline request if the current user is not a bot
GetUserFullInfo
Returns full information about a user by their identifier
GetUserPrivacySettingRules
Returns the current privacy settings
GetUserProfilePhotos
Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already
GetWallpapers
Returns background wallpapers
GetWebPageInstantView
Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page
GetWebPagePreview
Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview
ImportContacts
Adds new contacts or edits existing contacts; contacts’ user identifiers are ignored
JoinChat
Adds current user as a new member to a chat. Private and secret chats can’t be joined using this method
JoinChatByInviteLink
Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server
LeaveChat
Removes current user from chat members. Private and secret chats can’t be left using this method
LogOut
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
MethodType
OpenChat
This method should be called if 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)
OpenMessageContent
This method should be called if 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
OptimizeStorage
Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can’t be deleted
ParseTextEntities
Parses Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously
PinSupergroupMessage
Pins a message in a supergroup or channel; requires appropriate administrator rights in the supergroup or channel
PingProxy
Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization
ProcessDcUpdate
Handles a DC_UPDATE push service notification. Can be called before authorization
ReadAllChatMentions
Marks all mentions in a chat as read
RecoverAuthenticationPassword
Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
RecoverPassword
Recovers the password using a recovery code sent to an email address that was previously set up
RegisterDevice
Registers the currently used device for receiving push notifications
RemoveContacts
Removes users from the contacts list
RemoveFavoriteSticker
Removes a sticker from the list of favorite stickers
RemoveProxy
Removes a proxy server. Can be called before authorization
RemoveRecentHashtag
Removes a hashtag from the list of recently used hashtags
RemoveRecentSticker
Removes a sticker from the list of recently used stickers
RemoveRecentlyFoundChat
Removes a chat from the list of recently found chats
RemoveSavedAnimation
Removes an animation from the list of saved animations
RemoveStickerFromSet
Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot
RemoveTopChat
Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled
ReorderInstalledStickerSets
Changes the order of installed sticker sets
ReportChat
Reports a chat to the Telegram moderators. Supported only for supergroups, channels, or private chats with bots, since other chats can’t be checked by moderators
ReportSupergroupSpam
Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup
RequestAuthenticationPasswordRecovery
Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
RequestPasswordRecovery
Requests to send a password recovery code to an email address that was previously set up
ResendAuthenticationCode
Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null
ResendChangePhoneNumberCode
Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null
ResendEmailAddressVerificationCode
Re-sends the code to verify an email address to be added to a user’s Telegram Passport
ResendPhoneNumberConfirmationCode
Resends phone number confirmation code
ResendPhoneNumberVerificationCode
Re-sends the code to verify a phone number to be added to a user’s Telegram Passport
ResetAllNotificationSettings
Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to “default” and message previews are shown
ResetNetworkStatistics
Resets all network data usage statistics to zero. Can be called before authorization
SearchCallMessages
Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library
SearchChatMembers
Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels
SearchChatMessages
Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library
SearchChatRecentLocationMessages
Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user
SearchChats
Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list
SearchChatsOnServer
Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list
SearchContacts
Searches for the specified query in the first names, last names and usernames of the known user contacts
SearchHashtags
Searches for recently used hashtags by their prefix
SearchInstalledStickerSets
Searches for installed sticker sets by looking for specified query in their title and name
SearchMessages
Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance the number of returned messages is chosen by the library
SearchPublicChat
Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned
SearchPublicChats
Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results
SearchSecretMessages
Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance the number of returned messages is chosen by the library
SearchStickerSet
Searches for a sticker set by its name
SearchStickerSets
Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results
SearchStickers
Searches for stickers from public sticker sets that correspond to a given emoji
SendBotStartMessage
Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can’t be invited to a private chat other than the chat with the bot. Bots can’t be invited to channels (although they can be added as admins) and secret chats. Returns the sent message
SendCallDebugInformation
Sends debug information for a call
SendCallRating
Sends a call rating
SendChatAction
Sends a notification about user activity in a chat
SendChatScreenshotTakenNotification
Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats
SendChatSetTtlMessage
Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message
SendCustomRequest
Sends a custom request; for bots only
SendEmailAddressVerificationCode
Sends a code to verify an email address to be added to a user’s Telegram Passport
SendInlineQueryResultMessage
Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
SendMessage
Sends a message. Returns the sent message
SendMessageAlbum
Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages
SendPassportAuthorizationForm
Sends a Telegram Passport authorization form, effectively sharing data with the service
SendPaymentForm
Sends a filled-out payment form to the bot for final verification
SendPhoneNumberConfirmationCode
Sends phone number confirmation code. Should be called when user presses “https://t.me/confirmphone?phone=&hash=” or “tg://confirmphone?phone=&hash=******” link
SendPhoneNumberVerificationCode
Sends a code to verify a phone number to be added to a user’s Telegram Passport
SetAccountTtl
Changes the period of inactivity after which the account of the current user will automatically be deleted
SetAlarm
Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization
SetAuthenticationPhoneNumber
Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber
SetBio
Changes the bio of the current user
SetBotUpdatesStatus
Informs the server about the number of pending bot updates if they haven’t been processed for a long time; for bots only
SetChatClientData
Changes client data associated with a chat
SetChatDraftMessage
Changes the draft message in a chat
SetChatMemberStatus
Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat; instead, use addChatMember. The chat member status will not be changed until it has been synchronized with the server
SetChatNotificationSettings
Changes the notification settings of a chat
SetChatPhoto
Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires administrator rights in basic groups and the appropriate administrator rights in supergroups and channels. The photo will not be changed before request to the server has been completed
SetChatTitle
Changes the chat title. Supported only for basic groups, supergroups and channels. Requires administrator rights in basic groups and the appropriate administrator rights in supergroups and channels. The title will not be changed until the request to the server has been completed
SetCustomLanguagePack
Adds or changes a custom language pack to the current localization target
SetCustomLanguagePackString
Adds, edits or deletes a string in a custom language pack
SetDatabaseEncryptionKey
Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain
SetFileGenerationProgress
The next part of a file was generated
SetGameScore
Updates the game score of the specified user in the game; for bots only
SetInlineGameScore
Updates the game score of the specified user in a game; for bots only
SetName
Changes the first and last name of the current user. If something changes, updateUser will be sent
SetNetworkType
Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it should be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics
SetOption
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
SetPassportElement
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
SetPassportElementErrors
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
SetPassword
Changes the password for the user. If a new recovery email address is specified, then the error EMAIL_UNCONFIRMED is returned and the password change will not be applied until the new recovery email address has been confirmed. The application should periodically call getPasswordState to check whether the new email address has been confirmed
SetPinnedChats
Changes the order of pinned chats
SetProfilePhoto
Uploads a new profile photo for the current user. If something changes, updateUser will be sent
SetRecoveryEmailAddress
Changes the recovery email address of the user. If a new recovery email address is specified, then the error EMAIL_UNCONFIRMED is returned and the email address will not be changed until the new email has been confirmed. The application should periodically call getPasswordState to check whether the email address has been 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
SetScopeNotificationSettings
Changes notification settings for chats of a given type
SetStickerPositionInSet
Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
SetSupergroupDescription
Changes information about a supergroup or channel; requires appropriate administrator rights
SetSupergroupStickerSet
Changes the sticker set of a supergroup; requires appropriate rights in the supergroup
SetSupergroupUsername
Changes the username of a supergroup or channel, requires creator privileges in the supergroup or channel
SetTdlibParameters
Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
SetUserPrivacySettingRules
Changes user privacy settings
SetUsername
Changes the username of the current user. If something changes, updateUser will be sent
TerminateAllOtherSessions
Terminates all other sessions of the current user
TerminateSession
Terminates a session of the current user
TestCallBytes
Returns the received bytes; for testing only
TestCallEmpty
Does nothing; for testing only
TestCallString
Returns the received string; for testing only
TestCallVectorInt
Returns the received vector of numbers; for testing only
TestCallVectorIntObject
Returns the received vector of objects containing a number; for testing only
TestCallVectorString
For testing only request. Returns the received vector of strings; for testing only
TestCallVectorStringObject
Returns the received vector of objects containing a string; for testing only
TestGetDifference
Forces an updates.getDifference call to the Telegram servers; for testing only
TestNetwork
Sends a simple network request to the Telegram servers; for testing only
TestSquareInt
Returns the squared received number; for testing only
TestUseError
Does nothing and ensures that the Error object is used; for testing only
TestUseUpdate
Does nothing and ensures that the Update object is used; for testing only
ToggleBasicGroupAdministrators
Toggles the “All members are admins” setting in basic groups; requires creator privileges in the group
ToggleChatDefaultDisableNotification
Changes the value of the default disable_notification parameter, used when a message is sent to a chat
ToggleChatIsMarkedAsUnread
Changes the marked as unread state of a chat
ToggleChatIsPinned
Changes the pinned state of a chat. You can pin up to GetOption(“pinned_chat_count_max”) non-secret chats and the same number of secret chats
ToggleSupergroupInvites
Toggles whether all members of a supergroup can add new members; requires appropriate administrator rights in the supergroup.
ToggleSupergroupIsAllHistoryAvailable
Toggles whether the message history of a supergroup is available to new members; requires appropriate administrator rights in the supergroup.
ToggleSupergroupSignMessages
Toggles sender signatures messages sent in a channel; requires appropriate administrator rights in the channel.
UnblockUser
Removes a user from the blacklist
UnpinSupergroupMessage
Removes the pinned message from a supergroup or channel; requires appropriate administrator rights in the supergroup or channel
UpgradeBasicGroupChatToSupergroupChat
Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom. Deactivates the original basic group
UploadFile
Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message
UploadStickerFile
Uploads a PNG image with a sticker; for bots only; returns the uploaded file
ValidateOrderInfo
Validates the order information provided by a user and returns the available shipping options for a flexible invoice
ViewMessages
This method should be called if messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)
ViewTrendingStickerSets
Informs the server that some trending sticker sets have been viewed by the user

Traits§

Method