ClawdBot Discord Integration

Transform your Discord server with AI. Slash commands, moderation, and intelligent responses.

๐ŸŽฎ 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

  1. Go to Discord Developer Portal
  2. Click "New Application"
  3. Name it "ClawdBot" (or your preferred name)
  4. Click "Create"

Step 2: Create Bot User

  1. In your application, go to "Bot" tab
  2. Click "Add Bot"
  3. Confirm "Yes, do it!"
  4. Under "Privileged Gateway Intents", enable:
    • โœ… Presence Intent
    • โœ… Server Members Intent
    • โœ… Message Content Intent
  5. 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

  1. Copy the generated URL from OAuth2 page
  2. Paste in browser
  3. Select your server
  4. 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.

๐Ÿ“š Related Guides