Credentials. Watch mode keeps the Telethon session open for a long time, so protect the session file and stop the process when you no longer need it.
Who it is forAn analyst tracking a channel over weeks who wants counts and reactions on older posts to stay accurate without full re-exports.
The problemRe-exporting the whole channel each time is slow, and old posts keep changing as comments and reactions arrive.
The outcomeA single dataset file that merges new posts by post_id and comments by comment_id, with counters refreshed on recent posts.
What you need first
- Docker Desktop (recommended) or Python with the packages in requirements.txt
- Telegram API credentials: API_ID and API_HASH from https://my.telegram.org/apps
- A Telegram account session for Telethon, needed only for live exports
Steps
- Complete a first export, such as
docker compose run --rm cli export json, so a dataset exists. - Run
docker compose run --rm cli export json --incrementalon a schedule you choose. - For continuous updates, run
docker compose run --rm cli watch --poll-interval 30 --refresh-active-posts 20. - Check
data/state/for the saved incremental state anddata/raw/for the updated dataset.
Prompt for your agent
In the TheMyxa/telegram-parser repo, run `docker compose run --rm cli export json --incremental` for channel <channel-username>. Expected output is an updated *_dataset.json in data/raw/ and a state file in data/state/. Verify that the post count did not drop after the run before reporting.
Caveat. Incremental runs depend on the saved state in data/state/, so deleting that folder makes the next run behave like a fresh export.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TheMyxa/telegram-parser and "Keep a channel dataset current with incremental updates"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer