send_group_msg
Sends a single message to a specified QQ group for notifications, @mentions, or rich media; use CQ codes or message segments when real @ alerts are required.
Instructions
向指定 QQ 群发送单条群聊消息 (OneBot 11: send_group_msg)。
适用场景:在已加入的 QQ 群内发布通知、@成员或发送富媒体消息。不适用与替代:若目标是个人好友私聊,请改用 send_private_msg;若需向群内上传文档或压缩包附件,请改用 upload_group_file。
参数约束与交互:如需产生真实的 @全体成员 或 @指定成员 提醒,必须在 message 中使用 CQ 码 [CQ:at,qq=all] / [CQ:at,qq=123456](且保持 auto_escape=False)或传入 at 类型消息段,手写纯文本“@全体成员”不会触发群提醒。
行为与返回:非幂等群广播操作;前置要求当前 QQ 已加入目标群且未被禁言(@全体成员需群主或管理员权限且受每日次数限制),成功返回 status='ok' 及 data.message_id,无权限或被禁言时返回非 0 retcode。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"group_id": "<group_id>",
"message": "<message>"
},
"name": "send_group_msg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | 群消息内容;支持普通文本、含 `[CQ:at,qq=all]` 的 CQ 码字符串或 OneBot 11 消息段数组 | |
| group_id | Yes | 目标 QQ 群号(正整数,可通过 `get_group_list` 查询已加入的群号) | |
| auto_escape | No | 为 True 时不解析 CQ 码而按纯文本字面量发送;需要触发 @提醒或表情时必须保持 False,默认 False |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | 接口返回的业务负载数据(对象或数组,具体字段依工具而定) | |
| status | No | 执行状态标识,成功为 'ok'(或特定生命周期状态),失败为 'failed' 或 'error' | |
| message | No | 状态说明或错误诊断详情 | |
| retcode | No | OneBot 11 响应状态码,0 表示成功,非 0 表示协议端或网络错误 |