Client library to access the Telegram API. This package is based on the work of Enrico in the Telegram Link library.
It's rewritten in ES6 and has far less built-in features and dependencies. It is compatible with telegram-mt-node and telegram-tl-node, but is not a drop-in replacement.
No more additional libs. The **telegram-mtproto** library implements the **Mobile Protocol** and provides all features for work with telegram protocol
const { MTProto } = require('@mtproto/core');
const api_id = 'YOU_API_ID';
const api_hash = 'YOU_API_HASH';
// 1. Create an instance
const mtproto = new MTProto({
api_id,
api_hash,
// Use test servers
test: true,
});
// 2. Get the user country code
mtproto.call('help.getNearestDc').then(result => {
console.log(`country:`, result.country);
});