I am using the telethon-API to access the telegram-API for some network analysis over multiple groups. As I didn't quite understand how the spam-protection works I tried to test the limits of when telegram stops me from sending requests. I executed the following code-snippet (accidently without an await, so basically 200 requests immediately).
for i in range(100):
client.get_messages(g, limit=None)
client.get_participants(g)
Almost immediately I received an error: SessionRevokedError: The authorization has been invalidated, because of the user terminating all sessions (caused by GetHistoryRequest)
. I was logged out not only with my application but also on my smartphone and any telegram-web/desktop sessions I had open.
While I could login again on my smartphone, telegram-web and even through the telethon-api, once I send any other request like client.get_dialogs()
, I was immediately logged out of any device again.
Looking back, it might have been a bad idea but I continued trying logging in and getting kicked in different ways all to the same result.
Today, about 20 hours later I tried logging in again. I was kicked again same as yesterday but now I am quickly kicked out of the smartphone app when I try to enter my phone-number and confirmation (without even accessing any api).
I tried logging in again after multiple hours with enough time for the original requests to have been processed and deleting the .session
-db from telethon.
I basically have three questions:
- Anyone has any idea, what happened to my account and if this is just temporary / What I can do to restore it to normal behaviour?
- Can I somehow check the 'status' of my account, as I don't really understand what exactly is happening to it?
- Does anyone know of a guide or publications by telegram on how the spam-protection works?
Thank you very much for your help!