php
  • telegram-bot
  • php-telegram-bot
  • 2017-01-24 1 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 (수수 또는 기타)을 사용하는 것이 좋습니다

    관련 문제