Telethon
Telethon copied to clipboard
I have a lot Security error while unpacking a received message: Server replied with a wrong session ID
Code that causes the issue from telethon import TelegramClient, functions, sync, errors
client = TelegramClient('bot', api_id, api_hash) client.start()
while True: channel_info = client(functions.channels.GetMessagesRequest(channel='',id= [])) time.sleep(600) Traceback Security error while unpacking a received message: Server replied with a wrong session ID
this varn appears every time a loop is passed, how i can fix it?
I found a pattern that for the first time there is no error, but for subsequent ones it appears p.s. i use the one bot account
me too!
Me too
https://github.com/LonamiWebs/Telethon/issues/1476
same
Yeah i have the same problem -_-
me too
me too!
Same problem
me too!
me too
Hi guys! Try instead "sleep()" write like this "await asyncio.sleep()" It worked for me Good luck!
I meet the same problem,u can try :
client = TelegramClient(myaccount, api_id, api_hash)
while True:
client.connect()
channel_info = client(functions.channels.GetMessagesRequest(channel='',id= []))
time.sleep(5)
client.disconnect()
time.sleep(600) ##your delay time
u may notice that once u sending a request to Telegram server u need connect the client and then disconnet it. Maybe,it just deceive yourself,but it works well, Hahah. also,'server sent a very old message with id...' can be resolved this way