tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
ChatBoostAdded.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
8 ChatBoostAdded() = default;
9 explicit ChatBoostAdded(const nl::json& json) {
10 fromJson(json);
11 }
12
14 std::int32_t boostCount{};
15
16 nl::json toJson() const {
17 nl::json json = nl::json::object();
18 OBJECT_SERIALIZE_FIELD(json, "boost_count", boostCount);
19 return json;
20 }
21
22 void fromJson(const nl::json& json) {
23 OBJECT_DESERIALIZE_FIELD(json, "boost_count", boostCount, 0, false);
24 }
25 };
26
27}
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
Definition Object.hpp:19
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition Object.hpp:46
This object represents a service message about a user boosting a chat. https://core....
std::int32_t boostCount
Number of boosts added by the user.
void fromJson(const nl::json &json)
ChatBoostAdded(const nl::json &json)