Automated Discord log archival website for wafer.space Discord server.
- 📦 Multi-format exports: HTML, TXT, JSON, CSV
- 🔄 Hourly updates: Automated via GitHub Actions
- 📅 Monthly archives: Organized by date with navigation
- 🔍 SEO-friendly: Static HTML indexed by search engines
- 🎨 Discord-themed UI: Familiar look and feel
- 📊 Message statistics: Counts and archive history
See Design Document for complete architecture.
Pipeline: Discord API → DiscordChatExporter → Python Scripts → GitHub Pages
- Go to https://discord.com/developers/applications
- Click "New Application", give it a name
- Go to "Bot" section, click "Add Bot"
- Enable "Message Content Intent" (required!)
- Copy bot token (keep secret!)
- Go to OAuth2 → URL Generator
- Select "bot" scope
- Under "Bot Permissions", select these checkboxes:
- ☑ View Channels (under "General Permissions")
- ☑ Read Message History (under "Text Permissions")
- Permissions code should show:
66560
- Open generated URL and invite bot to your server
-
Add GitHub Secret:
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
DISCORD_BOT_TOKEN - Value: (paste your bot token)
-
Update config.toml:
[servers.wafer-space] guild_id = "YOUR_GUILD_ID_HERE" # See step 3 below for how to get this channels = [ { name = "general", id = "YOUR_CHANNEL_ID" }, { name = "announcements", id = "YOUR_CHANNEL_ID" } ]
-
Get Server and Channel IDs:
First, enable Developer Mode in Discord:
- Open Discord User Settings (gear icon next to your username)
- Go to "App Settings" → "Advanced"
- Toggle on "Developer Mode"
Then copy the IDs:
- Server ID (guild_id): Right-click the server icon in the left sidebar → "Copy Server ID"
- Channel IDs: Right-click any channel name → "Copy Channel ID"
- Paste these IDs into your
config.tomlfile
Option A: GitHub Actions (recommended):
- Go to Actions tab
- Select "Export Discord Logs" workflow
- Click "Run workflow"
- Wait for completion (~10-30 minutes for full history)
Option B: Local testing:
# Install dependencies
uv pip install -r requirements.txt
# Download DiscordChatExporter
wget https://github.com/Tyrrrz/DiscordChatExporter/releases/latest/download/DiscordChatExporter.Cli.linux-x64.zip
unzip DiscordChatExporter.Cli.linux-x64.zip
chmod +x DiscordChatExporter.Cli
# Set token
export DISCORD_BOT_TOKEN="your_token_here"
# Run export
uv run python scripts/export_channels.py
# Generate navigation
uv run python scripts/generate_navigation.py
# Preview locally
python -m http.server --directory public 8000
# Visit http://localhost:8000- Go to repository Settings → Pages
- Source: "Deploy from a branch"
- Branch:
gh-pages/root - Save
- Optional: Add custom domain
discord.wafer.space
- Check Actions tab for successful runs
- Visit your GitHub Pages URL
- Verify channels are listed
- Check that archives load correctly
- ✅ None! Fully automated via GitHub Actions
- Check Actions tab for any failed runs
- Review error logs if exports fail
- Review disk usage (exports grow over time)
- Verify all channels exporting correctly
Empty exports / No messages:
- Verify "Message Content Intent" is enabled in bot settings
- Check bot has "Read Message History" permission
- Confirm bot is in the server
Export fails with 403 Forbidden:
- Bot lacks channel access permissions
- Add bot role to channel permissions
Workflow fails:
- Check
DISCORD_BOT_TOKENsecret is set correctly - Review workflow logs in Actions tab
- Verify token hasn't been reset/revoked
Navigation not updating:
- Ensure
generate_navigation.pyruns after export - Check public/ directory has exported files
- Verify Jinja2 templates exist in templates/
discord-wafer-space/
├── .github/workflows/ # GitHub Actions automation
├── scripts/ # Python export and navigation scripts
├── templates/ # Jinja2 HTML templates
├── public/ # Generated static site (deployed)
├── exports/ # Temporary export storage (gitignored)
├── tests/ # pytest test suite
├── config.toml # Configuration
├── state.json # Export state tracking
└── requirements.txt # Python dependencies
Run tests:
uv run pytest tests/ -vType checking (future):
uv run mypy scripts/Code formatting (future):
uv run black scripts/ tests/MIT License - See LICENSE file
- Built with DiscordChatExporter by Tyrrrz
- Hosted on GitHub Pages
- Automated with GitHub Actions