Skip to content

sajjad-021/tdbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tdbot.lua

A simple Lua wrapper for telegram-bot.

See wiki for documentation.

How to Use

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

See example script below.

-- Load tdbot library.
tdbot = require 'tdbot'

-- An alias to sendText
function sendText(chat_id, reply_to_message_id, text)
  tdbot.sendText(chat_id, reply_to_message_id, text, 0, 1, nil, 1, 'html', 0, nil)
end

function tdbot_update_callback (data)
  if (data._ == "updateNewMessage") then
    local msg = data.message

    if msg.content._ == "messageText" then
      if msg.content.text == "ping" then
          sendText(chat_id, msg.id, '<b>pong!</b>')
        }, dl_cb, nil))
      end
    end
  end
end

The Functions

tdbot.lua is a Work In Progress. This commit is based on telegram-bot-171023-nightly.tl scheme.
Here is a list of telegram-bot methods. Checked functions has been tested and works or returned "ok".

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published