A simple Lua wrapper for tdbot
.
See wiki for documentation.
tdbot.lua
on a same directory level with the bot scripttdbot.lua
into the bot.See example script below.
-- Load tdbot library.
local tdbot = require 'tdbot'
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
tdbot.sendText(msg.chat_id, msg.id, '<b>pong!</b>', 'html')
end
end
end
end
tdbot.lua
is a Work In Progress. This commit is based on:
tdbot
commit https://github.com/vysheng/tdbot/commit/a838e8768f1c405306975763d59d48ca9f347805td_api.tl
from td
commit https://github.com/tdlib/td/commit/cfe4d9bdcee9305632eb228a46a95407d05b5c7aHere is a list of tdbot
methods. Checked functions has been tested and works or at least returned "ok".