Td: Problem using tdlib on Ubuntu server with lua language

Created on 2 Jan 2020  路  9Comments  路  Source: tdlib/td

I made tdlib through this link but I don't know how to attach it to my script.
I don't know which of the files in the image I need to attach to the lua script.
It also does not explain how to connect and use tdlib for lua.
I would like to stop using tdbot and use the original version of tdlib, thank you for your help.
How to connect and use tdlib on Ubuntu server with lua programming language Describe me with a simple example.
Many of my colleagues use lua in the construction of telegram robots, but there is no training in using the original version of tdlib.

How to connect to tdbot is as follows :
./telegram-bot -p api4 -L log.txt -s /root/myscript.lua

All 9 comments

1- The tdbot tutorial, which is completely for the middleware version, doesn't work.
2- Tdlua tutorials also have no documentation on their gate hubs and they have not been taught how to use them.
3- The JSON interface tutorial also has no clear documentation for the lua language.

If you have a bit of guidance on which files and how to use them, it helps. Because imprecise training causes programmers confusion.
Basic documentation should be illustrative.

Have you looked at examples for tdlua, especially on https://github.com/giuseppeM99/tdlua/blob/master/examples/tdbot.lua?

The JSON interface is the same for all programming languages, there is nothing specific for Lua.

The sample script you provided used the following code:
local tdlua = require "tdlua"
But I don't know what tdlua file really is and how to get it !!
I renamed the tg_cli file to tdlua but encountered the following error:
[ 1][t 0][1578036561.939141989][cli.cpp:4192] You should provide some valid api_id and api_hash
But the api_id and api_hash that I made are correct !!

I've even used the tdlua.so file, which is published on the https://t.me/tdlua telegram channel, but it still gives the following error:
[ 1][t 0][1578039535.861754179][cli.cpp:4192] You should provide some valid api_id and api_hash

I've used the following files in the script:
https://github.com/giuseppeM99/tdlua/blob/master/examples/tdbot.lua
https://github.com/giuseppeM99/tdlua/blob/master/examples/botid.lua

"tdlua" is https://github.com/giuseppeM99/tdlua. You need to build it as described in https://github.com/giuseppeM99/tdlua#tdlua. Using pre-built tdlua.so should be fine also.

The error "You should provide some valid api_id and api_hash" can be returned only by tg_cli test console client from TDLib repository, which must not be used.

How to install https://github.com/giuseppeM99/tdlua is not illustrative. Can you send me the installation instructions exactly?
I did a git clone and hit the installation instructions but it got error in the middle of the installation !!

README.md contains the whole build instructions for the library, but it would be simpler to use prebuilt tdlua.so. local tdlua = require "tdlua" will search for tdlua.so and load it. For more information about library loading in Lua, see https://stackoverflow.com/questions/34235540/whats-the-difference-between-loadfile-require-and-import.

Unfortunately I couldn't use tdlib but thank you for the guidance.
The following error will not be corrected at all :
[ 1][t 0][1578039535.861754179][cli.cpp:4192] You should provide some valid api_id and api_hash

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pishnok picture pishnok  路  3Comments

sh-a-v picture sh-a-v  路  3Comments

liaoyu1992 picture liaoyu1992  路  4Comments

FJarvan picture FJarvan  路  3Comments

IRGC picture IRGC  路  4Comments