JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q59349F
  • License MIT

TDLib (Telegram Database library) bindings for Node.js

Package Exports

  • tglib

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tglib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tglib

TDLib (Telegram Database library) bindings for Node.js


Getting started

  1. Build your own TDLib binary (https://github.com/tdlib/td#building)
  2. npm i -S tglib
  3. Use it!

Handling updates and errors

By default, tglib will handle the incoming updates internally. You can attach your own event listener for receiving updates and errors.


Fetch

Since TDLib is asynchronous, if you need to use some API like getChats, you need to add the @extra property to your query in client._send and filter the corresponding result in client._receive by matching the same @extra property that defined previously.

tglib provides an easy and convenient way to deal with these API called client.fetch, all you need to do is call the function and awaits for the result. tglib will take care of client._send and client._receive.


License

MIT