docs(discord-control): add runnable examples and smoke script

This commit is contained in:
2026-02-25 22:02:00 +00:00
parent f20728b02d
commit 8097ab7484
5 changed files with 137 additions and 2 deletions

View File

@@ -119,6 +119,18 @@ curl -sS http://127.0.0.1:8790/health
---
## Curl examples
示例文件:`docs/EXAMPLES.discord-control.json`
快速检查脚本:
```bash
./scripts/smoke-discord-control.sh
# with env
# AUTH_TOKEN=xxx CALLER_ID=agent-main GUILD_ID=123 CHANNEL_ID=456 ./scripts/smoke-discord-control.sh
```
## Notes
鉴权与内置风格对齐(简化版):

View File

@@ -0,0 +1,68 @@
{
"channel-private-create": {
"action": "channel-private-create",
"guildId": "123456789012345678",
"name": "ops-private",
"type": 0,
"parentId": "234567890123456789",
"topic": "ops only",
"position": 3,
"nsfw": false,
"allowedUserIds": [
"345678901234567890",
"456789012345678901"
],
"allowedRoleIds": [
"567890123456789012"
],
"allowMask": "67648",
"denyEveryoneMask": "1024",
"dryRun": true
},
"channel-private-update-merge": {
"action": "channel-private-update",
"guildId": "123456789012345678",
"channelId": "678901234567890123",
"mode": "merge",
"addUserIds": [
"345678901234567890"
],
"addRoleIds": [
"567890123456789012"
],
"removeTargetIds": [
"456789012345678901"
],
"allowMask": "67648",
"denyMask": "0",
"dryRun": true
},
"channel-private-update-replace": {
"action": "channel-private-update",
"guildId": "123456789012345678",
"channelId": "678901234567890123",
"mode": "replace",
"addUserIds": [
"345678901234567890"
],
"addRoleIds": [
"567890123456789012"
],
"allowMask": "67648",
"denyMask": "0",
"dryRun": true
},
"member-list": {
"action": "member-list",
"guildId": "123456789012345678",
"limit": 100,
"after": "0",
"fields": [
"user.id",
"user.username",
"nick",
"roles",
"joined_at"
]
}
}