Answer the question
In order to leave comments, you need to log in
How to register user account in telegram via TDLib on node.js?
There was a problem with registering an account in telegram via tdlib. In the library example, this code was found, but it sends a message to an already existing account, SMS is not sent.
How, based on this data, using a proxy to send a request for user registration?
const { Client } = require('tdl')
const { TDLib } = require('tdl-tdlib-ffi')
const client = new Client(new TDLib('tdjson'), {
apiId: 2222,
apiHash: '44e63611c5fc3669c527xxxxxxb76c46'
});
client.connect().then(
() => client.login(
() => ({
getPhoneNumber: retry => {
retry ? Promise.reject('Invalid phone number') : Promise.resolve("+9999xxxxx")
}, getAuthCode: retry => {
retry ? Promise.reject('Invalid auth code') :Promise.resolve("abcdef")
}, getPassword: (passwordHint, retry) => {
retry ? Promise.reject('Invalid password') : Promise.resolve('abcdef')
}, getName: () => {
Promise.resolve({ firstName: "data"})
}
})
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question