[−][src]Struct tgbot::types::LoginUrl
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]
S: Into<String>,
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]
S: Into<String>,
New text of the button in forwarded messages
pub fn bot_username<S>(self, bot_username: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<S> From<S> for LoginUrl where
S: Into<String>,
[src]
S: Into<String>,
impl Serialize for LoginUrl
[src]
Auto Trait Implementations
impl RefUnwindSafe for LoginUrl
impl Send for LoginUrl
impl Sync for LoginUrl
impl Unpin for LoginUrl
impl UnwindSafe for LoginUrl
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,