Skip to content

Conversation

@brzvsk
Copy link

@brzvsk brzvsk commented Sep 12, 2025

This PR adds support for parsing Telegram Desktop data exports (all chats) in addition to the existing single-chat export support. Both formats are automatically detected and processed with full backward compatibility.

Changes

Core Implementation

  • Automatic format detection: Examines the first 2MB of files to detect single-chat vs multi-chat exports
  • Extended TypeScript definitions for multi-chat export structure
  • Unified processing using shared parseChatObject() method for consistent behavior
  • Streaming support: Efficiently processes large multi-chat exports (tested with 300+ MB files)

Testing

  • Added comprehensive test suite for multi-chat format
  • All existing tests continue to pass (backward compatibility verified)
  • Tested with real data exports containing 2000+ chats

Documentation

  • Updated README.md with information about both export types
  • Added CLI usage notes for Telegram exports
  • Updated CHANGELOG.md

Testing Results

  • Single-chat export: Successfully parsed 29.8 MB file
  • Multi-chat export: Successfully processed 2236 chats from 303 MB file
  • All existing parser tests pass
  • New multi-chat tests pass
  • TypeScript compilation successful

Backward Compatibility

This change is fully backward compatible. Existing single-chat exports continue to work exactly as before with no changes required from users.

- Add automatic format detection for both single-chat and data exports
- Extend TypeScript definitions for multi-chat export structure
- Implement parseChatObject method for unified chat processing
- Add comprehensive tests for multi-chat format
- Update documentation and README with usage information
- Maintain full backward compatibility with existing single-chat exports

Closes: Support for parsing Telegram Desktop data exports (all chats)
in addition to single-chat exports. Both formats are automatically
detected and processed consistently.
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