account is not logged in: AuthKeyUnregisteredError
What could be the problem?
I can't quite figure out what's wrong with the code yet. If anything, I use MemorySession, save it to the database in json and load it from there. I store the AuthKey the same way it is stored in a StringSession.
You didn't save it right, or load it right, do initial confirmations if save key is same as loaded. or session is terminated
If I assign catch_up false, then everything works fine and receiving and sending messages, but if I assign catch_up true, then when client.start() I get this error
Show a minimal example that can reproduce this
https://pastebin.com/vm10pfL1 First you need to create data.json in the folder. Then run the script. Make actions so that any channel is recorded in update_states. And then restart the script
Write when you will be able to reproduce
it seems the problem in setattr(bot, "session", MySession(dict_data))
Bro the code is working but error is showing
right now you're not using the auth key at all. it's the bot_token that is logging you in. MySession(dict_data) has to be passed to TelegramClient(session=) not set as attribute to session
https://tl.telethon.dev/methods/contacts/get_contacts.html that's doc link the hash in example hold the api hash we gotten from telegram api?
Обсуждают сегодня