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

This object represents a phone contact. https://core.telegram.org/bots/api#contact. More...

#include <Contact.hpp>

Public Member Functions

 Contact ()=default
 
 Contact (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 phoneNumber
 Contact's phone number. More...
 
std::string firstName
 Contact's first name. More...
 
std::string lastName
 Optional. Contact's last name. More...
 
std::int64_t userId {}
 Optional. Contact's user identifier in Telegram. 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 a 64-bit integer or double-precision float type are safe for storing this identifier. More...
 
std::string vcard
 Optional. Additional data about the contact in the form of a vCard https://en.wikipedia.org/wiki/VCard . More...
 

Detailed Description

This object represents a phone contact. https://core.telegram.org/bots/api#contact.

Definition at line 7 of file Contact.hpp.

Constructor & Destructor Documentation

◆ Contact() [1/2]

tgbotxx::Contact::Contact ( )
default

◆ Contact() [2/2]

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

Definition at line 9 of file Contact.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 46 of file Contact.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 35 of file Contact.hpp.

Member Data Documentation

◆ firstName

std::string tgbotxx::Contact::firstName

Contact's first name.

Definition at line 17 of file Contact.hpp.

◆ lastName

std::string tgbotxx::Contact::lastName

Optional. Contact's last name.

Definition at line 20 of file Contact.hpp.

◆ phoneNumber

std::string tgbotxx::Contact::phoneNumber

Contact's phone number.

Definition at line 14 of file Contact.hpp.

◆ userId

std::int64_t tgbotxx::Contact::userId {}

Optional. Contact's user identifier in Telegram. 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 a 64-bit integer or double-precision float type are safe for storing this identifier.

Definition at line 26 of file Contact.hpp.

◆ vcard

std::string tgbotxx::Contact::vcard

Optional. Additional data about the contact in the form of a vCard https://en.wikipedia.org/wiki/VCard .

Definition at line 30 of file Contact.hpp.


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