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

This object represents a gift that can be sent by the bot. https://core.telegram.org/bots/api#gift. More...

#include <Gift.hpp>

Public Member Functions

 Gift ()=default
 
 Gift (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::string id
 Unique identifier of the gift.
 
Ptr< Stickersticker
 The sticker that represents the gift.
 
std::int64_t starCount {}
 The number of Telegram Stars that must be paid to send the sticker.
 
std::int64_t upgradeStarCount {}
 Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one.
 
std::int64_t totalCount {}
 Optional. The total number of the gifts of this type that can be sent; for limited gifts only.
 
std::int64_t remainingCount {}
 Optional. The number of remaining gifts of this type that can be sent; for limited gifts only.
 
Ptr< ChatpublisherChat
 Optional. Information about the chat that published the gift.
 

Detailed Description

This object represents a gift that can be sent by the bot. https://core.telegram.org/bots/api#gift.

Definition at line 9 of file Gift.hpp.

Constructor & Destructor Documentation

◆ Gift() [1/2]

tgbotxx::Gift::Gift ( )
default

◆ Gift() [2/2]

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

Definition at line 11 of file Gift.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 51 of file Gift.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 38 of file Gift.hpp.

Member Data Documentation

◆ id

std::string tgbotxx::Gift::id

Unique identifier of the gift.

Definition at line 16 of file Gift.hpp.

◆ publisherChat

Ptr<Chat> tgbotxx::Gift::publisherChat

Optional. Information about the chat that published the gift.

Definition at line 34 of file Gift.hpp.

◆ remainingCount

std::int64_t tgbotxx::Gift::remainingCount {}

Optional. The number of remaining gifts of this type that can be sent; for limited gifts only.

Definition at line 31 of file Gift.hpp.

◆ starCount

std::int64_t tgbotxx::Gift::starCount {}

The number of Telegram Stars that must be paid to send the sticker.

Definition at line 22 of file Gift.hpp.

◆ sticker

Ptr<Sticker> tgbotxx::Gift::sticker

The sticker that represents the gift.

Definition at line 19 of file Gift.hpp.

◆ totalCount

std::int64_t tgbotxx::Gift::totalCount {}

Optional. The total number of the gifts of this type that can be sent; for limited gifts only.

Definition at line 28 of file Gift.hpp.

◆ upgradeStarCount

std::int64_t tgbotxx::Gift::upgradeStarCount {}

Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one.

Definition at line 25 of file Gift.hpp.


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