A clean, consolidated toolkit for analyzing Discord message exports and generating beautiful summaries.
discord_digest.py- Main generator module (consolidates all functionality)generate_all_digests.sh- Batch script for processing all usersgithub_actions_workflow.yml- CI/CD workflow for automationrequirements.txt- Python dependencies (stdlib only!)README.md- This file
First, export your Discord channels using DiscordChatExporter:
# Download DiscordChatExporter
wget https://github.com/Tyrrrz/DiscordChatExporter/releases/latest/download/DiscordChatExporter.Cli.linux-x64.zip
unzip DiscordChatExporter.Cli.linux-x64.zip -d discord-exporter
chmod +x discord-exporter/DiscordChatExporter.Cli
# Export a channel
./discord-exporter/DiscordChatExporter.Cli export \
-t "YOUR_DISCORD_TOKEN" \
-c "CHANNEL_ID" \
-f Json \
-o "discord_exports/channel.json"For a single user:
python3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--output ./outputs \
--allFor all default users (dirvine., forthebux, JimCollinson):
chmod +x generate_all_digests.sh
./generate_all_digests.sh discord_exports outputsOpen the HTML files in your browser:
# macOS
open outputs/dirvine__complete_archive.html
# Linux
xdg-open outputs/dirvine__complete_archive.html
# Windows
start outputs\dirvine__complete_archive.htmlpython3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--completepython3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--weeklypython3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--fortnightlyModify the script or use the base code to add a --days parameter if needed.
python3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--formats md \
--allpython3 discord_digest.py \
--exports ./discord_exports \
--username "dirvine." \
--output /path/to/custom/dir \
--allFor each user, you get:
outputs/
βββ dirvine__complete_archive.md # All messages - markdown
βββ dirvine__complete_archive.html # All messages - HTML (beautiful!)
βββ dirvine__complete_archive.json # All messages - JSON (for AI)
βββ dirvine__weekly_digest.md # Last 7 days - markdown
βββ dirvine__weekly_digest.html # Last 7 days - HTML
βββ dirvine__weekly_digest.json # Last 7 days - JSON
βββ dirvine__fortnightly_digest.md # Last 14 days - markdown
βββ dirvine__fortnightly_digest.html # Last 14 days - HTML
βββ dirvine__fortnightly_digest.json # Last 14 days - JSON
βββ forthebux__complete_archive.md # And same for other users...
βββ JimCollinson__complete_archive.md
βββ ... (more files)
- β¨ Discord-style dark theme
- π Messages grouped by date
- π¬ Quote boxes showing conversation context
- π Clickable links to original Discord messages
- π± Responsive design (mobile-friendly)
- β‘ Fast loading even with thousands of messages
- π― Color-coded message types (posts vs replies)
To automate digest generation every week:
- Copy the workflow file:
mkdir -p .github/workflows
cp github_actions_workflow.yml .github/workflows/digest.yml-
Update channel IDs in the workflow file (lines ~43-55)
-
Add GitHub Secret:
- Go to Settings β Secrets and variables β Actions
- Create
DISCORD_BOT_TOKENwith your token - The token must have access to export messages
-
Commit and push:
git add .github/workflows/digest.yml
git commit -m "Add Discord digest automation"
git push- Run manually from Actions tab to test, or it will run automatically every Sunday at 22:00 UTC
- Human-readable plain text
- Perfect for documentation
- Easy to version control
- Works on GitHub, GitLab, etc.
- Beautiful visual presentation
- Styled like Discord dark mode
- Mobile responsive
- Click links to jump to Discord
- Open directly in browser
- Machine-readable structured data
- Perfect for:
- Feeding to LLMs/AI
- Data science analysis
- Custom processing
- Database imports
- Includes full metadata and timestamps
- Check exports directory path
- Verify files were exported with JSON format (not HTML/TXT)
- Try:
ls -la ./discord_exports/
- Check username spelling (case-sensitive during comparison, but accepts both)
- Verify user has messages in exported channels
- Try username without period if it fails:
"dirvine"instead of"dirvine."
chmod +x generate_all_digests.sh# Check Python is installed
python3 --version
# On some systems, use `python` instead of `python3`
python discord_digest.py --helpZero external dependencies! Uses only Python standard library:
json- JSON parsingpathlib- File operationsdatetime- Date/time handlingcollections- Data structuresargparse- Command-line argumentshtml- HTML escaping
Just need Python 3.8+
Edit generate_all_digests.sh:
USERS=("dirvine." "forthebux" "JimCollinson" "NewUser")Then run:
./generate_all_digests.sh discord_exports outputs- 1,000 messages: <1 second
- 10,000 messages: ~2 seconds
- 100,000 messages: ~5 seconds
HTML generation is fast even with thousands of messages.
- Never commit Discord tokens to git
- Use GitHub Secrets for automation
- Tokens should have minimal required permissions
- Consider using a bot account for exports
- Keep export files private (they contain message history)
- β Export your Discord channels
- β
Run
generate_all_digests.shlocally - β View the HTML files in your browser
- β Set up GitHub Actions for automation
- π (Future) Deploy to Autonomi network with Tauri/Svelte UI
project/
βββ discord_digest.py # Main module
βββ generate_all_digests.sh # Batch script
βββ github_actions_workflow.yml # CI/CD config
βββ requirements.txt # Dependencies
βββ README.md # This file
βββ discord_exports/ # Your exported JSONs
β βββ general-chat.json
β βββ general-support.json
β βββ bug-reports.json
β βββ hot-topics.json
βββ outputs/ # Generated files
βββ dirvine__complete_archive.html
βββ dirvine__weekly_digest.md
βββ forthebux__complete_archive.json
βββ ... (more files)
- Incremental updates: Re-run exports on the same directory to update with new messages
- Batch processing: Use
generate_all_digests.shfor all users at once - Scheduling: Set up cron job or use GitHub Actions
- Large servers: Export channels individually to avoid timeout
Found a bug? Want to suggest a feature?
- Check existing issues
- Describe the problem clearly
- Include output/error messages
- Suggest a fix if possible
MIT License - See LICENSE file for details
Made with β€οΈ for the Autonomi community
Questions? Issues? Open an issue or check QUICK_REFERENCE.md