Skip to main content
The Discord bot keeps an open connection to Discord’s gateway, so it needs no public URL. Do the shared bot setup first. You also need a Discord developer account.

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 the Bot section and click Add Bot
  4. Under Privileged Gateway Intents, enable:
    • Message Content Intent
    • Server Members Intent (optional)
  5. Copy the Bot Token

Step 2: Configure OAuth2 Scopes

  1. Go to OAuth2 → URL Generator
  2. Select scopes: bot and applications.commands
  3. Select bot permissions: Send Messages, Use Slash Commands, Read Message History
  4. Copy the generated URL and use it to invite the bot to your server

Step 3: Set Up OAuth for Account Linking

This enables users to link their Discord account from the GAIA web app via OAuth instead of the /auth bot command.
  1. In your Discord application, go to OAuth2
  2. Under Redirects, add:
  3. Copy your Client ID (shown at the top of the OAuth2 page)
  4. Click Reset Secret to generate a Client Secret and copy it
Add to apps/api/.env:
The Client ID here is the same as your DISCORD_CLIENT_ID used by the bot, it’s the application ID, not a separate credential.

Step 4: Add the bot’s credentials

In apps/bots/.env:

Step 5: Deploy slash commands

Run once, and again whenever commands change:

Step 6: Start the bot

Things to try next

Troubleshooting