add-discord
Add Discord bot channel integration via Chat SDK.
- License 许可
- MIT
- 最近更新
- 2026-10-30
- Stars
- ★ 5
- Forks
- 2
01 前言 Front Matter
- name
- add-discord
- description
- Add Discord bot channel integration via Chat SDK.
02 资源文件 2
03 SKILL.md 正文
Add Discord Channel
Adds Discord bot support via the Chat SDK bridge.
Install
NanoClaw doesn't ship channels in trunk. This skill copies the Discord adapter in from the channels branch.
Pre-flight (idempotent)
Skip to Credentials if all of these are already in place:
src/channels/discord.tsexistssrc/channels/index.tscontainsimport './discord.js';@chat-adapter/discordis listed inpackage.jsondependencies
Otherwise continue. Every step below is safe to re-run.
1. Fetch the channels branch
git fetch origin channels
2. Copy the adapter
git show origin/channels:src/channels/discord.ts > src/channels/discord.ts
3. Append the self-registration import
Append to src/channels/index.ts (skip if the line is already present):
import './discord.js';
4. Install the adapter package (pinned)
pnpm install @chat-adapter/discord@4.27.0
5. Build
pnpm run build
Credentials
Create Discord Bot
- Go to the Discord Developer Portal
- Click New Application and give it a name (e.g., "NanoClaw Assistant")
- From the General Information tab, copy the Application ID and Public Key
- Go to the Bot tab and click Add Bot if needed
- Copy the Bot Token (click Reset Token if you need a new one — you can only see it once)
- Under Privileged Gateway Intents, enable Message Content Intent
- Go to OAuth2 > URL Generator:
- Scopes: select
bot - Bot Permissions: select
Send Messages,Read Message History,Add Reactions,Attach Files,Use Slash Commands
- Scopes: select
- Copy the generated URL and open it in your browser to invite the bot to your server
Configure environment
All three values are required — the adapter will fail to start without DISCORD_PUBLIC_KEY and DISCORD_APPLICATION_ID.
Add to .env:
DISCORD_BOT_TOKEN=your-bot-token
DISCORD_APPLICATION_ID=your-application-id
DISCORD_PUBLIC_KEY=your-public-key
Sync to container: mkdir -p data/env && cp .env data/env/env
Next Steps
If you're in the middle of /setup, return to the setup flow now.
Otherwise, run /manage-channels to wire this channel to an agent group.
Channel Info
- type:
discord - terminology: Discord has "servers" (also called "guilds") containing "channels." Text channels start with #. The bot can also receive direct messages.
- how-to-find-id: Enable Developer Mode in Discord (Settings > App Settings > Advanced > Developer Mode). Then right-click a server and select "Copy Server ID" for the guild ID, and right-click the text channel and select "Copy Channel ID." The platform ID format used in registration is
discord:{guildId}:{channelId}— both IDs are required. - supports-threads: yes
- typical-use: Interactive chat — server channels or direct messages
- default-isolation: Same agent group for your personal server. Separate agent group for servers with different communities or where different members have different information boundaries.
04 同仓库更多 Skills
whatsapp-formatting
Format messages for WhatsApp, including mentions that render as real WhatsApp tags. Use when responding in a WhatsApp conversation (platform_id / chatJid ends with @s.whatsapp.net or @g.us).
welcome
Introduce yourself to a newly connected channel. Triggered automatically when a channel is first wired. Send a friendly greeting and brief overview of what you can do.
vercel-cli
Deploy apps to Vercel. Use when asked to deploy, ship, or publish a web application, or manage Vercel projects, domains, and environment variables.
slack-formatting
Format messages for Slack using mrkdwn syntax. Use when responding to Slack channels (folder starts with "slack_" or JID contains slack identifiers).
self-customize
Customize your own agent — add capabilities, install packages, add MCP servers, edit code or CLAUDE.md. Use when the user asks you to add a feature, install a tool, or modify how you work. For non-trivial code changes, delegate to a builder agent via create_agent.
onecli-gateway
OneCLI Gateway: transparent HTTPS proxy that injects stored credentials into outbound calls. You MUST use this skill when the user asks you to read emails, check calendar, access GitHub repos, create issues, check Stripe payments, or interact with ANY external service or API. Do NOT use browser extensions or OAuth CLI tools. Make HTTP requests directly; the gateway injects credentials automatically.