- Install python 3.8 or above
- Run
pip install -r requirements.txt
- Generate
TELEGRAM_API_ID
andTELEGRAM_API_SECRET
using the following instruction: https://core.telegram.org/api/obtaining_api_id and then save these values into ENV variables. - 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.
- Returns all available groups/supergroups:
python main.py list
- Removes all messages older than specified time delta:
python main.py remove -g 1 2 3 --exp 3h