Discord
Add Discord as a messaging channel. Supports text channels with attachments and reply context.
What it does
- Connects NanoClaw to Discord via the Bot API
- Supports text channels, attachments, and reply context
- Works alongside other channels or as a standalone
- Message Content Intent for full message access
- OAuth2 bot invitation flow
What you'll need
- NanoClaw installed and running
- A Discord account
- Discord Developer Portal access
- Bot token and Message Content Intent enabled
Install
/add-discord How it works
The /add-discord skill sets up NanoClaw as a Discord bot that can read and respond to messages in your server. The skill handles the code changes, walks you through bot creation in the Discord Developer Portal, and shows you how to wire channels to an agent group.
The skill starts by checking your NanoClaw installation, then copies the Discord adapter (src/channels/discord.ts) in from the channels branch, appends a self-registration import to src/channels/index.ts, and installs the pinned @chat-adapter/discord package. The adapter registers itself via the Chat SDK bridge and integrates into NanoClaw’s message processing pipeline alongside any other channels you already have running.
You then create a bot in the Discord Developer Portal. The skill walks you through each step: creating a new application, copying the Application ID and Public Key from General Information, generating a bot token, enabling the Message Content Intent (required for reading message text), and constructing an OAuth2 invite URL with the right permissions. You paste the invite URL into your browser, select the server, and the bot joins. All three credentials go into .env — DISCORD_BOT_TOKEN, DISCORD_APPLICATION_ID, and DISCORD_PUBLIC_KEY are required, and the adapter won’t start without them.
After the bot is in your server, you grab the server (guild) ID and the channel ID for the text channel where you want NanoClaw to listen. Discord’s Developer Mode (enabled in settings) lets you right-click the server and the channel to copy both IDs — registration uses the platform ID format discord:{guildId}:{channelId}.
The skill finishes by validating the build and running the channel registration test. You then wire the channel to an agent group with /manage-channels (or /init-first-agent if this is your first agent).
What you get
Once Discord is set up, NanoClaw supports several features specific to the platform:
- Attachments — the bot can receive and process files, images, and other attachments sent in the channel.
- Reply context — when you reply to a message, the bot sees the original message for context.
- @mention translation — Discord user mentions are converted to readable names in the message the agent sees.
- Message splitting — long agent responses are automatically split to stay within Discord’s character limits.
- Typing indicators — the bot shows “typing…” while the agent is processing.
Wiring channels
Like other NanoClaw channels, Discord channels are wired to agent groups with /manage-channels. Each wiring has a session mode — shared, agent-shared, or per-thread — so a Discord channel can share a conversation with your other channels or keep its own thread.
Use the same agent group for your personal server, and a separate agent group for servers with different communities or information boundaries.
Tips
- The Message Content Intent is a privileged intent that must be explicitly enabled in the Developer Portal. Without it, the bot receives empty message content for messages that aren’t commands or mentions.
- The bot works in server channels and in direct messages. DMing the bot once is also how the first-agent flow (
/init-first-agent) resolves your DM platform ID. - If the bot appears offline in your server, check that the token is correct and that the bot has the required permissions in the channel.
- Discord’s rate limits are generous for single-server bots. You’re unlikely to hit them in normal personal use.