summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go10
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)