Skip to content

Instantly share code, notes, and snippets.


Yunior González Santana YuniorGlez

View GitHub Profile
YuniorGlez /
Last active December 3, 2022 02:03 — forked from agentcooper/
Telegram chat backup/export

How to use

  1. Login to
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() or showDialogs() to get the list of contacts with ids or the 20 last conversations in the same order of the client view
  4. Run saveChat(userId) where userId is the id from step 3 (inside the [] )

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.