Skip to content

Discord Chat Quick Start

Get your herdctl agent chatting on Discord in under 5 minutes. This guide covers the minimal setup—see the full Discord reference for advanced configuration.

  1. Go to Discord Developer Portal
  2. Click New Application and give it a name
  3. Go to Bot → click Reset Token → copy the token

Still in the Developer Portal:

  1. Go to Bot → scroll to Privileged Gateway Intents
  2. Enable Message Content Intent
  3. Click Save Changes
  1. Go to OAuth2URL Generator
  2. Select scopes: bot, applications.commands
  3. Select permissions: Send Messages, Read Message History, Use Slash Commands
  4. Copy the URL and open it to invite the bot to your server

Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode), then:

  • Guild ID: Right-click server icon → Copy Server ID
  • Channel ID: Right-click channel → Copy Channel ID
Terminal window
export DISCORD_BOT_TOKEN="your-bot-token-here"
export DISCORD_GUILD_ID="123456789012345678"
export DISCORD_CHANNEL_ID="987654321098765432"

Add the chat.discord section to your agent YAML:

name: my-agent
description: "Agent with Discord chat"
system_prompt: |
You are a helpful assistant. Answer questions clearly and concisely.
chat:
discord:
bot_token_env: DISCORD_BOT_TOKEN
guilds:
- id: "${DISCORD_GUILD_ID}"
channels:
- id: "${DISCORD_CHANNEL_ID}"
mode: mention # Respond when @mentioned
dm:
enabled: true
mode: auto # Always respond to DMs
Terminal window
herdctl start

You should see:

[my-agent] Connecting to Discord...
[my-agent] Connected to Discord: MyBot#1234

Now try it:

  • In the channel: @MyBot Hello!
  • In a DM: Just say Hello!

Your bot automatically supports:

CommandDescription
/helpShow available commands
/resetClear conversation context
/statusShow bot connection info