haskell-tdlib-2.1.10.0: Binding to the Telegram Database Library
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

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

InternalLinkTypeCallsPage

The link is a link to the Call tab or page

Fields

  • section :: Maybe Text

    Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call"

InternalLinkTypeChatAffiliateProgram

The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link

Fields

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

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

InternalLinkTypeChatSelection

The link is a link that allows to select some chats

InternalLinkTypeContactsPage

The link is a link to the Contacts tab or page

Fields

  • section :: Maybe Text

    Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call"

InternalLinkTypeDirectMessagesChat

The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. If the chat is found and is channel, open the direct messages chat of the channel

Fields

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

InternalLinkTypeGiftAuction

The link is a link to a gift auction. Call getGiftAuctionState with the given auction identifier to process the link

Fields

InternalLinkTypeGiftCollection

The link is a link to a gift collection. Call searchPublicChat with the given username, then call getReceivedGifts with the received gift owner identifier and the given collection identifier, then show the collection if received

Fields

InternalLinkTypeGroupCall

The link is a link to a group call that isn't bound to a chat. Use getGroupCallParticipants to get the list of group call participants and show them on the join group call screen. Call joinGroupCall with the given invite_link to join the call

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

InternalLinkTypeLiveStory

The link is a link to a live story. Call searchPublicChat with the given chat username, then getChatActiveStories to get active stories in the chat, then find a live story among active stories of the chat, and then joinLiveStory to join the live story

Fields

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 mode 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

InternalLinkTypeMyProfilePage

The link is a link to the My Profile application page

Fields

  • section :: Maybe Text

    Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call"

InternalLinkTypeNewChannelChat

The link is a link to the screen for creating a new channel chat

InternalLinkTypeNewGroupChat

The link is a link to the screen for creating a new group chat

InternalLinkTypeNewPrivateChat

The link is a link to the screen for creating a new private chat with a contact

InternalLinkTypeNewStory

The link is a link to open the story posting interface

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

InternalLinkTypePremiumFeaturesPage

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

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

InternalLinkTypePremiumGiftPurchase

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

Fields

InternalLinkTypeProxy

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

Fields

  • proxy :: Maybe Proxy

    The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user

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

InternalLinkTypeSavedMessages

The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat

InternalLinkTypeSearch

The link is a link to the global chat and messages search field

InternalLinkTypeSettings

The link is a link to application settings

Fields

InternalLinkTypeStarPurchase

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

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 poster username, then call getStory with the received chat identifier and the given story identifier, then show the story if received

Fields

InternalLinkTypeStoryAlbum

The link is a link to an album of stories. Call searchPublicChat with the given username, then call getStoryAlbumStories with the received chat identifier and the given story album identifier, then show the story album if received

Fields

InternalLinkTypeTheme

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

Fields

InternalLinkTypeUnknownDeepLink

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

Fields

InternalLinkTypeUpgradedGift

The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link

Fields

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 joinVideoChat 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. If the bot is restricted for the current user, then show an error message. Otherwise, call searchWebApp with the received bot and the given web_app_short_name. Process 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