Skip to content

Commit

Permalink
Fix InlineKeyboardMarkup had wrong member data type
Browse files Browse the repository at this point in the history
  • Loading branch information
baderouaich committed Oct 3, 2023
1 parent 664f3b5 commit e8449fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/tgbotxx/objects/InlineKeyboardMarkup.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <tgbotxx/objects/IReplyMarkup.hpp>
#include <tgbotxx/objects/Object.hpp>
#include <tgbotxx/objects/IReplyMarkup.hpp>
#include <tgbotxx/objects/InlineKeyboardButton.hpp>

namespace tgbotxx {
Expand All @@ -13,19 +13,19 @@ namespace tgbotxx {
}

/// @brief Array of button rows, each represented by an Array of InlineKeyboardButton objects
std::vector<Ptr<InlineKeyboardButton>> inlineKeyboard;
std::vector<std::vector<Ptr<InlineKeyboardButton>>> inlineKeyboard;

/// @brief Serializes this object to JSON
/// @returns JSON representation of this object
nl::json toJson() const override {
nl::json json = nl::json::object();
OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "inline_keyboard", inlineKeyboard);
OBJECT_SERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, "inline_keyboard", inlineKeyboard);
return json;
}

/// @brief Deserializes this object from JSON
void fromJson(const nl::json &json) override {
OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "inline_keyboard", inlineKeyboard, false);
OBJECT_DESERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, "inline_keyboard", inlineKeyboard, false);
}

private:
Expand Down

0 comments on commit e8449fc

Please sign in to comment.