aboutsummaryrefslogtreecommitdiffstats
path: root/plugins.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-06-03 23:55:52 +0000
committerterminaldweller <devi@terminaldweller.com>2024-06-03 23:55:52 +0000
commit54510fb0c2b70aa3f4ebd00b91f25fef874f293c (patch)
tree8b8f25be96ec36744ec99eea97fea51aa8cf0d7e /plugins.go
parentinitial lua script support, fixes #27, fixes #34 (diff)
downloadmilla-54510fb0c2b70aa3f4ebd00b91f25fef874f293c.tar.gz
milla-54510fb0c2b70aa3f4ebd00b91f25fef874f293c.zip
updated the readme and added example for lua scripting
Diffstat (limited to 'plugins.go')
-rw-r--r--plugins.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins.go b/plugins.go
index 69b3622..45c2847 100644
--- a/plugins.go
+++ b/plugins.go
@@ -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)