pcaversaccio / telegram-group-counter

A simple Python script to check how many Telegram groups a user is in.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram Group Counter

👮‍♂️ Sanity checks License: WTFPL

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.

Prerequisites

  • Python >=3.6
  • Telegram API credentials (api_id and api_hash)
  1. Clone this repository:
git clone https://github.com/pcaversaccio/telegram-group-counter.git
cd telegram-group-counter
  1. Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`.
  1. Install the required packages:
pip install -r requirements.txt
  1. Create a .env file in the project root and add your Telegram API credentials1:
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!

Usage

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.

Footnotes

  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).

About

A simple Python script to check how many Telegram groups a user is in.

License:Do What The F*ck You Want To Public License


Languages

Language:Python 100.0%