Authorization #56
-
Good day! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, thanks for using the library, it means a lot to me. Do you mean it throws an exception and asks for a 2FA password when loading TelegramClient from the tdata folder? To actually re-use the session of that tdata, which won't ask for a 2FA password, you must use # flag=UseCurrentSession
# Convert TDesktop to Telethon using the current session.
client = await tdesk.ToTelethon(session="telethon.session", flag=UseCurrentSession) You might want to read more examples and documents here. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for using the library, it means a lot to me.
Do you mean it throws an exception and asks for a 2FA password when loading TelegramClient from the tdata folder?
That's because when you convert TDesktop to TelegramClient, it'll re-login by default (
flag=CreateNewSession
) hence needing the password.To actually re-use the session of that tdata, which won't ask for a 2FA passw…