Some useful scripts for work with telegram accounts with CLI. It supports 2-fa authorization.
- Clone repository
- Create virtual env
python -m venv venv && source venv/bin/activate
- Install requirements
python -m pip install -r requirements.txt
- Configure
config.ini
get this data here
[Telegram]
API_ID=11111
API_HASH=sdkjaksljdaisojd890qwj8d832jd
Now there are these modules:
--phone %your_phone_number%
--session-name %session_name_file%
Iterate through your dialog list and print it to stdout. This module has no specific arguments.
Example:
python3 tele_tools.py --phone %your_phone_here% show_dialogs
It prints to stdout chat_id and chat name for all dialogs in the account.
This module gets chat history and removes messages. (If you are admin - it removes anybody's messages if you aren't admin only your messages)
--older - remove message older than date
--newer - remove messages newer than date
--delta - remove mesages not in delta days from today
--regex - remove message matched to regex
--chat_id - comma-separated chat identificitors
--dry-run - dry run. Just print messages, not delete
Example:
python3 tele_tools.py --phone %your_phone_here% clean --delta 30 --chat_id %your_chat_id_for_cleaning%
This module downloads information from your cloud account. All messages and media files.
--download-channels - download messages from channels
--chat-id - comma-separated chat identificitors
--text-only - download only text infomation, no media
--max-size - max size of media to download