A command-line Telegram group utility built with Telethon. It supports account/session management and a menu-driven group workflow.
- Python 3.10+
- Telegram API ID and API hash from https://my.telegram.org
- Admin permissions for group announcements, moderation, or invite-link creation as applicable
git clone https://github.com/saifalisew1508/Telegram-Members-Adder.git
cd Telegram-Members-Adder
python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# Windows: .venv\\Scripts\\activate
python -m pip install --upgrade pip
pip install -r requirements.txtSet TELEGRAM_API_ID and TELEGRAM_API_HASH in your terminal environment. Do not commit them.
Linux/macOS:
export TELEGRAM_API_ID="YOUR_API_ID"
export TELEGRAM_API_HASH="YOUR_API_HASH"Windows PowerShell:
$env:TELEGRAM_API_ID="YOUR_API_ID"
$env:TELEGRAM_API_HASH="YOUR_API_HASH"Run python manager.py to add/login accounts, check saved sessions, or remove an account. Account metadata is stored in accounts.json; Telethon sessions are stored in sessions/.
Run python run.py to open the interactive menu:
- Send a group announcement - sends one message into the selected group/channel (for example, a family-group good morning message). It does not DM every member.
- Ban one member - enter one username or user ID. Requires the logged-in account to have appropriate admin rights and asks for explicit confirmation.
- Unban one member - enter one username or user ID and confirm.
- Export administrators - saves the group/channel administrator roster to
users.json, including user ID and username when available. It does not scrape the entire membership. - Create an invitation link - creates a link that people can use to join voluntarily. The account needs invite-link permission.
- Keep
sessions/,accounts.json,users.json, API credentials, login codes, and 2FA passwords private. users.jsonis local data and is excluded from Git.- The old
vars.txtpickle format is not loaded. Register accounts again usingmanager.py. - Use moderation only when justified and authorized. This project deliberately does not provide mass bans/unbans, member scraping, unsolicited mass-DMs, or automatic bulk member additions.
- Respect Telegram's Terms, user privacy, and group rules.
- Missing API credentials: set both environment variables in the same terminal session.
- Login required: run
python manager.pyand log in again. - Permission errors: ask a group administrator to grant the required rights.