Class TdjsonAbstract

Constructors

Methods

_request acceptCall acceptTermsOfService activateStoryStealthMode addBotMediaPreview addChatFolderByInviteLink addChatMember addChatMembers addChatToList addContact addCustomServerLanguagePack addFavoriteSticker addFileToDownloads addLocalMessage addLogMessage addMessageReaction addNetworkStatistics addPendingPaidMessageReaction addProxy addQuickReplyShortcutInlineQueryResultMessage addQuickReplyShortcutMessage addQuickReplyShortcutMessageAlbum addRecentSticker addRecentlyFoundChat addSavedAnimation addSavedNotificationSound addStickerToSet allowBotToSendMessages answerCallbackQuery answerCustomQuery answerInlineQuery answerPreCheckoutQuery answerShippingQuery answerWebAppQuery applyPremiumGiftCode assignAppStoreTransaction assignGooglePlayTransaction banChatMember blockMessageSenderFromReplies boostChat canBotSendMessages canPurchaseFromStore canSendMessageToUser canSendStory canTransferOwnership cancelDownloadFile cancelPasswordReset cancelPreliminaryUploadFile cancelRecoveryEmailAddressVerification changeImportedContacts changeStickerSet checkAuthenticationBotToken checkAuthenticationCode checkAuthenticationEmailCode checkAuthenticationPassword checkAuthenticationPasswordRecoveryCode checkChatFolderInviteLink checkChatInviteLink checkChatUsername checkCreatedPublicChatsLimit checkEmailAddressVerificationCode checkLoginEmailAddressCode checkPasswordRecoveryCode checkPhoneNumberCode checkPremiumGiftCode checkQuickReplyShortcutName checkRecoveryEmailAddressCode checkStickerSetName checkWebAppFileDownload cleanFileName clearAllDraftMessages clearAutosaveSettingsExceptions clearImportedContacts clearRecentEmojiStatuses clearRecentReactions clearRecentStickers clearRecentlyFoundChats clearSearchedForTags clickAnimatedEmojiMessage clickChatSponsoredMessage clickPremiumSubscriptionButton close closeChat closeSecretChat closeStory closeWebApp commitPendingPaidMessageReactions confirmQrCodeAuthentication confirmSession connectChatAffiliateProgram createBasicGroupChat createBusinessChatLink createCall createChatFolder createChatFolderInviteLink createChatInviteLink createChatSubscriptionInviteLink createForumTopic createInvoiceLink createNewBasicGroupChat createNewSecretChat createNewStickerSet createNewSupergroupChat createPrivateChat createSecretChat createSupergroupChat createTemporaryPassword createVideoChat deleteAccount deleteAllCallMessages deleteAllRevokedChatInviteLinks deleteBotMediaPreviews deleteBusinessChatLink deleteBusinessConnectedBot deleteChat deleteChatBackground deleteChatFolder deleteChatFolderInviteLink deleteChatHistory deleteChatMessagesByDate deleteChatMessagesBySender deleteChatReplyMarkup deleteCommands deleteDefaultBackground deleteFile deleteForumTopic deleteLanguagePack deleteMessages deletePassportElement deleteProfilePhoto deleteQuickReplyShortcut deleteQuickReplyShortcutMessages deleteRevokedChatInviteLink deleteSavedCredentials deleteSavedMessagesTopicHistory deleteSavedMessagesTopicMessagesByDate deleteSavedOrderInfo deleteStickerSet deleteStory destroy disableAllSupergroupUsernames disableProxy discardCall disconnectAllWebsites disconnectChatAffiliateProgram disconnectWebsite downloadFile editBotMediaPreview editBusinessChatLink editBusinessMessageCaption editBusinessMessageLiveLocation editBusinessMessageMedia editBusinessMessageReplyMarkup editBusinessMessageText editChatFolder editChatFolderInviteLink editChatInviteLink editChatSubscriptionInviteLink editCustomLanguagePackInfo editForumTopic editInlineMessageCaption editInlineMessageLiveLocation editInlineMessageMedia editInlineMessageReplyMarkup editInlineMessageText editMessageCaption editMessageLiveLocation editMessageMedia editMessageReplyMarkup editMessageSchedulingState editMessageText editProxy editQuickReplyMessage editStarSubscription editStory editStoryCover editUserStarSubscription enableProxy endGroupCall endGroupCallRecording endGroupCallScreenSharing finishFileGeneration forwardMessages getAccountTtl getActiveSessions getAllPassportElements getAllStickerEmojis getAnimatedEmoji getApplicationConfig getApplicationDownloadLink getArchiveChatListSettings getArchivedStickerSets getAttachedStickerSets getAttachmentMenuBot getAuthorizationState getAutoDownloadSettingsPresets getAutosaveSettings getAvailableChatBoostSlots getAvailableGifts getBackgroundUrl getBankCardInfo getBasicGroup getBasicGroupFullInfo getBlockedMessageSenders getBotInfoDescription getBotInfoShortDescription getBotMediaPreviewInfo getBotMediaPreviews getBotName getBusinessChatLinkInfo getBusinessChatLinks getBusinessConnectedBot getBusinessConnection getBusinessFeatures getCallbackQueryAnswer getCallbackQueryMessage getChat getChatActiveStories getChatAdministrators getChatAffiliateProgram getChatAffiliatePrograms getChatArchivedStories getChatAvailableMessageSenders getChatBoostFeatures getChatBoostLevelFeatures getChatBoostLink getChatBoostLinkInfo getChatBoostStatus getChatBoosts getChatEventLog getChatFolder getChatFolderChatCount getChatFolderChatsToLeave getChatFolderDefaultIconName getChatFolderInviteLinks getChatFolderNewChats getChatHistory getChatInviteLink getChatInviteLinkCounts getChatInviteLinkMembers getChatInviteLinks getChatJoinRequests getChatListsToAddChat getChatMember getChatMessageByDate getChatMessageCalendar getChatMessageCount getChatMessagePosition getChatNotificationSettingsExceptions getChatPinnedMessage getChatPostedToChatPageStories getChatRevenueStatistics getChatRevenueTransactions getChatRevenueWithdrawalUrl getChatScheduledMessages getChatSimilarChatCount getChatSimilarChats getChatSparseMessagePositions getChatSponsoredMessages getChatStatistics getChatStoryInteractions getChats getChatsForChatFolderInviteLink getChatsToSendStories getCloseFriends getCollectibleItemInfo getCommands getConnectedWebsites getContacts getCountries getCountryCode getCountryFlagEmoji getCreatedPublicChats getCurrentState getCurrentWeather getCustomEmojiReactionAnimations getCustomEmojiStickers getDatabaseStatistics getDeepLinkInfo getDefaultBackgroundCustomEmojiStickers getDefaultChatEmojiStatuses getDefaultChatPhotoCustomEmojiStickers getDefaultEmojiStatuses getDefaultMessageAutoDeleteTime getDefaultProfilePhotoCustomEmojiStickers getDisallowedChatEmojiStatuses getEmojiCategories getEmojiReaction getEmojiSuggestionsUrl getExternalLink getExternalLinkInfo getFavoriteStickers getFile getFileDownloadedPrefixSize getFileExtension getFileMimeType getForumTopic getForumTopicDefaultIcons getForumTopicLink getForumTopics getGameHighScores getGiveawayInfo getGreetingStickers getGrossingWebAppBots getGroupCall getGroupCallInviteLink getGroupCallStreamSegment getGroupCallStreams getGroupsInCommon getImportedContactCount getInactiveSupergroupChats getInlineGameHighScores getInlineQueryResults getInstalledBackgrounds getInstalledStickerSets getInternalLink getInternalLinkType getJsonString getJsonValue getKeywordEmojis getLanguagePackInfo getLanguagePackString getLanguagePackStrings getLinkPreview getLocalizationTargetInfo getLogStream getLogTagVerbosityLevel getLogTags getLogVerbosityLevel getLoginUrl getLoginUrlInfo getMainWebApp getMapThumbnailFile getMarkdownText getMe getMenuButton getMessage getMessageAddedReactions getMessageAvailableReactions getMessageEffect getMessageEmbeddingCode getMessageFileType getMessageImportConfirmationText getMessageLink getMessageLinkInfo getMessageLocally getMessageProperties getMessagePublicForwards getMessageReadDate getMessageStatistics getMessageThread getMessageThreadHistory getMessageViewers getMessages getNetworkStatistics getNewChatPrivacySettings getOption getOwnedBots getOwnedStickerSets getPassportAuthorizationForm getPassportAuthorizationFormAvailableElements getPassportElement getPasswordState getPaymentForm getPaymentReceipt getPhoneNumberInfo getPhoneNumberInfoSync getPollVoters getPreferredCountryLanguage getPremiumFeatures getPremiumGiftCodePaymentOptions getPremiumInfoSticker getPremiumLimit getPremiumState getPremiumStickerExamples getPremiumStickers getPreparedInlineMessage getProxies getProxyLink getPushReceiverId getReadDatePrivacySettings getRecentEmojiStatuses getRecentInlineBots getRecentStickers getRecentlyOpenedChats getRecentlyVisitedTMeUrls getRecommendedChatFolders getRecommendedChats getRecoveryEmailAddress getRemoteFile getRepliedMessage getSavedAnimations getSavedMessagesTags getSavedMessagesTopicHistory getSavedMessagesTopicMessageByDate getSavedNotificationSound getSavedNotificationSounds getSavedOrderInfo getScopeNotificationSettings getSearchedForTags getSecretChat getStarAdAccountUrl getStarGiftPaymentOptions getStarGiveawayPaymentOptions getStarPaymentOptions getStarRevenueStatistics getStarSubscriptions getStarTransactions getStarWithdrawalUrl getStatisticalGraph getStickerEmojis getStickerOutline getStickerSet getStickerSetName getStickers getStorageStatistics getStorageStatisticsFast getStory getStoryAvailableReactions getStoryInteractions getStoryNotificationSettingsExceptions getStoryPublicForwards getStoryStatistics getSuggestedFileName getSuggestedStickerSetName getSuitableDiscussionChats getSuitablePersonalChats getSupergroup getSupergroupFullInfo getSupergroupMembers getSupportName getSupportUser getTemporaryPasswordState getTextEntities getThemeParametersJsonString getThemedChatEmojiStatuses getThemedEmojiStatuses getTimeZones getTopChats getTrendingStickerSets getUser getUserChatBoosts getUserFullInfo getUserGifts getUserLink getUserPrivacySettingRules getUserProfilePhotos getUserSupportInfo getVideoChatAvailableParticipants getVideoChatRtmpUrl getWebAppLinkUrl getWebAppPlaceholder getWebAppUrl getWebPageInstantView hideContactCloseBirthdays hideSuggestedAction importContacts importMessages inviteGroupCallParticipants joinChat joinChatByInviteLink joinGroupCall launchPrepaidGiveaway leaveChat leaveGroupCall loadActiveStories loadChats loadGroupCallParticipants loadQuickReplyShortcutMessages loadQuickReplyShortcuts loadSavedMessagesTopics logOut openChat openChatSimilarChat openMessageContent openStory openWebApp optimizeStorage parseMarkdown parseTextEntities pinChatMessage pingProxy preliminaryUploadFile processChatFolderNewChats processChatJoinRequest processChatJoinRequests processPushNotification rateSpeechRecognition readAllChatMentions readAllChatReactions readAllMessageThreadMentions readAllMessageThreadReactions readChatList readFilePart readdQuickReplyShortcutMessages recognizeSpeech recoverAuthenticationPassword recoverPassword refundStarPayment registerDevice registerUser removeAllFilesFromDownloads removeBusinessConnectedBotFromChat removeChatActionBar removeContacts removeFavoriteSticker removeFileFromDownloads removeInstalledBackground removeMessageReaction removeNotification removeNotificationGroup removePendingPaidMessageReactions removeProxy removeRecentHashtag removeRecentSticker removeRecentlyFoundChat removeSavedAnimation removeSavedNotificationSound removeSearchedForTag removeStickerFromSet removeTopChat reorderActiveUsernames reorderBotActiveUsernames reorderBotMediaPreviews reorderChatFolders reorderInstalledStickerSets reorderQuickReplyShortcuts reorderSupergroupActiveUsernames replacePrimaryChatInviteLink replaceStickerInSet replaceVideoChatRtmpUrl reportAuthenticationCodeMissing reportChat reportChatPhoto reportChatSponsoredMessage reportMessageReactions reportPhoneNumberCodeMissing reportStory reportSupergroupAntiSpamFalsePositive reportSupergroupSpam requestAuthenticationPasswordRecovery requestPasswordRecovery requestQrCodeAuthentication resendAuthenticationCode resendEmailAddressVerificationCode resendLoginEmailAddressCode resendMessages resendPhoneNumberCode resendRecoveryEmailAddressCode resetAllNotificationSettings resetAuthenticationEmailAddress resetInstalledBackgrounds resetNetworkStatistics resetPassword reuseStarSubscription revokeChatInviteLink revokeGroupCallInviteLink saveApplicationLogEvent savePreparedInlineMessage searchAffiliatePrograms searchBackground searchCallMessages searchChatAffiliateProgram searchChatMembers searchChatMessages searchChatRecentLocationMessages searchChats searchChatsOnServer searchContacts searchEmojis searchFileDownloads searchHashtags searchInstalledStickerSets searchMessages searchOutgoingDocumentMessages searchPublicChat searchPublicChats searchPublicMessagesByTag searchPublicStoriesByLocation searchPublicStoriesByTag searchPublicStoriesByVenue searchQuote searchRecentlyFoundChats searchSavedMessages searchSecretMessages searchStickerSet searchStickerSets searchStickers searchStringsByPrefix searchUserByPhoneNumber searchUserByToken searchWebApp sellGift sendAuthenticationFirebaseSms sendBotStartMessage sendBusinessMessage sendBusinessMessageAlbum sendCallDebugInformation sendCallLog sendCallRating sendCallSignalingData sendChatAction sendCustomRequest sendEmailAddressVerificationCode sendGift sendInlineQueryResultMessage sendMessage sendMessageAlbum sendPassportAuthorizationForm sendPaymentForm sendPhoneNumberCode sendPhoneNumberFirebaseSms sendQuickReplyShortcutMessages sendStory sendWebAppCustomRequest sendWebAppData setAccentColor setAccountTtl setAlarm setApplicationVerificationToken setArchiveChatListSettings setAuthenticationEmailAddress setAuthenticationPhoneNumber setAutoDownloadSettings setAutosaveSettings setBio setBirthdate setBotInfoDescription setBotInfoShortDescription setBotName setBotProfilePhoto setBotUpdatesStatus setBusinessAwayMessageSettings setBusinessConnectedBot setBusinessGreetingMessageSettings setBusinessLocation setBusinessMessageIsPinned setBusinessOpeningHours setBusinessStartPage setChatAccentColor setChatActiveStoriesList setChatAffiliateProgram setChatAvailableReactions setChatBackground setChatClientData setChatDescription setChatDiscussionGroup setChatDraftMessage setChatEmojiStatus setChatLocation setChatMemberStatus setChatMessageAutoDeleteTime setChatMessageSender setChatNotificationSettings setChatPermissions setChatPhoto setChatPinnedStories setChatProfileAccentColor setChatSlowModeDelay setChatTheme setChatTitle setCloseFriends setCommands setCustomEmojiStickerSetThumbnail setCustomLanguagePack setCustomLanguagePackString setDatabaseEncryptionKey setDefaultBackground setDefaultChannelAdministratorRights setDefaultGroupAdministratorRights setDefaultMessageAutoDeleteTime setDefaultReactionType setEmojiStatus setFileGenerationProgress setForumTopicNotificationSettings setGameScore setGroupCallParticipantIsSpeaking setGroupCallParticipantVolumeLevel setGroupCallTitle setInactiveSessionTtl setInlineGameScore setLogStream setLogTagVerbosityLevel setLogVerbosityLevel setLoginEmailAddress setMenuButton setMessageFactCheck setMessageReactions setMessageSenderBlockList setName setNetworkType setNewChatPrivacySettings setOption setPassportElement setPassportElementErrors setPassword setPersonalChat setPinnedChats setPinnedForumTopics setPinnedSavedMessagesTopics setPollAnswer setProfileAccentColor setProfilePhoto setQuickReplyShortcutName setReactionNotificationSettings setReadDatePrivacySettings setRecoveryEmailAddress setSavedMessagesTagLabel setScopeNotificationSettings setStickerEmojis setStickerKeywords setStickerMaskPosition setStickerPositionInSet setStickerSetThumbnail setStickerSetTitle setStoryPrivacySettings setStoryReaction setSupergroupCustomEmojiStickerSet setSupergroupStickerSet setSupergroupUnrestrictBoostCount setSupergroupUsername setTdlibParameters setUserEmojiStatus setUserPersonalProfilePhoto setUserPrivacySettingRules setUserSupportInfo setUsername setVideoChatDefaultParticipant shareChatWithBot sharePhoneNumber shareUsersWithBot startGroupCallRecording startGroupCallScreenSharing startScheduledGroupCall stopBusinessPoll stopPoll suggestUserProfilePhoto synchronizeLanguagePack terminateAllOtherSessions terminateSession testCallBytes testCallEmpty testCallString testCallVectorInt testCallVectorIntObject testCallVectorString testCallVectorStringObject testGetDifference testNetwork testProxy testReturnError testSquareInt testUseUpdate toggleAllDownloadsArePaused toggleBotCanManageEmojiStatus toggleBotIsAddedToAttachmentMenu toggleBotUsernameIsActive toggleBusinessConnectedBotChatIsPaused toggleChatDefaultDisableNotification toggleChatFolderTags toggleChatHasProtectedContent toggleChatIsMarkedAsUnread toggleChatIsPinned toggleChatIsTranslatable toggleChatViewAsTopics toggleDownloadIsPaused toggleForumTopicIsClosed toggleForumTopicIsPinned toggleGeneralForumTopicIsHidden toggleGiftIsSaved toggleGroupCallEnabledStartNotification toggleGroupCallIsMyVideoEnabled toggleGroupCallIsMyVideoPaused toggleGroupCallMuteNewParticipants toggleGroupCallParticipantIsHandRaised toggleGroupCallParticipantIsMuted toggleGroupCallScreenSharingIsPaused toggleHasSponsoredMessagesEnabled togglePaidMessageReactionIsAnonymous toggleSavedMessagesTopicIsPinned toggleSessionCanAcceptCalls toggleSessionCanAcceptSecretChats toggleStoryIsPostedToChatPage toggleSupergroupCanHaveSponsoredMessages toggleSupergroupHasAggressiveAntiSpamEnabled toggleSupergroupHasHiddenMembers toggleSupergroupIsAllHistoryAvailable toggleSupergroupIsBroadcastGroup toggleSupergroupIsForum toggleSupergroupJoinByRequest toggleSupergroupJoinToSendMessages toggleSupergroupSignMessages toggleSupergroupUsernameIsActive toggleUsernameIsActive transferChatOwnership translateMessageText translateText unpinAllChatMessages unpinAllMessageThreadMessages unpinChatMessage upgradeBasicGroupChatToSupergroupChat uploadStickerFile validateOrderInfo viewMessages viewPremiumFeature viewTrendingStickerSets writeGeneratedFilePart

Constructors

Methods

  • Send a request to the actual libtdjson.so here. Do not forget to handle Error responses and timeouts.

    Type Parameters

    Parameters

    • message: R

    Returns Promise<any>

  • Accepts an incoming call.

    Parameters

    Returns Promise<Ok>

  • Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only.

    Returns Promise<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.

    Parameters

    Returns Promise<BotMediaPreview>

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

    Parameters

    Returns Promise<FailedToAddMembers>

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

    Parameters

    Returns Promise<FailedToAddMembers>

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

    Parameters

    Returns Promise<Ok>

  • Adds a user to the contact list or edits an existing contact by their user identifier.

    Parameters

    Returns Promise<Ok>

  • Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to favorite stickers.

    Parameters

    Returns Promise<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 message database is used, the list of file downloads is persistent across application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file.

    Parameters

    Returns Promise<File>

  • Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message.

    Parameters

    Returns Promise<Message>

  • Adds a message to TDLib internal log. Can be called synchronously.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Adds the paid message reaction to a message. Use getMessageAvailableReactions to check whether the reaction is available for the message.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Proxy>

  • Adds a message to a quick reply shortcut via inline bot. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message.

    Parameters

    Returns Promise<QuickReplyMessage>

  • Adds a message to a quick reply shortcut. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message.

    Parameters

    Returns Promise<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 be only grouped in an album with messages of the same type. Returns sent messages.

    Parameters

    Returns Promise<QuickReplyMessages>

  • Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers.

    Parameters

    Returns Promise<Stickers>

  • Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first.

    Parameters

    Returns Promise<Ok>

  • Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<NotificationSound>

  • Sets the result of a callback query; for bots only.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Sets the result of a shipping query; for bots only.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Stops the downloading of a file. If a file has already been downloaded, does nothing.

    Parameters

    Returns Promise<Ok>

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

    Returns Promise<Ok>

  • Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile.

    Parameters

    Returns Promise<Ok>

  • Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time.

    Parameters

    Returns Promise<ImportedContacts>

  • Installs/uninstalls or activates/archives a sticker set.

    Parameters

    Returns Promise<Ok>

  • Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in.

    Parameters

    Returns Promise<Ok>

  • Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Checks whether a file can be downloaded and saved locally by Web App request.

    Parameters

    Returns Promise<Ok>

  • Removes potentially dangerous characters from the name of a file. Returns an empty string on failure. Can be called synchronously.

    Parameters

    Returns Promise<Text>

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

    Returns Promise<Ok>

  • Clears all imported contacts, contact list remains unchanged.

    Returns Promise<Ok>

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

    Returns Promise<Ok>

  • Clears the list of recently used reactions.

    Returns Promise<Ok>

  • Clears the list of recently found chats.

    Returns Promise<Ok>

  • Clears the list of recently searched for hashtags or cashtags.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<Ok>

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

    Returns Promise<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 Promise<Ok>

  • Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed.

    Parameters

    Returns Promise<Ok>

  • Closes a secret chat, effectively transferring its state to secretChatStateClosed.

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that a story is closed by the user.

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that a previously opened Web App was closed.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<BusinessChatLink>

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

    Parameters

    Returns Promise<ChatFolderInfo>

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

    Parameters

    Returns Promise<ChatInviteLink>

  • Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup.

    Parameters

    Returns Promise<ForumTopicInfo>

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

    Parameters

    Returns Promise<Chat>

  • Returns an existing chat corresponding to a known secret chat.

    Parameters

    Returns Promise<Chat>

  • Returns an existing chat corresponding to a known supergroup or channel.

    Parameters

    Returns Promise<Chat>

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

    Parameters

    Returns Promise<GroupCallId>

  • Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Deletes a file from the TDLib file cache.

    Parameters

    Returns Promise<Ok>

  • Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages.

    Parameters

    Returns Promise<Ok>

  • Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Deletes saved credentials for all payment provider bots.

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Deletes saved order information.

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<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 Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Returns Promise<Ok>

  • Disconnects all websites from the current user's Telegram account.

    Returns Promise<Ok>

  • Disconnects website from the current user's Telegram account.

    Parameters

    Returns Promise<Ok>

  • Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.

    Parameters

    Returns Promise<File>

  • 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.

    Parameters

    Returns Promise<BusinessMessage>

  • Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.

    Parameters

    Returns Promise<ChatInviteLink>

  • Edits information about a custom local language pack in the current localization target. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<Ok>

  • Edits the text of an inline text or game message sent via a bot; for bots only.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Message>

  • Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side.

    Parameters

    Returns Promise<Message>

  • Edits the media content of a message, including 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 exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side.

    Parameters

    Returns Promise<Message>

  • Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side.

    Parameters

    Returns Promise<Message>

  • Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed.

    Parameters

    Returns Promise<Ok>

  • Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side.

    Parameters

    Returns Promise<Message>

  • Edits an existing proxy server for network requests. Can be called before authorization.

    Parameters

    Returns Promise<Proxy>

  • 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. Media message can be edited only to a media message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Cancels or re-enables Telegram Star subscription for a user; for bots only.

    Parameters

    Returns Promise<Ok>

  • Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Ends a group call. Requires groupCall.can_be_managed.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message.

    Parameters

    Returns Promise<Messages>

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

    Returns Promise<AccountTtl>

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

    Parameters

    Returns Promise<Emojis>

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

    Returns Promise<JsonValue>

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

    Returns Promise<HttpUrl>

  • Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets.

    Parameters

    Returns Promise<StickerSets>

  • Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization.

    Returns Promise<AuthorizationState>

  • Returns gifts that can be sent to other users.

    Returns Promise<Gifts>

  • Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot.

    Parameters

    Returns Promise<BasicGroup>

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

    Parameters

    Returns Promise<Text>

  • Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true.

    Parameters

    Returns Promise<Text>

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

    Parameters

    Returns Promise<Text>

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

    Parameters

    Returns Promise<Message>

  • Returns information about a chat by its identifier; this is an offline request if the current user is not a bot.

    Parameters

    Returns Promise<Chat>

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

    Parameters

    Returns Promise<Stories>

  • Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id).

    Parameters

    Returns Promise<ChatEvents>

  • Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly.

    Parameters

    Returns Promise<Count>

  • Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted.

    Parameters

    Returns Promise<Chats>

  • Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder.

    Parameters

    Returns Promise<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 request if only_local is true.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<ChatInviteLink>

  • Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links.

    Parameters

    Returns Promise<ChatInviteLinks>

  • Returns the last message sent in a chat no later than the specified date. Returns a 404 error if such message doesn't exist.

    Parameters

    Returns Promise<Message>

  • Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset".

    Parameters

    Returns Promise<MessageCalendar>

  • Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats.

    Parameters

    Returns Promise<Count>

  • Returns information about a newest pinned message in the chat. Returns a 404 error if the message doesn't exist.

    Parameters

    Returns Promise<Message>

  • Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<ChatRevenueStatistics>

  • 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.

    Parameters

    Returns Promise<HttpUrl>

  • Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id).

    Parameters

    Returns Promise<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 searchMessagesFilterFailedToSend filter without an enabled message database.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<ChatStatistics>

  • Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state.

    Parameters

    Returns Promise<Chats>

  • Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there.

    Returns Promise<Chats>

  • Returns all close friends of the current user.

    Returns Promise<Users>

  • Returns the list of commands supported by the bot for the given user scope and language; for bots only.

    Parameters

    Returns Promise<BotCommands>

  • Returns information about existing countries. Can be called before authorization.

    Returns Promise<Countries>

  • Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization.

    Returns Promise<Text>

  • Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously.

    Parameters

    Returns Promise<Text>

  • Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization.

    Returns Promise<Updates>

  • Returns TGS stickers with generic animations for custom emoji reactions.

    Returns Promise<Stickers>

  • Returns the list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<DeepLinkInfo>

  • Returns default list of custom emoji stickers for reply background.

    Returns Promise<Stickers>

  • Returns default list of custom emoji stickers for placing on a chat photo.

    Returns Promise<Stickers>

  • Returns default list of custom emoji stickers for placing on a profile photo.

    Returns Promise<Stickers>

  • Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true.

    Returns Promise<EmojiStatuses>

  • Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation.

    Parameters

    Returns Promise<HttpUrl>

  • Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<LoginUrlInfo>

  • Returns information about a file; this is an offline request.

    Parameters

    Returns Promise<File>

  • Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously.

    Parameters

    Returns Promise<Text>

  • Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously.

    Parameters

    Returns Promise<Text>

  • Returns the list of custom emoji, which can be used as forum topic icon by all users.

    Returns Promise<Stickers>

  • Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server.

    Parameters

    Returns Promise<ForumTopics>

  • Returns greeting stickers from regular sticker sets that can be used for the start page of other users.

    Returns Promise<Stickers>

  • Returns a list of common group chats with a given user. Chats are sorted by their type and creation date.

    Parameters

    Returns Promise<Chats>

  • Returns the total number of imported contacts.

    Returns Promise<Count>

  • Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium.

    Returns Promise<Chats>

  • Returns an HTTPS or a tg: link with the given type. Can be called before authorization.

    Parameters

    Returns Promise<HttpUrl>

  • Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously.

    Parameters

    Returns Promise<Text>

  • Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously.

    Parameters

    Returns Promise<JsonValue>

  • Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified.

    Parameters

    Returns Promise<Emojis>

  • Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview.

    Parameters

    Returns Promise<LinkPreview>

  • Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously.

    Returns Promise<LogStream>

  • Returns the list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously.

    Returns Promise<LogTags>

  • Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button.

    Parameters

    Returns Promise<HttpUrl>

  • Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button.

    Parameters

    Returns Promise<LoginUrlInfo>

  • Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<FormattedText>

  • Returns information about a message. Returns a 404 error if the message doesn't exist.

    Parameters

    Returns Promise<Message>

  • Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code.

    Parameters

    Returns Promise<Text>

  • Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request.

    Parameters

    Returns Promise<MessageLink>

  • Returns information about a message, if it is available without sending network request. Returns a 404 error if message isn't available locally. This is an offline request.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<PublicForwards>

  • Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib.

    Parameters

    Returns Promise<Messages>

  • Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers == true.

    Parameters

    Returns Promise<MessageViewers>

  • Returns information about messages. If a message is not found, returns null on the corresponding position of the result.

    Parameters

    Returns Promise<Messages>

  • Returns the list of owned by the current user bots.

    Returns Promise<Users>

  • Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy, or wants to buy access to media in a messagePaidMedia message.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<PhoneNumberInfo>

  • Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib.

    Parameters

    Returns Promise<MessageSenders>

  • Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown.

    Parameters

    Returns Promise<Text>

  • Returns examples of premium stickers for demonstration purposes.

    Returns Promise<Stickers>

  • Returns the list of proxies that are currently set up. Can be called before authorization.

    Returns Promise<Proxies>

  • Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization.

    Parameters

    Returns Promise<HttpUrl>

  • Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously.

    Parameters

    Returns Promise<PushReceiverId>

  • Returns up to 20 recently used inline bots in the order of their last usage.

    Returns Promise<Users>

  • Returns recently opened chats; this is an offline request. Returns chats in the order of last opening.

    Parameters

    Returns Promise<Chats>

  • Returns a list of channel chats recommended to the current user.

    Returns Promise<Chats>

  • Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application.

    Parameters

    Returns Promise<File>

  • Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively. Returns a 404 error if the message doesn't exist.

    Parameters

    Returns Promise<Message>

  • Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id).

    Parameters

    Returns Promise<Messages>

  • Returns saved order information. Returns a 404 error if there is no saved order information.

    Returns Promise<OrderInfo>

  • Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the owned Telegram Stars.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<Emojis>

  • Returns outline of a sticker; this is an offline request. Returns a 404 error if the outline isn't known.

    Parameters

    Returns Promise<Outline>

  • Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned.

    Parameters

    Returns Promise<Stickers>

  • Returns the list of chats with non-default notification settings for stories.

    Returns Promise<Chats>

  • Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib.

    Parameters

    Returns Promise<PublicForwards>

  • Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first.

    Returns Promise<Chats>

  • Returns a list of channel chats, which can be used as a personal chat.

    Returns Promise<Chats>

  • Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot.

    Parameters

    Returns Promise<Supergroup>

  • Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters.

    Parameters

    Returns Promise<ChatMembers>

  • Returns localized name of the Telegram support user; for Telegram support only.

    Returns Promise<Text>

  • Returns a user that can be contacted to get support.

    Returns Promise<User>

  • Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously.

    Parameters

    Returns Promise<TextEntities>

  • Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously.

    Parameters

    Returns Promise<Text>

  • Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status.

    Returns Promise<EmojiStatuses>

  • Returns information about a user by their identifier. This is an offline request if the current user is not a bot.

    Parameters

    Returns Promise<User>

  • Returns an HTTPS link, which can be used to get information about the current user.

    Returns Promise<UserLink>

  • Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right.

    Parameters

    Returns Promise<RtmpUrl>

  • Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked.

    Parameters

    Returns Promise<HttpUrl>

  • Returns a default placeholder for Web Apps of a bot; this is an offline request. Returns a 404 error if the placeholder isn't known.

    Parameters

    Returns Promise<Outline>

  • Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button.

    Parameters

    Returns Promise<HttpUrl>

  • Hides the list of contacts that have close birthdays for 24 hours.

    Returns Promise<Ok>

  • Imports messages exported from another app.

    Parameters

    Returns Promise<Ok>

  • Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats.

    Parameters

    Returns Promise<Ok>

  • Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created.

    Parameters

    Returns Promise<Ok>

  • Uses an invite link to add the current user to the chat if possible. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created.

    Parameters

    Returns Promise<Chat>

  • Joins an active group call. Returns join response payload for tgcalls.

    Parameters

    Returns Promise<Text>

  • Removes the current user from chat members. Private and secret chats can't be left using this method.

    Parameters

    Returns Promise<Ok>

  • Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded.

    Parameters

    Returns Promise<Ok>

  • Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded.

    Parameters

    Returns Promise<Ok>

  • Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded.

    Parameters

    Returns Promise<Ok>

  • Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages.

    Parameters

    Returns Promise<Ok>

  • Loads quick reply shortcuts created by the current user. The loaded data will be sent through updateQuickReplyShortcut and updateQuickReplyShortcuts.

    Returns Promise<Ok>

  • Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded.

    Parameters

    Returns Promise<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 Promise<Ok>

  • Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats).

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat methods.

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed.

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that a story is opened and is being viewed by the user.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<WebAppInfo>

  • Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously.

    Parameters

    Returns Promise<FormattedText>

  • Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned.

    Parameters

    Returns Promise<Ok>

  • Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization.

    Parameters

    Returns Promise<Seconds>

  • Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message.

    Parameters

    Returns Promise<File>

  • Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Rates recognized speech in a video note or a voice note message.

    Parameters

    Returns Promise<Ok>

  • Marks all reactions in a chat or a forum topic as read.

    Parameters

    Returns Promise<Ok>

  • Traverse all chats in a chat list and marks all messages in the chats as read.

    Parameters

    Returns Promise<Ok>

  • Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.

    Parameters

    Returns Promise<FilePart>

  • Readds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message.

    Parameters

    Returns Promise<QuickReplyMessages>

  • Recognizes speech in a video note or a voice note message.

    Parameters

    Returns Promise<Ok>

  • Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword.

    Parameters

    Returns Promise<Ok>

  • Refunds a previously done payment in Telegram Stars; for bots only.

    Parameters

    Returns Promise<Ok>

  • Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription.

    Parameters

    Returns Promise<PushReceiverId>

  • Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration.

    Parameters

    Returns Promise<Ok>

  • Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids.

    Parameters

    Returns Promise<Ok>

  • Removes a chat action bar without any other action.

    Parameters

    Returns Promise<Ok>

  • Removes users from the contact list.

    Parameters

    Returns Promise<Ok>

  • Removes a reaction from a message. A chosen reaction can always be removed.

    Parameters

    Returns Promise<Ok>

  • Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user.

    Parameters

    Returns Promise<Ok>

  • Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user.

    Parameters

    Returns Promise<Ok>

  • Removes a proxy server. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Removes a hashtag from the list of recently used hashtags.

    Parameters

    Returns Promise<Ok>

  • Removes a sticker from the list of recently used stickers.

    Parameters

    Returns Promise<Ok>

  • Removes an animation from the list of saved animations.

    Parameters

    Returns Promise<Ok>

  • Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags.

    Parameters

    Returns Promise<Ok>

  • Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user.

    Parameters

    Returns Promise<Ok>

  • Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled.

    Parameters

    Returns Promise<Ok>

  • Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true.

    Parameters

    Returns Promise<Ok>

  • Changes order of media previews in the list of media previews of a bot.

    Parameters

    Returns Promise<Ok>

  • Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel.

    Parameters

    Returns Promise<Ok>

  • Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right.

    Parameters

    Returns Promise<ChatInviteLink>

  • Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet.

    Parameters

    Returns Promise<Ok>

  • Reports that authentication code wasn't delivered via SMS; for official mobile applications only. Works only when the current authorization state is authorizationStateWaitCode.

    Parameters

    Returns Promise<Ok>

  • Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported.

    Parameters

    Returns Promise<Ok>

  • Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if messageProperties.can_report_reactions.

    Parameters

    Returns Promise<Ok>

  • Reports that authentication code wasn't delivered via SMS to the specified phone number; for official mobile applications only.

    Parameters

    Returns Promise<Ok>

  • Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true.

    Parameters

    Returns Promise<Ok>

  • Reports messages in a supergroup as spam; requires administrator rights in the supergroup.

    Parameters

    Returns Promise<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 Promise<Ok>

  • Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword.

    Parameters

    Returns Promise<Ok>

  • Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode.

    Parameters

    Returns Promise<Ok>

  • Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message.

    Parameters

    Returns Promise<Messages>

  • Resets all chat and scope notification settings to their default values. By default, all chats are unmuted and message previews are shown.

    Returns Promise<Ok>

  • Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true.

    Returns Promise<Ok>

  • Resets list of installed backgrounds to its default value.

    Returns Promise<Ok>

  • Resets all network data usage statistics to zero. Can be called before authorization.

    Returns Promise<Ok>

  • Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time.

    Returns Promise<ResetPasswordResult>

  • Reuses an active Telegram Star subscription to a channel chat and joins the chat again.

    Parameters

    Returns Promise<Ok>

  • Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked, then additionally to the revoked link returns new primary link.

    Parameters

    Returns Promise<ChatInviteLinks>

  • Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag.

    Parameters

    Returns Promise<Ok>

  • Saves application log event on the server. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib.

    Parameters

    Returns Promise<FoundMessages>

  • Searches a chat with an affiliate program. Returns the chat if found and the program is active.

    Parameters

    Returns Promise<Chat>

  • Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights if the chat is a channel.

    Parameters

    Returns Promise<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 message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation.

    Parameters

    Returns Promise<FoundChatMessages>

  • Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list.

    Parameters

    Returns Promise<Chats>

  • Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list.

    Parameters

    Returns Promise<Chats>

  • Searches for the specified query in the first names, last names and usernames of the known user contacts.

    Parameters

    Returns Promise<Users>

  • Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

    Parameters

    Returns Promise<FoundMessages>

  • Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned.

    Parameters

    Returns Promise<Chat>

  • Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results. Excludes private chats with contacts and chats from the chat list from the results.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<FoundMessages>

  • Searches for public stories by the given address location. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

    Parameters

    Returns Promise<FoundStories>

  • Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

    Parameters

    Returns Promise<FoundStories>

  • Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit.

    Parameters

    Returns Promise<FoundStories>

  • Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously.

    Parameters

    Returns Promise<FoundPosition>

  • Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request.

    Parameters

    Returns Promise<Chats>

  • Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<FoundMessages>

  • Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results.

    Parameters

    Returns Promise<StickerSets>

  • Searches for stickers from public sticker sets that correspond to any of the given emoji.

    Parameters

    Returns Promise<Stickers>

  • Searches a user by their phone number. Returns a 404 error if the user can't be found.

    Parameters

    Returns Promise<User>

  • Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found.

    Parameters

    Returns Promise<FoundWebApp>

  • Sells a gift received by the current user for Telegram Stars.

    Parameters

    Returns Promise<Ok>

  • Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<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 be only grouped in an album with messages of the same type. Returns sent messages.

    Parameters

    Returns Promise<BusinessMessages>

  • Sends log file for a call to Telegram servers.

    Parameters

    Returns Promise<Ok>

  • Sends a notification about user activity in a chat.

    Parameters

    Returns Promise<Ok>

  • Sends a gift to another user. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.

    Parameters

    Returns Promise<Ok>

  • Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages.

    Parameters

    Returns Promise<Messages>

  • Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused.

    Parameters

    Returns Promise<Ok>

  • Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos.

    Parameters

    Returns Promise<Ok>

  • Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story.

    Parameters

    Returns Promise<Story>

  • Sends data received from a keyboardButtonTypeWebApp Web App to a bot.

    Parameters

    Returns Promise<Ok>

  • Changes accent color and background custom emoji for the current user; for Telegram Premium users only.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Succeeds after a specified amount of time has passed. Can be called before initialization.

    Parameters

    Returns Promise<Ok>

  • Application verification has been completed. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress.

    Parameters

    Returns Promise<Ok>

  • Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword.

    Parameters

    Returns Promise<Ok>

  • Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings.

    Parameters

    Returns Promise<Ok>

  • Changes the bio of the current user.

    Parameters

    • options: Omit<SetBio, "@type">

    Returns Promise<Ok>

  • Changes the birthdate of the current user.

    Parameters

    Returns Promise<Ok>

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

    Parameters

    Returns Promise<Ok>

  • Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true.

    Parameters

    Returns Promise<Ok>

  • Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true.

    Parameters

    Returns Promise<Ok>

  • Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only.

    Parameters

    Returns Promise<Ok>

  • Changes the business away message settings of the current user. Requires Telegram Business subscription.

    Parameters

    Returns Promise<Ok>

  • Adds or changes business bot that is connected to the current user account.

    Parameters

    Returns Promise<Ok>

  • Changes the business greeting message settings of the current user. Requires Telegram Business subscription.

    Parameters

    Returns Promise<Ok>

  • Changes the business location of the current user. Requires Telegram Business subscription.

    Parameters

    Returns Promise<Ok>

  • Pins or unpins a message sent on behalf of a business account; for bots only.

    Parameters

    Returns Promise<Ok>

  • Changes the business opening hours of the current user. Requires Telegram Business subscription.

    Parameters

    Returns Promise<Ok>

  • Changes the business start page of the current user. Requires Telegram Business subscription.

    Parameters

    Returns Promise<Ok>

  • Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes application-specific data associated with a chat.

    Parameters

    Returns Promise<Ok>

  • Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified.

    Parameters

    Returns Promise<Ok>

  • Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use.

    Parameters

    Returns Promise<Ok>

  • Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed.

    Parameters

    Returns Promise<Ok>

  • Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels. Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).

    Parameters

    Returns Promise<Ok>

  • Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed.

    Parameters

    Returns Promise<Ok>

  • Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat.

    Parameters

    Returns Promise<Ok>

  • Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right.

    Parameters

    Returns Promise<Ok>

  • Changes the chat theme. Supported only in private and secret chats.

    Parameters

    Returns Promise<Ok>

  • Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Changes the list of close friends of the current user.

    Parameters

    Returns Promise<Ok>

  • Sets the list of commands supported by the bot for the given user scope and language; for bots only.

    Parameters

    Returns Promise<Ok>

  • Adds or changes a custom local language pack to the current localization target.

    Parameters

    Returns Promise<Ok>

  • Adds, edits or deletes a string in a custom local language pack. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain.

    Parameters

    Returns Promise<Ok>

  • Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only.

    Parameters

    Returns Promise<Ok>

  • Changes the emoji status of the current user; for Telegram Premium users only.

    Parameters

    Returns Promise<Ok>

  • Updates the game score of the specified user in the game; for bots only.

    Parameters

    Returns Promise<Message>

  • Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level.

    Parameters

    Returns Promise<Ok>

  • Sets group call title. Requires groupCall.can_be_managed group call flag.

    Parameters

    Returns Promise<Ok>

  • Changes the period of inactivity after which sessions will automatically be terminated.

    Parameters

    Returns Promise<Ok>

  • Updates the game score of the specified user in a game; for bots only.

    Parameters

    Returns Promise<Ok>

  • Sets new log stream for internal logging of TDLib. Can be called synchronously.

    Parameters

    Returns Promise<Ok>

  • Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously.

    Parameters

    Returns Promise<Ok>

  • Sets the verbosity level of the internal logging of TDLib. Can be called synchronously.

    Parameters

    Returns Promise<Ok>

  • Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly.

    Parameters

    Returns Promise<EmailAddressAuthenticationCodeInfo>

  • Sets menu button for the given user or for all users; for bots only.

    Parameters

    Returns Promise<Ok>

  • Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true.

    Parameters

    Returns Promise<Ok>

  • Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked.

    Parameters

    Returns Promise<Ok>

  • Changes the first and last name of the current user.

    Parameters

    Returns Promise<Ok>

  • Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it must be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics.

    Parameters

    Returns Promise<Ok>

  • Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings").

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<PasswordState>

  • Changes the personal chat of the current user.

    Parameters

    Returns Promise<Ok>

  • Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup.

    Parameters

    Returns Promise<Ok>

  • Changes the user answer to a poll. A poll in quiz mode can be answered only once.

    Parameters

    Returns Promise<Ok>

  • Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only.

    Parameters

    Returns Promise<Ok>

  • Changes a profile photo for the current user.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<PasswordState>

  • Changes label of a Saved Messages tag; for Telegram Premium users only.

    Parameters

    Returns Promise<Ok>

  • Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user.

    Parameters

    Returns Promise<Ok>

  • Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user.

    Parameters

    Returns Promise<Ok>

  • Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user.

    Parameters

    Returns Promise<Ok>

  • Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user.

    Parameters

    Returns Promise<Ok>

  • Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true.

    Parameters

    Returns Promise<Ok>

  • Changes chosen reaction on a story that has already been sent.

    Parameters

    Returns Promise<Ok>

  • Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color.

    Parameters

    Returns Promise<Ok>

  • Changes the sticker set of a supergroup; requires can_change_info administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; requires can_restrict_members administrator right.

    Parameters

    Returns Promise<Ok>

  • Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel.

    Parameters

    Returns Promise<Ok>

  • Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters.

    Parameters

    Returns Promise<Ok>

  • Changes the emoji status of a user; for bots only.

    Parameters

    Returns Promise<Ok>

  • Changes the editable username of the current user.

    Parameters

    Returns Promise<Ok>

  • Changes default participant identifier, on whose behalf a video chat in the chat will be joined.

    Parameters

    Returns Promise<Ok>

  • Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot.

    Parameters

    Returns Promise<Ok>

  • Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber.

    Parameters

    Returns Promise<Ok>

  • Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot.

    Parameters

    Returns Promise<Ok>

  • Starts recording of an active group call. Requires groupCall.can_be_managed group call flag.

    Parameters

    Returns Promise<Ok>

  • Suggests a profile photo to another regular user with common messages.

    Parameters

    Returns Promise<Ok>

  • Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Terminates all other sessions of the current user.

    Returns Promise<Ok>

  • Terminates a session of the current user.

    Parameters

    Returns Promise<Ok>

  • Returns the received bytes; for testing only. This is an offline method. Can be called before authorization.

    Parameters

    Returns Promise<TestBytes>

  • Does nothing; for testing only. This is an offline method. Can be called before authorization.

    Returns Promise<Ok>

  • Returns the received string; for testing only. This is an offline method. Can be called before authorization.

    Parameters

    Returns Promise<TestString>

  • Forces an updates.getDifference call to the Telegram servers; for testing only.

    Returns Promise<Ok>

  • Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization.

    Returns Promise<Ok>

  • Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization.

    Parameters

    Returns Promise<Ok>

  • Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously.

    Parameters

    Returns Promise<Error>

  • Returns the squared received number; for testing only. This is an offline method. Can be called before authorization.

    Parameters

    Returns Promise<TestInt>

  • Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization.

    Returns Promise<Update>

  • Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true.

    Parameters

    Returns Promise<Ok>

  • Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true.

    Parameters

    Returns Promise<Ok>

  • Changes the value of the default disable_notification parameter, used when a message is sent to a chat.

    Parameters

    Returns Promise<Ok>

  • Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges.

    Parameters

    Returns Promise<Ok>

  • Changes the pinned state of a chat. There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium.

    Parameters

    Returns Promise<Ok>

  • Changes the view_as_topics setting of a forum chat or Saved Messages.

    Parameters

    Returns Promise<Ok>

  • Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic.

    Parameters

    Returns Promise<Ok>

  • Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics.

    Parameters

    Returns Promise<Ok>

  • Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the supergroup.

    Parameters

    Returns Promise<Ok>

  • Toggles whether a gift is shown on the current user's profile page.

    Parameters

    Returns Promise<Ok>

  • Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only.

    Parameters

    Returns Promise<Ok>

  • Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag.

    Parameters

    Returns Promise<Ok>

  • Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves.

    Parameters

    Returns Promise<Ok>

  • Toggles whether the current user has sponsored messages enabled. The setting has no effect for users without Telegram Premium for which sponsored messages are always enabled.

    Parameters

    Returns Promise<Ok>

  • Changes whether the paid message reaction of the user to a message is anonymous. The message must have paid reaction added by the user.

    Parameters

    Returns Promise<Ok>

  • Changes the pinned state of a Saved Messages topic. There can be up to getOption("pinned_saved_messages_topic_count_max") pinned topics. The limit can be increased with Telegram Premium.

    Parameters

    Returns Promise<Ok>

  • Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_posted_to_chat_page == true.

    Parameters

    Returns Promise<Ok>

  • Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable sponsored messages.

    Parameters

    Returns Promise<Ok>

  • Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true.

    Parameters

    Returns Promise<Ok>

  • Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true.

    Parameters

    Returns Promise<Ok>

  • Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums.

    Parameters

    Returns Promise<Ok>

  • Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right.

    Parameters

    Returns Promise<Ok>

  • Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right.

    Parameters

    Returns Promise<Ok>

  • Toggles whether sender signature or link to the account is added to sent messages in a channel; requires can_change_info member right.

    Parameters

    Returns Promise<Ok>

  • Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached.

    Parameters

    Returns Promise<Ok>

  • Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached.

    Parameters

    Returns Promise<Ok>

  • Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats.

    Parameters

    Returns Promise<Ok>

  • Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved.

    Parameters

    Returns Promise<FormattedText>

  • Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved.

    Parameters

    Returns Promise<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.

    Parameters

    Returns Promise<Ok>

  • Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup.

    Parameters

    Returns Promise<Ok>

  • Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel.

    Parameters

    Returns Promise<Ok>

  • Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires owner privileges. Deactivates the original basic group.

    Parameters

    Returns Promise<Chat>

  • Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels).

    Parameters

    Returns Promise<Ok>

  • Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen.

    Parameters

    Returns Promise<Ok>

  • Informs the server that some trending sticker sets have been viewed by the user.

    Parameters

    Returns Promise<Ok>

  • Writes a part of a generated file. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file.

    Parameters

    Returns Promise<Ok>