Discord Bot Setup¶
Detailed guide for creating and configuring a Discord bot for Automate-E.
Create the Application¶
- Go to discord.com/developers/applications
- Click New Application
- Name it (e.g., "My Agent") and click Create
Get the Bot Token¶
- Go to the Bot tab in the left sidebar
- Click Reset Token
- Copy the token -- you'll need this as
DISCORD_BOT_TOKEN - Never share this token or commit it to git
Enable Required Intents¶
Still on the Bot tab, scroll down to Privileged Gateway Intents and enable:
- Message Content Intent -- required for the bot to read message text
Without this, the bot connects but can't see what users write.
Disable Public Access¶
To prevent random users from adding your bot to their servers:
- Go to the Installation tab
- Set Install Link to None
- Go back to the Bot tab
- Disable Public Bot
Invite to Your Server¶
- Go to the OAuth2 tab
- In OAuth2 URL Generator, check the
botscope - Under Bot Permissions, select:
- View Channels
- Send Messages
- Create Public Threads
- Send Messages in Threads
- Read Message History
- Copy the generated URL
- Open it in your browser, select your server, and authorize
Configure the Agent¶
In your character.json, set the channels the bot should listen on:
Channel names must match exactly, with the # prefix.
Thread Mode¶
When someone sends a message in a monitored channel, the bot creates a thread for the conversation. This keeps the main channel clean and gives each conversation its own context.
DM Support¶
The bot automatically responds to direct messages. No configuration needed.
Allow Other Bots¶
By default, the bot ignores messages from other bots. To allow specific bots:
Use the bot's user ID (not application ID). You can find this by enabling Developer Mode in Discord, then right-clicking the bot user.
Run the Agent¶
export CHARACTER_FILE=./character.json
export DISCORD_BOT_TOKEN=your-token-here
export ANTHROPIC_API_KEY=sk-ant-...
npm start
You should see:
[Automate-E] Loaded character: My Agent
[Automate-E] Logged in as My Agent#1234
[Automate-E] Listening on channels: #general, #support
[Automate-E] DMs: enabled
Send a message in one of the configured channels -- the bot creates a thread and responds.