Compare commits

..

1 Commits

Author SHA1 Message Date
mio 4edbf32ef9 Add docs
- Add more-detailed usage doc
- Add a smaller hello world example
- Include a user systemd file
- Fix config check to include second-level nested tables
2022-03-21 04:09:12 +00:00
2 changed files with 8 additions and 4 deletions

View File

@ -10,7 +10,7 @@
## Installation
- Install Lua and other dependencies. Examples:
- Install Lua and other dependencies. Example:
- Debian/Ubuntu-based distributions: `apt-get install lua-socket lua-sec`
@ -53,8 +53,8 @@
from IRC commands sent to the server like `JOIN` or `PART`. Name the
handler after the code word that will be used to trigger the function and
add it to `itte_handlers` so it can be automatically picked up by the
module. For example, if the code users will type is "!hello" (where the "!"
is a prefix to mark it as a bot code), name the function
module. For example, if the code users will type is `!hello` (where `!` is
a prefix to mark it as a bot code), name the function
`itte_handlers.hello()`. Handler names cannot start with numbers or special
characters.

View File

@ -129,7 +129,11 @@ function itte.get_config(reload)
-- Second-level nested tables
if type(v) == "table" then
for kk, vv in pairs(v) do
itte.config[k][kk] = vv
if (type(vv) == "table") or (type(vv) == "function") then
itte.config[k] = v
else
itte.config[k][kk] = vv
end
end
else
itte.config[k] = v