我有用于inlineQuery的代码:
$result_search = "SELECT * FROM insects WHERE '$level' LIKE '%$search%';
在Bots.Business上编写的Bot JavaScript代码(BJS):
{ "ok": true, "result": true }
/ trackResult命令(在answerInlineQuery方法之后处理):
results = [];
item = {
type: "article",
id: "13",
title: "Test item",
input_message_content: { "message_text": "this is text" }
}
results.push(item);
Api.answerInlineQuery({
inline_query_id: request.id,
results: results,
cache_time: 0,
on_result: "/trackResult"
})
在错误日志中(我只是将成功通知记录为错误):
因此:answerInlineQuery已发送,但在电报聊天中实际上没有任何内联结果。
答案 0 :(得分:0)
results = [];
item = {
type: "article",
id: "13",
title: "Test item",
input_message_content: '{ "message_text": "this is text" }'
}
results.push(item);
Api.answerInlineQuery({
inline_query_id: request.id,
results: results,
cache_time: 0,
on_result: "/trackResult"
})
需要将input_message_content作为字符串传递