InternalLinkType

Enum InternalLinkType 

Source
pub enum InternalLinkType {
Show 25 variants GetInternalLinkType(GetInternalLinkType), ActiveSessions(InternalLinkTypeActiveSessions), AuthenticationCode(InternalLinkTypeAuthenticationCode), Background(InternalLinkTypeBackground), BotStart(InternalLinkTypeBotStart), BotStartInGroup(InternalLinkTypeBotStartInGroup), ChangePhoneNumber(InternalLinkTypeChangePhoneNumber), ChatInvite(InternalLinkTypeChatInvite), FilterSettings(InternalLinkTypeFilterSettings), Game(InternalLinkTypeGame), LanguagePack(InternalLinkTypeLanguagePack), Message(InternalLinkTypeMessage), MessageDraft(InternalLinkTypeMessageDraft), PassportDataRequest(InternalLinkTypePassportDataRequest), PhoneNumberConfirmation(InternalLinkTypePhoneNumberConfirmation), Proxy(InternalLinkTypeProxy), PublicChat(InternalLinkTypePublicChat), QrCodeAuthentication(InternalLinkTypeQrCodeAuthentication), Settings(InternalLinkTypeSettings), StickerSet(InternalLinkTypeStickerSet), Theme(InternalLinkTypeTheme), ThemeSettings(InternalLinkTypeThemeSettings), UnknownDeepLink(InternalLinkTypeUnknownDeepLink), UnsupportedProxy(InternalLinkTypeUnsupportedProxy), VideoChat(InternalLinkTypeVideoChat), // some variants omitted
}
Expand description

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

Variants§

§

GetInternalLinkType(GetInternalLinkType)

Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization

§

ActiveSessions(InternalLinkTypeActiveSessions)

The link is a link to the active sessions section of the app. Use getActiveSessions to handle the link

§

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

§

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 group to add the bot to, and then call sendBotStartMessage with the given start parameter and the chosen group chat. Bots can be added to a public group only by administrators of the group

§

ChangePhoneNumber(InternalLinkTypeChangePhoneNumber)

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

§

ChatInvite(InternalLinkTypeChatInvite)

The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link

§

FilterSettings(InternalLinkTypeFilterSettings)

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

§

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

§

LanguagePack(InternalLinkTypeLanguagePack)

The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link

§

Message(InternalLinkTypeMessage)

The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link

§

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 app, otherwise ignore it

§

PhoneNumberConfirmation(InternalLinkTypePhoneNumberConfirmation)

The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link

§

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

§

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

§

Settings(InternalLinkTypeSettings)

The link is a link to app settings

§

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

§

Theme(InternalLinkTypeTheme)

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

§

ThemeSettings(InternalLinkTypeThemeSettings)

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

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

§

UnsupportedProxy(InternalLinkTypeUnsupportedProxy)

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

§

VideoChat(InternalLinkTypeVideoChat)

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

Implementations§

Source§

impl InternalLinkType

Source

pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>

Source

pub fn is_active_sessions(&self) -> bool

Source

pub fn is_authentication_code(&self) -> bool

Source

pub fn is_background(&self) -> bool

Source

pub fn is_bot_start(&self) -> bool

Source

pub fn is_bot_start_in_group(&self) -> bool

Source

pub fn is_change_phone_number(&self) -> bool

Source

pub fn is_chat_invite(&self) -> bool

Source

pub fn is_filter_settings(&self) -> bool

Source

pub fn is_game(&self) -> bool

Source

pub fn is_language_pack(&self) -> bool

Source

pub fn is_message(&self) -> bool

Source

pub fn is_message_draft(&self) -> bool

Source

pub fn is_passport_data_request(&self) -> bool

Source

pub fn is_phone_number_confirmation(&self) -> bool

Source

pub fn is_proxy(&self) -> bool

Source

pub fn is_public_chat(&self) -> bool

Source

pub fn is_qr_code_authentication(&self) -> bool

Source

pub fn is_settings(&self) -> bool

Source

pub fn is_sticker_set(&self) -> bool

Source

pub fn is_theme(&self) -> bool

Source

pub fn is_theme_settings(&self) -> bool

Source

pub fn is_unsupported_proxy(&self) -> bool

Source

pub fn is_video_chat(&self) -> bool

Source

pub fn on_active_sessions<F: FnOnce(&InternalLinkTypeActiveSessions)>( &self, fnc: F, ) -> &Self

Source

pub fn on_authentication_code<F: FnOnce(&InternalLinkTypeAuthenticationCode)>( &self, fnc: F, ) -> &Self

Source

pub fn on_background<F: FnOnce(&InternalLinkTypeBackground)>( &self, fnc: F, ) -> &Self

Source

pub fn on_bot_start<F: FnOnce(&InternalLinkTypeBotStart)>( &self, fnc: F, ) -> &Self

Source

pub fn on_bot_start_in_group<F: FnOnce(&InternalLinkTypeBotStartInGroup)>( &self, fnc: F, ) -> &Self

Source

pub fn on_change_phone_number<F: FnOnce(&InternalLinkTypeChangePhoneNumber)>( &self, fnc: F, ) -> &Self

Source

pub fn on_chat_invite<F: FnOnce(&InternalLinkTypeChatInvite)>( &self, fnc: F, ) -> &Self

Source

pub fn on_filter_settings<F: FnOnce(&InternalLinkTypeFilterSettings)>( &self, fnc: F, ) -> &Self

Source

pub fn on_game<F: FnOnce(&InternalLinkTypeGame)>(&self, fnc: F) -> &Self

Source

pub fn on_language_pack<F: FnOnce(&InternalLinkTypeLanguagePack)>( &self, fnc: F, ) -> &Self

Source

pub fn on_message<F: FnOnce(&InternalLinkTypeMessage)>(&self, fnc: F) -> &Self

Source

pub fn on_message_draft<F: FnOnce(&InternalLinkTypeMessageDraft)>( &self, fnc: F, ) -> &Self

Source

pub fn on_passport_data_request<F: FnOnce(&InternalLinkTypePassportDataRequest)>( &self, fnc: F, ) -> &Self

Source

pub fn on_phone_number_confirmation<F: FnOnce(&InternalLinkTypePhoneNumberConfirmation)>( &self, fnc: F, ) -> &Self

Source

pub fn on_proxy<F: FnOnce(&InternalLinkTypeProxy)>(&self, fnc: F) -> &Self

Source

pub fn on_public_chat<F: FnOnce(&InternalLinkTypePublicChat)>( &self, fnc: F, ) -> &Self

Source

pub fn on_qr_code_authentication<F: FnOnce(&InternalLinkTypeQrCodeAuthentication)>( &self, fnc: F, ) -> &Self

Source

pub fn on_settings<F: FnOnce(&InternalLinkTypeSettings)>(&self, fnc: F) -> &Self

Source

pub fn on_sticker_set<F: FnOnce(&InternalLinkTypeStickerSet)>( &self, fnc: F, ) -> &Self

Source

pub fn on_theme<F: FnOnce(&InternalLinkTypeTheme)>(&self, fnc: F) -> &Self

Source

pub fn on_theme_settings<F: FnOnce(&InternalLinkTypeThemeSettings)>( &self, fnc: F, ) -> &Self

Source

pub fn on_unsupported_proxy<F: FnOnce(&InternalLinkTypeUnsupportedProxy)>( &self, fnc: F, ) -> &Self

Source

pub fn on_video_chat<F: FnOnce(&InternalLinkTypeVideoChat)>( &self, fnc: F, ) -> &Self

Source

pub fn as_active_sessions(&self) -> Option<&InternalLinkTypeActiveSessions>

Source

pub fn as_authentication_code( &self, ) -> Option<&InternalLinkTypeAuthenticationCode>

Source

pub fn as_background(&self) -> Option<&InternalLinkTypeBackground>

Source

pub fn as_bot_start(&self) -> Option<&InternalLinkTypeBotStart>

Source

pub fn as_bot_start_in_group(&self) -> Option<&InternalLinkTypeBotStartInGroup>

Source

pub fn as_change_phone_number( &self, ) -> Option<&InternalLinkTypeChangePhoneNumber>

Source

pub fn as_chat_invite(&self) -> Option<&InternalLinkTypeChatInvite>

Source

pub fn as_filter_settings(&self) -> Option<&InternalLinkTypeFilterSettings>

Source

pub fn as_game(&self) -> Option<&InternalLinkTypeGame>

Source

pub fn as_language_pack(&self) -> Option<&InternalLinkTypeLanguagePack>

Source

pub fn as_message(&self) -> Option<&InternalLinkTypeMessage>

Source

pub fn as_message_draft(&self) -> Option<&InternalLinkTypeMessageDraft>

Source

pub fn as_passport_data_request( &self, ) -> Option<&InternalLinkTypePassportDataRequest>

Source

pub fn as_phone_number_confirmation( &self, ) -> Option<&InternalLinkTypePhoneNumberConfirmation>

Source

pub fn as_proxy(&self) -> Option<&InternalLinkTypeProxy>

Source

pub fn as_public_chat(&self) -> Option<&InternalLinkTypePublicChat>

Source

pub fn as_qr_code_authentication( &self, ) -> Option<&InternalLinkTypeQrCodeAuthentication>

Source

pub fn as_settings(&self) -> Option<&InternalLinkTypeSettings>

Source

pub fn as_sticker_set(&self) -> Option<&InternalLinkTypeStickerSet>

Source

pub fn as_theme(&self) -> Option<&InternalLinkTypeTheme>

Source

pub fn as_theme_settings(&self) -> Option<&InternalLinkTypeThemeSettings>

Source

pub fn as_unsupported_proxy(&self) -> Option<&InternalLinkTypeUnsupportedProxy>

Source

pub fn as_video_chat(&self) -> Option<&InternalLinkTypeVideoChat>

Source

pub fn active_sessions<T: AsRef<InternalLinkTypeActiveSessions>>(t: T) -> Self

Source

pub fn authentication_code<T: AsRef<InternalLinkTypeAuthenticationCode>>( t: T, ) -> Self

Source

pub fn background<T: AsRef<InternalLinkTypeBackground>>(t: T) -> Self

Source

pub fn bot_start<T: AsRef<InternalLinkTypeBotStart>>(t: T) -> Self

Source

pub fn bot_start_in_group<T: AsRef<InternalLinkTypeBotStartInGroup>>( t: T, ) -> Self

Source

pub fn change_phone_number<T: AsRef<InternalLinkTypeChangePhoneNumber>>( t: T, ) -> Self

Source

pub fn chat_invite<T: AsRef<InternalLinkTypeChatInvite>>(t: T) -> Self

Source

pub fn filter_settings<T: AsRef<InternalLinkTypeFilterSettings>>(t: T) -> Self

Source

pub fn game<T: AsRef<InternalLinkTypeGame>>(t: T) -> Self

Source

pub fn language_pack<T: AsRef<InternalLinkTypeLanguagePack>>(t: T) -> Self

Source

pub fn message<T: AsRef<InternalLinkTypeMessage>>(t: T) -> Self

Source

pub fn message_draft<T: AsRef<InternalLinkTypeMessageDraft>>(t: T) -> Self

Source

pub fn passport_data_request<T: AsRef<InternalLinkTypePassportDataRequest>>( t: T, ) -> Self

Source

pub fn phone_number_confirmation<T: AsRef<InternalLinkTypePhoneNumberConfirmation>>( t: T, ) -> Self

Source

pub fn proxy<T: AsRef<InternalLinkTypeProxy>>(t: T) -> Self

Source

pub fn public_chat<T: AsRef<InternalLinkTypePublicChat>>(t: T) -> Self

Source

pub fn qr_code_authentication<T: AsRef<InternalLinkTypeQrCodeAuthentication>>( t: T, ) -> Self

Source

pub fn settings<T: AsRef<InternalLinkTypeSettings>>(t: T) -> Self

Source

pub fn sticker_set<T: AsRef<InternalLinkTypeStickerSet>>(t: T) -> Self

Source

pub fn theme<T: AsRef<InternalLinkTypeTheme>>(t: T) -> Self

Source

pub fn theme_settings<T: AsRef<InternalLinkTypeThemeSettings>>(t: T) -> Self

Source

pub fn unsupported_proxy<T: AsRef<InternalLinkTypeUnsupportedProxy>>( t: T, ) -> Self

Source

pub fn video_chat<T: AsRef<InternalLinkTypeVideoChat>>(t: T) -> Self

Trait Implementations§

Source§

impl AsRef<InternalLinkType> for InternalLinkType

Source§

fn as_ref(&self) -> &InternalLinkType

Converts this type into a shared reference of the (usually inferred) input type.
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 Default for InternalLinkType

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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

Source§

fn deserialize<D>(deserializer: D) -> Result<InternalLinkType, D::Error>
where D: Deserializer<'de>,

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

impl RObject for InternalLinkType

Source§

fn to_json(&self) -> RTDResult<String>

Return td type to json string
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

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