rizaumami / tdbot.lua Goto Github PK
View Code? Open in Web Editor NEWLua wrapper for telegram-bot
License: GNU General Public License v3.0
Lua wrapper for telegram-bot
License: GNU General Public License v3.0
hi
you can send to me example for set proxy?
for language lua
hi i wanna change the api id and api hash from the lua-source in tdbot
but ill face this error :
["@type"] = "error",
code = 400,
message = "Unexpected setTdlibParameters"
how can i fix it ?
if i send msg with parse_mode and callback the callback funcation not work
see: https://github.com/rizaumami/tdbot.lua/blob/master/tdbot.lua#L106 and 720 and 1088
assert (tdbot_function (a.tdbody, a.callback or dl_cb, a.data))
end, {tdbody = tdbody, callback = callback, data = data})
This fix the Bug...
and if you can add split msg by 4096 byte per msg for a long text msg
Thanks You, Amazing Work! ๐
hi, how to join channel with id (without link)?
function (importChatInviteLink) not work with channel username.
and how to start one bot with tdbot?
when i use more then 1 text in markDown
bot dont send text and crash
here is my code
if messageText == "test" then
tdbot.sendText(msg.chat_id,msg.id,'`Test` `Test2`','md')
end
Hello,
I use telegram-bot nightly (180801) version downloaded from valtman.name/telegram-bot .
How to find or compile the latest update of tdbot which supports new syntax of tdbot.lua wrapper that located on github.com/rizaumami/tdbot.lua .
For example, the { _ = "user"} response, changed to: { ["@type"] = "user"} and my current tdbot doesn't recognize it.
Cheers
hey riza
is there any function to get inlinequery data?
i try everything
this is a vardump of updateNewCallbackQuery
_ = "updateNewCallbackQuery",
chat_id = 87227375,
chat_instance = "-506799303792642479",
id = "374638468114935129",
message_id = 695205888,
_ = "callbackQueryPayloadData",
data = "Z2V0Y2hhdDg3MjI3MzE1"
} --[[table: 0x55ee4cd761b0]],
sender_user_id = 87227375
} --[[table: 0x55ee4cd76e60]]
Hi Riza, how can i handle all nils so if tdbot got nil don't break the code?
Hi
i want a now functions of tdlib for lua!
you can help me about it??!
tanks for answer
if text have more then 1 parse mode in a text like
<b>test</b> <b>test</b>
bot crash and log is :
[ 1][t 0][1549041921.485059500][clilua.cpp:148][!Td] FAILED TO PARSE LUA: [Error : 0 : Expected Array, got Object]
[ 0][t 0][1549041921.485291243][clilua.cpp:213][!Td] lua: ./tdbot.lua:114: assertion failed!
[pid 81692] [time 1549041921] Signal: 6
how to disable json response print in terminal ?
Hi,
Can you give an example that explain how to send inline keyboard button via "replyMarkupInlineKeyboard" (on sendMessage method) in bot (API) mode ?
The new update of tdlib supports API, so it should work.
I use the code below, but it returns error that says:
[ 1][t 0][1533544806.054300547][clilua.cpp:148][!Td] FAILED TO PARSE LUA: [Error : 0 : Expected array, got JsonObject]
[ 0][t 0][1533496321.609632015][clilua.cpp:186][!Td] lua: ./bot.lua:51: assertion failed!
function tdbot_update_callback (data)
if (data["@type"]== "updateNewMessage") then
local msg = data.message
if msg.content["@type"]== "messageText" then
if msg.content.text.text == "ping" then
assert(tdbot_function({
["@type"]="sendMessage",
chat_id=msg.chat_id,
reply_to_message_id=msg.id,
disable_notification=false,
from_background=true,
reply_markup={
["@type"]="replyMarkupInlineKeyboard",
rows={
{
text="example",
type={
["@type"]="inlineKeyboardButtonTypeUrl",
url="https://example.com"
}
}
}
},
input_message_content={
["@type"]="inputMessageText",
text={text="pong"},
disable_web_page_preview=true,
clear_draft=false,
entities={},
parse_mode=nil
}
},dl_cb, nil))
end
end
end
end
So what's the problem?!
Tnx
Hello
Could you please tell me why this error occurs whenever I use getChatMessageByQuery with my bot?
Thanks
hi,
how can i use replay_markup in bot ?
its not working :
assert (tdbot_function ({
_ = "sendMessage",
chat_id = math.ceil(msg.chat_id),
reply_to_message_id = 0,
disable_notification=false,
from_background=true,
reply_markup={
_ = "replyMarkupShowKeyboard",
resize_keyboard = true,
rows ={
{
[0] = {
_ = "keyboardButton",
text = "bottom1",
type = {
_ = "keyboardButtonTypeText"
}
}
},
{
[0] = {
_ = "keyboardButton",
text = "bottom2",
type = {
_ = "keyboardButtonTypeText"
}
}
},
},
},
input_message_content={
_="inputMessageText",
text= "itsok",
disable_web_page_preview=true,
clear_draft=false,
entities={},
parse_mode=MarkDown}
}, dl_cb, nil))
ty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.