[−][src]Module telegram_client::api
Structs
Api | |
TGAcceptCall | Accepts an incoming call. |
TGAcceptTermsOfService | Accepts Telegram terms of services. |
TGAddChatMember | 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. |
TGAddChatMembers | 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. |
TGAddCustomServerLanguagePack | Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization. |
TGAddFavoriteSticker | 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. |
TGAddLocalMessage | 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. |
TGAddLogMessage | Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGAddNetworkStatistics | Adds the specified data to data usage statistics. Can be called before authorization. |
TGAddProxy | Adds a proxy server for network requests. Can be called before authorization. |
TGAddRecentSticker | 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. |
TGAddRecentlyFoundChat | 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. |
TGAddSavedAnimation | 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. |
TGAddStickerToSet | Adds a new sticker to a set; for bots only. Returns the sticker set. |
TGAnswerCallbackQuery | Sets the result of a callback query; for bots only. |
TGAnswerCustomQuery | Answers a custom query; for bots only. |
TGAnswerInlineQuery | Sets the result of an inline query; for bots only. |
TGAnswerPreCheckoutQuery | Sets the result of a pre-checkout query; for bots only. |
TGAnswerShippingQuery | Sets the result of a shipping query; for bots only. |
TGBlockUser | Adds a user to the blacklist. |
TGCancelDownloadFile | Stops the downloading of a file. If a file has already been downloaded, does nothing. |
TGCancelUploadFile | Stops the uploading of a file. Supported only for files uploaded by using |
TGChangeChatReportSpamState | Reports to the server whether a chat is a spam chat or not. Can be used only if ChatReportSpamState.can_report_spam is true. After this request, ChatReportSpamState.can_report_spam becomes false forever. |
TGChangeImportedContacts | 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. |
TGChangePhoneNumber | 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. |
TGChangeStickerSet | Installs/uninstalls or activates/archives a sticker set. |
TGCheckAuthenticationBotToken | Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is |
TGCheckAuthenticationCode | Checks the authentication code. Works only when the current authorization state is |
TGCheckAuthenticationPassword | Checks the authentication password for correctness. Works only when the current authorization state is |
TGCheckChangePhoneNumberCode | Checks the authentication code sent to confirm a new phone number of the user. |
TGCheckChatInviteLink | Checks the validity of an invite link for a chat and returns information about the corresponding chat. |
TGCheckChatUsername | Checks whether a username can be set for a chat. |
TGCheckDatabaseEncryptionKey | Checks the database encryption key for correctness. Works only when the current authorization state is |
TGCheckEmailAddressVerificationCode | Checks the email address verification code for Telegram Passport. |
TGCheckPhoneNumberConfirmationCode | Checks phone number confirmation code. |
TGCheckPhoneNumberVerificationCode | Checks the phone number verification code for Telegram Passport. |
TGCheckRecoveryEmailAddressCode | Checks the 2-step verification recovery email address verification code. |
TGCleanFileName | 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. |
TGClearAllDraftMessages | Clears draft messages in all chats. |
TGClearImportedContacts | Clears all imported contacts, contact list remains unchanged. |
TGClearRecentStickers | Clears the list of recently used stickers. |
TGClearRecentlyFoundChats | Clears the list of recently found chats. |
TGClose | Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, |
TGCloseChat | Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed. |
TGCloseSecretChat | Closes a secret chat, effectively transfering its state to |
TGCreateBasicGroupChat | Returns an existing chat corresponding to a known basic group. |
TGCreateCall | Creates a new call. |
TGCreateNewBasicGroupChat | Creates a new basic group and sends a corresponding |
TGCreateNewSecretChat | Creates a new secret chat. Returns the newly created chat. |
TGCreateNewStickerSet | Creates a new sticker set; for bots only. Returns the newly created sticker set. |
TGCreateNewSupergroupChat | Creates a new supergroup or channel and sends a corresponding |
TGCreatePrivateChat | Returns an existing chat corresponding to a given user. |
TGCreateSecretChat | Returns an existing chat corresponding to a known secret chat. |
TGCreateSupergroupChat | Returns an existing chat corresponding to a known supergroup or channel. |
TGCreateTemporaryPassword | Creates a new temporary password for processing payments. |
TGDeleteAccount | 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 |
TGDeleteChatHistory | Deletes all messages in the chat. Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat. |
TGDeleteChatMessagesFromUser | Deletes all messages sent by the specified user to a chat. Supported only in supergroups; requires can_delete_messages administrator privileges. |
TGDeleteChatReplyMarkup | 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. |
TGDeleteFile | Deletes a file from the TDLib file cache. |
TGDeleteLanguagePack | Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted. Can be called before authorization. |
TGDeleteMessages | Deletes messages. |
TGDeletePassportElement | Deletes a Telegram Passport element. |
TGDeleteProfilePhoto | Deletes a profile photo. If something changes, |
TGDeleteSavedCredentials | Deletes saved credentials for all payment provider bots. |
TGDeleteSavedOrderInfo | Deletes saved order info. |
TGDeleteSupergroup | 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. |
TGDestroy | 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 |
TGDisableProxy | Disables the currently enabled proxy. Can be called before authorization. |
TGDiscardCall | Discards a call. |
TGDisconnectAllWebsites | Disconnects all websites from the current user's Telegram account. |
TGDisconnectWebsite | Disconnects website from the current user's Telegram account. |
TGDownloadFile | Downloads a file from the cloud. Download progress and completion of the download will be notified through |
TGEditCustomLanguagePackInfo | Edits information about a custom local language pack in the current localization target. Can be called before authorization. |
TGEditInlineMessageCaption | Edits the caption of an inline message sent via a bot; for bots only. |
TGEditInlineMessageLiveLocation | Edits the content of a live location in an inline message sent via a bot; for bots only. |
TGEditInlineMessageMedia | 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. |
TGEditInlineMessageReplyMarkup | Edits the reply markup of an inline message sent via a bot; for bots only. |
TGEditInlineMessageText | Edits the text of an inline text or game message sent via a bot; for bots only. |
TGEditMessageCaption | Edits the message content caption. Returns the edited message after the edit is completed on the server side. |
TGEditMessageLiveLocation | 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. |
TGEditMessageMedia | 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. |
TGEditMessageReplyMarkup | Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side. |
TGEditMessageText | 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. |
TGEditProxy | Edits an existing proxy server for network requests. Can be called before authorization. |
TGEnableProxy | Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization. |
TGFinishFileGeneration | Finishes the file generation. |
TGForwardMessages | 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. |
TGGenerateChatInviteLink | 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. |
TGGetAccountTtl | Returns the period of inactivity after which the account of the current user will automatically be deleted. |
TGGetActiveLiveLocationMessages | 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. |
TGGetActiveSessions | Returns all active sessions of the current user. |
TGGetAllPassportElements | Returns all available Telegram Passport elements. |
TGGetApplicationConfig | Returns application config, provided by the server. Can be called before authorization. |
TGGetArchivedStickerSets | Returns a list of archived sticker sets. |
TGGetAttachedStickerSets | Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets. |
TGGetAuthorizationState | Returns the current authorization state; this is an offline request. For informational purposes only. Use |
TGGetBasicGroup | Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot. |
TGGetBasicGroupFullInfo | Returns full information about a basic group by its identifier. |
TGGetBlockedUsers | Returns users that were blocked by the current user. |
TGGetCallbackQueryAnswer | 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. |
TGGetChat | Returns information about a chat by its identifier, this is an offline request if the current user is not a bot. |
TGGetChatAdministrators | Returns a list of users who are administrators of the chat. |
TGGetChatEventLog | 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). |
TGGetChatHistory | 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. |
TGGetChatMember | Returns information about a single member of a chat. |
TGGetChatMessageByDate | Returns the last message sent in a chat no later than the specified date. |
TGGetChatMessageCount | Returns approximate number of messages of the specified type in the chat. |
TGGetChatNotificationSettingsExceptions | Returns list of chats with non-default notification settings. |
TGGetChatPinnedMessage | Returns information about a pinned chat message. |
TGGetChatReportSpamState | Returns information on whether the current chat can be reported as spam. |
TGGetChatStatisticsUrl | Returns URL with the chat statistics. Currently this method can be used only for channels. |
TGGetChats | 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 a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1). For optimal performance the number of returned chats is chosen by the library. |
TGGetConnectedWebsites | Returns all website where the current user used Telegram to log in. |
TGGetContacts | Returns all user contacts. |
TGGetCountryCode | Uses current user IP to found his country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization. |
TGGetCreatedPublicChats | Returns a list of public chats created by the user. |
TGGetCurrentState | Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. This is especially usefull if TDLib is run in a separate process. This is an offline method. Can be called before authorization. |
TGGetDatabaseStatistics | Returns database statistics. |
TGGetDeepLinkInfo | 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. |
TGGetFavoriteStickers | Returns favorite stickers. |
TGGetFile | Returns information about a file; this is an offline request. |
TGGetFileDownloadedPrefixSize | Returns file downloaded prefix size from a given offset. |
TGGetFileExtension | 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. |
TGGetFileMimeType | 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. |
TGGetGameHighScores | 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. |
TGGetGroupsInCommon | Returns a list of common group chats with a given user. Chats are sorted by their type and creation date. |
TGGetImportedContactCount | Returns the total number of imported contacts. |
TGGetInlineGameHighScores | Returns game high scores and some part of the high score table in the range of the specified user; for bots only. |
TGGetInlineQueryResults | 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. |
TGGetInstalledStickerSets | Returns a list of installed sticker sets. |
TGGetInviteText | Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram. |
TGGetLanguagePackInfo | Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization. |
TGGetLanguagePackString | 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. |
TGGetLanguagePackStrings | Returns strings from a language pack in the current localization target by their keys. Can be called before authorization. |
TGGetLocalizationTargetInfo | Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization. |
TGGetLogStream | Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGGetLogTagVerbosityLevel | Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGGetLogTags | Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGGetLogVerbosityLevel | Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGGetMapThumbnailFile | Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded. |
TGGetMe | Returns the current user. |
TGGetMessage | Returns information about a message. |
TGGetMessageLink | Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat. |
TGGetMessageLocally | Returns information about a message, if it is available locally without sending network request. This is an offline request. |
TGGetMessages | Returns information about messages. If a message is not found, returns null on the corresponding position of the result. |
TGGetNetworkStatistics | Returns network data usage statistics. Can be called before authorization. |
TGGetOption | Returns the value of an option by its name. (Check the list of available options on |
TGGetPassportAuthorizationForm | Returns a Telegram Passport authorization form for sharing data with a service. |
TGGetPassportAuthorizationFormAvailableElements | Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form. |
TGGetPassportElement | Returns one of the available Telegram Passport elements. |
TGGetPasswordState | Returns the current state of 2-step verification. |
TGGetPaymentForm | Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy. |
TGGetPaymentReceipt | Returns information about a successful payment. |
TGGetPreferredCountryLanguage | 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. |
TGGetProxies | Returns list of proxies that are currently set up. Can be called before authorization. |
TGGetProxyLink | Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization. |
TGGetPublicMessageLink | Returns a public HTTPS link to a message. Available only for messages in public supergroups and channels. |
TGGetPushReceiverId | Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGGetRecentInlineBots | Returns up to 20 recently used inline bots in the order of their last usage. |
TGGetRecentStickers | Returns a list of recently used stickers. |
TGGetRecentlyVisitedTMeUrls | Returns t.me URLs recently visited by a newly registered user. |
TGGetRecoveryEmailAddress | 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. |
TGGetRemoteFile | 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. |
TGGetRepliedMessage | Returns information about a message that is replied by given message. |
TGGetSavedAnimations | Returns saved animations. |
TGGetSavedOrderInfo | Returns saved order info, if any. |
TGGetScopeNotificationSettings | Returns the notification settings for chats of a given type. |
TGGetSecretChat | Returns information about a secret chat by its identifier. This is an offline request. |
TGGetStickerEmojis | Returns emoji corresponding to a sticker. |
TGGetStickerSet | Returns information about a sticker set by its identifier. |
TGGetStickers | 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. |
TGGetStorageStatistics | Returns storage usage statistics. Can be called before authorization. |
TGGetStorageStatisticsFast | Quickly returns approximate storage usage statistics. Can be called before authorization. |
TGGetSupergroup | Returns information about a supergroup or channel by its identifier. This is an offline request if the current user is not a bot. |
TGGetSupergroupFullInfo | Returns full information about a supergroup or channel by its identifier, cached for up to 1 minute. |
TGGetSupergroupMembers | 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. |
TGGetSupportUser | Returns a user that can be contacted to get support. |
TGGetTemporaryPasswordState | Returns information about the current temporary password. |
TGGetTextEntities | 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. |
TGGetTopChats | Returns a list of frequently used chats. Supported only if the chat info database is enabled. |
TGGetTrendingStickerSets | Returns a list of trending sticker sets. |
TGGetUser | Returns information about a user by their identifier. This is an offline request if the current user is not a bot. |
TGGetUserFullInfo | Returns full information about a user by their identifier. |
TGGetUserPrivacySettingRules | Returns the current privacy settings. |
TGGetUserProfilePhotos | Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already. |
TGGetWallpapers | Returns background wallpapers. |
TGGetWebPageInstantView | Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page. |
TGGetWebPagePreview | 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. |
TGImportContacts | Adds new contacts or edits existing contacts; contacts' user identifiers are ignored. |
TGJoinChat | Adds current user as a new member to a chat. Private and secret chats can't be joined using this method. |
TGJoinChatByInviteLink | 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. |
TGLeaveChat | Removes current user from chat members. Private and secret chats can't be left using this method. |
TGLogOut | Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, |
TGOpenChat | 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). |
TGOpenMessageContent | 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 |
TGOptimizeStorage | Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted. |
TGParseTextEntities | 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. |
TGPinChatMessage | Pins a message in a chat; requires appropriate administrator rights in the group or channel. |
TGPingProxy | Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization. |
TGProcessPushNotification | Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization. |
TGProxyTypeHttp | A HTTP transparent proxy server. |
TGProxyTypeMtproto | An MTProto proxy server. |
TGProxyTypeSocks5 | A SOCKS5 proxy server. |
TGReadAllChatMentions | Marks all mentions in a chat as read. |
TGReadFilePart | Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file. |
TGRecoverAuthenticationPassword | 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 |
TGRecoverPassword | Recovers the password using a recovery code sent to an email address that was previously set up. |
TGRegisterDevice | Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription. |
TGRemoveContacts | Removes users from the contact list. |
TGRemoveFavoriteSticker | Removes a sticker from the list of favorite stickers. |
TGRemoveNotification | Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user. |
TGRemoveNotificationGroup | Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user. |
TGRemoveProxy | Removes a proxy server. Can be called before authorization. |
TGRemoveRecentHashtag | Removes a hashtag from the list of recently used hashtags. |
TGRemoveRecentSticker | Removes a sticker from the list of recently used stickers. |
TGRemoveRecentlyFoundChat | Removes a chat from the list of recently found chats. |
TGRemoveSavedAnimation | Removes an animation from the list of saved animations. |
TGRemoveStickerFromSet | Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot. |
TGRemoveTopChat | Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled. |
TGReorderInstalledStickerSets | Changes the order of installed sticker sets. |
TGReportChat | 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. |
TGReportSupergroupSpam | Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup. |
TGRequestAuthenticationPasswordRecovery | Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is |
TGRequestPasswordRecovery | Requests to send a password recovery code to an email address that was previously set up. |
TGResendAuthenticationCode | Re-sends an authentication code to the user. Works only when the current authorization state is |
TGResendChangePhoneNumberCode | Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received |
TGResendEmailAddressVerificationCode | Re-sends the code to verify an email address to be added to a user's Telegram Passport. |
TGResendPhoneNumberConfirmationCode | Resends phone number confirmation code. |
TGResendPhoneNumberVerificationCode | Re-sends the code to verify a phone number to be added to a user's Telegram Passport. |
TGResendRecoveryEmailAddressCode | Resends the 2-step verification recovery email address verification code. |
TGResetAllNotificationSettings | 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. |
TGResetNetworkStatistics | Resets all network data usage statistics to zero. Can be called before authorization. |
TGSearchCallMessages | 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. |
TGSearchChatMembers | 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. |
TGSearchChatMessages | 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 ( |
TGSearchChatRecentLocationMessages | Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user. |
TGSearchChats | 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. |
TGSearchChatsOnServer | 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. |
TGSearchContacts | Searches for the specified query in the first names, last names and usernames of the known user contacts. |
TGSearchHashtags | Searches for recently used hashtags by their prefix. |
TGSearchInstalledStickerSets | Searches for installed sticker sets by looking for specified query in their title and name. |
TGSearchMessages | 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. |
TGSearchPublicChat | 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. |
TGSearchPublicChats | 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. |
TGSearchSecretMessages | 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. |
TGSearchStickerSet | Searches for a sticker set by its name. |
TGSearchStickerSets | Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results. |
TGSearchStickers | Searches for stickers from public sticker sets that correspond to a given emoji. |
TGSendBotStartMessage | 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. |
TGSendCallDebugInformation | Sends debug information for a call. |
TGSendCallRating | Sends a call rating. |
TGSendChatAction | Sends a notification about user activity in a chat. |
TGSendChatScreenshotTakenNotification | Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats. |
TGSendChatSetTtlMessage | Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message. |
TGSendCustomRequest | Sends a custom request; for bots only. |
TGSendEmailAddressVerificationCode | Sends a code to verify an email address to be added to a user's Telegram Passport. |
TGSendInlineQueryResultMessage | Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message. |
TGSendMessage | Sends a message. Returns the sent message. |
TGSendMessageAlbum | Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages. |
TGSendPassportAuthorizationForm | Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after |
TGSendPaymentForm | Sends a filled-out payment form to the bot for final verification. |
TGSendPhoneNumberConfirmationCode | Sends phone number confirmation code. Should be called when user presses " |
TGSendPhoneNumberVerificationCode | Sends a code to verify a phone number to be added to a user's Telegram Passport. |
TGSetAccountTtl | Changes the period of inactivity after which the account of the current user will automatically be deleted. |
TGSetAlarm | Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization. |
TGSetAuthenticationPhoneNumber | Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is |
TGSetBio | Changes the bio of the current user. |
TGSetBotUpdatesStatus | Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only. |
TGSetChatClientData | Changes client data associated with a chat. |
TGSetChatDraftMessage | Changes the draft message in a chat. |
TGSetChatMemberStatus | 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 |
TGSetChatNotificationSettings | Changes the notification settings of a chat. |
TGSetChatPhoto | 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. |
TGSetChatTitle | 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. |
TGSetCustomLanguagePack | Adds or changes a custom local language pack to the current localization target. |
TGSetCustomLanguagePackString | Adds, edits or deletes a string in a custom local language pack. Can be called before authorization. |
TGSetDatabaseEncryptionKey | Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain. |
TGSetFileGenerationProgress | Informs TDLib on a file generation prograss. |
TGSetGameScore | Updates the game score of the specified user in the game; for bots only. |
TGSetInlineGameScore | Updates the game score of the specified user in a game; for bots only. |
TGSetLogStream | Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGSetLogTagVerbosityLevel | Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGSetLogVerbosityLevel | Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously. |
TGSetName | Changes the first and last name of the current user. If something changes, |
TGSetNetworkType | 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. |
TGSetOption | Sets the value of an option. (Check the list of available options on |
TGSetPassportElement | 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. |
TGSetPassportElementErrors | 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. |
TGSetPassword | Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed. |
TGSetPinnedChats | Changes the order of pinned chats. |
TGSetPollAnswer | Changes user answer to a poll. |
TGSetProfilePhoto | Uploads a new profile photo for the current user. If something changes, |
TGSetRecoveryEmailAddress | 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. |
TGSetScopeNotificationSettings | Changes notification settings for chats of a given type. |
TGSetStickerPositionInSet | 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. |
TGSetSupergroupDescription | Changes information about a supergroup or channel; requires appropriate administrator rights. |
TGSetSupergroupStickerSet | Changes the sticker set of a supergroup; requires appropriate rights in the supergroup. |
TGSetSupergroupUsername | Changes the username of a supergroup or channel, requires creator privileges in the supergroup or channel. |
TGSetTdlibParameters | Sets the parameters for TDLib initialization. Works only when the current authorization state is |
TGSetUserPrivacySettingRules | Changes user privacy settings. |
TGSetUsername | Changes the username of the current user. If something changes, |
TGStopPoll | Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set. |
TGSynchronizeLanguagePack | Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization. |
TGTdlibParameters | Contains parameters for TDLib initialization. |
TGTerminateAllOtherSessions | Terminates all other sessions of the current user. |
TGTerminateSession | Terminates a session of the current user. |
TGTestCallBytes | Returns the received bytes; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallEmpty | Does nothing; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallString | Returns the received string; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallVectorInt | Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallVectorIntObject | Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallVectorString | Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization. |
TGTestCallVectorStringObject | Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization. |
TGTestGetDifference | Forces an updates.getDifference call to the Telegram servers; for testing only. |
TGTestNetwork | Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization. |
TGTestSquareInt | Returns the squared received number; for testing only. This is an offline method. Can be called before authorization. |
TGTestUseError | Does nothing and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization. |
TGTestUseUpdate | Does nothing and ensures that the |
TGToggleBasicGroupAdministrators | Toggles the "All members are admins" setting in basic groups; requires creator privileges in the group. |
TGToggleChatDefaultDisableNotification | Changes the value of the default disable_notification parameter, used when a message is sent to a chat. |
TGToggleChatIsMarkedAsUnread | Changes the marked as unread state of a chat. |
TGToggleChatIsPinned | 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. |
TGToggleSupergroupInvites | Toggles whether all members of a supergroup can add new members; requires appropriate administrator rights in the supergroup. |
TGToggleSupergroupIsAllHistoryAvailable | Toggles whether the message history of a supergroup is available to new members; requires appropriate administrator rights in the supergroup. |
TGToggleSupergroupSignMessages | Toggles sender signatures messages sent in a channel; requires appropriate administrator rights in the channel. |
TGUnblockUser | Removes a user from the blacklist. |
TGUnpinChatMessage | Removes the pinned message from a chat; requires appropriate administrator rights in the group or channel. |
TGUpgradeBasicGroupChatToSupergroupChat | Creates a new supergroup from an existing basic group and sends a corresponding |
TGUploadFile | Asynchronously uploads a file to the cloud without sending it in a message. |
TGUploadStickerFile | Uploads a PNG image with a sticker; for bots only; returns the uploaded file. |
TGValidateOrderInfo | Validates the order information provided by a user and returns the available shipping options for a flexible invoice. |
TGViewMessages | Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels). |
TGViewTrendingStickerSets | Informs the server that some trending sticker sets have been viewed by the user. |
TGWriteGeneratedFilePart | Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file. |
Enums
TGFileType |
Traits
TDFB |