package main import ( "os" "runtime" "git.xeserv.us/xena/worm/script" "github.com/layeh/gopher-luar" "github.com/thoj/go-ircevent" "github.com/yuin/gopher-lua" ) func main() { l := script.InitLua() i := irc.IRC("Cadey", "love") i.Debug = true err := i.Connect(os.Getenv("IRC_SERVER")) if err != nil { panic(err) } i.AddCallback("001", func(e *irc.Event) { i.Join("#test") }) i.AddCallback("PRIVMSG", func(e *irc.Event) { levent := luar.New(l, e) err := l.CallByParam(lua.P{ Fn: l.GetGlobal("handleMessage"), NRet: 0, Protect: true, }, levent) if err != nil { panic(err) } }) l.DoFile("./modules/test.lua") runtime.Goexit() }