Prerequisites
Before you start, make sure you have the following installed and available:Node.js 22+
Volvox.Bot requires Node.js 22 or later.
pnpm
Install with
npm install -g pnpm.PostgreSQL 17+
Required for all bot state and configuration.
Redis 7+
Recommended for caching, rate limiting, and session storage. The bot runs without it but performance degrades.
Anthropic API key
Required for all AI features (chat, moderation, triage).
Discord application
A Discord bot token and application with the correct intents enabled.
Step-by-step setup
Clone and install
Clone the repository and install all dependencies:The repository is a pnpm workspace that includes both the bot (
/) and the web dashboard (web/).Configure environment variables
Copy the example environment file and fill in your values:Open See the environment variables reference below for all options.
.env in your editor. At minimum, set the three required variables:Configure the bot
Edit
config.json in the repository root to match your Discord server. Key sections include:ai— AI chat settings, feedback, and channel blocklistaiAutoMod— Auto-moderation thresholds and actionstriage— Message triage and daily budgetwelcome— Welcome messages with template variablesmoderation— Moderation features and protected rolesbackup— Auto-backup schedule and retentionperformance— Monitoring thresholds and alerting
config.json at runtime via the /config slash command or the web dashboard.Set up your Discord bot
- Go to the Discord Developer Portal and create a new application.
- Navigate to Bot → Add Bot and copy the token into
DISCORD_TOKEN. - Under Privileged Gateway Intents, enable all four:
- Message Content Intent
- Server Members Intent
- Guild Voice States Intent (for voice tracking)
- Guild Message Reactions Intent (for reaction roles and AI feedback)
- Navigate to OAuth2 → URL Generator and select these scopes:
bot,applications.commands. - Under Bot Permissions, select at minimum:
- View Channels
- Send Messages
- Read Message History
- Manage Messages
- Add Reactions
- Manage Roles
- Copy the generated URL and use it to invite the bot to your server.
- Copy the Client ID from OAuth2 → General into
DISCORD_CLIENT_ID.
Run database migrations
Apply all pending schema migrations:This runs
node-pg-migrate up against the DATABASE_URL in your .env. The bot also runs migrations automatically on startup, so this step is optional but recommended to verify your database connection before starting.See the database guide for details on all migrations and rollback procedures.Deploy slash commands
Register all slash commands with Discord:This pushes commands globally. For development, you can scope deployment to a single guild for instant propagation:
Global command registration can take up to one hour to propagate across all Discord clients. Guild-scoped commands are available immediately.
Environment variables
Required
| Variable | Description |
|---|---|
DISCORD_TOKEN | Discord bot token from the Developer Portal |
DISCORD_CLIENT_ID | Discord application/client ID for slash command deployment |
ANTHROPIC_API_KEY | Anthropic API key for Claude (AI chat, moderation, triage) |
DATABASE_URL | PostgreSQL connection string, e.g. postgresql://user:pass@host:5432/dbname |
Recommended
| Variable | Description | Default |
|---|---|---|
REDIS_URL | Redis connection string for caching and rate limiting | (disabled) |
SESSION_SECRET | Secret for JWT signing — generate with openssl rand -base64 32 | (required for OAuth2) |
Web dashboard
| Variable | Description |
|---|---|
NEXTAUTH_URL | The canonical URL of the dashboard, e.g. http://localhost:3000 |
NEXTAUTH_SECRET | JWT encryption secret — generate with openssl rand -base64 32 |
DISCORD_CLIENT_SECRET | Discord OAuth2 client secret |
DISCORD_REDIRECT_URI | Discord OAuth2 redirect URI, e.g. http://localhost:3001/api/v1/auth/discord/callback |
BOT_API_SECRET | Shared secret for bot ↔ dashboard API authentication |
BOT_API_URL | URL the dashboard uses to reach the bot API, e.g. http://localhost:3001 |
DASHBOARD_URL | URL of the dashboard for CORS origin, e.g. http://localhost:3000 |
NEXT_PUBLIC_DISCORD_CLIENT_ID | Discord client ID exposed to the browser |
Optional
| Variable | Description | Default |
|---|---|---|
BOT_API_PORT | Port for the bot’s REST API | 3001 |
BOT_OWNER_IDS | Comma-separated Discord user IDs that bypass all permission checks | (from config.json) |
PG_POOL_SIZE | PostgreSQL connection pool size | 5 |
DATABASE_SSL | SSL mode: false, no-verify, or true | Auto-detected |
MEM0_API_KEY | mem0 API key for long-term user memory (optional feature) | (disabled) |
WEBHOOK_SECRET | HMAC signing secret for outbound webhook notifications | (disabled) |
SENTRY_DSN | Sentry DSN for error tracking | (disabled) |
LOG_LEVEL | Logging level: debug, info, warn, error | info |
Running in production
Start the bot with:node src/index.js directly. For production deployments, consider using a process manager like PM2 to handle restarts and log rotation:
Running the web dashboard
The web dashboard is a separate Next.js application in theweb/ directory. It requires its own environment variables in addition to the root .env.