TDLib JSON CLI is a simple command line tool uses stdin & stdout as input & output of tdlib's td_json_client.
You can use this to replace the buggy, weird tg-cli and it's json interface.
This project is licensed under AGPL v3.0, but you can distribute it separately so you are not required to make your project open source under AGPL compatible license.
./bin/tdlib-json-cli [verbosity]
[verbosity] = 0123456789 Set TDLib's verbosity level at startup.
- 0 - fatal errors;
- 1 - errors;
- 2 - warnings and debug warnings;
- 3 - informational;
- 4 - debug;
- 5 - verbose debug;
- greater than 5 and up to 1024 can be used to enable even more logging.
tdlib-json-cli will use stdin & stdout to process data.
Request will be send to tdlib line by line, so make sure you have your json string in one line.
Response will be recieve from tdlib to stdout line by line.
See TDLib Documention for more information.
We provide 2 extra command to control tdlib-json-cli behaviors.
Change the verbose level of the tdlib.
exit the tdlib-json-cli.
We provide serveral events for you to know tdlib-json-cli status.
They are json strings which write to stdout like {"@cli":{"event":"EVENT_ID"}}
.
This event will be trigged at td client created.
This event will be trigged at tdlib-json-cli exited.
brew install gperf cmake openssl readline
mkdir Release
cd Release
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DCMAKE_BUILD_TYPE=Release ..
make -j4
See td/README.md
See td/README.md
You should have php, doxygen, node.js and npm installed.
Before generate types file, you MUST build successfully at least one time. This because of some code of tdlib which used to generate docs and are generated at the build time.
cd td
doxygen
cd ../types-generator
npm i
cd ..
node ./types-generator/index.js
This will write types.json
to the project root directory which contains types of all the objects and functions.