rizaumami / tdbot.lua

Lua wrapper for telegram-bot
GNU General Public License v3.0
24 stars 21 forks source link
lua tdbot tdclii telegram-bot telegram-cli

tdbot.lua

A simple Lua wrapper for tdbot.

See wiki for documentation.

How to Use

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

The Functions

tdbot.lua is a Work In Progress. This commit is based on:

Here is a list of tdbot methods. Checked functions has been tested and works or at least returned "ok".