tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::SharedUser Struct Reference

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button. https://core.telegram.org/bots/api#shareduser. More...

#include <SharedUser.hpp>

Public Member Functions

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

Public Attributes

std::int64_t userId {}
 Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
 
std::string firstName
 Optional. First name of the user, if the name was requested by the bot.
 
std::string lastName
 Optional. Last name of the user, if the name was requested by the bot.
 
std::string username
 Optional. Username of the user, if the username was requested by the bot.
 
std::vector< Ptr< PhotoSize > > photo
 Optional. Available sizes of the chat photo, if the photo was requested by the bot.
 

Detailed Description

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button. https://core.telegram.org/bots/api#shareduser.

Definition at line 8 of file SharedUser.hpp.

Constructor & Destructor Documentation

◆ SharedUser() [1/2]

tgbotxx::SharedUser::SharedUser ( )
default

◆ SharedUser() [2/2]

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

Definition at line 10 of file SharedUser.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 46 of file SharedUser.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 35 of file SharedUser.hpp.

Member Data Documentation

◆ firstName

std::string tgbotxx::SharedUser::firstName

Optional. First name of the user, if the name was requested by the bot.

Definition at line 22 of file SharedUser.hpp.

◆ lastName

std::string tgbotxx::SharedUser::lastName

Optional. Last name of the user, if the name was requested by the bot.

Definition at line 25 of file SharedUser.hpp.

◆ photo

std::vector<Ptr<PhotoSize> > tgbotxx::SharedUser::photo

Optional. Available sizes of the chat photo, if the photo was requested by the bot.

Definition at line 31 of file SharedUser.hpp.

◆ userId

std::int64_t tgbotxx::SharedUser::userId {}

Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.

Definition at line 19 of file SharedUser.hpp.

◆ username

std::string tgbotxx::SharedUser::username

Optional. Username of the user, if the username was requested by the bot.

Definition at line 28 of file SharedUser.hpp.


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