Skip to content

rizaumami/tdbot.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tdbot.lua

A simple Lua wrapper for tdbot.

See wiki for documentation.

How to Use

  • Put tdbot.lua on a same directory level with the bot script
  • Import tdbot.lua into the bot.
  • Call the functions.

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".