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
- Build your own TDLib binary (https://github.com/tdlib/td#building)
npm i -S tglib- 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