Overview
Connect Clawdbot to Discord and bring AI-powered conversations to your server:
- AI responses in channels and DMs
- Slash commands for easy interaction
- Multi-server support from one bot
- Role-based permissions for access control
Prerequisites
- Clawdbot installed on your machine
- A Discord account
- Admin access to a Discord server (or create your own)
Step 1: Create a Discord Application
- Go to the Discord Developer Portal
- Click “New Application”
- Enter a name (e.g., “My AI Assistant”) and click Create
Step 2: Create the Bot
- In your application, go to the “Bot” section in the left sidebar
- Click “Add Bot” → “Yes, do it!”
- Under Token, click “Reset Token” and copy it
⚠️ Important: Keep your bot token secret. Never share it or commit it to version control.
Configure Bot Settings
Enable these options under Privileged Gateway Intents:
- ✅ Message Content Intent — Required to read messages
- ✅ Server Members Intent — Optional, for member info
Click Save Changes.
Step 3: Invite Bot to Your Server
- Go to “OAuth2” → “URL Generator”
- Under Scopes, select:
- ✅
bot - ✅
applications.commands
- ✅
- Under Bot Permissions, select:
- ✅ Send Messages
- ✅ Read Message History
- ✅ Use Slash Commands
- ✅ Embed Links (optional, for rich responses)
- Copy the generated URL and open it in your browser
- Select your server and click Authorize
Step 4: Add Bot to Clawdbot
Run in your terminal:
clawdbot channels add discord
When prompted, paste your bot token.
Or use the setup wizard:
clawdbot onboard
Select Add messaging channel → Discord.
Step 5: Configure Bot Behavior
Set Allowed Channels
Restrict the bot to specific channels:
clawdbot config set discord.allowedChannels "123456789012345678,987654321098765432"
To get a channel ID: Right-click the channel → Copy ID (enable Developer Mode in Discord settings first).
Set Trigger Mode
Choose how the bot responds:
# Respond to mentions only (default)
clawdbot config set discord.trigger mention
# Respond to all messages in allowed channels
clawdbot config set discord.trigger all
# Respond to messages starting with a prefix
clawdbot config set discord.trigger prefix
clawdbot config set discord.prefix "!ai"
Step 6: Start the Gateway
clawdbot gateway
Your Discord bot is now online! Test it by mentioning the bot or using your configured trigger.
Slash Commands
Clawdbot automatically registers these slash commands:
| Command | Description |
|---|---|
/ask [question] | Ask the AI a question |
/reset | Reset conversation context |
/help | Show available commands |
To use: Type / in any channel where the bot has access.
Multi-Server Setup
Your bot can run on multiple servers simultaneously. Each server maintains its own conversation context.
Per-Server Configuration
# Set different AI personalities per server
clawdbot config set discord.servers.123456789.personality "helpful assistant"
clawdbot config set discord.servers.987654321.personality "coding expert"
Troubleshooting
Bot is Online but Not Responding
- Check Message Content Intent is enabled in Developer Portal
- Verify the bot has permission to read/send in the channel
- Confirm
clawdbot gatewayis running
”Missing Access” Error
The bot needs proper permissions:
- Re-invite with correct permissions using the OAuth2 URL
- Or manually adjust role permissions in Server Settings
Commands Not Showing
Slash commands may take up to 1 hour to register globally. For instant updates during development:
clawdbot config set discord.guildCommands true
This registers commands per-server (instant) instead of globally.
Next Steps
- Connect Telegram — Add another platform
- Connect Slack — For workplace AI
- Voice Assistant — Add voice features