summaryrefslogtreecommitdiff
path: root/include/tgbot/net/HttpReqArg.h
diff options
context:
space:
mode:
authorAndrea Giove <andreagiove@outlook.com>2016-03-27 16:31:11 +0200
committerAndrea Giove <andreagiove@outlook.com>2016-03-27 16:31:11 +0200
commitd2baea74a0ac09db992ab36a861d09caccdab697 (patch)
tree35935e0f42891093de0d815622da901891f3941d /include/tgbot/net/HttpReqArg.h
parentf889903cd7132ce39e81da15d2f335ac511b2e1f (diff)
Add answerInlineQuery method
Diffstat (limited to 'include/tgbot/net/HttpReqArg.h')
-rw-r--r--include/tgbot/net/HttpReqArg.h17
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.
*/