tgbotxx 1.1.6.9
Telegram Bot C++ Library
Loading...
Searching...
No Matches
InlineKeyboardMarkup.hpp
Go to the documentation of this file.
1#pragma once
5
6namespace tgbotxx {
11 explicit InlineKeyboardMarkup(const nl::json& json) {
12 _fromJson(json);
13 }
14 virtual ~InlineKeyboardMarkup() = default;
15
17 std::vector<std::vector<Ptr<InlineKeyboardButton>>> inlineKeyboard;
18
21 nl::json toJson() const override {
22 nl::json json = nl::json::object();
24 return json;
25 }
26
28 void fromJson(const nl::json& json) override {
29 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, "inline_keyboard", inlineKeyboard, false);
30 }
31
32 private:
34 void _fromJson(const nl::json& json) {
35 fromJson(json);
36 }
37 };
38}
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, json_field, array_array_field)
Definition Object.hpp:32
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, json_field, array_array_field, optional)
Definition Object.hpp:108
The interface of reply markup objects InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove ...
This object represents an inline keyboard that appears right next to the message it belongs to....
virtual ~InlineKeyboardMarkup()=default
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
InlineKeyboardMarkup(const nl::json &json)
nl::json toJson() const override
Serializes this object to JSON.
std::vector< std::vector< Ptr< InlineKeyboardButton > > > inlineKeyboard
Array of button rows, each represented by an Array of InlineKeyboardButton objects.