0

When I click on inline keyboard, I can not get no answer our .Help me please? This is my code:

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);

}
Matteo Enna
  • 1,285
  • 1
  • 15
  • 36

1 Answers1

1

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

You will see HTTP status code. Something like this : HTTP request failed! HTTP/1.1 404 Not Found

I advise you not to use file_get_content and use CURL (guzzle or other)

Stepchik
  • 275
  • 1
  • 3
  • 14