Socket
Book a DemoInstallSign in
Socket

telegram-mtproto-javascript

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram-mtproto-javascript

JavaScript library for using Telegram API.

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
11
57.14%
Maintainers
1
Weekly downloads
 
Created
Source

telegram-mtproto-javascript

This repository contains an improved version TelegramApi that based on webogram.

List of improvements:

  • No more dependency on jQuery
  • Password verification implemented
  • Added support for HTTPS

Getting started

  • Install package via npm
npm install telegram-mtproto-javascript
  • Add a <script> to your index.html
<html>
<head>
    <title>My amazing app</title>
</head>
<body>
    <script src="node_modules/telegram-mtproto-javascript/dist/telegramApi.js"></script>
<body>
</html>
  • Set your app configuration
/* You should register your application on https://my.telegram.org/ */
telegramApi.setConfig({
  app: {
    id: 0, /* App ID */
    hash: 'qwertyasdfghzxcvbnqwertyasd', /* App hash */
    version: '0.0.0' /* App version */
  },
  server: {
    test: [
        { id: 1, host: '149.154.175.10', port: 80 },
        { id: 2, host: '149.154.167.40', port: 443 },
        { id: 3, host: '149.154.175.117', port: 80 },
    ],
    production: [
        { id: 1, host: '149.154.175.50', port: 80 },
        { id: 2, host: '149.154.167.50', port: 80 },
        { id: 3, host: '149.154.175.100', port: 80 },
        { id: 4, host: '1149.154.167.50', port: 80 },
        { id: 5, host: '149.154.171.5', port: 80 },
    ],
    https: [
        { id: 1, host: 'pluto.web.telegram.org', port: 80 },
        { id: 2, host: 'venus.web.telegram.org', port: 80 },
        { id: 3, host: 'aurora.web.telegram.org', port: 80 },
        { id: 4, host: 'vesta.web.telegram.org', port: 80 },
        { id: 5, host: 'flora.web.telegram.org', port: 80 },
    ]
  }
});
  • Check your status
telegramApi.getUserInfo().then(function(user) {
    if (user.id) {
        // You have already signed in
    } else {
        // Log in
    }
});

API documentation

Keywords

telegram

FAQs

Package last updated on 21 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.