comp-tg/readme.org

51 lines
1.3 KiB
Org Mode
Raw Normal View History

2021-08-16 08:17:12 +00:00
* Computer bot
2022-01-18 20:21:34 +00:00
Original is *[[https://gitdab.com/er2/comp-tg][here]]* and on my private server.
Mirrors can update irregularly.
2021-08-16 08:17:12 +00:00
-----
2022-01-18 20:21:34 +00:00
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.
2021-08-16 08:17:12 +00:00
Bot uses an OOP-style of Lua
as [[https://is.gd/f0Vadk][described on Wikipedia]].
2022-02-26 07:08:26 +00:00
For more readability bot's userland written in MoonScript.
2022-01-18 20:21:34 +00:00
Maybe I will rewrite bot's core to C but here already so many Lua code.
2021-08-16 08:17:12 +00:00
* Installation
[[https://alpinelinux.org][Alpine linux]], root:
+ Enable community repo (described in wiki)
2022-01-18 20:21:34 +00:00
+ Install lua and tools: ~apk add doas git lua5.3-dev luarocks musl-dev gcc openssl-dev~
2021-08-16 08:17:12 +00:00
+ Install LuaSec for https requests: ~luarocks-5.3 install luasec~
2022-02-26 07:08:26 +00:00
+ Install MoonScript: ~luarocks-5.1 install moonscript~
2021-08-16 08:17:12 +00:00
+ Create user: ~adduser user~
2022-01-18 20:21:34 +00:00
setup it (add to doas) and login to this user
2021-08-16 08:17:12 +00:00
+ Clone repo: ~git clone --recursive https://gitdab.com/er2/comp-tg~
and enter ~cd comp-tg~
+ Change token and owner in *config.lua*
2022-02-26 07:08:26 +00:00
+ Compile bot: ~moonc src/~
2022-01-18 20:21:34 +00:00
+ 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)
2021-08-16 08:17:12 +00:00
2022-01-18 20:21:34 +00:00
+ Start it ~doas service mybot start~