tutorial13 min read2mo ago

NanoClaw Discord Bot: Add AI to Your Server (2026 Guide)

NanoClaw's Discord skill turns any Discord server into an AI-powered workspace. It connects through the Discord Gateway API, supports slash commands, responds in threads without losing context, and lets you control exactly which channels and roles can interact with it. Setup takes about 10 minutes.

NanoClaw Discord Bot: Add AI to Your Server (2026 Guide)
nanoclawdiscord botdiscord AInanoclaw discordserver automationslash commandsAI chatbot

TL;DR — NanoClaw Discord Bot

NanoClaw's Discord skill turns any Discord server into an AI-powered workspace. It connects through the Discord Gateway API, supports slash commands, responds in threads without losing context, and lets you control exactly which channels and roles can interact with it. Setup takes about 10 minutes. You need a Discord developer account, a bot token, and NanoClaw installed locally. The bot supports multi-server deployments, file and image analysis, code block formatting, and custom personality configuration. This guide covers the full setup process, advanced configuration, and troubleshooting for common issues.

Table of Contents

  1. Why Add NanoClaw to Discord?
  2. Prerequisites
  3. Setup Guide: 8 Steps
  4. Key Features
  5. Advanced Configuration
  6. Discord Bot Best Practices
  7. Troubleshooting
  8. NanoClaw vs Other Discord AI Bots
  9. Frequently Asked Questions

Why Add NanoClaw to Discord?

Discord started as a gaming chat app. In 2026, it is where developer teams coordinate, open-source projects run their support channels, study groups collaborate, and creator communities build audiences. Over 200 million monthly active users interact on Discord, and the platform's server architecture — channels, threads, roles, permissions — makes it one of the best structured environments for dropping an AI assistant into.

The problem is that most Discord AI bots are shallow. They wrap a language model API in a bot framework, respond to messages, and call it a day. There is no memory between conversations, no awareness of thread context, no way to restrict the bot to specific channels, and no integration with the tools you actually use.

NanoClaw's Discord skill is different because NanoClaw itself is different. It is not a standalone bot. It is an AI agent framework where Discord becomes one of many input/output surfaces. When someone asks NanoClaw a question in your Discord server, NanoClaw can pull from its full toolkit — web search, file analysis, code execution, MCP server integrations — and deliver the answer back into the Discord thread.

Here is what that looks like in practice:

For developer teams: A team member pastes an error log in your #bugs channel. NanoClaw reads the log, identifies the issue, checks the project documentation it has access to, and posts a fix — complete with formatted code blocks — in a thread under the original message.

For open-source projects: New contributors ask setup questions in your #help channel. NanoClaw answers them using your project's actual README and configuration files, not generic advice scraped from Stack Overflow three years ago.

For learning communities: Students ask questions in topic channels. NanoClaw provides explanations calibrated to the channel's difficulty level — beginner-friendly in #getting-started, more technical in #advanced-topics.

For creator communities: Moderators use slash commands to generate content summaries, schedule announcements, or analyze images and files shared in the server.

The NanoClaw Discord integration is not a toy. It is a production-grade connection between your community and an AI that actually knows your context.


Prerequisites

Before you start, make sure you have these four things ready:

1. NanoClaw Installed and Running

NanoClaw needs to be installed on your machine or server. If you have not set it up yet, follow the NanoClaw installation guide first. Verify it is working by running a quick command in your terminal:

nanoclaw --version

You should see version 2.4 or higher. The Discord skill requires at least version 2.4.

2. Discord Developer Account

You need access to the Discord Developer Portal. Any Discord account can access this — you do not need a special developer tier or paid plan. If you have a Discord account, you already have access.

3. A Discord Server You Own or Administer

You need the "Manage Server" permission on whichever server you want to add the bot to. If you are testing, create a fresh server — it takes five seconds and keeps your experiments separate from your production community.

4. Node.js 18+

The Discord Gateway connection runs through a Node.js process. Check your version:

node --version

If you are below v18, update before continuing. The discord.js library that NanoClaw uses under the hood requires Node.js 18 as the minimum.


Setup Guide: 8 Steps

Step 1: Create a Discord Application

Open the Discord Developer Portal and click New Application in the top right.

Give your application a name. This is the name that appears in the OAuth2 authorization screen when people add the bot to their servers. Use something descriptive — "NanoClaw AI" or "YourProject AI Assistant" both work. You can change it later.

Accept the Developer Terms of Service and click Create.

You will land on the General Information page. Note the Application ID — you will need it in Step 7. Optionally, upload an app icon and write a description. These are cosmetic but make the bot look professional when users encounter it.

Step 2: Generate a Bot Token

In the left sidebar, click Bot.

Click Reset Token (or Add Bot if this is a brand new application). Discord will show you a token string. This is your bot's authentication credential.

Copy this token immediately and store it somewhere safe. Discord only shows the full token once. If you lose it, you will need to reset it and update your configuration.

A few important settings on this page:

  • Public Bot — Turn this OFF unless you want anyone to add your bot to their server. For private team bots, keep it disabled.
  • Presence Intent — Turn ON if you want the bot to see who is online. Optional but useful for some configurations.
  • Server Members Intent — Turn ON. Required for role-based access control.
  • Message Content Intent — Turn ON. Required for the bot to read message content in channels. Without this, the bot can only respond to slash commands and direct mentions.

Click Save Changes.

Step 3: Set Bot Permissions

Still in the Developer Portal, go to OAuth2 in the left sidebar.

Under OAuth2 URL Generator, select these scopes:

  • bot
  • applications.commands

The bot scope lets your application join servers. The applications.commands scope lets it register slash commands.

In the Bot Permissions section below, select:

  • Read Messages/View Channels — The bot needs to see channels to respond.
  • Send Messages — The bot needs to reply.
  • Send Messages in Threads — Required for thread-aware conversations.
  • Create Public Threads — Lets the bot spin up threads for long conversations.
  • Embed Links — Required for rich embeds in responses.
  • Attach Files — Lets the bot share generated files and images.
  • Read Message History — Required for context in ongoing conversations.
  • Use Slash Commands — Enables /nanoclaw commands.
  • Add Reactions — Optional. Lets the bot react to acknowledge messages.

The permission integer will auto-calculate at the bottom of the page. Copy the generated URL — you will use it in Step 7, but not yet.

Step 4: Run the /add-discord Skill in NanoClaw

This is where NanoClaw's side of the setup happens. Open your terminal and run:

nanoclaw /add-discord

NanoClaw will prompt you for three pieces of information:

  1. Bot Token — Paste the token you copied in Step 2.
  2. Application ID — The Application ID from Step 1.
  3. Guild ID (optional) — If you want slash commands to register instantly on a specific server during development, paste that server's ID. Right-click the server name in Discord and select "Copy Server ID" (you need Developer Mode enabled in Discord settings). Leave this blank for global command registration, which takes up to an hour to propagate.

NanoClaw stores these credentials in its encrypted configuration store. They are not saved as plain text in any config file.

After entering the credentials, NanoClaw will test the connection:

[NanoClaw] Testing Discord Gateway connection...
[NanoClaw] Connected as NanoClaw AI#8842
[NanoClaw] Registered 4 slash commands
[NanoClaw] Discord skill activated. Bot is online.

If you see this output, the connection is live. If not, jump to the Troubleshooting section.

Step 5: Configure Channel Allowlist

By default, NanoClaw listens in every channel it can see. For most servers, you want to restrict this. Run:

nanoclaw discord:config channels

NanoClaw will list every channel in your server and let you select which ones the bot should respond in. You can choose channels by name or ID.

Example configuration:

Channel allowlist:
  ✓ #ai-assistant
  ✓ #dev-help
  ✓ #general
  ✗ #announcements
  ✗ #off-topic
  ✗ #voice-chat

You can also configure this with a direct command:

nanoclaw discord:config channels --allow ai-assistant,dev-help,general

The bot will ignore all messages in channels not on the allowlist. It will still respond to slash commands in any channel — the allowlist only affects passive message monitoring.

Step 6: Set Trigger Mode

NanoClaw supports three trigger modes that control when the bot responds to messages:

Mention mode (default and recommended):

nanoclaw discord:config trigger mention

The bot only responds when someone @mentions it. This is the least intrusive option and works well for busy servers.

Slash command mode:

nanoclaw discord:config trigger slash

The bot only responds to /nanoclaw slash commands. It ignores all regular messages, even direct mentions. Best for servers that want a clean separation between human chat and AI interactions.

All messages mode:

nanoclaw discord:config trigger all

The bot processes every message in allowlisted channels. This is useful for dedicated AI channels where the entire purpose is interacting with the bot, but it can be noisy in general-purpose channels. Use this sparingly.

You can also combine modes:

nanoclaw discord:config trigger mention,slash

This responds to both @mentions and slash commands while ignoring regular messages. It is the best setup for most production servers.

Step 7: Invite the Bot to Your Server

Go back to the OAuth2 URL you generated in Step 3, or construct it manually:

https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&permissions=YOUR_PERMISSION_INTEGER&scope=bot+applications.commands

Replace YOUR_APPLICATION_ID with the ID from Step 1 and YOUR_PERMISSION_INTEGER with the calculated permission value from Step 3.

Open this URL in your browser. Discord will ask you to select a server. Choose your target server from the dropdown, verify the permissions, and click Authorize.

The bot will appear in your server's member list. If NanoClaw is running, the bot should show as online within a few seconds.

Step 8: Test the First Interaction

Go to one of your allowlisted channels and test the bot:

If using mention mode:

@NanoClaw AI What can you help me with?

If using slash command mode:

/nanoclaw ask What can you help me with?

The bot should respond within 2-5 seconds with a summary of its capabilities. If it does not respond, check that:

  • NanoClaw is running in your terminal
  • The channel is on the allowlist
  • The trigger mode matches how you are addressing the bot
  • The bot has the correct permissions in that channel

Congratulations. NanoClaw is live in your Discord server.


Key Features

Once the bot is running, you have access to NanoClaw's full feature set through Discord. Here is what each major feature looks like in practice.

Multi-Server Support

A single NanoClaw instance can serve multiple Discord servers simultaneously. Each server maintains its own configuration — separate channel allowlists, trigger modes, personality settings, and conversation history. Add the bot to additional servers by repeating Step 7 with different server invitations.

Configure per-server settings with the --guild flag:

nanoclaw discord:config channels --guild 123456789 --allow dev-help,general
nanoclaw discord:config channels --guild 987654321 --allow ai-chat

There is no hard limit on the number of servers, but performance depends on your hardware. A single NanoClaw instance on a modest VPS (2 vCPU, 4 GB RAM) handles 10-15 active servers comfortably.

Thread-Aware Conversations

This is the feature that separates NanoClaw from most Discord AI bots. When someone starts a conversation with NanoClaw, the bot tracks the full thread context. Follow-up messages in the same thread reference previous messages automatically.

Example:

User: @NanoClaw AI Explain how WebSockets work
Bot:  [detailed explanation of WebSockets]
User: How is that different from Server-Sent Events?
Bot:  [comparison that references its own WebSocket explanation]
User: Show me a Node.js example of each
Bot:  [two code blocks with Node.js implementations]

The bot maintains context for the entire thread lifetime. When the thread is archived, the conversation state is cleaned up automatically.

NanoClaw also creates threads proactively when conversations get long. If a channel exchange exceeds three back-and-forth messages, the bot suggests moving to a thread to keep the channel clean.

Slash Command Integration

NanoClaw registers four slash commands by default:

CommandDescription
----------------------
/nanoclaw ask [question]Ask a question and get a response
/nanoclaw summarizeSummarize the last N messages in the channel
/nanoclaw analyze [attachment]Analyze an uploaded file or image
/nanoclaw configView or change bot settings (admin only)

Slash commands work in every channel, regardless of the channel allowlist. They support Discord's autocomplete, so users get helpful suggestions as they type.

You can register custom slash commands through NanoClaw's skill system. Any NanoClaw skill can be exposed as a Discord slash command with a single configuration line.

File and Image Analysis

Drag and drop a file or image into a message that mentions the bot, and NanoClaw will analyze it. Supported inputs include:

  • Images (PNG, JPG, WebP, GIF) — NanoClaw describes the image, extracts text via OCR, and answers questions about visual content.
  • Code files — Paste a .py, .js, .ts, .go, or any text-based code file. NanoClaw reviews the code, identifies issues, and suggests improvements.
  • Documents (PDF, TXT, MD) — NanoClaw reads and summarizes documents, extracts key points, and answers questions about the content.
  • Log files — Paste error logs or server output. NanoClaw parses the log, identifies the root cause, and suggests fixes.

File size limit is 25 MB (Discord's standard attachment limit). For larger files, NanoClaw provides a temporary upload URL.

Code Block Formatting

When NanoClaw includes code in its responses, it uses Discord's native markdown formatting with language-specific syntax highlighting:

def fibonacci(n): if n <= 1: return n return fibonacci(n - 1) + fibonacci(n - 2)

The bot automatically detects the programming language from context and applies the correct syntax tag. For multi-language responses, each block gets its own language tag. Long code responses are split across multiple messages to stay within Discord's 2,000-character limit, with each message forming a complete, copy-pasteable block.

Role-Based Access Control

Control who can interact with the bot using Discord's native role system. Configure access tiers:

nanoclaw discord:config roles --admin @Moderators,@Admin
nanoclaw discord:config roles --user @Members,@Contributors
nanoclaw discord:config roles --blocked @Muted

Three access levels:

  • Admin — Can use /nanoclaw config, change bot settings, and access all features.
  • User — Can ask questions, analyze files, and use standard slash commands.
  • Blocked — The bot ignores all messages and commands from these roles.

By default, all server members have user-level access and server administrators have admin access. Role-based access control is optional — configure it only if you need granular control.


Advanced Configuration

Custom Personality

Shape how the bot communicates by defining a personality profile:

nanoclaw discord:config personality

This opens an interactive editor where you can set:

  • Name — How the bot refers to itself ("I'm NanoClaw" vs "I'm your AI assistant" vs "I'm DevBot")
  • Tone — Casual, professional, technical, friendly, or a custom description
  • Response length — Concise (1-2 paragraphs), standard (2-4 paragraphs), or detailed (unlimited)
  • Specialization — Tell the bot what your server is about so it calibrates responses accordingly

Example personality for a Python learning community:

name: PyHelper
tone: friendly and encouraging, like a patient teaching assistant
length: concise
specialization: >
  This is a Python learning community. Members range from complete
  beginners to intermediate developers. Always explain concepts
  step by step. Use Python 3.12+ syntax. Include runnable code
  examples whenever possible. Avoid jargon without definitions.

The personality applies globally across all channels in that server. You can override it per-channel if needed:

nanoclaw discord:config personality --channel dev-help --tone technical
nanoclaw discord:config personality --channel beginners --tone "simple and encouraging, avoid jargon"

Channel-Specific Restrictions

Beyond the allowlist, you can configure what the bot can do in each channel:

nanoclaw discord:config channel dev-help --features ask,analyze,summarize
nanoclaw discord:config channel announcements --features summarize
nanoclaw discord:config channel general --features ask

This lets you have a full-featured AI assistant in your development channels while limiting the bot to summarization in your announcements channel.

Rate Limits

Prevent abuse and manage API costs by setting rate limits:

nanoclaw discord:config ratelimit --per-user 20/hour
nanoclaw discord:config ratelimit --per-channel 100/hour
nanoclaw discord:config ratelimit --global 500/hour

When a user hits their rate limit, the bot responds with a polite message explaining the cooldown period. Rate limits reset on a rolling window, not a fixed clock.

For servers with premium tiers, you can assign different rate limits to different roles:

nanoclaw discord:config ratelimit --role @Premium --per-user 100/hour
nanoclaw discord:config ratelimit --role @Members --per-user 10/hour

Context Window Management

By default, the bot includes the last 10 messages in a thread as conversation context. Adjust this based on your needs and API costs:

nanoclaw discord:config context --messages 20

Higher context means more coherent conversations but higher token usage. For code review channels where long discussions are common, 20-30 messages works well. For quick Q&A channels, 5-10 is sufficient.


Discord Bot Best Practices

After running NanoClaw in production Discord servers, here are six practices that make the difference between a bot people love and one they mute.

1. Start with Mention Mode

Do not launch the bot in "all messages" mode on a busy server. Start with mention-only. Let your community discover the bot organically. Users who find it useful will naturally @mention it more. Switch to combined mention + slash mode after a week if adoption is strong.

2. Create a Dedicated Channel

Even with channel allowlists, create a dedicated #ai-assistant or #ask-ai channel. Some users feel self-conscious asking an AI questions in front of others. A dedicated channel normalizes the interaction and gives heavy users a space where they will not feel like they are clogging up general chat.

3. Set the Personality Before Launch

A bot with a well-defined personality feels like a team member. A bot with default settings feels like a tool. Spend five minutes configuring the personality to match your community's tone before you announce the bot. The difference in adoption rates is dramatic.

4. Pin a Usage Guide

In every channel the bot is active, pin a short message explaining how to interact with it. Include the trigger mode (mention or slash command), what the bot can do, and any relevant limitations. Users who know what the bot is capable of use it more effectively.

5. Monitor the First Week Closely

Check the NanoClaw logs daily for the first week:

nanoclaw discord:logs --last 24h

Look for recurring error patterns, questions the bot handles poorly, and channels where the bot is either too active or too quiet. Adjust configuration based on real usage patterns, not assumptions.

6. Set Reasonable Rate Limits from Day One

It takes one enthusiastic user sending 200 messages to the bot in an hour to blow through your API budget. Set rate limits before launch, not after you get the invoice. 20 messages per user per hour is a sensible starting point for most communities.


Troubleshooting

Bot Shows Offline

Symptoms: The bot appears in the member list but shows a gray (offline) status.

Fix: Check that NanoClaw is running in your terminal. The Discord connection requires an active NanoClaw process. If you close the terminal, the bot goes offline.

For persistent uptime, run NanoClaw as a background service:

nanoclaw discord:start --daemon

Or use a process manager like pm2:

pm2 start "nanoclaw discord:start" --name nanoclaw-discord

Bot Does Not Respond to Messages

Symptoms: The bot is online but ignores messages.

Likely causes:

  1. Channel not allowlisted. Run nanoclaw discord:config channels to verify.
  2. Wrong trigger mode. If set to slash-only, the bot ignores @mentions. Check with nanoclaw discord:config trigger.
  3. Message Content Intent disabled. Go back to the Developer Portal > Bot settings and confirm Message Content Intent is toggled ON.
  4. Missing permissions. The bot needs "Read Messages" and "Send Messages" in the specific channel. Check Discord's channel-level permission overrides.

Slash Commands Not Appearing

Symptoms: Typing /nanoclaw does not show autocomplete suggestions.

Fix: Slash commands registered globally take up to one hour to propagate across Discord. If you set a Guild ID during setup, guild-specific commands should appear immediately. To force re-registration:

nanoclaw discord:commands --register

If commands still do not appear, verify the applications.commands scope was included in the OAuth2 URL (Step 3).

Rate Limit Errors from Discord

Symptoms: The bot responds intermittently or logs show HTTP 429 errors.

Fix: Discord enforces its own rate limits on bot API calls. If your bot is responding to too many messages too quickly, Discord will throttle it. NanoClaw handles this automatically with exponential backoff, but if you are seeing persistent 429 errors:

  • Reduce the bot's activity by tightening the channel allowlist
  • Increase the per-channel rate limit cooldown
  • Check if another bot on the same application is consuming rate limit budget

Responses Truncated or Missing Code Blocks

Symptoms: Long bot responses cut off mid-sentence, or code blocks do not render correctly.

Fix: Discord has a 2,000-character limit per message. NanoClaw splits long responses across multiple messages automatically, but edge cases exist. Update to the latest NanoClaw version:

nanoclaw update

If code blocks still render incorrectly, check that the bot has "Embed Links" permission enabled. Some formatting features require embed permissions even for plain text messages.


NanoClaw vs Other Discord AI Bots

FeatureNanoClawMEE6 AIClyde (Discord)MidJourney BotCustom GPT Bot
----------------------------------------------------------------------------
Thread-aware contextYesNoLimitedNoManual
Slash commandsYesYesYesYesManual setup
File/image analysisYesNoLimitedImage onlyVia API
Code formattingAuto-detectBasicBasicN/AManual
Channel allowlistYesYesServer-wideChannel-specificManual
Role-based accessGranular (3 tiers)Premium onlyBasicSubscriptionManual
Custom personalityFull configTemplatesNoN/ASystem prompt
Multi-serverUnlimitedPer planBuilt-inSubscriptionPer instance
MCP integrationsFull ecosystemNoNoNoNo
Self-hostedYesNoNoNoYes
CostNanoClaw license + API$12-24/moFree (limited)$10-30/moAPI costs only
Setup time~10 minutes~5 minutesBuilt-in~2 minutesHours

The key differentiator is that NanoClaw is not just a chatbot sitting in your server. It is an AI agent with access to NanoClaw's full skill and MCP ecosystem. MEE6 and Clyde can answer questions. NanoClaw can answer questions, search the web, analyze your codebase, run scripts, connect to your databases through MCP servers, and pipe results back into Discord.

If you need a simple chatbot for casual conversation, Clyde or MEE6 will do. If you need an AI team member that actually does work inside your Discord server, NanoClaw is in a different category.


Frequently Asked Questions

Is NanoClaw's Discord bot free?

NanoClaw itself requires a license (free tier available with rate limits). The Discord integration is included in all plans at no additional cost. You will pay for the underlying LLM API calls (Claude, GPT, etc.) based on usage. For a moderately active server with 50-100 daily interactions, expect $5-15/month in API costs.

Can I run the bot on multiple servers at once?

Yes. A single NanoClaw instance supports unlimited servers with independent configurations. Each server gets its own channel allowlist, trigger mode, personality settings, and rate limits. Performance depends on your hardware, but a standard VPS handles 10-15 active servers without issues.

Does the bot store conversation data?

NanoClaw stores conversation context locally on your machine or server for the duration of the thread. When a thread is archived or a configurable TTL expires, the conversation data is purged. No conversation data is sent to NanoClaw's servers. If you are running NanoClaw with a third-party LLM API (Claude, GPT), messages are sent to that API provider per their data policies.

Can I restrict the bot to specific roles?

Yes. NanoClaw supports three access tiers — admin, user, and blocked — mapped to Discord roles. See the Role-Based Access Control section for configuration details. You can also assign different rate limits per role.

Does it work with Discord forums?

Yes. Discord forum channels are treated as a collection of threads. NanoClaw responds in forum posts the same way it responds in threads — with full conversation context. Add the forum channel to your allowlist, and the bot will respond to posts and replies within them.

What happens if NanoClaw crashes?

If the NanoClaw process stops, the bot goes offline in Discord. No messages are lost — Discord queues them. When NanoClaw restarts, it reconnects automatically and can process any mentions or commands it missed (configurable, disabled by default). For production deployments, use a process manager like pm2 or systemd to auto-restart on crashes.


Frequently Asked Questions

Is NanoClaw's Discord bot free?
NanoClaw itself requires a license (free tier available with rate limits). The Discord integration is included in all plans at no additional cost. You pay for the underlying LLM API calls based on usage. For a moderately active server with 50-100 daily interactions, expect $5-15/month in API costs.
Can I run the NanoClaw Discord bot on multiple servers at once?
Yes. A single NanoClaw instance supports unlimited servers with independent configurations. Each server gets its own channel allowlist, trigger mode, personality settings, and rate limits. A standard VPS handles 10-15 active servers without issues.
Does the NanoClaw Discord bot store conversation data?
NanoClaw stores conversation context locally on your machine or server for the duration of the thread. When a thread is archived or a configurable TTL expires, the conversation data is purged. No conversation data is sent to NanoClaw's servers.
Can I restrict the NanoClaw bot to specific Discord roles?
Yes. NanoClaw supports three access tiers — admin, user, and blocked — mapped to Discord roles. You can also assign different rate limits per role for granular control.
Does NanoClaw work with Discord forums?
Yes. Discord forum channels are treated as a collection of threads. NanoClaw responds in forum posts with full conversation context. Add the forum channel to your allowlist, and the bot will respond to posts and replies within them.
What happens if NanoClaw crashes while running as a Discord bot?
If the NanoClaw process stops, the bot goes offline in Discord. No messages are lost. When NanoClaw restarts, it reconnects automatically and can process missed mentions or commands. For production deployments, use a process manager like pm2 or systemd to auto-restart on crashes.

Stay in the Loop

Join 1,000+ developers. Get the best new Skills & MCPs weekly.

No spam. Unsubscribe anytime.