A simple script to export members from Telegram Groups and Channels to a CSV file and to automatically add members to Telegram Groups.
Exporting and adding members to channels requires the user from which the script is launched to be a Channel admin.
Auto Add Members In Telegram Group
pip3 install telethon
-
To run it you need to generate API credentials for your Telegram user, you can do it here, and access your already created ones here
-
Replace your credentials in the python script
api_id = 12345 # Your API ID api_hash = 'XXXXXXXXXXXXXXX' # Your API Hash phone = '+11234567890' # Your Phone Number With Country Code.
Just follow the instructions in the script after running it from your shell.
Users can be added using:
-
Username: Gets temporarily banned with less requests.
-
User ID: Gets temporarily banned with more requests.
Temporarily bans lasts for up to a day
Adding users by Username expects a CSV file with one username per line.
Adding users by User ID expects a CSV file such as: username,user_id,user_access_hash