Skip to content

getMyCommands

获取 Bot 的命令列表。

请求

POST /:token/getmycommands

参数

参数类型必填描述
scopeBotCommandScope命令的作用范围,默认为所有聊天
language_codeString语言代码(IETF),用于获取特定语言的命令列表

响应

返回 BotCommand 对象数组。

json
{
  "ok": true,
  "result": [
    {
      "command": "start",
      "description": "启动机器人"
    },
    {
      "command": "help",
      "description": "获取帮助信息"
    },
    {
      "command": "settings",
      "description": "修改设置"
    }
  ]
}

BotCommand 字段说明

字段类型描述
commandString命令文本
descriptionString命令描述

错误码

错误码描述
400请求参数错误
401Token 无效或已过期
500服务器内部错误