Effortless Telegram channels monitoring - Archiving messages from Telegram channels into daily ND-JSON files.
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the project directory with the following variables:EG_API_ID=your_telegram_api_id EG_API_HASH=your_telegram_api_hash EG_DATA_DIR=/path/to/data/directory EG_CHANNELS=channel_username1,channel_username2,channel_username3 EG_SESSION_ID=your_session_id EG_AUTO_JOIN_CHANNELS=1 LOG_LEVEL=INFO
Ensure you replace the placeholders with your actual values.
Run the script using the following command:
python src/main.py
The script will authenticate your Telegram account, listen to the specified channels, and log incoming messages into newline-delimited JSON files in the designated data directory.
To setup session files, you can use the following command
docker run --env-file .env -e EG_SESSION_ID=/app/sessions/anon -v ./sessions:/app/sessions -i ghcr.io/remiallain/echogram:latest
Then start the service with the sessions volume mounted and with same EG_SESSION_ID
- The script logs messages for the specified channels only.
- Each day's messages are stored in a separate
.ndjson
file. - Ensure the specified channels exist and are accessible by the authenticated account.