Discord Project Manager
Automated Discord project collaboration for OpenClaw multi-agent teams. Create Forum Channels and threads, manage who can speak where, and control mention-only mode — all from the CLI.
Prerequisites
- - OpenClaw with Discord channel configured
- Discord bot with
Manage Channels permission in the target guild - Python 3.8+
Quick Start
CODEBLOCK0
This creates a thread in your default forum, gives agent-a free speech (owner), and sets agent-b to mention-only mode.
Commands
Configuration
CODEBLOCK1
Agent Registry
CODEBLOCK2
Forum Channels
CODEBLOCK3
Threads
CODEBLOCK4
Permissions
CODEBLOCK5
Project Registry
CODEBLOCK6
Projects are automatically registered when threads are created and updated when participants change or threads are archived. The --agent filter shows only projects where the agent is owner or participant, with role labels.
Batch operations: add and remove accept multiple agent names. A single config patch is applied for all agents, so only one gateway reload happens.
The --all flag on mention-mode scans the live OpenClaw config to find every account that currently has access to the thread, then sets mention mode for all of them — including accounts not in the agent registry (e.g. manually configured bots).
Architecture
3-Tier Project Structure
| Tier | Use Case | Example |
|---|
| Forum Channel | Large project with sub-teams | 📦-product-launch |
| Thread |
Individual task or sub-project | api-refactor |
| Default Channel | Quick tasks, no isolation needed | #dev-ops |
Permission Model
- - Owner:
requireMention: false — speaks freely, drives the conversation - Participants:
requireMention: true — only responds when @mentioned - Non-participants: no channel access configured
This keeps threads focused: the owner leads, others contribute when asked.
How It Works
- 1. Thread/Forum creation — threads via
openclaw message CLI, forums via Discord REST API - Permission management — patches OpenClaw config (
channels.discord.accounts.<account>.guilds.<guild>.channels.<channel>) - Config reload — triggers SIGUSR1 graceful restart (2-5s). Falls back to
openclaw gateway restart if needed.
Data Files
CODEBLOCK7
Both auto-generated by config init and registry init. Excluded from git (user-specific data).
Security & Permissions
This skill requires access to your OpenClaw configuration:
- - Reads
~/.openclaw/openclaw.json to obtain the Discord bot token and agent account mappings - Writes channel permission entries to the same config file (with file locking and atomic writes)
- Triggers SIGUSR1 for graceful config reload (falls back to
openclaw gateway restart)
The bot token is used exclusively for Discord REST API calls (forum channel creation). It is never logged, stored elsewhere, or transmitted to third parties.
Recommendations:
- - Back up
~/.openclaw/openclaw.json before first use - Ensure your Discord bot has only
Manage Channels permission - Review the source code if you have concerns about config access
Troubleshooting
| Problem | Check |
|---|
| Thread creation fails | Is the default forum set? (forum-channel set-default) |
| Mention mode not working |
Does the agent have
mentionPatterns in OpenClaw config? |
| Forum creation 403 | Does the bot have
Manage Channels permission in the guild? |
| Permission changes delayed | Config reload takes 2-5s. If still not working, run
openclaw gateway restart |
Source Structure
CODEBLOCK8
Version: 2.2.1
Last Updated: 2026-02-27
Discord 项目管理器
为OpenClaw多智能体团队提供自动化的Discord项目协作功能。可通过命令行界面创建论坛频道和帖子、管理发言权限、控制仅提及模式。
前置条件
- - 已配置Discord频道的OpenClaw
- 在目标服务器拥有管理频道权限的Discord机器人
- Python 3.8+
快速开始
bash
SKILL_DIR=/path/to/discord-project-manager
1. 初始化(仅首次)
python3 $SKILL_DIR/scripts/discord-pm.py config init
python3 $SKILL_DIR/scripts/discord-pm.py registry init
python3 $SKILL
DIR/scripts/discord-pm.py forum-channel set-default channel_id>
2. 创建项目帖子
python3 $SKILL_DIR/scripts/discord-pm.py thread create \
--name my-feature \
--owner agent-a \
--participants agent-a,agent-b
这将在默认论坛中创建一个帖子,赋予agent-a自由发言权限(所有者),并将agent-b设置为仅提及模式。
命令
配置
bash
discord-pm.py config init # 从OpenClaw配置自动检测服务器ID
discord-pm.py config get # 显示当前配置
discord-pm.py config set-guild # 手动设置服务器ID
discord-pm.py config set-forum # 设置默认论坛频道
智能体注册表
bash
discord-pm.py registry init # 从OpenClaw配置自动收集智能体信息
discord-pm.py registry list # 列出所有已注册智能体
论坛频道
bash
创建新论坛频道(直接使用Discord REST API)
discord-pm.py forum-channel create [--emoji ] [--description ]
管理论坛频道
discord-pm.py forum-channel set-default
discord-pm.py forum-channel add # 注册已有频道
discord-pm.py forum-channel remove
discord-pm.py forum-channel list
帖子
bash
创建帖子(除非指定--forum-channel,否则使用默认论坛)
discord-pm.py thread create \
--name \
--owner \
--participants \
[--forum-channel ] \
[--no-mention] \
[--message ]
discord-pm.py thread archive # 移除所有权限
discord-pm.py thread status # 显示权限和参与者
权限
bash
discord-pm.py permissions add [agent2...] [--no-mention]
discord-pm.py permissions remove [agent2...]
discord-pm.py permissions mention-mode
项目注册表
bash
discord-pm.py project list [--active] [--archived] [--agent ]
discord-pm.py project info
discord-pm.py project describe
discord-pm.py project update --next-action
项目会在帖子创建时自动注册,并在参与者变更或帖子归档时自动更新。--agent过滤器仅显示该智能体作为所有者或参与者的项目,并附带角色标签。
批量操作:add和remove接受多个智能体名称。所有智能体将应用单个配置补丁,因此只会触发一次网关重载。
mention-mode的--all标志会扫描实时OpenClaw配置,查找当前有权访问该帖子的所有账户,然后为它们全部设置提及模式——包括不在智能体注册表中的账户(例如手动配置的机器人)。
架构
三层项目结构
| 层级 | 用途 | 示例 |
|---|
| 论坛频道 | 包含子团队的大型项目 | 📦-产品发布 |
| 帖子 |
单个任务或子项目 | api-重构 |
| 默认频道 | 快速任务,无需隔离 | #开发运维 |
权限模型
- - 所有者:requireMention: false — 自由发言,主导对话
- 参与者:requireMention: true — 仅在@提及时才响应
- 非参与者:未配置频道访问权限
这使帖子保持专注:所有者主导,其他人在被询问时贡献。
工作原理
- 1. 帖子/论坛创建 — 通过openclaw message CLI创建帖子,通过Discord REST API创建论坛
- 权限管理 — 修改OpenClaw配置(channels.discord.accounts..guilds..channels.)
- 配置重载 — 触发SIGUSR1优雅重启(2-5秒)。必要时回退到openclaw gateway restart。
数据文件
data/
├── config.json # 技能配置(服务器ID、默认论坛)
├── agents.json # 智能体注册表(账户ID、用户ID、频道)
└── projects.json # 项目注册表(帖子、所有者、参与者、下一步操作)
均由config init和registry init自动生成。排除在git之外(用户特定数据)。
安全与权限
本技能需要访问您的OpenClaw配置:
- - 读取 ~/.openclaw/openclaw.json 以获取Discord机器人令牌和智能体账户映射
- 写入 频道权限条目到同一配置文件(带文件锁定和原子写入)
- 触发 SIGUSR1进行优雅配置重载(回退到openclaw gateway restart)
机器人令牌仅用于Discord REST API调用(论坛频道创建)。绝不会被记录、存储在其他地方或传输给第三方。
建议:
- - 首次使用前备份~/.openclaw/openclaw.json
- 确保您的Discord机器人仅拥有管理频道权限
- 如对配置访问有疑虑,请审查源代码
故障排除
| 问题 | 检查项 |
|---|
| 帖子创建失败 | 是否设置了默认论坛?(forum-channel set-default) |
| 提及模式无效 |
智能体在OpenClaw配置中是否有mentionPatterns? |
| 论坛创建返回403 | 机器人在服务器中是否有管理频道权限? |
| 权限变更延迟 | 配置重载需要2-5秒。如仍无效,运行openclaw gateway restart |
源码结构
discord-project-manager/
├── SKILL.md
├── scripts/
│ ├── discord-pm.py # 统一命令行界面
│ └── cli.sh # Bash封装
├── lib/
│ ├── discord_api.py # Discord API(CLI + REST)
│ ├── config.py # OpenClaw配置操作
│ ├── skill_config.py # 技能本地配置
│ ├── registry.py # 智能体注册表
│ ├── thread.py # 帖子生命周期
│ ├── permissions.py # 权限管理
│ ├── forum.py # 论坛频道管理
│ ├── projects.py # 项目注册表
│ └── validators.py # 输入验证
└── data/ # 自动生成,git忽略
版本:2.2.1
最后更新:2026-02-27