set_group_add_option
设置群聊的入群验证方式。请求使用 群资料协议写入,并在写入后重新读取群资料确认生效。
此接口在已认证的服务连接中调用,账号须属于当前框架且处于在线状态。self_id 与 protocol_id 共同选择账号。
适用协议
Android(手机 / 平板)/ Linux QQ。
调用方式
向已认证的 WebSocket 连接发送:
json
{
"type": "action",
"id": "example-1",
"action": "set_group_add_option",
"params": {
"self_id": 123456789,
"protocol_id": 0,
"group_id": 987654321,
"add_type": 1
}
}响应通过相同 id 对应请求。连接、HTTP 调用与错误处理见通信协议。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
self_id | integer | 是 | 当前框架内的账号 QQ 号 |
protocol_id | integer | 是 | 账号协议配置 ID;从 get_protocol_list 获取,必须显式传入,0 也是有效 ID |
group_id | integer | 是 | 目标群号 |
add_type | integer | 是 | 群申请加入方式 |
group_question | string | 否 | group question |
group_answer | string | 否 | group answer |
返回值
以下为成功响应的 data,错误通过 ok: false 与 error 返回。
| 字段 | 类型 | 说明 |
|---|---|---|
group_id | integer | 目标群号 |
add_type | integer | 群申请加入方式 |
group_question | string | group question |
group_answer | string | group answer |
read_back_verified | boolean | 是否已读取上游设置确认变更 |
