M
M
misc12015-09-14 18:54:55
JavaScript
misc1, 2015-09-14 18:54:55

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

3 answer(s)
L
laughedelic, 2017-06-25
@laughedelic

  • There is a telegram-js library . From the description:
    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.

  • And one more, based on webogram: TelegramApi

A
Ali, 2020-03-31
Qasimov @alik0211

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);
});

S
Sergey, 2015-09-14
Protko @Fesor

webogram sources are available, so...
https://github.com/zhukov/webogram

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question