tgbotxx 1.1.6.9
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
16 std::string type;
17
18
21 nl::json toJson() const {
22 nl::json json = nl::json::object();
23 OBJECT_SERIALIZE_FIELD(json, "type", type);
24 return json;
25 }
26
28 void fromJson(const nl::json& json) {
29 OBJECT_DESERIALIZE_FIELD(json, "type", type, "", true);
30 }
31 };
32}
#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:44
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.