Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Discord Digest Generator - Unified Version

A clean, consolidated toolkit for analyzing Discord message exports and generating beautiful summaries.

πŸ“¦ What's Included

  • discord_digest.py - Main generator module (consolidates all functionality)
  • generate_all_digests.sh - Batch script for processing all users
  • github_actions_workflow.yml - CI/CD workflow for automation
  • requirements.txt - Python dependencies (stdlib only!)
  • README.md - This file

⚑ Quick Start

1. Get Discord Exports

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"

2. Generate Digests

For a single user:

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --output ./outputs \
  --all

For all default users (dirvine., forthebux, JimCollinson):

chmod +x generate_all_digests.sh
./generate_all_digests.sh discord_exports outputs

3. View Results

Open 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.html

πŸ“‹ Usage Examples

Generate Complete Archive Only

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --complete

Generate Weekly Summary Only

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --weekly

Generate Fortnightly Summary Only

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --fortnightly

Custom Time Range (30 days)

Modify the script or use the base code to add a --days parameter if needed.

Generate Only Markdown (No HTML/JSON)

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --formats md \
  --all

Specify Custom Output Directory

python3 discord_digest.py \
  --exports ./discord_exports \
  --username "dirvine." \
  --output /path/to/custom/dir \
  --all

πŸ“Š Output Files

For 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)

🎨 HTML Output Features

  • ✨ 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)

πŸ€– GitHub Actions Setup

To automate digest generation every week:

  1. Copy the workflow file:
   mkdir -p .github/workflows
   cp github_actions_workflow.yml .github/workflows/digest.yml
  1. Update channel IDs in the workflow file (lines ~43-55)

  2. Add GitHub Secret:

    • Go to Settings β†’ Secrets and variables β†’ Actions
    • Create DISCORD_BOT_TOKEN with your token
    • The token must have access to export messages
  3. Commit and push:

   git add .github/workflows/digest.yml
   git commit -m "Add Discord digest automation"
   git push
  1. Run manually from Actions tab to test, or it will run automatically every Sunday at 22:00 UTC

πŸ“ Output Format Details

Markdown (.md)

  • Human-readable plain text
  • Perfect for documentation
  • Easy to version control
  • Works on GitHub, GitLab, etc.

HTML (.html)

  • Beautiful visual presentation
  • Styled like Discord dark mode
  • Mobile responsive
  • Click links to jump to Discord
  • Open directly in browser

JSON (.json)

  • Machine-readable structured data
  • Perfect for:
    • Feeding to LLMs/AI
    • Data science analysis
    • Custom processing
    • Database imports
  • Includes full metadata and timestamps

πŸ”§ Troubleshooting

"No JSON files found"

  • Check exports directory path
  • Verify files were exported with JSON format (not HTML/TXT)
  • Try: ls -la ./discord_exports/

"No messages found for user"

  • 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."

Permission denied on .sh file

chmod +x generate_all_digests.sh

Python not found

# Check Python is installed
python3 --version

# On some systems, use `python` instead of `python3`
python discord_digest.py --help

πŸ“¦ Python Dependencies

Zero external dependencies! Uses only Python standard library:

  • json - JSON parsing
  • pathlib - File operations
  • datetime - Date/time handling
  • collections - Data structures
  • argparse - Command-line arguments
  • html - HTML escaping

Just need Python 3.8+

🎯 Advanced: Adding More Users

Edit generate_all_digests.sh:

USERS=("dirvine." "forthebux" "JimCollinson" "NewUser")

Then run:

./generate_all_digests.sh discord_exports outputs

πŸ“ˆ Performance

  • 1,000 messages: <1 second
  • 10,000 messages: ~2 seconds
  • 100,000 messages: ~5 seconds

HTML generation is fast even with thousands of messages.

πŸ” Security Notes

  • 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)

πŸš€ Next Steps

  1. βœ… Export your Discord channels
  2. βœ… Run generate_all_digests.sh locally
  3. βœ… View the HTML files in your browser
  4. βœ… Set up GitHub Actions for automation
  5. πŸ”œ (Future) Deploy to Autonomi network with Tauri/Svelte UI

πŸ“– File Structure

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)

πŸ’‘ Tips

  • Incremental updates: Re-run exports on the same directory to update with new messages
  • Batch processing: Use generate_all_digests.sh for all users at once
  • Scheduling: Set up cron job or use GitHub Actions
  • Large servers: Export channels individually to avoid timeout

🀝 Contributing

Found a bug? Want to suggest a feature?

  • Check existing issues
  • Describe the problem clearly
  • Include output/error messages
  • Suggest a fix if possible

πŸ“„ License

MIT License - See LICENSE file for details


Made with ❀️ for the Autonomi community

Questions? Issues? Open an issue or check QUICK_REFERENCE.md

About

A Python tool for analyzing Discord message exports to track user activity and interactions in the Autonomi community and beyond

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages