diff options
author | Oleg Morozenkov <reo7sp@users.noreply.github.com> | 2017-03-21 18:50:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 18:50:45 +0300 |
commit | 4d9e96d9c91e1faeefb67de2164c026f84be020e (patch) | |
tree | 60af55841a59d7af13bb492d248e0744478e8056 /include | |
parent | 1c7d4c17062644d28f485b0ff6cbc213e975ac29 (diff) | |
parent | 156c087f3eeeeffb949ae6a572dd7b52815eb0e5 (diff) |
Merge pull request #43 from kukin-konstantin/master
fix errors and new function
Diffstat (limited to 'include')
-rw-r--r-- | include/tgbot/Api.h | 4 | ||||
-rw-r--r-- | include/tgbot/tools/FileTools.h | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index b2f6911..0710f17 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -323,7 +323,7 @@ public: * @param fileId File identifier to get info about * @return A File object. */ - File::Ptr getFile(int32_t fileId) const; + File::Ptr getFile(const std::string &fileId) const; /** * Use this method for your bot to leave a group, supergroup or channel. @@ -475,6 +475,8 @@ public: */ bool unbanChatMember(int64_t chatId, int32_t userId) const; + std::string downloadFile(const std::string& filePath, const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>()) const; + private: boost::property_tree::ptree sendRequest(const std::string& method, const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>()) const; diff --git a/include/tgbot/tools/FileTools.h b/include/tgbot/tools/FileTools.h index 7329a8e..97fb52c 100644 --- a/include/tgbot/tools/FileTools.h +++ b/include/tgbot/tools/FileTools.h @@ -19,6 +19,13 @@ namespace FileTools { */ std::string read(const std::string& filePath); +/** +* Save file to disk. +* @param filePath Path to a file +* @return bool success +*/ +bool write(const std::string& content, const std::string& filePath); + }; |