Skip to main content

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:

CommandWhat It Does
/supportOpens a support conversation with your AI assistant
/order-statusChecks order status using your Order Management workflow
/book-appointmentSchedules appointments via your Booking workflow
/gravity-linkLinks 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

  1. A Discord account with permission to create applications
  2. A Gravity Rail workspace with Professional or Enterprise plan
  3. At least one workflow you want to connect to Discord

Step 1: Create a Discord Application

  1. Go to the Discord Developer Portal
  2. Click New Application and give it a name
  3. Navigate to Bot in the left sidebar
  4. Click Reset Token and copy your bot token (you'll need this)
  5. Note down these values from General Information:
    • Application ID
    • Public Key

Step 2: Configure Bot Permissions

In the Discord Developer Portal:

  1. Go to Bot settings
  2. Enable MESSAGE CONTENT INTENT if you plan to use Gateway Mode
  3. Under OAuth2URL Generator:
    • Select scopes: bot, applications.commands
    • Select bot permissions as needed

Step 3: Add Bot in Gravity Rail

  1. Navigate to Discord Bots in your workspace
  2. Click Add Discord Bot
  3. 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:

  1. Set Response Mode based on your use case
  2. Enable Auto-Link by Email if your members have matching Discord emails
  3. Toggle Allow Direct Messages if you want DM support
  4. Enable Gateway Mode if you want @mention responses

Step 5: Create Slash Commands

  1. Go to the Commands tab on your bot detail page
  2. Click Add Command
  3. Enter:
    • Command name (lowercase, letters/numbers/dashes)
    • Description (shown to users in Discord)
    • Workflow to trigger

Step 6: Register Commands & Install

  1. Click Register Commands to push commands to Discord
  2. Use the Install Bot link to add the bot to your Discord server
  3. 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

ScenarioRecommended Mode
High-traffic public channelMentions
Support channelAuto
Internal team channelAuto
Command-only botOff

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:

  1. Verify the bot is installed in your Discord server
  2. Check that commands are registered (click Register Commands)
  3. Ensure the bot is active in Gravity Rail
  4. Verify the webhook URL in Discord Developer Portal

@Mentions Not Working

Solutions:

  1. Enable Gateway Mode in bot settings
  2. Enable MESSAGE_CONTENT Intent in Discord Developer Portal
  3. Check that Response Mode is not set to "Off"
  4. Verify the bot has permission to read messages in the channel

User Linking Fails

Solutions:

  1. Ensure Client Secret is configured
  2. Verify user's Discord email is verified
  3. Check member exists with matching email (for auto-link)
  4. User can try /gravity-link command again

Slow Responses

Solutions:

  1. Simplify the workflow triggered by commands
  2. Ensure tools and data sources are responding quickly
  3. Check for any errors in workflow execution
  4. 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.