tg-paper-plane

TDLib bindings for Node.js

Usage no npm install needed!

<script type="module">
  import tgPaperPlane from 'https://cdn.skypack.dev/tg-paper-plane';
</script>

README

Paper Plane

TDLib bindings for Node.js.

Paper Plane is a package for easing the interaction with TDLib through Node.js. It's completely asynchrounus, blazing fast and reliable, so you can build a Telegram client with no worries of MTProto or Telegram API.

Installation

npm i -S tg-paper-plane

Note: TDlib library (libtdjson.so) must be installed on your machine.

Example

A fully functioning but simple client is available at example/ directory. Before using it, make sure you have an app in Telegram Development Tools. Set TD_API_ID and TD_API_HASH environment variables. You can get these for your own from Telegram account tools.

Methods

TDlib has a complete documentation of methods, types and everything else in the library.

Changelog

v0.0.9

  • Added a Promise.race for async queries, so it won't return continuous Time out responses.

v0.0.8

  • fetch function now handles errors correctly.

v0.0.7

  • Fixed a minor typo with this.fetching which caused the whole client to stop working :)

v0.0.6

  • Added encryptionKey parameter to class constructor, so the class can be used for encrypted databases, too. Also, authorizationWaitEncryptionKey is automatically handled by Paper Plane.

v0.0.5

  • Call this.resolver when an AuthReady received from TDlib.

v0.0.4

  • Removed Babel from dependencies,
  • Set Node.js required version to >=8.0.0,
  • Added JSDoc comments for each function in class,
  • Updated example,
  • and squished a few bugs.