From 115d20373c21b107a428a55247c64f900e116038 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 6 Apr 2019 22:18:25 +0200 Subject: Update tengo vendor and load the stdlib. Fixes #789 (#792) --- gateway/gateway.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index 82be2a98..9957a21d 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -10,6 +10,7 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" "github.com/d5/tengo/script" + "github.com/d5/tengo/stdlib" lru "github.com/hashicorp/golang-lru" "github.com/peterhellberg/emojilib" "github.com/sirupsen/logrus" @@ -503,6 +504,7 @@ func modifyMessageTengo(filename string, msg *config.Message) error { return err } s := script.New(res) + s.SetImports(stdlib.GetModuleMap(stdlib.AllModuleNames()...)) _ = s.Add("msgText", msg.Text) _ = s.Add("msgUsername", msg.Username) _ = s.Add("msgAccount", msg.Account) -- cgit v1.2.3