summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorray-pixar <pixar@chmail.ir>2015-09-08 20:44:22 +0430
committerray-pixar <pixar@chmail.ir>2015-09-08 20:44:22 +0430
commita4954856e680b85eebdcfa5dddf5c9baf8102077 (patch)
tree3293e47e65faafe07283211c0d8b1995457e6151
parent55b698000a6faa719567b31ac614ba23aec1c6f6 (diff)
Bug fix: now bot can parse messages correctly
-rw-r--r--src/Api.cpp5
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", ""));
}