Skip to content

feat: add Telegram chat history support - #23

Open
tazhate wants to merge 1 commit into
titanwings:masterfrom
tazhate:feat/telegram-support
Open

feat: add Telegram chat history support#23
tazhate wants to merge 1 commit into
titanwings:masterfrom
tazhate:feat/telegram-support

Conversation

@tazhate

@tazhate tazhate commented Apr 28, 2026

Copy link
Copy Markdown

Summary

  • Add tools/telegram_parser.py — parser for Telegram Desktop JSON exports
  • Update SKILL.md to add Telegram as method C in the Step 2 data import flow
  • Update README_EN.md and README_RU.md data source tables and file tree

How it works

Export from Telegram Desktop:

  1. Open the chat → top-right menu → Export chat history → format: JSON
  2. Provide the path to result.json

Auto-detection: personal chats automatically identify the contact from the chat name. Group chats require --target "Name".

CLI usage:

# Personal chat (contact auto-detected)
python tools/telegram_parser.py --json ./result.json --output messages.txt

# Group chat
python tools/telegram_parser.py --json ./result.json --target "Name" --output messages.txt

# List participants
python tools/telegram_parser.py --json ./result.json --list-contacts

Details

  • Handles Telegram's mixed-text fields (bold/italic spans + plain strings)
  • Skips service messages, stickers, photos without captions
  • Same message dict schema as wechat_parser (sender, content, timestamp) — fully compatible with the existing chat_analyzer → persona_builder pipeline
  • Conflict/sweet keyword lists extended with Russian and English terms
  • Output format identical to WeChat/iMessage parser

Add tools/telegram_parser.py to parse Telegram Desktop JSON exports.
Supports personal chats (auto-detects the contact) and group chats
(via --target flag). Handles mixed-text fields, skips service/media
messages, classifies messages using the same long/conflict/sweet/daily
buckets as wechat_parser. Output format is identical so the rest of
the pipeline (chat_analyzer → persona_builder) works unchanged.

Update SKILL.md to add Telegram as method C in the data import step,
with the one-liner bash command. Update README_EN and README_RU data
source tables and file tree.

Context: reviewed existing wechat_parser.py output format and message
dict schema, wrote parser from scratch, ran smoke test against a
synthetic JSON export to verify all edge cases (mixed text, service
messages, emoji keyword detection).
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