Discord Bots

Deploy AI-powered bots in Discord with slash commands, @mentions, and DMs.

Advanced
3 min read

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

  1. Go to Discord Developer Portal
  2. Click New Application
  3. Under Bot, click Reset Token and save it
  4. Note the Application ID and Public Key

2. Add Bot in Gravity Rail

  1. Go to Discord Bots
  2. Click Add Discord Bot
  3. Enter:
    • Bot Name
    • Application ID
    • Bot Token
    • Public Key
  4. Save

3. Configure Slash Commands

  1. Open your bot's detail page

  2. Go to the Commands tab

  3. Add commands:

    CommandDescriptionWorkflow
    supportGet helpSupport Workflow
    order-statusCheck ordersOrder Lookup
  4. Click Register Commands

4. Install the Bot

  1. Copy the Install URL from the bot detail page
  2. Open in browser
  3. Select your Discord server
  4. Authorize

Your bot is now live! Try /support hello in Discord.

Response Modes

ModeWhen Bot Responds
MentionsOnly when @mentioned
AutoAI decides based on context
OffSlash commands only

Set in bot's Behavior tab.

Gateway Mode

Enable for @mention responses:

  1. Open bot settings
  2. Enable Gateway Mode
  3. Select a Default Workflow
  4. 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

CommandPurpose
/gravity-linkLink 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

SettingDescription
Application IDFrom Discord Developer Portal
Bot TokenSecret token for bot authentication
Public KeyFor webhook signature verification
Client SecretFor OAuth linking (optional)

Behavior

SettingDescription
Reply in ThreadsCreate threads for responses
Response Modementions, auto, or off
Auto-Link by EmailMatch users by verified email
Allow DMsEnable direct message interactions
Gateway ModeReal-time @mention responses
Default WorkflowWorkflow 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

  • Channels — Overview of all communication channels
  • Slack Bots — Deploy AI bots in Slack
  • Workflows — Build the conversation flows that power your bot