From efc336e60cf1331bf5f3213d296981b87b8b2a6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Jun 2023 19:24:05 +0300 Subject: =?UTF-8?q?fixes=20#3537=20(Telegram:=2032-=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=80=D1=8F=D0=B4=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=B0=D0=B4=D0=B0=D0=B5=D1=82=20=D0=B2=20?= =?UTF-8?q?64-=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BD=D0=BE=D0=B9=20Win?= =?UTF-8?q?dows)=20+=20update=20to=20the=20fresh=20TDLIB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Telegram/tdlib/td/example/web/tdweb/README.md | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/example/web/tdweb/README.md (limited to 'protocols/Telegram/tdlib/td/example/web/tdweb/README.md') diff --git a/protocols/Telegram/tdlib/td/example/web/tdweb/README.md b/protocols/Telegram/tdlib/td/example/web/tdweb/README.md new file mode 100644 index 0000000000..591bc941fb --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/web/tdweb/README.md @@ -0,0 +1,29 @@ +## tdweb - TDLib in a browser + +[TDLib](https://github.com/tdlib/td) is a library for building Telegram clients. tdweb is a convenient wrapper for TDLib in a browser which controls TDLib instance creation, +handles interaction with TDLib and manages a filesystem for persistent TDLib data. + +For interaction with TDLib, you need to create an instance of the class `TdClient`, providing a handler for incoming updates and other options if needed. +Once this is done, you can send queries to the TDLib instance using the method `TdClient.send` which returns a Promise object representing the result of the query. + +See [Getting Started](https://core.telegram.org/tdlib/getting-started) for a description of basic TDLib concepts and a short introduction to TDLib usage. + +See the [td_api.tl](https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl) scheme or +the automatically generated [HTML documentation](https://core.telegram.org/tdlib/docs/td__api_8h.html) for a list of all available +TDLib [methods](https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_function.html) and [classes](https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_object.html). +The JSON representation of TDLib API objects is straightforward: all API objects are represented as JSON objects with the same keys as the API object field names in the +[td_api.tl](https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl) scheme. Note that in the automatically generated C++ documentation all fields have an additional terminating underscore +which shouldn't be used in the JSON interface. The object type name is stored in the special field '@type' which is optional in places where type is uniquely determined by the context. +Fields of Bool type are stored as Boolean, fields of int32, int53, and double types are stored as Number, fields of int64 and string types are stored as String, +fields of bytes type are base64 encoded and then stored as String, fields of array type are stored as Array. +You can also add the field '@extra' to any query to TDLib and the response will contain the field '@extra' with exactly the same value. + +## Installation +As usual, add npm tdweb package into your project: +``` +npm install tdweb +``` + +All files will be installed into `node_modules/tdweb/dist/` folder. For now, it is your responsibility to make +those files loadable from your server. For example, [telegram-react](https://github.com/evgeny-nadymov/telegram-react) +manually copies these files into the `public` folder. If you know how to avoid this problem, please tell us. -- cgit v1.2.3