feat(discord-control): add channel-private-update and member-list field projection

This commit is contained in:
2026-02-25 21:59:51 +00:00
parent 4bec5982a5
commit f20728b02d
3 changed files with 138 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ export AUTH_TOKEN='strong-token'
# export REQUIRE_AUTH_TOKEN=true
# optional action gates
# export ENABLE_CHANNEL_PRIVATE_CREATE=true
# export ENABLE_CHANNEL_PRIVATE_UPDATE=true
# export ENABLE_MEMBER_LIST=true
# optional allowlist
# export ALLOWED_GUILD_IDS='123,456'
@@ -70,6 +71,33 @@ curl -sS http://127.0.0.1:8790/health
---
## Action: channel-private-update
对现有频道的白名单/覆盖权限做增删改。
### Request
```json
{
"action": "channel-private-update",
"guildId": "123",
"channelId": "789",
"mode": "merge",
"addUserIds": ["111"],
"addRoleIds": ["333"],
"removeTargetIds": ["222"],
"allowMask": "67648",
"denyMask": "0",
"dryRun": false
}
```
说明:
- `mode=merge`:在现有覆盖基础上增删
- `mode=replace`:重建覆盖(保留/补上 @everyone deny
---
## Action: member-list
### Request
@@ -79,13 +107,15 @@ curl -sS http://127.0.0.1:8790/health
"action": "member-list",
"guildId": "123",
"limit": 100,
"after": "0"
"after": "0",
"fields": ["user.id", "user.username", "nick", "roles", "joined_at"]
}
```
说明:
- `limit` 1~1000
- `after` 用于分页Discord snowflake
- `fields` 可选:字段裁剪,减小返回体;可用 `user.xxx` 选子字段
---