我最近尝试使用 webhook 从电报获取更新。我的程序在 getUpdates() 上正常工作。但是当我设置 webhook 我得到了
“来自 webhook 的错误响应:400 Bad Request”
尝试通过 getWebhookInfo 方法检查 webhook 状态时出错。
这是我的代码:
$telegram->commandsHandler(true)
当在 getUpdates mod 下面的代码中使用时,一切都很好。
$telegram->commandsHandler(false)
应该说我使用 https 并且我的 ssl 没问题。
这是 getWebhookInfo 对我的回答。
{
"ok": true,
"result": {
"url": "https://telbit.ir/api/bot/<token>",
"has_custom_certificate": false,
"pending_update_count": 13,
"last_error_date": 1476344420,
"last_error_message": "Wrong response from the webhook: 400 Bad Request"
}
}