below and the script seems to just keep running after AuthKeyUnregisteredError
Documentation for disconnected
first use await client.run_until_disconnected() than await client.disconnected, it may handle some extra things and you don't need to use sys.exit(). just let the interpreter leave cleanly and handle the raised error once library crashes show the logs when you reproduce that behavior if run_until_disconnected is same
2023-09-03 22:12:07,547 - INFO - TELEGRAM-CLIENT: awaiting self.client.run_until_disconnected()2023-09-03 22:12:14,110 - INFO - TELEGRAM-CLIENT.client.updates: Cannot get difference since the account is not logged in: AuthKeyUnregisteredError still not exiting
mehh, does it keep logging forever or it goes silent, you sure it's not raising?
Just silent I’ve tried waiting 5 mins but no new logs
can you confirm it's not raising anything try: await client.run_until_disconnected() except: logger.info('run_until_disconnected Raised')
awaiting of client.run_until_disconnected() just blocking asyncio event loop this function should be like entry point, and to disconnect from your error you need put your code into try except: try: await self.cl.run_until_disconnected() except AuthKeyError: await self.client.disconnect()
Same result ...
I've noticed now that if i sign in and directly terminate session from my phone it doesn't raise error but if i sign in > log out > sign in > terminate it raises error
Since it's not raising you're doing something weird that messes with the library logic of raising, probably the was_once_logged_in. looking at how start() doesn't ask you for phone input, means you're authorized at start in the .session file, but since Updates handling is failing while running, you need to show more info on what you're doing with latest full code after to reproduce it. it's mostly a side effect of catch_up
I will try removing catch_up tomorrow
Обсуждают сегодня