58 nl::json
json = nl::json::object();
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Serialize.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
This object represents a gift that can be sent by the bot. https://core.telegram.org/bots/api#gift.
std::int64_t personalTotalCount
Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only.
bool hasColors
Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance.
std::int64_t totalCount
Optional. The total number of the gifts of this type that can be sent; for limited gifts only.
bool isPremium
Optional. True, if the gift can only be purchased by Telegram Premium subscribers.
Ptr< Sticker > sticker
The sticker that represents the gift.
std::int64_t upgradeStarCount
Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one.
Ptr< Chat > publisherChat
Optional. Information about the chat that published the gift.
std::int64_t remainingCount
Optional. The number of remaining gifts of this type that can be sent; for limited gifts only.
std::int64_t personalRemainingCount
Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts o...
nl::json toJson() const
Serializes this object to JSON.
std::int64_t uniqueGiftVariantCount
Optional. The total number of different unique gifts that can be obtained by upgrading the gift.
std::string id
Unique identifier of the gift.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
Ptr< GiftBackground > background
Optional. Information about the chat that published the gift.
std::int64_t starCount
The number of Telegram Stars that must be paid to send the sticker.
Gift(const nl::json &json)