tdlib / td

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

I need some advice on authorization #2944

Closed annovikava closed 1 week ago

annovikava commented 4 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 4 months ago

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

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