Discord Integration
Connect your Hatcher agent to Discord so it can interact with users in your server’s channels. Setup takes about 5 minutes.
Prerequisites
- A Discord account
- A Discord server where you have Manage Server permission (or create a new one)
- A Hatcher agent already created (Getting Started)
- Discord integration is free on all Hatcher plans
Setup
Create a Discord Application
- Go to the Discord Developer Portal
- Click New Application in the top right
- Enter a name for your application (e.g., “My Crypto Agent”)
- Accept the terms of service and click Create
Create the Bot
- In your application’s settings, click Bot in the left sidebar
- Your bot is created automatically with the application
Get the Bot Token
- On the Bot page, click Reset Token
- Discord will show you the token once — copy it immediately
MTIzNDU2Nzg5MDEyMzQ1Njc4.ABCDEF.abcdefghijklmnopqrstuvwxyz1234567890Save this token somewhere secure. Discord only shows it once. If you lose it, you’ll need to reset it (which invalidates the old token).
Enable Privileged Intents
Still on the Bot page, scroll down to Privileged Gateway Intents and enable:
- Message Content Intent — Required so your bot can read message text
- Server Members Intent — Required for member-related features
Click Save Changes.
Without Message Content Intent enabled, your bot will receive empty messages and won’t be able to respond. This is the most common setup mistake.
Generate the Invite URL
- Go to OAuth2 in the left sidebar
- Click URL Generator
- Under Scopes, check:
botapplications.commands
- Under Bot Permissions, check:
- Send Messages
- Read Message History
- Use Slash Commands
- Embed Links
- Attach Files
- Add Reactions
- Copy the generated URL at the bottom of the page
Invite the Bot to Your Server
- Paste the URL from the previous step into your browser
- Select the server you want to add the bot to
- Click Authorize
- Complete the CAPTCHA if prompted
You should see your bot appear in the server’s member list (it will show as offline until your Hatcher agent starts).
Get the Application ID
- On the General Information page of your application (in the left sidebar)
- Copy the Application ID (a long numeric string) — you’ll need this along with the bot token
Configure in Hatcher
- Go to your Hatcher Dashboard
- Navigate to My Agents and select your agent
- Open the Integrations tab
- Find Discord and click Configure
- Paste your Bot Token into the token field
- Paste your Application ID into the application ID field
- Click Save
Restart your agent
Click Restart on your agent to apply the new configuration. Within a few seconds, your bot should appear as online in your Discord server.
Test it
Go to a channel in your Discord server where the bot has access and send a message. Your agent should respond.
Channel Permissions
By default, the bot can see and respond in all channels it has access to. To restrict it to specific channels:
- In Discord, go to Server Settings → Roles
- Find your bot’s role
- Go to the specific channel’s settings → Permissions
- Configure which channels the bot can read and send messages in
Slash Commands
The agent framework automatically registers slash commands with Discord if configured. Users in your server can type / to see available commands.
Troubleshooting
Bot is offline in Discord
- Check that your agent is running. Go to the Hatcher dashboard and verify the status is Active.
- Verify the token. If you reset the token in Discord, you need to update it in Hatcher too.
- Restart the agent after saving the token.
Bot is online but doesn’t respond
- Message Content Intent is probably not enabled. Go to the Discord Developer Portal → your app → Bot → enable Message Content Intent → Save Changes. Then restart the agent in Hatcher.
- Check channel permissions. Make sure the bot’s role has permission to read messages and send messages in the channel.
”Used disallowed intents” error in logs
You enabled intents in your agent config that aren’t enabled in the Developer Portal. Go back to the Bot page and enable the required Privileged Gateway Intents.
Bot responds to some users but not others
Check the channel permissions. The bot needs Read Message History and View Channel permissions for each channel where it should work.
Rate limiting (429 errors)
Discord rate limits bots to approximately 50 requests per second globally. If your agent sends too many messages too quickly, Discord will temporarily block it. This usually resolves within a few seconds.
”Invalid token” error
Your token is wrong or has been reset. Go to the Discord Developer Portal, reset the token, copy the new one, and update it in Hatcher.
Useful Links
- Discord Developer Portal — Manage your applications and bots
- Discord Developer Documentation — Official API reference
- Discord Permissions Calculator — Generate permission integers