haskell-tdlib-2.0.47.0
Safe HaskellSafe-Inferred
LanguageGHC2021

TD.Data.InternalLinkType

Synopsis

Documentation

data InternalLinkType Source #

Describes an internal https://t.me or tg: link, which must be processed by the application in a special way

Constructors

InternalLinkTypeActiveSessions

The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user

InternalLinkTypeAttachmentMenuBot

The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL

Fields

InternalLinkTypeAuthenticationCode

The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode

Fields

InternalLinkTypeBackground

The link is a link to a background. Call searchBackground with the given background name to process the link. If background is found and the user wants to apply it, then call setDefaultBackground

Fields

InternalLinkTypeBotAddToChannel

The link is a link to a Telegram bot, which is expected to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights

Fields

InternalLinkTypeBotStart

The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed

Fields

InternalLinkTypeBotStartInGroup

The link is a link to a Telegram bot, which is expected to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat

Fields

InternalLinkTypeBusinessChat

The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, then open received private chat and replace chat draft with the provided text

Fields

InternalLinkTypeBuyStars

The link is a link to the Telegram Star purchase section of the application

Fields

  • star_count :: Maybe Int

    The number of Telegram Stars that must be owned by the user

  • purpose :: Maybe Text

    Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions

InternalLinkTypeChangePhoneNumber

The link is a link to the change phone number section of the application

InternalLinkTypeChatBoost

The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat

Fields

InternalLinkTypeChatFolderInvite

The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink

Fields

InternalLinkTypeChatFolderSettings

The link is a link to the folder section of the application settings

InternalLinkTypeChatInvite

The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink

Fields

InternalLinkTypeDefaultMessageAutoDeleteTimerSettings

The link is a link to the default message auto-delete timer settings section of the application settings

InternalLinkTypeEditProfileSettings

The link is a link to the edit profile section of the application settings

InternalLinkTypeGame

The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame

Fields

InternalLinkTypeInstantView

The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser

Fields

InternalLinkTypeInvoice

The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link

Fields

InternalLinkTypeLanguagePack

The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id"

Fields

InternalLinkTypeLanguageSettings

The link is a link to the language section of the application settings

InternalLinkTypeMainWebApp

The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and open the returned URL as a Web App

Fields

InternalLinkTypeMessage

The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there

Fields

InternalLinkTypeMessageDraft

The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field

Fields

InternalLinkTypePassportDataRequest

The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it

Fields

  • bot_user_id :: Maybe Int

    User identifier of the service's bot; the corresponding user may be unknown yet

  • scope :: Maybe Text

    Telegram Passport element types requested by the service

  • public_key :: Maybe Text

    Service's public key

  • nonce :: Maybe Text

    Unique request identifier provided by the service

  • callback_url :: Maybe Text

    An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}:/passportsuccess or tgbot{bot_user_id}:/passportcancel must be opened otherwise

InternalLinkTypePhoneNumberConfirmation

The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it

Fields

InternalLinkTypePremiumFeatures

The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link

Fields

InternalLinkTypePremiumGift

The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases

Fields

InternalLinkTypePremiumGiftCode

The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode

Fields

InternalLinkTypePrivacyAndSecuritySettings

The link is a link to the privacy and security section of the application settings

InternalLinkTypeProxy

The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy

Fields

InternalLinkTypePublicChat

The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. If the chat is found, open its profile information screen or the chat itself. If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field

Fields

InternalLinkTypeQrCodeAuthentication

The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown

InternalLinkTypeRestorePurchases

The link forces restore of App Store purchases when opened. For official iOS application only

InternalLinkTypeSettings

The link is a link to application settings

InternalLinkTypeStickerSet

The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet

Fields

InternalLinkTypeStory

The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received

Fields

InternalLinkTypeTheme

The link is a link to a cloud theme. TDLib has no theme support yet

Fields

InternalLinkTypeThemeSettings

The link is a link to the theme section of the application settings

InternalLinkTypeUnknownDeepLink

The link is an unknown tg: link. Call getDeepLinkInfo to process the link

Fields

InternalLinkTypeUnsupportedProxy

The link is a link to an unsupported proxy. An alert can be shown to the user

InternalLinkTypeUserPhoneNumber

The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field

Fields

InternalLinkTypeUserToken

The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat

Fields

InternalLinkTypeVideoChat

The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link

Fields

InternalLinkTypeWebApp

The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party applications instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App

Fields