在电报游戏机器人中回答内联查询不起作用

时间:2018-02-21 11:42:51

标签: php bots telegram telegram-bot php-telegram-bot

当我在聊天屏幕中输入bot的用户名时,内联模式可以正常工作,但它不会显示我的游戏列表(结果参数)。有什么问题?

$message= file_get_contents("php://input");
$arrayMessage= json_decode($message, true);
$inlinequeryId = $arrayMessage['inline_query']['id'];
$reply_markup     = array(
    'inline_keyboard' => array(
        array(
            array( 'text' => 'start game', 'callback_game' => 'it starts the game' )
        )
    )
);

$inlineResult = array(
    'type'=>'game',
    'id' =>$inlinequeryId,
    'game_short_name' => 'cuttherope',
    'replay_markup' => $reply_markup
);
$inlineResult = json_encode($inlineResult);

$url = "https://api.telegram.org/bot" . $token . "/answerInlineQuery?inline_query_id=" . $inlinequeryId . "&results=" . $inlineResult;
file_get_contents( $url );

0 个答案:

没有答案
相关问题