Giter Club home page Giter Club logo

telegramapi's Introduction

TelegramApi

Based on webogram

Getting started

  1. Install package via npm
npm install telegram-api-js

Or bower

bower install telegram-api-js
  1. Add a <script> to your index.html
<html>
<head>
    <title>My amazing app</title>
</head>
<body>
    <script src="js/jquery.js"></script>
    <script src="node_modules/telegram-api-js/dist/telegramApi.js"></script>
<body>
</html>
  1. 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: 2, /* DC ID */
        host: '0.0.0.0',
        port: 443
      }
    ],
    production: [
      {
        id: 2, /* DC ID */
        host: '0.0.0.0',
        port: 123
      }
    ]
  }
});
  1. Check your status
telegramApi.getUserInfo().then(function(user) {
    if (user.id) {
        // You have already signed in
    } else {
        // Log in
    }
});

API documentation

telegramapi's People

Contributors

sunriselink avatar

Watchers

James Cloos avatar BigZero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.