From a4954856e680b85eebdcfa5dddf5c9baf8102077 Mon Sep 17 00:00:00 2001 From: ray-pixar Date: Tue, 8 Sep 2015 20:44:22 +0430 Subject: Bug fix: now bot can parse messages correctly --- src/Api.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Api.cpp b/src/Api.cpp index da0aa7b..84caa74 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -267,7 +267,10 @@ ptree Api::sendRequest(const string& method, const vector& args) con ptree result = TgTypeParser::getInstance().parseJson(serverResponse); try { if (result.get("ok")) { - return result.find("result")->second; + if(method != "getMe" && method != "sendMessage") + return result; + else + return result.find("result")->second; } else { throw TgException(result.get("description", "")); } -- cgit v1.2.3