tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::LoginUrl Struct Reference

This object 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. All the user needs to do is tap/click a button and confirm that they want to log in: More...

#include <LoginUrl.hpp>

Public Member Functions

 LoginUrl ()=default
 
 LoginUrl (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON. More...
 

Public Attributes

std::string url
 An HTTPS URL to 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. More...
 
std::string forwardText
 Optional. New text of the button in forwarded messages. More...
 
std::string botUsername
 Optional. 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. More...
 
bool requestWriteAccess {}
 Optional. Pass True to request the permission for your bot to send messages to the user. More...
 

Detailed Description

This object 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. All the user needs to do is tap/click a button and confirm that they want to log in:

Note
Telegram apps support these buttons as of version 5.7. https://core.telegram.org/bots/api#loginurl

Definition at line 11 of file LoginUrl.hpp.

Constructor & Destructor Documentation

◆ LoginUrl() [1/2]

tgbotxx::LoginUrl::LoginUrl ( )
default

◆ LoginUrl() [2/2]

tgbotxx::LoginUrl::LoginUrl ( const nl::json &  json)
inlineexplicit

Definition at line 13 of file LoginUrl.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::LoginUrl::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 48 of file LoginUrl.hpp.

◆ toJson()

nl::json tgbotxx::LoginUrl::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 38 of file LoginUrl.hpp.

Member Data Documentation

◆ botUsername

std::string tgbotxx::LoginUrl::botUsername

Optional. 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.

Definition at line 31 of file LoginUrl.hpp.

◆ forwardText

std::string tgbotxx::LoginUrl::forwardText

Optional. New text of the button in forwarded messages.

Definition at line 26 of file LoginUrl.hpp.

◆ requestWriteAccess

bool tgbotxx::LoginUrl::requestWriteAccess {}

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

Definition at line 34 of file LoginUrl.hpp.

◆ url

std::string tgbotxx::LoginUrl::url

An HTTPS URL to 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.

Definition at line 23 of file LoginUrl.hpp.


The documentation for this struct was generated from the following file: