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 /src | |
parent | f889903cd7132ce39e81da15d2f335ac511b2e1f (diff) |
Add answerInlineQuery method
Diffstat (limited to 'src')
-rw-r--r-- | src/Api.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index 2e27e1d..47c7882 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -255,6 +255,17 @@ void Api::setWebhook(const string& url) const { sendRequest("setWebhook", args); } +void Api::answerInlineQuery(const std::string inlineQueryId, const std::vector<InlineQueryResult::Ptr> results, + int32_t cacheTime=300, bool isPersonal=false, const std::string& nextOffset=""){ + vector<HttpReqArg> args; + args.push_back(HttpReqArg("inline_query_id", inlineQueryId)); + args.push_back(HttpReqArg("results", results, TgTypeParser::getInstance().parseInlineQueryResult)); + args.push_back(HttpReqArg("cache_time", cacheTime)); + args.push_back(HttpReqArg("is_personal", isPersonal)); + args.push_back(HttpReqArg("next_offset", nextOffset)); + sendRequest("answerInlineQuery", args); +} + ptree Api::sendRequest(const string& method, const vector<HttpReqArg>& args) const { string url = "https://api.telegram.org/bot"; |