FULLY CODED SCRIPT FOR SCRAPPING AND AUTO ADDING MEMBERS TO A GROUP ON TELEGRAM.
Script to export members from a particular telegram groups and channels to a CSV file and to add members to another telegram groups or channels:
- Exporting and adding members to channels requires the user from which the script is launched to be a channel or group admin.
### INSTALL DEPENDENCIES ###
- You'd need python3 and pip3 installed and available in your PATH.
- Run `pip3 install -r requirements.txt` from the projects root directory.
This would automatically install "TELETHON" as it would as well be needed for the script to run perfectly.
- TELEGRAM CONFIGURATION:
1. To run it you need to generate API credentials for your Telegram user, you can do it via the link below.
You can as well access your already created ones through the link below.
2. Replace your credentials in the script:
api_id = 000000 # YOUR API_ID
api_hash = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # YOUR API_HASH
phone = '+34000000000' # YOUR PHONE NUMBER, INCLUDING COUNTRY CODE
Just follow the instructions in the script after running it from your the shell.
ADDING USERS TO GROUPS:
Users can be added using:
- **Username**: Gets temporarily banned with less requests.
- **User ID**: Gets temporarily banned with more requests.
However, it's important to note that temporarily bans last for up to a day in my experience.
- Adding users by Username outputs a CSV file with one username per line.
- Adding users by User ID outputs a CSV file such as: `username,user_id, user_access_hash`
NOTE: No headers are expected in the CSV files.
Once you have your CSV prepared, just follow the instructions in the script.