Skip to content

A simple script for cleaning up messages in Telegram groups and supergroups. In addition, the script can be deployed to Heroku as a scheduled job.

License

Notifications You must be signed in to change notification settings

spzSource/tg-cleanser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tg-cleanser

Configuration

  1. Install python 3.8 or above
  2. Run pip install -r requirements.txt
  3. Generate TELEGRAM_API_ID and TELEGRAM_API_SECRET using the following instruction: https://core.telegram.org/api/obtaining_api_id and then save these values into ENV variables.
  4. Add TELEGRAM_SESSION env variable. It can contain any value or session string, like described here https://docs.pyrogram.org/topics/storage-engines#session-strings . Second option is useful when deploying the script to heroku.

Commands:

  1. Returns all available groups/supergroups:
python main.py list
  1. Removes all messages older than specified time delta:
python main.py remove -g 1 2 3 --exp 3h

About

A simple script for cleaning up messages in Telegram groups and supergroups. In addition, the script can be deployed to Heroku as a scheduled job.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages