Telethon – Cannot get difference since the account is not logged in: AuthKeyUnregisteredError

AuthKeyUnregisteredError

I wrote my userbot on Teleton, everything was fine until I uploaded it to another hosting (in Germany) and clicked to end the session on the old hosting (in Helsinki). Every time I try to run the bot on a host or on a local machine, I get this error. this happens every time, and when this error occurs, it automatically terminates all sessions with the userbot

I launch the bot, enter the code that telegram sended to me, everything is good, and after some time (2-5 minutes, always different), when the bot needs to process some action, it gives this error
2023-09-09 19:48:14,685 - telethon.client.updates - INFO - Cannot get difference since the account is not logged in: AuthKeyUnregisteredError(but it was logged in)

I try to delete old sessions databases and rename it on

client = TelegramClient('anon', api_id, api_hash) 

to

client = TelegramClient('userbot', api_id, api_hash)

i tried this like 10 times

Please help, if someone had that problem or knows how to fix it, let me know

  • You may want to check How to Ask

    – 

Leave a Comment