alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
625 stars 111 forks source link

First example doesnt work #276

Open horr0rjkeezor opened 1 year ago

horr0rjkeezor commented 1 year ago

Code: `const path = require('path'); const MTProto = require('@mtproto/core');

const api_id = "1663794"; const api_hash = "d011ea569072f733217411d392cce73";

// 1. Create instance const mtproto = new MTProto({ api_id, api_hash,

storageOptions: {
    path: path.resolve(__dirname, './data/1.json'),
},

}); console.log("test before"); // 2. Print the user country code mtproto.call('help.getNearestDc').then(result => { console.log('country:', result.country); }); console.log("test after");`

When i run, i get this messages in console:

D:\xampp\htdocs\telegrr>node index.js test before test after

And what i can do with this? Method "help.getNearestDc", does not respond. I wait five minutes.