接入 Discord
在社区中使用 AI 助手
将 OpenClaw 接入 Discord,让 AI 助手在社区服务器中为你服务。适合团队协作和社区互动。
1 创建 Discord 应用
访问 Discord Developer Portal,点击「New Application」创建应用。
在应用设置中,记录以下信息:
- Application ID(在 General Information 页面)
- Bot Token(在 Bot 页面,点击「Reset Token」生成)
⚠️ 注意:Bot Token 只会显示一次,请立即保存。
2 配置 Bot 权限
在 Bot 页面,启用以下 Privileged Gateway Intents:
- ✅ MESSAGE CONTENT INTENT
- ✅ SERVER MEMBERS INTENT(可选)
然后在 OAuth2 → URL Generator 中生成邀请链接:
- Scopes:
bot - Permissions:
Read Messages,Send Messages,Read Message History
💡 提示:复制生成的邀请链接,在浏览器中打开即可将 Bot 添加到服务器。
3 配置 OpenClaw
使用以下命令添加 Discord 频道:
Terminal
openclaw channels add --channel discord --token "YOUR_BOT_TOKEN" --application-id "YOUR_APP_ID"
或者编辑配置文件 ~/.openclaw/config.yaml:
config.yaml
channels:
- channel: discord
token: "YOUR_BOT_TOKEN"
applicationId: "YOUR_APP_ID"
4 启动并测试
重启 Gateway:
Terminal
openclaw gateway restart
在 Discord 服务器中 @ 你的 Bot,或在 DM 中发送消息,即可开始对话!
🎉 完成!
你的 Discord AI 助手已就绪。高级功能:
- 查看 Discord 高级配置(斜杠命令、线程支持等)
- 接入飞书 - 企业内部 AI 助手