Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/140.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ tgbot cpp-应答内联查询_C++ - Fatal编程技术网

C++ tgbot cpp-应答内联查询

C++ tgbot cpp-应答内联查询,c++,C++,如何使用回答内联查询?我试过几种方法,但都不管用 我最后一次尝试出错:错误请求:无法解析json编码的内联查询结果:意外的字符串结束 bot.getEvents().onInlineQuery([&bot](const TgBot::InlineQuery::Ptr& query) { std::vector<TgBot::InlineQueryResult::Ptr> results; TgBot::InlineQueryResultArticle

如何使用回答内联查询?我试过几种方法,但都不管用

我最后一次尝试出错:
错误请求:无法解析json编码的内联查询结果:意外的字符串结束

bot.getEvents().onInlineQuery([&bot](const TgBot::InlineQuery::Ptr& query) {

    std::vector<TgBot::InlineQueryResult::Ptr> results;
    TgBot::InlineQueryResultArticle::Ptr article(new TgBot::InlineQueryResultArticle);

    auto text = TgBot::InputTextMessageContent();
    text.messageText = "Inline Test";

    article->title = "Inline Title!";
    article->id = "1234";
    results.push_back(article);

    bot.getApi().answerInlineQuery(query->id, results);});
bot.getEvents(){
std::矢量结果;
TgBot::InlineQueryResultArticle::Ptr文章(新的TgBot::InlineQueryResultArticle);
自动文本=TgBot::InputTextMessageContent();
text.messageText=“内联测试”;
文章->标题=“内联标题!”;
物品->id=“1234”;
结果:推回(文章);
getApi().answerInlineQuery(查询->id,结果);});

可能是相关的是的,是的。谢谢:)