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
请发表评论