The Discord Exporter Bot is configured entirely through environment variables. Create aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/trustlessmatt/discord-exporter-bot/llms.txt
Use this file to discover all available pages before exploring further.
.env file in your project root based on .env.example.
Required Variables
These variables must be set for the bot to function.Your Discord bot token for authentication.Where to get it:
- Go to the Discord Developer Portal
- Create a new application or select an existing one
- Navigate to the “Bot” section
- Click “Reset Token” to generate a new token
- Copy the token immediately (it won’t be shown again)
The Discord server (guild) ID where the bot will operate.Where to get it:
- Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode)
- Right-click on your server icon
- Select “Copy Server ID”
Optional Variables
These variables enable additional features but are not required for basic export functionality.Anthropic API key for Claude AI-powered digest generation.What it enables:
- The
!digestcommand for AI-generated summaries - Automatic daily digest generation at midnight ET
- Smart analysis of team conversations, extracting updates, blockers, and action items
- Sign up at Anthropic Console
- Navigate to API Keys
- Create a new API key
claude-haiku-4-5-20251001 (configured in bot.py:31)Token limit: 4096 tokens per digest (configured in bot.py:32)Without this key, only the
!export command will work. The !digest command will fail with “ANTHROPIC_API_KEY not set” (bot.py:290).Path to a Dokploy volume mount for persistent digest storage.What it enables:Directory structure:
- Saves daily digests to a persistent volume that survives container restarts
- Useful for Dokploy deployments where local storage is ephemeral
{DOKPLOY_VOLUME_PATH}/Daily Digests/. If not found, falls back to local ./Daily Digests/ directory.GitHub repository URL for automatic digest backup and version control.What it enables:Requirements:
- Automatic git commits and pushes after each digest is generated
- Version history of all team digests
- Easy sharing and access to digest archive
- Must be used with
GITHUB_TOKEN - Repository must already exist (bot doesn’t create repos)
- Bot will clone the repo on first run (bot.py:429-454)
- On subsequent runs, bot pulls latest changes before committing (bot.py:407-427)
GitHub Personal Access Token (PAT) for repository authentication.What it enables:How it’s used:
The bot constructs authenticated URLs by inserting the token (bot.py:435-438, 535-538):Security Note: This token grants access to your repositories. Never commit it to version control.
- Authenticates bot to push commits to your digest repository
- Required for
GITHUB_REPO_URLto work
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click “Generate new token (classic)”
- Give it a descriptive name (e.g., “Discord Bot Digest Sync”)
- Set expiration (or “No expiration” for convenience)
- Select scopes:
- ✅
repo(Full control of private repositories)
- ✅
- Click “Generate token” and copy it immediately
Configuration Object
The bot loads these environment variables into aConfig dataclass (bot.py:21-61) with additional defaults:
Example Configuration
Validation
The bot validates required variables on startup (bot.py:49-52):Feature Matrix
| Feature | Required Variables | Optional Variables |
|---|---|---|
Message Export (!export) | DISCORD_TOKEN, GUILD_ID | - |
AI Digests (!digest) | DISCORD_TOKEN, GUILD_ID, ANTHROPIC_API_KEY | - |
| Scheduled Daily Digests | DISCORD_TOKEN, GUILD_ID, ANTHROPIC_API_KEY | - |
| Persistent Storage | DISCORD_TOKEN, GUILD_ID | DOKPLOY_VOLUME_PATH |
| GitHub Backup | DISCORD_TOKEN, GUILD_ID | GITHUB_REPO_URL, GITHUB_TOKEN |
| Full Stack | DISCORD_TOKEN, GUILD_ID, ANTHROPIC_API_KEY | DOKPLOY_VOLUME_PATH, GITHUB_REPO_URL, GITHUB_TOKEN |