-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TdLib for server side (with storing multiple account sessions) #718
Comments
TDLib doesn't manage multiple accounts itself. So you will need to create a directory for each phone number, i.e. phonenumber123456789, and initialize a TDLib instance with that directory as database and files directory. After TDLib instance is created it will send you |
Ok, thanks |
and where we have to give it database directory path? |
found it, thanks |
Hello,
Actually I'm trying to build server based app where the logic is that multiple users should be able to connect their telegram account to my application.
I got from here #40 that we should create one database per account. But, which logic I should use to work with database which corresponds to concrete user? For example server gets request to retrieve first 10 chats of user with phone P1 (I guess the best way is to use phone number as user identifier). And lets assume that we already created session for user with phone P1. How tdlib client on server side can know that currently he should use session for user with phone P1?
Also is that possible to check if tdlib created session for user with concrete phone? Or in another words is that possible to get current AuthorizationState based on phone?
Thanks for your help!
The text was updated successfully, but these errors were encountered: