itte/examples/gordon/gordon.config.lua

46 lines
1.1 KiB
Lua
Raw Normal View History

2022-08-29 23:13:52 +00:00
local irc = require("itte")
local folia = require("folia")
itte_config = {
debug = false,
messages = {
2022-08-30 03:08:54 +00:00
help = "Don't just stand there like a big f—ing muffin! " ..
"Order something! Your Casa's Kitchen commands are: {{codes}}",
quit = "Master Chef under maintenance.",
2022-08-29 23:13:52 +00:00
reload = "Config reloaded.",
},
}
itte_handlers = {}
2022-08-30 03:08:54 +00:00
folia.foils_dir = os.getenv("PWD") .. "/commands"
2022-08-29 23:13:52 +00:00
local gordon = {}
-- Create handlers for each foil
function gordon.generate_handlers(handlers, foils_dir)
local foils = folia.get_foils(foils_dir)
for key, foil in pairs(foils) do
handlers[key] = function (cxt, msg)
irc.message(cxt, { msg.reply_to }, folia.output(key))
end
end
2022-08-30 03:08:54 +00:00
-- Add aliases
if folia.output("burger") ~= nil then
itte_handlers.borgar = function (cxt, msg)
irc.message(cxt, { msg.reply_to }, folia.output("burger"))
end
end
if folia.output("coffee") ~= nil then
itte_handlers.cofe = function (cxt, msg)
irc.message(cxt, { msg.reply_to }, folia.output("coffee"))
end
end
2022-08-29 23:13:52 +00:00
end
gordon.generate_handlers(itte_handlers, folia.foils_dir)