tgbotxx
1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
KeyboardButtonPollType.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
tgbotxx/objects/Object.hpp
>
3
4
namespace
tgbotxx
{
7
struct
KeyboardButtonPollType
{
8
KeyboardButtonPollType
() =
default
;
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
}
Object.hpp
OBJECT_SERIALIZE_FIELD
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Serialize.
Definition
Object.hpp:27
OBJECT_DESERIALIZE_FIELD
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition
Object.hpp:64
tgbotxx
Definition
Api.hpp:11
tgbotxx::Ptr
std::shared_ptr< T > Ptr
Definition
Ptr.hpp:6
tgbotxx::KeyboardButtonPollType
This object represents type of a poll, which is allowed to be created and sent when the corresponding...
Definition
KeyboardButtonPollType.hpp:7
tgbotxx::KeyboardButtonPollType::fromJson
void fromJson(const nl::json &json)
Deserializes this object from JSON.
Definition
KeyboardButtonPollType.hpp:29
tgbotxx::KeyboardButtonPollType::KeyboardButtonPollType
KeyboardButtonPollType(const nl::json &json)
Definition
KeyboardButtonPollType.hpp:9
tgbotxx::KeyboardButtonPollType::type
std::string type
Optional. “quiz“ or “regular“. If “quiz“ is passed, the user will be allowed to create only polls in ...
Definition
KeyboardButtonPollType.hpp:17
tgbotxx::KeyboardButtonPollType::toJson
nl::json toJson() const
Serializes this object to JSON.
Definition
KeyboardButtonPollType.hpp:22
tgbotxx::KeyboardButtonPollType::KeyboardButtonPollType
KeyboardButtonPollType()=default
include
tgbotxx
objects
KeyboardButtonPollType.hpp
Generated on Sun Mar 22 2026 21:33:30 for tgbotxx by
1.9.8