Answer the question
In order to leave comments, you need to log in
Telegram API implementation in JS?
Good day to all.
Is there a js library/implementation of the Telegram API? I would like to work with the API directly from the browser (as in webogram ).
Everything that I found under nodejs :(.
Answer the question
In order to leave comments, you need to log in
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.
Use @mtproto/core - https://github.com/alik0211/mtproto-core
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);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question