我最近尝试使用webhook从telegram获取更新。我的程序在getuupdates()中正常工作。但是当我设置webhook时,我得到
" webhook的错误响应:400 Bad Request"
使用getWebhookInfo方法检查webhook状态时出现错误。
下面是我的代码:$telegram->commandsHandler(true)
当在getuupdates mod中使用下面的代码时,一切都很好。$telegram->commandsHandler(false)
它应该说我使用https并且我的ssl是ok的。
这是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"
}
}
我找到了答案
一切都很好。错误的发生是因为我的框架。