Help Center/Integrations/Configuring Discord Bot
Back to Help Center
Integrations

Configuring Discord Bot

Complete guide to creating and integrating a Discord bot

Overview

Discord is a popular platform for community chat. This guide shows you how to create a Discord bot and connect it to AgentClaw.

Step 1: Create Discord Application

  1. Go to Discord Developer Portal
  2. Click "New Application"
  3. Enter a name for your bot
  4. Click "Create"

Step 2: Create Bot User

  1. In your application, go to the "Bot" section
  2. Click "Add Bot"
  3. Confirm by clicking "Yes, do it!"
  4. Under "Token", click "Reset Token"
  5. Copy the token - save this securely!

Step 3: Configure Bot Permissions

Under "Privileged Gateway Intents", enable:

  • Message Content Intent (required to read messages)
  • Server Members Intent (optional, for member info)
  • Presence Intent (optional, for user status)

Click "Save Changes"

Step 4: Add Bot Token to AgentClaw

  1. Go to your AgentClaw instance configuration
  2. Add environment variable:
    • Name: DISCORD_BOT_TOKEN
    • Value: Paste your bot token
  3. Save and restart your instance

Step 5: Invite Bot to Your Server

  1. In Discord Developer Portal, go to "OAuth2" → "URL Generator"
  2. Under "Scopes", select:
    • bot
    • applications.commands
  3. Under "Bot Permissions", select:
    • ✓ Send Messages
    • ✓ Read Messages/View Channels
    • ✓ Read Message History
    • ✓ Add Reactions (optional)
  4. Copy the generated URL
  5. Open the URL in your browser
  6. Select the server to add the bot to
  7. Click "Authorize"

Step 6: Test Your Bot

  1. Check your AgentClaw logs - bot should connect
  2. In Discord, @mention your bot: @YourBot hello
  3. Bot should respond with AI-generated message

Bot Behavior in Discord

Your bot will respond to:

  • Direct messages (DMs)
  • @mentions in channels
  • Replies to bot messages
  • Messages in channels where bot has permissions

Troubleshooting

Bot Shows as Offline

  • Check instance is running in AgentClaw
  • Verify DISCORD_BOT_TOKEN is correct
  • Check logs for connection errors
  • Ensure Message Content Intent is enabled

Bot Online But Not Responding

  • Ensure bot has permission to read/send messages in channel
  • Try @mentioning the bot directly
  • Check AI provider API key is valid
  • Review logs for errors

"Invalid Token" Error

  • Regenerate token in Discord Developer Portal
  • Update DISCORD_BOT_TOKEN in AgentClaw
  • Restart instance

Next Steps

Still need help?

Our support team is ready to assist you with any questions.

Contact Support