Skip to content

Instantly share code, notes, and snippets.

@ronik56
ronik56 / leave_all_telegram_groups.py
Last active January 4, 2024 14:21
script to leave all telegram groups
from telethon.sync import TelegramClient
from telethon.tl.functions.messages import GetDialogsRequest
from telethon.tl.types import InputPeerEmpty
# Go to https://my.telegram.org/apps, sign in, go to API development tools, create an app, copy and paste below:
api_id = 111111
api_hash = '2o23o13k1o3131'
phone = '+123456789'
client = TelegramClient(phone, api_id, api_hash)
client.connect()