getMyCommands
获取 Bot 的命令列表。
请求
POST /:token/getmycommands
参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| scope | BotCommandScope | 否 | 命令的作用范围,默认为所有聊天 |
| language_code | String | 否 | 语言代码(IETF),用于获取特定语言的命令列表 |
响应
返回 BotCommand 对象数组。
json
{
"ok": true,
"result": [
{
"command": "start",
"description": "启动机器人"
},
{
"command": "help",
"description": "获取帮助信息"
},
{
"command": "settings",
"description": "修改设置"
}
]
}BotCommand 字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| command | String | 命令文本 |
| description | String | 命令描述 |
错误码
| 错误码 | 描述 |
|---|---|
| 400 | 请求参数错误 |
| 401 | Token 无效或已过期 |
| 500 | 服务器内部错误 |
