๐ Discord Guide
๐ฎ Discord Integration Overview
ClawdBot integrates with Discord as a bot, providing AI assistance to your server members.
What You Can Do
- โ Answer questions in channels
- โ Slash commands (/ask, /code, /image)
- โ DM support for private conversations
- โ Server moderation features
- โ Role-based permissions
- โ Multi-channel support
- โ Thread conversations
Requirements
- Discord account
- Server with "Manage Server" permission
- ClawdBot installed and running
- Discord Developer Portal access
๐ค Discord Bot Setup
Step 1: Create Discord Application
- Go to Discord Developer Portal
- Click "New Application"
- Name it "ClawdBot" (or your preferred name)
- Click "Create"
Step 2: Create Bot User
- In your application, go to "Bot" tab
- Click "Add Bot"
- Confirm "Yes, do it!"
- Under "Privileged Gateway Intents", enable:
- โ Presence Intent
- โ Server Members Intent
- โ Message Content Intent
- Click "Reset Token" and copy your bot token
Step 3: Set Bot Permissions
Go to "OAuth2" โ "URL Generator":
- Scopes: bot, applications.commands
- Bot Permissions:
- Read Messages/View Channels
- Send Messages
- Send Messages in Threads
- Embed Links
- Attach Files
- Read Message History
- Add Reactions
- Use Slash Commands
Step 4: Invite Bot to Server
- Copy the generated URL from OAuth2 page
- Paste in browser
- Select your server
- Click "Authorize"
โ๏ธ ClawdBot Configuration
Add Discord Token to Config
# In ~/.clawdbot/config.yaml
channels:
discord:
enabled: true
token: "YOUR_BOT_TOKEN_HERE"
# Optional settings
prefix: "!"
mentionOnly: false # Respond to all messages or only mentions
# Channel whitelist (optional)
allowedChannels:
- "1234567890" # Channel ID
- "0987654321"
# Role permissions (optional)
allowedRoles:
- "Admin"
- "Moderator"
Start ClawdBot
clawdbot start
# Check Discord connection
clawdbot status discord
Verify Bot is Online
In your Discord server, you should see the bot appear online in the member list.
โก Slash Commands
Built-in Commands
| Command | Description | Example |
|---|---|---|
/ask |
Ask AI a question | /ask What is quantum computing? |
/code |
Generate code | /code Python function to sort list |
/image |
Analyze image | /image [attach image] describe this |
/summarize |
Summarize messages | /summarize last 50 messages |
/translate |
Translate text | /translate to Spanish: Hello |
/help |
Show help | /help |
Mention-Based Interaction
@ClawdBot what's the weather in Tokyo?
@ClawdBot explain this code: [paste code]
@ClawdBot remind me in 1 hour to check email
Prefix Commands (Optional)
!ask What is AI?
!code Create a React component
!help
โจ Discord Features
Thread Support
ClawdBot automatically creates threads for long conversations:
User: @ClawdBot help me debug this code
Bot: [Creates thread "Debugging Session"]
Bot: Sure! Let's work through this together...
Embed Responses
Rich embed formatting for better readability:
/ask What is machine learning?
Bot responds with formatted embed:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ค Machine Learning โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Definition: ... โ
โ Key Concepts: ... โ
โ Applications: ... โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Code Syntax Highlighting
/code Python quicksort
Bot responds:
```python
def quicksort(arr):
if len(arr) <= 1:
return arr
...
```
Reaction-Based Controls
- ๐ - Mark as helpful
- ๐ - Regenerate response
- โ - Delete response
- ๐งต - Move to thread
๐ก๏ธ Moderation Features
Auto-Moderation
# In config.yaml
channels:
discord:
moderation:
enabled: true
filterProfanity: true
filterSpam: true
filterLinks: false
# Auto-actions
warnThreshold: 3
muteThreshold: 5
banThreshold: 10
Moderator Commands
| Command | Description | Permission |
|---|---|---|
/warn @user |
Warn user | Moderator |
/mute @user 1h |
Mute user | Moderator |
/ban @user |
Ban user | Admin |
/clear 50 |
Delete messages | Moderator |
Content Filtering
channels:
discord:
contentFilter:
blockedWords:
- "spam"
- "scam"
blockedDomains:
- "malicious-site.com"
allowedFileTypes:
- "png"
- "jpg"
- "pdf"
๐ง Troubleshooting
Bot Not Responding
# Check bot status
clawdbot status discord
# View logs
clawdbot logs --channel discord
# Restart Discord channel
clawdbot channel restart discord
Missing Permissions
Ensure bot has these permissions in Discord server settings:
- Read Messages
- Send Messages
- Use Slash Commands
Slash Commands Not Appearing
# Re-register slash commands
clawdbot discord register-commands
# May take up to 1 hour to propagate globally
# Or kick and re-invite bot
Bot Shows Offline
# Check token is correct
# Verify intents are enabled in Developer Portal
# Restart ClawdBot
โ Discord FAQ
Can I use ClawdBot in multiple Discord servers?
Yes! One bot instance can serve multiple servers. Just invite it to each
server.
Does ClawdBot support voice channels?
Not currently. ClawdBot focuses on text-based interactions.
Can I customize the bot's name and avatar?
Yes, in the Discord Developer Portal under your application settings.
How do I restrict bot to specific channels?
Use
allowedChannels in config.yaml or Discord's channel
permissions.Can ClawdBot respond in DMs?
Yes, users can DM the bot directly for private conversations.