diff options
-rw-r--r-- | src/Api.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<HttpReqArg>& args) con ptree result = TgTypeParser::getInstance().parseJson(serverResponse); try { if (result.get<bool>("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", "")); } |