diff options
author | Oleg Morozenkov <reo7sp@users.noreply.github.com> | 2017-08-19 20:41:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 20:41:21 +0300 |
commit | 057bd0ca13013aecb9fafc886d60fc24ce3408cd (patch) | |
tree | e7f4ae1e420e204fe3e60c0c326021f4ce8c8e0a | |
parent | 778f0c54bce8186ace310c70bdd797aa0d759869 (diff) | |
parent | 50674897366b37a02a7838c2fc1f3726a7210d2c (diff) |
Merge pull request #53 from JellyBrick/patch-3
Bug Fix
-rw-r--r-- | src/Api.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index b9ea183..31e08f3 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -662,14 +662,13 @@ void Api::deleteMessage(int64_t chatId, int32_t messageId) const { } ptree Api::sendRequest(const string& method, const vector<HttpReqArg>& args) const { - string url = "https://api.telegram.org/bot"; url += _token; url += "/"; url += method; string serverResponse = HttpClient::getInstance().makeRequest(url, args); - if (serverResponse.find("<html>") != serverResponse.npos) { + if (!serverResponse.compare(0, 6, "<html>")) { throw TgException("tgbot-cpp library have got html page instead of json response. Maybe you entered wrong bot token."); } |