tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
KeyboardButtonPollType.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
9 explicit KeyboardButtonPollType(const nl::json& json) {
10 fromJson(json);
11 }
12
17 std::string type;
18
19
22 nl::json toJson() const {
23 nl::json json = nl::json::object();
24 OBJECT_SERIALIZE_FIELD(json, "type", type);
25 return json;
26 }
27
29 void fromJson(const nl::json& json) {
30 OBJECT_DESERIALIZE_FIELD(json, "type", type, "", true);
31 }
32 };
33}
#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 type of a poll, which is allowed to be created and sent when the corresponding...
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::string type
Optional. “quiz“ or “regular“. If “quiz“ is passed, the user will be allowed to create only polls in ...
nl::json toJson() const
Serializes this object to JSON.