i enable /setinlinefeedback (100% for test) in Botfather and my answerInlineQuery show correct results with no error {"ok":true,"result":true}... but when tap on one of the results return no update and when i send the update to chat, update return
{"update_id":14516733, "message":{"message_id":1857,"from{"id":96000969,"is_bot":false,"first_name":"Mostafa","last_name":"Emrani","username":"Mostafa_MRNI","language_code":"en-US"},"chat":{"id":96000969,"first_name":"Mostafa","last_name":"Emrani","username":"Mostafa_MRNI","type":"private"},"date":1520788397,"text":"Your Product:"}}
update if (isset($update->chosen_inline_result->result_id))
return false.
my answerInlineQuery functions:
if (isset($update->inline_query)) {
$inlineQuery = $update->inline_query;
$queryId = $inlineQuery->id;
$userId = $inlineQuery->from->id;
$Chatid = $this->model->getChatIdformUser($userId);
$queryText = $inlineQuery->query;
//$this->model->sendMessage($Chatid, $queryId . '-' . $userId . '-' . $Chatid . '-' . json_encode($inlineQuery, JSON_UNESCAPED_UNICODE));
if ($queryText == '#invoice') {
$resu = $this->model->answerInlineQuery($queryId, $this->queryResultsInvoice($Chatid), 0, true);
} else {
$resu = $this->model->answerInlineQuery($queryId, $this->queryResults($queryText), 0, false);
}
//$this->model->sendMessage($Chatid, json_encode($resu));
}
and
function answerInlineQuery($inline_query_id, $results, $cache_time , $is_personal)
{
$url = 'https://api.telegram.org/bot' . BOT_API_KEY . '/answerInlineQuery';
$post = array("inline_query_id" => $inline_query_id, "results" => json_encode($results), "cache_time" => $cache_time, "is_personal" => $is_personal);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 500);
$check = curl_exec($ch);
curl_close($ch);
//$this->sendMessage($chatid,$check);
return $check;
}
and
function queryResults($qryText)
{
$res = $this->model->inlineSearch($qryText);
$result = array();
for ($x = 1; $x <= sizeof($res); $x++) {
$result1 = array('type' => 'article', 'id' => strval($res[$x - 1]['prod_code']), 'title' => $res[$x - 1]['prod_name'], 'input_message_content' => array('message_text' => 'Your Product:'), 'description' => $res[$x - 1]['prod_price'] . ' $ ');
array_push($result, $result1);
}
return $result;
}
function queryResultsInvoice($Chatid)
{
$res = $this->model->getProductInOrder($Chatid);
$result = array();
for ($x = 1; $x <= sizeof($res); $x++) {
$res_prodCount = $this->model->getCountProd($Chatid, $res[$x - 1]['prod_id']);
$desc = '';
if ($res_prodCount != 0) {
$desc = '-- In your order ' . $res_prodCount . 'has available.';
}
$result1 = array('type' => 'article', 'id' => strval($res[$x - 1]['prod_code']), 'title' => $res[$x - 1]['prod_name'], 'input_message_content' => array('message_text' => 'Your Product:'), 'description' => $res[$x - 1]['prod_price'] . ' $ ' . $desc);
array_push($result, $result1);
}
return $result;
}
when i getWebhookInfo return no error... please help me... i spend 5 days in this problem and have no idea to solve it...