tgbotxx 1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::UniqueGiftInfo Struct Reference

Describes a service message about a unique gift that was sent or received. https://core.telegram.org/bots/api#uniquegiftinfo. More...

#include <UniqueGiftInfo.hpp>

Public Member Functions

 UniqueGiftInfo ()=default
 
 UniqueGiftInfo (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

Ptr< UniqueGiftgift
 Information about the gift.
 
std::string origin
 
std::string lastResaleCurrency {}
 Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
 
std::int64_t lastResaleAmount {}
 Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins.
 
std::string ownedGiftId
 Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts.
 
std::int64_t transferStarCount {}
 Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.
 
std::time_t nextTransferDate {}
 Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.
 

Detailed Description

Describes a service message about a unique gift that was sent or received. https://core.telegram.org/bots/api#uniquegiftinfo.

Definition at line 8 of file UniqueGiftInfo.hpp.

Constructor & Destructor Documentation

◆ UniqueGiftInfo() [1/2]

tgbotxx::UniqueGiftInfo::UniqueGiftInfo ( )
default

◆ UniqueGiftInfo() [2/2]

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

Definition at line 10 of file UniqueGiftInfo.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 59 of file UniqueGiftInfo.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 46 of file UniqueGiftInfo.hpp.

Member Data Documentation

◆ gift

Ptr<UniqueGift> tgbotxx::UniqueGiftInfo::gift

Information about the gift.

Definition at line 15 of file UniqueGiftInfo.hpp.

◆ lastResaleAmount

std::int64_t tgbotxx::UniqueGiftInfo::lastResaleAmount {}

Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins.

Definition at line 30 of file UniqueGiftInfo.hpp.

◆ lastResaleCurrency

std::string tgbotxx::UniqueGiftInfo::lastResaleCurrency {}

Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.

Definition at line 27 of file UniqueGiftInfo.hpp.

◆ nextTransferDate

std::time_t tgbotxx::UniqueGiftInfo::nextTransferDate {}

Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.

Definition at line 42 of file UniqueGiftInfo.hpp.

◆ origin

std::string tgbotxx::UniqueGiftInfo::origin

@briefOrigin of the gift. Currently, either:

  • “upgrade” for gifts upgraded from regular gifts,
  • “transfer” for gifts transferred from other users or channels,
  • “resale” for gifts bought from other users,
  • “gifted_upgrade” for upgrades purchased after the gift was sent, or
  • “offer” for gifts bought or sold through gift purchase offers

Definition at line 23 of file UniqueGiftInfo.hpp.

◆ ownedGiftId

std::string tgbotxx::UniqueGiftInfo::ownedGiftId

Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts.

Definition at line 34 of file UniqueGiftInfo.hpp.

◆ transferStarCount

std::int64_t tgbotxx::UniqueGiftInfo::transferStarCount {}

Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.

Definition at line 38 of file UniqueGiftInfo.hpp.


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