A simple Python script to check how many Telegram groups a user is in.
WTFPL License
The Python script telegram_group_counter.py
allows you to programmatically count the number of Telegram groups you're a member of using the Telegram API and the Telethon library.
>=3.6
api_id
and api_hash
)git clone https://github.com/pcaversaccio/telegram-group-counter.git
cd telegram-group-counter
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`.
pip install -r requirements.txt
.env
file in the project root and add your Telegram API credentials[^1]:API_ID="your_api_id"
API_HASH="your_api_hash"
PHONE_NUMBER="your_phone_number"
[!CAUTION] Make sure to keep your
.env
file secure and never commit it to version control!
Run the script using Python:
python scripts/telegram_group_counter.py
The script will output the number of Telegram groups you're a member of 🫡.
You are in 123 Telegram groups.
[^1]: To get the Telegram API credentials go to my.telegram.org
and log in with your phone number. Now click on API development tools
and create a new application by filling in the required fields. Once created, you'll see your api_id
(a number) and api_hash
(a string).