diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-06-03 23:55:52 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-06-03 23:55:52 +0000 |
commit | 54510fb0c2b70aa3f4ebd00b91f25fef874f293c (patch) | |
tree | 8b8f25be96ec36744ec99eea97fea51aa8cf0d7e /plugins.go | |
parent | initial lua script support, fixes #27, fixes #34 (diff) | |
download | milla-54510fb0c2b70aa3f4ebd00b91f25fef874f293c.tar.gz milla-54510fb0c2b70aa3f4ebd00b91f25fef874f293c.zip |
updated the readme and added example for lua scripting
Diffstat (limited to 'plugins.go')
-rw-r--r-- | plugins.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2,9 +2,12 @@ package main import ( "log" + "net/http" "reflect" "github.com/ailncode/gluaxmlpath" + "github.com/cjoudrey/gluahttp" + "github.com/kohkimakimoto/gluayaml" "github.com/lrstanley/girc" lua "github.com/yuin/gopher-lua" "gitlab.com/megalithic-llc/gluasocket" @@ -235,6 +238,8 @@ func RunScript(scriptPath string, client *girc.Client) { luaState.PreloadModule("milla", millaModuleLoaderClosure(luaState, client)) gluasocket.Preload(luaState) gluaxmlpath.Preload(luaState) + luaState.PreloadModule("http", gluahttp.NewHttpModule(&http.Client{}).Loader) + luaState.PreloadModule("yaml", gluayaml.Loader) log.Print("Running script: ", scriptPath) |