Skip to content

leaveChat

Bot 离开聊天群组。

请求

POST /:token/leavechat

参数

参数类型必填描述
chat_idInteger/String目标聊天的唯一标识符或用户名

响应

成功时返回 Boolean 值 true

json
{
  "ok": true,
  "result": true
}

错误码

错误码描述
400请求参数错误,如 chat_id 格式不正确
401Token 无效或已过期
403Bot 不是该聊天的成员
404聊天不存在
500服务器内部错误

示例

cURL

bash
curl -X POST "https://api.example.com/<token>/leavechat" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": -1001234567890
  }'