Skip to content

henry701/tg-notify-deleted-messages

 
 

Repository files navigation

About

tg-notify-deleted-messages allows you to track messages which were deleted or edited by your interlocutors. You receive notifications when messages are deleted or edited in monitored chats.

Configuration

  1. Go to https://my.telegram.org . Select "API development tools" and create application.
  2. Copy .env.example file with name .env and change values.

Start daemon

docker-compose up -d app

Then, interact with the application using the API described on openapi.yaml.

Stop daemon

docker-compose stop app

Run tests

PYTHONPATH=app/src python3 -m pytest tests/test_*.py -v

Or with unittest discover:

PYTHONPATH=app/src python3 -m unittest discover -s tests -p "test_*.py" -v

Run integration tests

SQLite (ephemeral file):

INTEGRATION_DATABASE_URL=sqlite+pysqlite:////tmp/tgdel-integration.sqlite3 \
PYTHONPATH=app/src python3 -m unittest discover -s tests -p "integration_*.py" -v

Postgres:

INTEGRATION_DATABASE_URL=postgresql+psycopg://postgres:postgres@127.0.0.1:5432/postgres \
PYTHONPATH=app/src python3 -m unittest discover -s tests -p "integration_*.py" -v

Disk usage and attachments

tg-notify-deleted-messages stores message history for the time specified in the MESSAGES_TTL_DAYS environment variable, with default TTL: 14 days.

Preloading can also persist per-dialog checkpoints to avoid rescanning the same TTL window on every restart. This behavior is enabled by default through PRELOAD_CHECKPOINTS_ENABLED=1. The checkpoint flush cadence during preload is controlled by PRELOAD_CHECKPOINT_UPDATE_EVERY_MESSAGES, with default 100.

You can change this interval by changing the .env file or by defining environment variables at the system level.

Be careful, your messages can fill your disk space!

Roadmap

See ROADMAP.md.

Contribution

Feel free to create issues, bug reports and pull requests. I will be very grateful if someone implements any of the features described in the roadmap!

CI trigger

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages

  • Python 97.7%
  • Dockerfile 1.8%
  • Shell 0.5%