L
L
LebedevFF2020-07-27 19:35:00
API
LebedevFF, 2020-07-27 19:35:00

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. 5f1f011816f0f801620035.png
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 question

Ask a Question

731 491 924 answers to any question