tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.23k stars 1.47k forks source link

I need some advice on authorization #2944

Closed annovikava closed 1 month ago

annovikava commented 5 months ago

Hi. I am looking for advice on the logic of authorization. I'm trying to upgrade the ruby gem to a new version of tdlib and I don't understand how to work with authorization. Old version is - eb80924

In the old version, every time it was necessary to send requests to telegram, a new client instance was created, a request was sent to setTdlibParameters, followed by checkDatabaseEncryptionKey, after which the rest of the operations were performed from the same client. In the new version, setTdlibParameters is missing and after setTdlibParameters it is required to go through the confirmation code, which is absolutely unacceptable for my tasks.

What can you recommend? I'm thinking about using the singleton pattern to work with the client, but I'm not sure if this is the right option.

levlam commented 5 months ago

See https://core.telegram.org/tdlib/getting-started#user-authorization.

checkDatabaseEncryptionKey doesn't exist anymore and setTdlibParameters didn't change conceptually.