LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.68k stars 1.38k forks source link

All sessions crushed #3999

Closed Stepashka20 closed 1 year ago

Stepashka20 commented 1 year ago

Checklist

Code that causes the issue

from telethon import TelegramClient, events, sync

api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'

client = TelegramClient('session_name', api_id, api_hash)
client.start()

I use this code to authorize as userbot. I entered the code, then everything is fine for the first 10 minutes, but then the telegram delete ALL sessions and I have to receive SMS to my phone. What should I do?

Lonami commented 1 year ago

Unfortunately, I don't think this is a bug in Telethon, but rather one of Telegram's anti-spam measures. I do not know how to circumvent this, but I truly believe there's nothing Telethon can do to fix it (other than trying to mimic official clients more closely, which would make it easier on spammers, which I would rather not even try).