[][src]Struct tgbot::types::LoginUrl

pub struct LoginUrl { /* fields omitted */ }

Represents a parameter of the inline keyboard button used to automatically authorize a user

Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram

Methods

impl LoginUrl[src]

pub fn new<S>(url: S) -> Self where
    S: Into<String>, 
[src]

Creates a new LoginUrl with given URL

An HTTP URL will be opened with user authorization data added to the query string when the button is pressed

If the user refuses to provide authorization data, the original URL without information about the user will be opened

The data added is the same as described in Receiving authorization data

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization

pub fn forward_text<S>(self, forward_text: S) -> Self where
    S: Into<String>, 
[src]

New text of the button in forwarded messages

pub fn bot_username<S>(self, bot_username: S) -> Self where
    S: Into<String>, 
[src]

Username of a bot, which will be used for user authorization

See Setting up a bot for more details

If not specified, the current bot's username will be assumed

The url's domain must be the same as the domain linked with the bot

See Linking your domain to the bot for more details

pub fn request_write_access(self, request_write_access: bool) -> Self[src]

Pass True to request the permission for your bot to send messages to the user

Trait Implementations

impl Clone for LoginUrl[src]

impl Debug for LoginUrl[src]

impl<'de> Deserialize<'de> for LoginUrl[src]

impl<S> From<S> for LoginUrl where
    S: Into<String>, 
[src]

impl Serialize for LoginUrl[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.