【问题标题】:i made a button but i can not answer to button in the inline keybord我做了一个按钮,但我无法回答内联键盘中的按钮
【发布时间】:2017-01-25 06:35:55
【问题描述】:

当我点击内联键盘时,我无法得到我们的答案。请帮帮我?这是我的代码:

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

}

【问题讨论】:

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


    【解决方案1】:

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

    您将看到 HTTP 状态代码。像这样的东西: HTTP 请求失败! HTTP/1.1 404 未找到

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

    【讨论】:

      猜你喜欢
      • 2017-01-02
      • 1970-01-01
      • 2020-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-20
      • 1970-01-01
      相关资源
      最近更新 更多