Documentation 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.
Installation Guide
This guide covers everything you need to install and configure the Discord Exporter Bot, including Discord bot setup, Python installation, Docker deployment, and environment configuration.Setting Up Your Discord Bot
Create a Discord Application
- Go to the Discord Developer Portal
- Click New Application
- Give your application a name (e.g., “Team Exporter Bot”)
- Click Create
Create a Bot User
- In your application, navigate to the Bot tab in the left sidebar
- Click Add Bot and confirm
- Under the bot’s username, click Reset Token to generate a new token
- Copy this token - you’ll need it for your
.envfile
Enable Required Intents
Scroll down to Privileged Gateway Intents and enable:
- ✅ Message Content Intent (required to read message contents)
- ✅ Server Members Intent (required for member information)
Invite the Bot to Your Server
- Navigate to the OAuth2 → URL Generator tab
- Under Scopes, select:
bot
- Under Bot Permissions, select:
Read Messages/View ChannelsRead Message HistorySend Messages
- Copy the generated URL at the bottom
- Open the URL in your browser and select your server
- Click Authorize
Python Installation
Requirements
- Python 3.11 or higher (required for
zoneinfosupport) - pip (Python package installer)
Installing Python
- macOS
- Linux
- Windows
Using Homebrew:Verify installation:
Setting Up the Project
Add bot.py and requirements.txt
Copy the
bot.py file into your project directory.Create requirements.txt with the following dependencies:requirements.txt
Environment Configuration
Creating Your .env File
Create a.env file in your project directory. Use this template based on .env.example:
.env
Environment Variables Reference
Your Discord bot token from the Developer Portal.How to get it: Bot tab → Reset Token → Copy
Your Discord server’s ID.How to get it: Enable Developer Mode → Right-click server → Copy Server ID
Your Anthropic API key for Claude AI digests.How to get it: Sign up at console.anthropic.com and create an API keyNote: The bot will run without this, but
!digest command won’t work.Custom path for digest output. Useful for saving directly to an Obsidian vault.Default: Saves to
./Daily Digests/ in the project directoryExample: /Users/yourname/Documents/Obsidian/TeamVaultGitHub repository URL for auto-syncing digests.Format:
https://github.com/username/repository.gitRequires: GITHUB_TOKEN must also be setGitHub personal access token with
repo scope.How to get it: GitHub Settings → Developer settings → Personal access tokens → Generate new token (classic) → Select repo scopeNote: The bot will commit digests with author “Discord Bot <bot@discord.local>”Getting an Anthropic API Key
Sign up for Anthropic
Visit console.anthropic.com and create an account.
Docker Installation
For production deployments, Docker provides a clean, isolated environment.Dockerfile
The bot includes a Dockerfile:Dockerfile
Building and Running
Run the container
- Runs the container in detached mode (
-d) - Names the container
discord-bot - Loads environment variables from
.env - Mounts volumes for exports and digests (persists data outside container)
Docker Compose (Optional)
For easier management, create adocker-compose.yml:
docker-compose.yml
Verification Steps
After installation, verify everything is working:Test export command
In a Discord channel, type:Expected response:Check that the JSON file was created in the
exports/ directory.Test digest command (if using Claude)
In a Discord channel, type:Expected response:Check that the Markdown file was created in the
Daily Digests/ directory (or your custom DOKPLOY_VOLUME_PATH).Verify GitHub sync (if configured)
If you set up GitHub sync, after running
!digest, check your GitHub repository to see if the commit was pushed:- Go to your GitHub repository
- Look for a commit with message “Daily digest for YYYY-MM-DD”
- Verify the digest file is in the repository
Troubleshooting
Bot doesn't connect to Discord
Bot doesn't connect to Discord
Symptoms: No log messages, or “Invalid token” errorSolutions:
- Verify your
DISCORD_TOKENis correct in.env - Make sure you copied the token immediately after generating it (they’re only shown once)
- Reset the token in Discord Developer Portal if needed
- Check that
.envfile is in the same directory asbot.py
Bot connects but doesn't respond to commands
Bot connects but doesn't respond to commands
Symptoms: Bot is online, but
!export and !digest do nothingSolutions:- Verify Message Content Intent is enabled in Discord Developer Portal
- Make sure the bot has permissions to read and send messages in the channel
- Check that you’re using the correct command prefix (
!) - Look for permission errors in the logs
Export works but digest fails
Export works but digest fails
Symptoms:
!export succeeds but !digest returns an errorSolutions:- Verify
ANTHROPIC_API_KEYis set in.env - Check that your Anthropic account has available credits
- Test your API key with a simple curl request
- Look for Claude API errors in the logs
GitHub sync not working
GitHub sync not working
Symptoms: Digest generates but doesn’t appear in GitHubSolutions:
- Verify both
GITHUB_REPO_URLandGITHUB_TOKENare set - Check that your token has
reposcope - Ensure the repository exists and you have push access
- Look for git errors in the logs
- Make sure
gitis installed (required for GitHub sync)
Missing message content or mentions show as IDs
Missing message content or mentions show as IDs
Symptoms: Export JSON shows empty content or unresolved mentions like
<@123456>Solutions:- Enable Message Content Intent in Discord Developer Portal (required)
- Enable Server Members Intent for proper member name resolution
- Restart the bot after enabling intents
Next Steps
Configuration
Learn about environment variables and configuration options
Commands
Explore available commands and features
GitHub Integration
Set up GitHub sync and Obsidian integration
Usage Guide
Learn all commands and features
Integration
Connect with Obsidian and workflows