Compare commits

..

1 Commits

Author SHA1 Message Date
mio 86c7eaf04c 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 03:17:04 +00:00
2 changed files with 4 additions and 8 deletions

View File

@ -10,7 +10,7 @@
## Installation ## Installation
- Install Lua and other dependencies. Example: - Install Lua and other dependencies. Examples:
- Debian/Ubuntu-based distributions: `apt-get install lua-socket lua-sec` - 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 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 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 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 `!` is module. For example, if the code users will type is "!hello" (where the "!"
a prefix to mark it as a bot code), name the function is a prefix to mark it as a bot code), name the function
`itte_handlers.hello()`. Handler names cannot start with numbers or special `itte_handlers.hello()`. Handler names cannot start with numbers or special
characters. characters.

View File

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