Skip to content

Conversation

@jmjava
Copy link
Owner

@jmjava jmjava commented Jan 25, 2026

Summary

This PR adds Discord message export and summarization functionality with comprehensive test coverage.

Features Added

Discord Sync Tool (discord-sync/)

  • Main script: sync-discord.sh - Exports and summarizes Discord messages
  • Filtering options:
    • Date range (--after, --before)
    • Username filtering (--username, supports multiple)
    • Topic/keyword filtering (--topic, supports multiple)
  • Output formats: JSON (default), TXT, HTML
  • Automatic summaries: Statistics, top contributors, recent messages, topic analysis
  • Uses Docker: Leverages tyrrrz/discordchatexporter for exports

Documentation

  • Comprehensive README with usage examples
  • Token generation instructions (user token method for regular users)
  • Troubleshooting guide

Tests

  • 32 new tests for Discord sync functionality
  • Fixed 4 pre-existing test failures:
    • test-config-loader.sh: Proper TEST_UPSTREAM_ORG handling
    • test-safety-checks.sh: Use config system instead of hardcoding
  • All 51 tests now passing

Test Architecture

  • Added test/ARCHITECTURE.md to prevent hardcoding values
  • Documents proper use of configuration system
  • Explains TEST_UPSTREAM_ORG usage

Configuration

  • Updated .env-template with Discord token documentation
  • Updated .gitignore to exclude exports/discord/

Testing

All tests pass:

  • test-config-loader.sh: 13/13 ✅
  • test-safety-checks.sh: 6/6 ✅
  • test-sync-discord.sh: 32/32 ✅

Total: 51/51 tests passing

- Add discord-sync/ folder with sync-discord.sh script
  - Supports date range filtering (--after, --before)
  - Supports username filtering (--username, multiple)
  - Supports topic/keyword filtering (--topic, multiple)
  - Multiple output formats (json, txt, html)
  - Automatic summary generation with statistics
  - Uses Docker (tyrrrz/discordchatexporter) for exports

- Add comprehensive test suite (32 tests)
  - Argument parsing and validation
  - Path resolution
  - Error handling
  - Filename generation
  - Date normalization
  - Config integration

- Fix existing test failures
  - test-config-loader.sh: Fix TEST_UPSTREAM_ORG handling
  - test-safety-checks.sh: Use config system instead of hardcoding

- Add test architecture documentation
  - ARCHITECTURE.md explains how to write tests properly
  - Prevents hardcoding values
  - Documents TEST_UPSTREAM_ORG usage

- Update .env-template with Discord token configuration
- Update .gitignore to exclude exports/discord/
- Update test framework to fix duplicate summary issue

All 51 tests passing
@jmjava jmjava merged commit b70ddf8 into master Jan 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant