Telegram bot written in Lua
Find a file
2022-02-25 12:54:26 +03:00
etc optional quoted args, update lib 2022-02-13 15:23:16 +03:00
src ??? 2022-02-25 12:54:26 +03:00
.gitignore remove neednt db 2021-08-16 11:17:12 +03:00
.gitmodules split api 2021-08-16 11:56:28 +03:00
bot.rc update lib, remove depend() in rc file 2022-02-02 18:52:28 +03:00
config.lua add хуех on эх, start command 2022-02-25 10:31:32 +03:00
init.lua luajit support 2022-01-23 18:18:53 +03:00
LICENSE add readme, some code refactoring 2021-07-19 10:55:01 +03:00
readme.org update readme 2022-01-18 20:21:34 +00:00
start.sh luajit support 2022-01-23 18:18:53 +03:00

Computer bot

Original is here and on my private server. Mirrors can update irregularly.


This is a bot for Telegram. It haven't got much possibilities, but this code can be used in other bots.

Bot can use locale of Telegram client (unlike much bots) and use it or fallback to English.

Bot uses an OOP-style of Lua as described on Wikipedia.

Maybe I will rewrite bot's core to C but here already so many Lua code.

Installation

Alpine linux, root:

  • Enable community repo (described in wiki)
  • Install lua and tools: apk add doas git lua5.3-dev luarocks musl-dev gcc openssl-dev
  • Install LuaSec for https requests: luarocks-5.3 install luasec
  • Create user: adduser user setup it (add to doas) and login to this user
  • Clone repo: git clone --recursive https://gitdab.com/er2/comp-tg and enter cd comp-tg
  • Change token and owner in config.lua
  • Add service doas cp bot.rc /etc/init.d/mybot && doas chmod +x /etc/init.d/mybot
  • Configure it doas vi /etc/init.d/mybot (change user)
  • Start it doas service mybot start