You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法执行Telegram Bot的getBotCommands方法,请求返回404错误求助

问题解决:Telegram getBotCommands 返回404 Not Found

你遇到的问题核心是混淆了Telegram MTProto方法和HTTP Bot API的接口路径:

  • 你参考的bots.getBotCommands是MTProto协议的方法,并非HTTP Bot API的可用端点
  • HTTP Bot API中,获取机器人命令的正确接口是getMyCommands

正确调用示例

替换你的TOKEN后执行:

curl -X POST -H 'Content-Type: application/json' https://api.telegram.org/bot${TOKEN}/getMyCommands

额外验证点

  • 确认你的${TOKEN}变量已正确赋值,没有拼写错误
  • 该接口无需特殊权限,只要机器人token有效即可正常返回结果(即使没有设置任何命令,也会返回空数组的成功响应)

内容的提问来源于stack exchange,提问作者Vitaly Chura

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 23:43:09