diff options
author | Wim <wim@42.be> | 2020-01-09 21:52:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 21:52:19 +0100 |
commit | 9d84d6dd643c4017074e81465671cd9b25f9539a (patch) | |
tree | 8a767f91d655a6cf21d476e4fb7aa6fd8a952df8 /gateway/gateway.go | |
parent | 0f708daf2d14dcca261ef98cc698a1b1f2a6aa74 (diff) | |
download | matterbridge-msglm-9d84d6dd643c4017074e81465671cd9b25f9539a.tar.gz matterbridge-msglm-9d84d6dd643c4017074e81465671cd9b25f9539a.tar.bz2 matterbridge-msglm-9d84d6dd643c4017074e81465671cd9b25f9539a.zip |
Update to tengo v2 (#976)
Diffstat (limited to 'gateway/gateway.go')
-rw-r--r-- | gateway/gateway.go | 10 |
1 files changed, 5 insertions, 5 deletions
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) |