tg-notify-deleted-messages
allows you to track messages, which were deleted by
your interlocutors. After deleting, they will be stored in "Saved Messages" with
metadata about the sender.
It also supports attachments, without storing them on your disk.
- Go to https://my.telegram.org . Select "API development tools" and create application.
- Copy
.env.example
file with name.env
. ChangeTELEGRAM_API_ID
andTELEGRAM_API_HASH
values. - Authenticate your account using command:
docker-compose create --force-recreate --build app && docker-compose run app python ./src/monitor.py auth
docker-compose up -d app
docker-compose stop app
tg-notify-deleted-messages
store messages history for the time specified
in the MESSAGES_TTL_DAYS
environment variable, with default TTL – 14 days.
You can change this interval by changing the .env
file, or defining environment
variable at the system level.
The application supports attachments, but don't store it. Be careful, your messages can fill your disk space.
Please, don't run this application on servers, where other persons have access to. Messages history and credentials are stored in the insecure SQLite database.
Now it sends only the information about the sender of the message, but it doesn't point, from which entity the message was deleted.
If you want to support the old messages, but you start this application recently, it'll be great, if it will preload the messages in the database once it starts.
It will allows us to receive notifications, when the message was deleted, instead of finding these messages in the "Saved messages".
Now the application stores only the first version of the message. It means, that after your companion edit the message and then he will delete it, you will receive the information about the first version of the message.
The best implementation is to store all versions of the message and receive all of them.
As soon as your companion will know that you use this tool, they will start editing the messages, instead of deleting it. To handle it, we can store the versions of every message, and after forwarding the original message to the bot, it should send you the history of edits.
Feel free to create issues, bug reports and pull requests. I will be very grateful, if someone will implement one of the features, described in the roadmap.