enricostara / telegram-mt-node

Telegram MTProto library (javascript, node.js)
MIT License
77 stars 25 forks source link

Cannot create authKey #18

Open mistougi opened 7 years ago

mistougi commented 7 years ago

Hello, I'm facing a weird problem when I try to create an authkey, the error I am receiving is:

I'm using Telegram.Link to as a dependency. [ERROR] Fri, 09 Dec 2016 14:20:21 GMT ConstructorBuilder.registry Unable to retrieve a Type by Id [00000000000000000198562b9ebd4a5840000000632416056be4800f5a191361ca0e9d74428b918313613128856cd8176808cc21abb7cdaf081690f737d01a355100000015c4b51c01000000216be86c022bb4c3]

I am using it like this:

export default class Client {
constructor(){
this.data = {}
}
{...}

connect(){
  this.data.client = Telegram.Link.createClient(
        this.data.app, this.data.dataCenter,(error) => {
        if (error) {
            console.log("Unable to create client: " + JSON.stringify(error));
            return this.connect();
        } else {
            console.log("Creating auth key...");
            try{
               this.data.client.createAuthKey((auth) =>{
               this.data.app.authKey = auth.key.encrypt('password');
               console.log('client connect to ' + JSON.stringify(this.data.dataCenter));
              });
            }catch(error){
              console.log('Error:', error);
            }
        }
    });
  }
}

Any idea of what could be happening? Thank you.

goodmind commented 7 years ago

@mistougi can you test my fork? https://github.com/goodmind/telegram.link