Warm tip: This article is reproduced from serverfault.com, please click

php-尝试为电报设置webhook时出现错误

(php - i am getting an error when i tried to set webhook for telegram)

发布于 2017-02-06 04:41:25

我想为某些用户输入设置电报的webhook,以便电报自动回复预定义的问题,并且我能够编写运行良好的程序,但是当我尝试为该程序设置webhook时,显示错误:

{
   "ok": false,"error_code": 400,"description": "Bad Request: bad webhook: Ip is reserved"
}  

我想像这样设置webhook:

https://api.telegram.org/bot<token>/setwebhook?url=https://localhost/Manisha/bot.php  
Questioner
Manisha Malik
Viewed
0
Quentin 2017-02-06 16:51:20

你需要使用电报服务器可以访问公共可用URLhttp://localhost/不公开。

你正在尝试向运行该机器人的计算机发出HTTP请求

这不是你的服务器,而是Telegram的服务器。它不起作用,因为:

  • 你的PHP尚未安装
  • 电报不会让你的机器人戳他们的内部服务器