The Discord Exporter Bot can automatically commit and push daily digests to a GitHub repository, providing version control, backup, and easy sharing of your team’s activity summaries.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.
Overview
When GitHub integration is enabled, the bot:- Clones your repository on first run (bot.py:429-454)
- Pulls latest changes before each digest (bot.py:407-427)
- Commits each new digest with a descriptive message (bot.py:526-532)
- Pushes to the
mainbranch automatically (bot.py:540-545)
GitHub integration is optional. Without it, digests are only saved locally.
Prerequisites
Create a GitHub repository
Create a new repository to store your digests:
- Go to github.com/new
- Choose a repository name (e.g.,
team-discord-digests) - Set to Private (recommended for team data)
- Important: Initialize with a README or make an initial commit
- Click “Create repository”
Generate a Personal Access Token
Create a token with repository access:
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click “Generate new token (classic)”
- Configure the token:
- Note:
Discord Bot Digest Sync - Expiration: Choose based on your security policy
- Scopes: Select
repo(Full control of private repositories)
- Note:
- Click “Generate token”
- Copy the token immediately - you won’t be able to see it again
The token must have
repo scope to clone private repositories and push commits.Configuration
Full HTTPS URL to your GitHub repository.Format:Examples:
Personal Access Token for authentication.Format:
ghp_ followed by 36 alphanumeric charactersSecurity best practices:- Never commit this token to version control
- Use a token with minimal required permissions (
reposcope only) - Set an expiration date and rotate tokens regularly
- Use different tokens for different bots/services
How It Works
First Run: Repository Clone
When the bot runs for the first time with GitHub configured, it clones your repository (bot.py:429-494):- Bot checks if
.gitdirectory exists - If not, creates output directory (e.g.,
/app/data/Daily Digests) - Clones repository into that directory
- Logs:
"Git repo cloned successfully"
Subsequent Runs: Pull Latest Changes
Before creating each digest, the bot pulls updates (bot.py:407-427):Commit and Push: Saving Digests
After generating a digest, the bot commits and pushes (bot.py:497-552):- Author: Discord Bot
<bot@discord.local> - Message format:
Daily digest for YYYY-MM-DD - Branch:
main
Repository Structure
Your GitHub repository will be organized like this:YYYY-MM-DD - Team Digest.md (bot.py:387)
Directory name: Daily Digests (configurable via config.digests_dir)
Example Digest File
Each digest is a fully-formatted Markdown file with frontmatter:2026-03-04 - Team Digest.md
- YAML frontmatter for metadata
- Structured sections (Updates, Blockers, Decisions, etc.)
- Activity statistics
- Obsidian-style wiki links to previous/next days
- Timestamp of generation
Git Configuration
The bot automatically configures git with these settings (bot.py:506-516):- Identifies commits as bot-generated
- Prevents conflicts with your personal git config
- No GitHub account required for this email
git_commit_and_push() function in bot.py:
Troubleshooting
Authentication Fails
Error:fatal: Authentication failed for 'https://github.com/...'
Causes:
- Invalid or expired token
- Token lacks
reposcope - Token hasn’t been copied correctly (missing characters)
- Go to GitHub tokens page
- Delete old token
- Create new token with
reposcope - Update
.envfile - Restart bot
Repository Not Found
Error:fatal: repository 'https://github.com/...' not found
Causes:
- Repository doesn’t exist
- URL is misspelled
- Token doesn’t have access to private repository
Push Rejected
Error:error: failed to push some refs to 'https://github.com/...'
Causes:
- Remote has commits that local doesn’t have
- Branch protection rules prevent push
Clone Fails (Directory Not Empty)
Error:fatal: destination path '...' already exists and is not an empty directory
Solution:
The bot has fallback logic (bot.py:460-494), but if it still fails:
Git Not Installed
Error:git: command not found
Solution:
This should never happen with the provided Dockerfile (includes git installation), but if you’re running without Docker:
Viewing Digests on GitHub
Web Interface
Navigate to your repository:https://github.com/username/repo
GitHub will render Markdown files beautifully:
- Click any
YYYY-MM-DD - Team Digest.mdfile - View formatted content with headings, lists, and links
- See commit history for each file
Commit History
View all digest commits:- Date: When the digest was created
- Message:
Daily digest for YYYY-MM-DD - Author: Discord Bot
- Files changed: 1 file (the digest)
Clone Locally
Clone the repository to view digests offline:Advanced: Multiple Bots
If you run multiple Discord bots for different servers, you can:Option 1: Different Repositories
Each bot pushes to its own repository:Option 2: Different Branches
All bots push to the same repository but different branches: Limitation: Current implementation hardcodesmain branch (bot.py:486, 541). You’d need to modify the code:
.env:
Option 3: Subdirectories
Customizedigests_dir to organize by team:
Best Practices
Use a dedicated repository
Use a dedicated repository
Create a separate repository just for digests rather than mixing with code. This makes it easier to share access with team leads without exposing source code.
Set repository to Private
Set repository to Private
Discord conversations may contain sensitive information. Always use a private repository unless your team explicitly approves public sharing.
Rotate tokens regularly
Rotate tokens regularly
Set token expiration to 90 days and create calendar reminders to rotate before expiry.
Add a README to your digest repo
Add a README to your digest repo
Explain what the repository contains and how digests are generated:
Grant appropriate access
Grant appropriate access
Give team leads and managers Read access to the repository so they can review digests without being in Discord.
Monitor repository size
Monitor repository size
Each digest is ~2-10 KB. At 365 days/year:
- 1 year: ~1-4 MB
- 5 years: ~5-20 MB
Integration with Other Tools
Obsidian
The digests are formatted for Obsidian with:- YAML frontmatter
- Wiki-style internal links
- Daily note structure
Notion
Import digests to Notion:- Use Notion’s “Import” feature
- Select “Markdown & CSV”
- Upload digest files
- Notion will preserve formatting and frontmatter
Slack/Email Notifications
Use GitHub Actions to notify on new commits:.github/workflows/notify.yml
Disabling GitHub Integration
To disable GitHub sync:-
Remove from
.env: -
Or set to empty:
-
Restart bot:
/app/digests/ but won’t be pushed to GitHub.
Bot logs will show: