php
  • telegram-bot
  • php-telegram-bot
  • 2017-01-24 89 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 Not Found

    我建议你不要使用file_get_content并使用CURL(guzzle或其他)

    相关问题