Discord Bots
Deploy AI-powered bots in Discord with slash commands, @mentions, and DMs.
Discord Bots
Connect your Gravity Rail workflows to Discord. Create custom slash commands, respond to @mentions, and interact via direct messages.
Quick Start
1. Create a Discord Application
- Go to Discord Developer Portal
- Click New Application
- Under Bot, click Reset Token and save it
- Note the Application ID and Public Key
2. Add Bot in Gravity Rail
- Go to Discord Bots
- Click Add Discord Bot
- Enter:
- Bot Name
- Application ID
- Bot Token
- Public Key
- Save
3. Configure Slash Commands
-
Open your bot's detail page
-
Go to the Commands tab
-
Add commands:
Command Description Workflow supportGet help Support Workflow order-statusCheck orders Order Lookup -
Click Register Commands
4. Install the Bot
- Copy the Install URL from the bot detail page
- Open in browser
- Select your Discord server
- Authorize
Your bot is now live! Try /support hello in Discord.
Response Modes
| Mode | When Bot Responds |
|---|---|
| Mentions | Only when @mentioned |
| Auto | AI decides based on context |
| Off | Slash commands only |
Set in bot's Behavior tab.
Gateway Mode
Enable for @mention responses:
- Open bot settings
- Enable Gateway Mode
- Select a Default Workflow
- Enable MESSAGE CONTENT Intent in Discord Developer Portal
Gateway mode maintains a persistent connection for real-time responses.
Account Linking
Link Discord users to members:
Manual: Users run /gravity-link
Auto-Link: Enable in settings - matches by verified email
Linked accounts get personalized responses based on member data.
Commands
Built-in Commands
| Command | Purpose |
|---|---|
/gravity-link | Link Discord account to Gravity Rail |
Custom Commands
Create commands that trigger workflows:
/order-status → Order Lookup Workflow
/book-meeting → Scheduling Workflow
/ask → General Agent Workflow
Rules:
- Lowercase letters, numbers, and dashes only
- 1-32 characters
- Must include a message parameter
Settings Reference
General
| Setting | Description |
|---|---|
| Application ID | From Discord Developer Portal |
| Bot Token | Secret token for bot authentication |
| Public Key | For webhook signature verification |
| Client Secret | For OAuth linking (optional) |
Behavior
| Setting | Description |
|---|---|
| Reply in Threads | Create threads for responses |
| Response Mode | mentions, auto, or off |
| Auto-Link by Email | Match users by verified email |
| Allow DMs | Enable direct message interactions |
| Gateway Mode | Real-time @mention responses |
| Default Workflow | Workflow for @mentions (gateway mode) |
Tips
- Test in a private channel first before deploying to public channels
- Use threads to keep conversations organized
- Monitor gateway status in bot detail page if using @mentions
- Register commands after any changes to command configuration
Common Issues
Commands not showing in Discord → Click Register Commands after changes
@Mentions not working → Enable Gateway Mode and MESSAGE CONTENT Intent
"Link your account first" message
→ Run /gravity-link or enable auto-link by email
Slow responses → Check workflow complexity; simplify if needed
Related
- Channels — Overview of all communication channels
- Slack Bots — Deploy AI bots in Slack
- Workflows — Build the conversation flows that power your bot