28 std::variant<cpr::File, std::string>
media{
""};
44 nl::json json = nl::json::object();
47 if (
auto idx =
media.index(); idx == 0)
48 json[
"media"] = std::get<cpr::File>(
media).filepath;
50 json[
"media"] = std::get<std::string>(
media);
68 void _fromJson(
const nl::json& json) {
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
#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.
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)