Save Telegram chat log

tg (telegram-cli) accepts Lua scripts. Here is my script which saves as many messages as you want into a sqlite database.

https://github.com/psamim/telegram-cli-backup


I created my own script based on @Samim's in a gist.

It prints to a file so that you can save it as you like, rather than using a SQL database. Also, it has a sleep feature so that you can a larger number of dialogs' histories. It is still limited by telegram-cli's hard limit of 100. I changed that by editing the source and raising the limit.


Answer :

It's not possible to backup your chat history in an automated way with the official application, this feature is not provided yet

Workaround :

You can still make it manually; tested on official client on windows

  • Open a chat window
  • Click on the last Sent/Received message and maintain you click
  • Move the mouse up to select all the messages
  • Right click to copy the messages
  • Save them into a text file or else