diff options
-rw-r--r-- | include/tgbot/TgTypeParser.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h index f7c9791..07eb1b6 100644 --- a/include/tgbot/TgTypeParser.h +++ b/include/tgbot/TgTypeParser.h @@ -187,6 +187,17 @@ private: json += ','; } + void appendToJson(std::string& json, const std::string& varName, const bool& value) const { + if (value == 0) { + return; + } + json += '"'; + json += varName; + json += "\":"; + json += (value ? "true" : "false"); + json += ','; + } + void appendToJson(std::string& json, const std::string& varName, const std::string& value) const; }; |