Skip to content

Instantly share code, notes, and snippets.

@femdiya
Created August 2, 2025 15:24
Show Gist options
  • Save femdiya/eb8019bd2524cb078cc2593b33460614 to your computer and use it in GitHub Desktop.
Save femdiya/eb8019bd2524cb078cc2593b33460614 to your computer and use it in GitHub Desktop.
Telethon script to delete user's account.
from telethon.sync import TelegramClient
from telethon.tl.functions.account import DeleteAccountRequest
api_id = 123456 # Replace with your API ID.
api_hash = 'xxxxxx' # Replace with your API Hash.
with TelegramClient('delete_me', api_id, api_hash) as client:
try:
client(DeleteAccountRequest(
reason='User requested account deletion'
))
print("Account deletion requested successfully.")
except Exception as e:
print(f"Error: {e}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment