Step 1: Create an Application
Open the Developer Portal
Go to discord.com/developers/applications and click New Application.Name it whatever you want — this is the internal name, not the bot’s display name.
Create a Bot
In your application settings, go to Bot:
- Click Add Bot
- Copy the bot token — you’ll need this in a moment
- Scroll down to Privileged Gateway Intents and enable Message Content Intent
Step 2: Set Bot Permissions
In your application settings, go to OAuth2 → URL Generator:- Scopes:
bot - Bot Permissions:
- Send Messages
- Send Messages in Threads
- Create Public Threads
- Read Message History
- Embed Links
- Attach Files
- Add Reactions
Step 3: Get Your Guild ID
In Discord, enable Developer Mode:- Open User Settings → Advanced
- Toggle on Developer Mode
- Right-click your server name → Copy Server ID
Step 4: Add Token to Spacebot
- TOML Config
config.toml
config.toml
Verify It’s Working
Send a message in a channel the bot has access to. You should see:- A typing indicator while the bot processes your message
- A reply from the bot
Filtering
Restrict to Specific Channels
By default the bot responds in every channel it has access to. To limit it, add channel IDs to your binding.config.toml
channel_ids is empty or omitted, the bot responds in all channels.
Require Mentions Per Channel
Setrequire_mention = true on a Discord binding to only process messages that either:
- Explicitly @mention the bot, or
- Reply to a bot message
config.toml
DM Filtering
By default, all DMs are ignored. To allow specific users, add their Discord user IDs.config.toml
config.toml
Multiple Servers
Route different Discord servers to different agents.config.toml
Threads
Threads get their own separate conversation with isolated history. Messages in the main channel share one conversation. Threads are the natural fit for isolated conversations in a busy server. The bot can create threads from messages when responding withOutboundResponse::ThreadReply. If thread creation fails (missing permissions or DM context), it falls back to a regular message.
Rich Messages
Discord supports rich message features:Embeds
Cards with titles, descriptions, fields, colors, and footers. Up to 10 embeds per message.Interactive Elements
- Buttons — Primary, Secondary, Success, Danger, and Link styles. Max 5 per row.
- Select Menus — Dropdown selection with custom options
Polls
Create polls with:- Up to 10 answer options
- Duration between 1 and 720 hours
- Multiselect support
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Disallowed intent(s) error in logs | Message Content Intent not enabled | Discord Developer Portal → Bot → enable Message Content Intent → Save Changes |
| Bot connects but doesn’t see messages | Message Content Intent disabled | Discord Developer Portal → Bot → enable Message Content Intent |
| Bot doesn’t respond in channel | No access | Make sure the bot has permissions in that channel |
| Bot doesn’t respond to DMs | DM filtering | Add user ID to dm_allowed_users |
| Bot responds in wrong channels | No channel filter | Add channel_ids to your binding |
401 Unauthorized on startup | Invalid token | Copy a fresh token from the Developer Portal |
Next Steps
Configure Permissions
Set up channel filters and access control
Agent Configuration
Create multiple agents for different servers
Message Coalescing
Learn how burst handling works