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 registers the channels where the bot should be active.
The skill starts by checking your NanoClaw installation and applying the DiscordChannel class through the skills engine. This adds the discord.js dependency, creates the channel adapter, and integrates it 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, 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.
After the bot is in your server, you grab the channel ID for the text channel where you want NanoClaw to listen. Discord’s Developer Mode (enabled in settings) lets you right-click any channel to copy its ID. You paste this into the skill, and it registers the channel in the database.
The skill finishes with a verification step — it sends a test message in the registered channel to confirm the bot is connected and responding.
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.
Channel modes
Like other NanoClaw channels, Discord supports main and trigger-only registration. A main channel gets full two-way communication. A trigger-only channel sends commands to the agent but receives responses through your primary channel (WhatsApp, Telegram, or another Discord channel).
This is useful if you want a dedicated Discord channel for commands while keeping conversation flowing in a different app.
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.
- Discord bots can only operate in servers (guilds), not in DMs, with NanoClaw’s current implementation.
- 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.