zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
620 stars 136 forks source link

Getting "Error 400 API_ID_INVALID 2 1" on the most basic of examples #188

Closed napindc closed 5 years ago

napindc commented 6 years ago

I have node v6.14.0 and am using v2.2.2 of this project. When I run the following code, I get a Error 400 API_ID_INVALID 2 1 error. This is both when I use the api_id provided in the examples for this project, and when using my own ones that I created on Telegram. Any ideas why this is happening?

`const MTProto = require('telegram-mtproto').MTProto;

const config = {
    id  : 49631,
    hash: 'fb050b8f6771e15bfda5df2409931569',
};
const api = {
    invokeWithLayer: 0xda9b0d0d,
    layer          : 57,
    initConnection : 0x69796de9,
    api_id         : config.id,
    app_version    : '1.0.1',
    lang_code      : 'en'
};
const server = {
    webogram: true,
    dev: true
    // dev: false
};

const telegram = MTProto({ api, server });

telegram('auth.sendCode', (data) => {
    console.log(data);
});`
osgafarov commented 6 years ago

Any luck?