Discord Bots
Bring your AI-powered workflows directly into Discord. Discord Bots enable your team and community to interact with Gravity Rail through familiar Discord interfaces - slash commands, @mentions, and direct messages.
Overview
Discord Bots bridge your Gravity Rail workspace with Discord communities, allowing you to:
- Deploy AI assistants that respond to questions and provide support in Discord channels
- Create custom slash commands that trigger specific workflows (e.g.,
/order-status,/schedule-meeting) - Enable @mention responses for natural conversational interactions
- Link Discord users to members for personalized experiences
- Support direct messages for private bot interactions
Key Features
Custom Slash Commands
Create branded slash commands that connect directly to your Gravity Rail workflows:
| Command | What It Does |
|---|---|
/support | Opens a support conversation with your AI assistant |
/order-status | Checks order status using your Order Management workflow |
/book-appointment | Schedules appointments via your Booking workflow |
/gravity-link | Links user's Discord account to their Gravity Rail profile |
Each command triggers a specific workflow, giving you complete control over the AI's behavior, available tools, and response style.
Response Modes
Choose how your bot responds to messages:
Mentions Only (Default)
- Bot responds when explicitly @mentioned
- Best for busy channels where you don't want automatic responses
- Always responds in DMs
Auto (AI Decides)
- Uses AI to determine if a message warrants a response
- Considers conversation context and bot's purpose
- Great for support channels where users may ask questions without @mentioning
Off
- Only slash commands work
- No automatic message responses
- Useful for bots that should only respond to explicit commands
Account Linking
Connect Discord users to their Gravity Rail profiles:
Manual Linking: Users run /gravity-link and authorize via Discord OAuth
Auto-Link by Email: If enabled, users with matching verified emails are automatically linked when they first interact with the bot
Linked accounts enable:
- Personalized responses using member data
- Access to member-specific workflows
- Persistent conversation history
Gateway Mode for Real-Time Responses
Enable Gateway Mode for immediate @mention responses:
- Maintains a persistent connection to Discord
- Responds instantly to @mentions and messages
- Required for auto-respond mode
- Uses dedicated infrastructure for reliability
Getting Started
Prerequisites
- A Discord account with permission to create applications
- A Gravity Rail workspace with Professional or Enterprise plan
- At least one workflow you want to connect to Discord
Step 1: Create a Discord Application
- Go to the Discord Developer Portal
- Click New Application and give it a name
- Navigate to Bot in the left sidebar
- Click Reset Token and copy your bot token (you'll need this)
- Note down these values from General Information:
- Application ID
- Public Key
Step 2: Configure Bot Permissions
In the Discord Developer Portal:
- Go to Bot settings
- Enable MESSAGE CONTENT INTENT if you plan to use Gateway Mode
- Under OAuth2 → URL Generator:
- Select scopes:
bot,applications.commands - Select bot permissions as needed
- Select scopes:
Step 3: Add Bot in Gravity Rail
- Navigate to Discord Bots in your workspace
- Click Add Discord Bot
- Enter:
- Bot Name: A friendly name for this configuration
- Application ID: From Discord Developer Portal
- Bot Token: The token you copied earlier
- Public Key: From Discord Developer Portal
- Client Secret (optional): Required for OAuth user linking
Step 4: Configure Behavior
On the Behavior tab:
- Set Response Mode based on your use case
- Enable Auto-Link by Email if your members have matching Discord emails
- Toggle Allow Direct Messages if you want DM support
- Enable Gateway Mode if you want @mention responses
Step 5: Create Slash Commands
- Go to the Commands tab on your bot detail page
- Click Add Command
- Enter:
- Command name (lowercase, letters/numbers/dashes)
- Description (shown to users in Discord)
- Workflow to trigger
Step 6: Register Commands & Install
- Click Register Commands to push commands to Discord
- Use the Install Bot link to add the bot to your Discord server
- Test by running your commands in Discord!
Use Cases
Customer Support Bot
Scenario: Provide 24/7 AI-powered support in your Discord community
Configuration:
- Response Mode: Mentions
- Gateway Mode: Enabled
- Default Workflow: Your Support workflow with FAQ knowledge base
Slash Commands:
/support- Start a support conversation/faq- Get quick answers to common questions/ticket- Create a support ticket
Behavior:
- Users @mention the bot with questions
- Bot uses your knowledge base to provide answers
- Complex issues can escalate to human operators
Internal Team Assistant
Scenario: Help your team with quick lookups and actions
Configuration:
- Response Mode: Auto
- Auto-Link by Email: Enabled
- Allow DM: Enabled
Slash Commands:
/schedule- Check team availability/standup- Post daily standup update/docs- Search internal documentation
Behavior:
- Team members linked automatically by email
- Bot joins conversations when relevant
- DMs available for private requests
Community Engagement Bot
Scenario: Engage new members and answer questions about your product
Configuration:
- Response Mode: Off (commands only)
- Public commands for all users
Slash Commands:
/getting-started- Onboarding guide for new members/features- Learn about product features/roadmap- Check upcoming features
Behavior:
- Non-intrusive - only responds to explicit commands
- Provides consistent, accurate information
- Reduces repetitive questions for moderators
Advanced Features
Multiple Bots
Create different bots for different purposes:
- Public support bot for your community server
- Internal bot for your team server
- Specialized bots for different workflows
Threaded Conversations
When enabled, bot responses create Discord threads:
- Keeps channel organized
- Maintains conversation context
- Users can continue conversations naturally
File Attachments
Bots can send files generated by workflows:
- PDFs, images, documents
- Generated reports
- Downloaded artifacts from tools
Linked Roles
Integrate with Discord's Linked Roles feature:
- Verify member status
- Grant roles based on Gravity Rail membership
- Display verification badges
Best Practices
Command Naming
✓ Use clear, action-oriented names: /check-order, /book-meeting
✗ Avoid generic names: /do, /action, /run
Response Mode Selection
| Scenario | Recommended Mode |
|---|---|
| High-traffic public channel | Mentions |
| Support channel | Auto |
| Internal team channel | Auto |
| Command-only bot | Off |
Workflow Design
- Keep initial responses quick (under 3 seconds)
- Use deferred responses for longer operations
- Include fallback messages for errors
- Consider conversation context in prompts
Security
- Only give the bot permissions it needs
- Use client secret for proper OAuth linking
- Review who can use commands (server roles)
- Monitor bot activity for abuse
Troubleshooting
Bot Not Responding to Commands
Solutions:
- Verify the bot is installed in your Discord server
- Check that commands are registered (click Register Commands)
- Ensure the bot is active in Gravity Rail
- Verify the webhook URL in Discord Developer Portal
@Mentions Not Working
Solutions:
- Enable Gateway Mode in bot settings
- Enable MESSAGE_CONTENT Intent in Discord Developer Portal
- Check that Response Mode is not set to "Off"
- Verify the bot has permission to read messages in the channel
User Linking Fails
Solutions:
- Ensure Client Secret is configured
- Verify user's Discord email is verified
- Check member exists with matching email (for auto-link)
- User can try
/gravity-linkcommand again
Slow Responses
Solutions:
- Simplify the workflow triggered by commands
- Ensure tools and data sources are responding quickly
- Check for any errors in workflow execution
- Consider using simpler AI models for faster responses
Pricing & Limits
Feature availability and limits are determined by your subscription plan. See the pricing page for details.
Related Resources
- Workflows Guide - Configure workflows for Discord commands
- Chats Overview - Understand conversation management
- Toolkits Guide - Add custom tools to bot workflows