From ffc3c38882d669ea6b2abeea5c0f7c7b322fa6e7 Mon Sep 17 00:00:00 2001 From: sebest Date: Mon, 25 May 2020 15:49:44 -0300 Subject: * add SetMyCommand to the api --- src/TgTypeParser.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/TgTypeParser.cpp') diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index 06a2b2a..95c60c9 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -2026,6 +2026,23 @@ string TgTypeParser::parseLabeledPrice(const LabeledPrice::Ptr& object) const { return result; } +BotCommand::Ptr TgTypeParser::parseJsonAndGetBotCommand(const boost::property_tree::ptree& data) const { + auto result(make_shared()); + result->command = data.get("command", ""); + result->description = data.get("description",""); + return result; +} + +string TgTypeParser::parseBotCommand(const BotCommand::Ptr& object) const { + std::string result; + result += '{'; + appendToJson(result, "command", object->command); + appendToJson(result, "description", object->description); + removeLastComma(result); + result += '}'; + return result; +} + OrderInfo::Ptr TgTypeParser::parseJsonAndGetOrderInfo(const boost::property_tree::ptree& data) const { auto result(make_shared()); result->name = data.get("name", ""); -- cgit v1.2.3