php
  • telegram-bot
  • php-telegram-bot
  • 2017-01-24 5 views 0 likes 
    0

    インラインキーボードをクリックすると、私たちは答えを得ることができない。これは私のコードです:ボタンを作ったが、インラインキーボードのボタンに答えることができない

    if ($data == "1") { 
        $message = 's'; 
        $url = 'https://api.telegram.org/bot'.$token.'/sendMessage?chat_id='.$user_id.'&text='.$message; 
        $update = file_get_contents($url); 
        $url = 'https://api.telegram.org/bot'.$token.'/answerCallbackQuery?chat_id='.$user_id .'&callback_query_id='.$chat_id_in; 
        $update = file_get_contents($url); 
    
    } 
    

    答えて

    1

    $error = error_get_last(); echo "HTTP request failed. Error was: " . $error['message'];

    あなたはHTTPステータスコードが表示されます。このようなもの: HTTPリクエストが失敗しました! HTTP/1.1 404が見つかりません

    file_get_contentを使用せずにCURL(guzzleなど)を使用することをお勧めします。

    関連する問題