Discord Bot Setup

Deploy your NeuroGen AI agent as a Discord bot. Your bot can respond to mentions, DMs, and engage with your server community.


Prerequisites

Before you begin, make sure you have: - A NeuroGen account with an AI agent created - A Discord account - Admin access to a Discord server (for adding the bot)


Step 1: Create Your Application

  1. Go to the Discord Developer Portal

  2. Click "New Application" in the top right

  3. Enter a name for your application (e.g., "My AI Bot")

  4. Click "Create"


Step 2: Create the Bot

  1. In your application, click "Bot" in the left sidebar

  2. Click "Add Bot" and confirm with "Yes, do it!"

  3. Under the bot's username, click "Reset Token"

  4. Copy the token and save it somewhere safe

  5. You'll need this for NeuroGen
  6. Keep this token secret!

  7. Enable Message Content Intent (IMPORTANT!)

  8. Scroll down to "Privileged Gateway Intents"
  9. Toggle ON "Message Content Intent"
  10. This is required for the bot to read messages
  11. Click "Save Changes"

Step 3: Add Bot to Your Server

  1. In the left sidebar, click "Installation"

  2. Under "Install Link", select "Discord Provided Link"

  3. Under "Default Install Settings":

  4. Click "Guild Install"
  5. Under Scopes, add: bot
  6. Under Permissions, check:

    • Send Messages
    • Read Message History
    • View Channels
    • Add Reactions (optional)
    • Embed Links (optional)
  7. Copy the install link shown at the top of the page

  8. Open the link in your browser

  9. Select your server and click "Authorize"

Option B: Using OAuth2 URL Generator (Alternative)

  1. In the left sidebar, click "OAuth2" > "URL Generator"

  2. Under Scopes, check: bot

  3. Under Bot Permissions, check:

  4. Send Messages
  5. Read Message History
  6. View Channels

  7. Copy the Generated URL at the bottom

  8. Open it in your browser and authorize for your server


Step 4: Connect to NeuroGen

  1. Go to Dashboard > Integrations

  2. Click the Discord button

  3. Paste your bot token from Step 2

  4. Select an AI agent to power your bot

  5. Configure options:

  6. Respond to DMs: Bot will reply to direct messages
  7. Respond to Mentions: Bot will reply when @mentioned
  8. Allowed Channels: Restrict bot to specific channels (optional)

  9. Click Connect Discord Bot


Step 5: Start Using Your Bot

Mention the Bot

In any channel where the bot has access:

@YourBotName What's the weather like today?

Send a DM

Click on the bot in the server member list and send a direct message.


Bot Commands

Command Description
!help Show help information
!reset Clear conversation history

Features

Conversation Memory

The bot remembers context within each channel or DM conversation. Use !reset to clear history.

Channel Isolation

Conversations in different channels are kept separate, so the bot maintains appropriate context.

Rate Limiting

To prevent abuse: 10 messages per minute and 60 messages per hour per user.

Rich Responses

The bot can send formatted messages with embeds for better readability.


Troubleshooting

Bot Shows as Offline

Discord bots using webhooks may appear offline in the member list. This is normal - the bot will still respond to messages.

Bot Not Responding to Messages

  1. Check Message Content Intent
  2. Go to Discord Developer Portal > Your App > Bot
  3. Make sure "Message Content Intent" is enabled
  4. Save changes and wait a few minutes

  5. Check Permissions

  6. The bot needs "View Channel" and "Send Messages" permissions
  7. Right-click the channel > Edit Channel > Permissions
  8. Make sure the bot role has these permissions

  9. Check the Token

  10. If you regenerated the token, update it in NeuroGen

"Missing Permissions" Error

Re-invite the bot using the installation link with correct permissions selected.

Bot Not in Server

The bot needs to be invited to your server first. Use the installation link from Step 3.


Security Notes

  • Never share your bot token - Anyone with the token can control your bot
  • Bot tokens are encrypted when stored in NeuroGen
  • You can regenerate tokens in the Discord Developer Portal if compromised
  • Each server (guild) tracks usage separately

Managing Your Bot

Update Settings

Go to Dashboard > Integrations and click your Discord bot to: - Change the connected agent - Toggle DM/mention responses - Restrict to specific channels - View usage statistics

Disconnect Bot

Click Disconnect to stop the integration. The bot will remain in your server but won't respond.

Remove from Server

To remove the bot from a Discord server: 1. Go to Server Settings > Integrations 2. Find your bot and click "Remove"

Delete Application

To delete the bot entirely: 1. Go to Discord Developer Portal 2. Select your application 3. Go to Settings > Delete Application


Best Practices

  1. Set a clear bot name - Help users understand what the bot does
  2. Configure appropriate channels - Limit the bot to relevant channels
  3. Monitor usage - Check the integrations dashboard regularly
  4. Set expectations - Use the help command to explain capabilities

Next Steps


Need help? Contact support@neurogen.cc

Connecting