From 9d84d6dd643c4017074e81465671cd9b25f9539a Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 9 Jan 2020 21:52:19 +0100 Subject: Update to tengo v2 (#976) --- gateway/gateway.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index b74a3aaa..e265e62b 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -10,8 +10,8 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/internal" - "github.com/d5/tengo/script" - "github.com/d5/tengo/stdlib" + "github.com/d5/tengo/v2" + "github.com/d5/tengo/v2/stdlib" lru "github.com/hashicorp/golang-lru" "github.com/matterbridge/emoji" "github.com/sirupsen/logrus" @@ -514,7 +514,7 @@ func modifyMessageTengo(filename string, msg *config.Message) error { if err != nil { return err } - s := script.New(res) + s := tengo.NewScript(res) s.SetImports(stdlib.GetModuleMap(stdlib.AllModuleNames()...)) _ = s.Add("msgText", msg.Text) _ = s.Add("msgUsername", msg.Username) @@ -541,7 +541,7 @@ func (gw *Gateway) modifyUsernameTengo(msg *config.Message, br *bridge.Bridge) ( if err != nil { return "", err } - s := script.New(res) + s := tengo.NewScript(res) s.SetImports(stdlib.GetModuleMap(stdlib.AllModuleNames()...)) _ = s.Add("result", "") _ = s.Add("msgText", msg.Text) @@ -580,7 +580,7 @@ func (gw *Gateway) modifySendMessageTengo(origmsg *config.Message, msg *config.M return err } } - s := script.New(res) + s := tengo.NewScript(res) s.SetImports(stdlib.GetModuleMap(stdlib.AllModuleNames()...)) _ = s.Add("inAccount", origmsg.Account) _ = s.Add("inProtocol", origmsg.Protocol) -- cgit v1.2.3