InternalLinkType

Enum InternalLinkType 

Source
pub enum InternalLinkType {
Show 44 variants ActiveSessions, AttachmentMenuBot(Box<InternalLinkTypeAttachmentMenuBot>), AuthenticationCode(InternalLinkTypeAuthenticationCode), Background(InternalLinkTypeBackground), BotAddToChannel(InternalLinkTypeBotAddToChannel), BotStart(InternalLinkTypeBotStart), BotStartInGroup(InternalLinkTypeBotStartInGroup), BusinessChat(InternalLinkTypeBusinessChat), ChangePhoneNumber, ChatBoost(InternalLinkTypeChatBoost), ChatFolderInvite(InternalLinkTypeChatFolderInvite), ChatFolderSettings, ChatInvite(InternalLinkTypeChatInvite), DefaultMessageAutoDeleteTimerSettings, EditProfileSettings, Game(InternalLinkTypeGame), InstantView(InternalLinkTypeInstantView), Invoice(InternalLinkTypeInvoice), LanguagePack(InternalLinkTypeLanguagePack), LanguageSettings, Message(InternalLinkTypeMessage), MessageDraft(InternalLinkTypeMessageDraft), PassportDataRequest(InternalLinkTypePassportDataRequest), PhoneNumberConfirmation(InternalLinkTypePhoneNumberConfirmation), PremiumFeatures(InternalLinkTypePremiumFeatures), PremiumGift(InternalLinkTypePremiumGift), PremiumGiftCode(InternalLinkTypePremiumGiftCode), PrivacyAndSecuritySettings, Proxy(InternalLinkTypeProxy), PublicChat(InternalLinkTypePublicChat), QrCodeAuthentication, RestorePurchases, Settings, SideMenuBot(InternalLinkTypeSideMenuBot), StickerSet(InternalLinkTypeStickerSet), Story(InternalLinkTypeStory), Theme(InternalLinkTypeTheme), ThemeSettings, UnknownDeepLink(InternalLinkTypeUnknownDeepLink), UnsupportedProxy, UserPhoneNumber(InternalLinkTypeUserPhoneNumber), UserToken(InternalLinkTypeUserToken), VideoChat(InternalLinkTypeVideoChat), WebApp(InternalLinkTypeWebApp),
}

Variants§

§

ActiveSessions

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

§

AttachmentMenuBot(Box<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 a third-party apps, 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

§

AuthenticationCode(InternalLinkTypeAuthenticationCode)

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

§

Background(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

§

BotAddToChannel(InternalLinkTypeBotAddToChannel)

The link is a link to a Telegram bot, which is supposed 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

§

BotStart(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

§

BotStartInGroup(InternalLinkTypeBotStartInGroup)

The link is a link to a Telegram bot, which is supposed 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.

§

BusinessChat(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

§

ChangePhoneNumber

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

§

ChatBoost(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

§

ChatFolderInvite(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

§

ChatFolderSettings

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

§

ChatInvite(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

§

DefaultMessageAutoDeleteTimerSettings

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

§

EditProfileSettings

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

§

Game(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

§

InstantView(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

§

Invoice(InternalLinkTypeInvoice)

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

§

LanguagePack(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”

§

LanguageSettings

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

§

Message(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

§

MessageDraft(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

§

PassportDataRequest(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

§

PhoneNumberConfirmation(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

§

PremiumFeatures(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

§

PremiumGift(InternalLinkTypePremiumGift)

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

§

PremiumGiftCode(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

§

PrivacyAndSecuritySettings

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

§

Proxy(InternalLinkTypeProxy)

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

§

PublicChat(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, then put the draft text in the input field

§

QrCodeAuthentication

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

§

RestorePurchases

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

§

Settings

The link is a link to application settings

§

SideMenuBot(InternalLinkTypeSideMenuBot)

The link is a link to a bot, which can be installed to the side menu. 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 side menu, then show a disclaimer about Mini Apps being a third-party apps, 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 bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App

§

StickerSet(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

§

Story(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

§

Theme(InternalLinkTypeTheme)

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

§

ThemeSettings

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

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

§

UnsupportedProxy

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

§

UserPhoneNumber(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 the chat. If draft text isn’t empty, then put the draft text in the input field

§

UserToken(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

§

VideoChat(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

§

WebApp(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 a third-party apps 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

Trait Implementations§

Source§

impl Clone for InternalLinkType

Source§

fn clone(&self) -> InternalLinkType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InternalLinkType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InternalLinkType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for InternalLinkType

Source§

fn eq(&self, other: &InternalLinkType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for InternalLinkType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InternalLinkType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,