mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 01:49:22 +00:00
Update to tengo v2 (#976)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user