diff options
author | Andrea Giove <andreagiove@outlook.com> | 2016-03-27 16:31:11 +0200 |
---|---|---|
committer | Andrea Giove <andreagiove@outlook.com> | 2016-03-27 16:31:11 +0200 |
commit | d2baea74a0ac09db992ab36a861d09caccdab697 (patch) | |
tree | 35935e0f42891093de0d815622da901891f3941d /include/tgbot/net/HttpReqArg.h | |
parent | f889903cd7132ce39e81da15d2f335ac511b2e1f (diff) |
Add answerInlineQuery method
Diffstat (limited to 'include/tgbot/net/HttpReqArg.h')
-rw-r--r-- | include/tgbot/net/HttpReqArg.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/tgbot/net/HttpReqArg.h b/include/tgbot/net/HttpReqArg.h index f0e4492..5056e6c 100644 --- a/include/tgbot/net/HttpReqArg.h +++ b/include/tgbot/net/HttpReqArg.h @@ -24,6 +24,7 @@ #define TGBOT_HTTPPARAMETER_H #include <string> +#include <vector> #include <boost/lexical_cast.hpp> @@ -42,6 +43,22 @@ public: { } + template<typename T> + HttpReqArg(const std::string& name, const std::vector<T>& list, function<std::string (const T&)> parsingFunction){ + this->name = name; + value = "["; + for (const T& item : list){ + value += parsingFunction(item); + value += ','; + } + value.erase(this->value.length() - 1); + value += ']'; + + isFile = false; + mimeType = "text/plain"; + fileName = ""; + } + /** * Name of an argument. */ |