24 nl::json json = nl::json::object();
35 void _fromJson(
const nl::json& json) {
#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)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscripti...
Ptr< User > user
User for which the gift code was created.
nl::json toJson() const override
Serializes this object to JSON.
ChatBoostSourceGiftCode(const nl::json &json)
ChatBoostSourceGiftCode()
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times f...
ChatBoostSourceGiveaway()
Ptr< User > user
Optional. User that won the prize in the giveaway if any.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
nl::json toJson() const override
Serializes this object to JSON.
std::int32_t giveawayMessageId
Identifier of a message in the chat with the giveaway; the message could have been deleted already....
ChatBoostSourceGiveaway(const nl::json &json)
bool isUnclaimed
Optional. True, if the giveaway was completed, but there was no user to win the prize.
This object describes the source of a chat boost. It can be one of:
ChatBoostSource(const nl::json &json)
virtual nl::json toJson() const
Serializes this object to JSON.
ChatBoostSource()=default
virtual void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::string source
Source of the boost.
The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscripti...
ChatBoostSourcePremium(const nl::json &json)
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
nl::json toJson() const override
Serializes this object to JSON.
Ptr< User > user
User that boosted the chat.