Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 222aea0f42665a74a88f7b616d9081c5e2749144 Author: Wim <wim@42.be> Date: Thu Jan 09 21:52:19 2020 +0000 Update to tengo v2 (#976) diff --git a/gateway/gateway.go b/gateway/gateway.go index b74a3aa..e265e62 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -108 +108 @@ 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" @@ -5147 +5147 @@ 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) @@ -5417 +5417 @@ 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) @@ -5807 +5807 @@ 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) diff --git a/go.mod b/go.mod index ff07c4a..d47fa93 100644 --- a/go.mod +++ b/go.mod @@ -77 +77 @@ require (   github.com/Philipp15b/go-steam v1.0.1-0.20190816133340-b04c5a83c1c0   github.com/Rhymen/go-whatsapp v0.1.0   github.com/bwmarrin/discordgo v0.20.2 - github.com/d5/tengo v1.24.8 + github.com/d5/tengo/v2 v2.0.2   github.com/dfordsoft/golib v0.0.0-20180902042739-76ee6ab99bec   github.com/fsnotify/fsnotify v1.4.7   github.com/go-telegram-bot-api/telegram-bot-api v4.6.5-0.20181225215658-ec221ba9ea45+incompatible diff --git a/go.sum b/go.sum index 9963c24..c356ee3 100644 --- a/go.sum +++ b/go.sum @@ -338 +338 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc  github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=  github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=  github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/d5/tengo v1.24.8 h1:PRJ+NWt7ae/9sSbIfThOBTkPSvNV+dwYoBAvwfNgNJY= -github.com/d5/tengo v1.24.8/go.mod h1:VhLq8Q2QFhCIJO3NhvM934qOThykMqJi9y9Siqd1ocQ= +github.com/d5/tengo/v2 v2.0.2 h1:3APkPZPc1FExaJoWrN5YzvDqc6GNkQH6ehmCRDmN83I= +github.com/d5/tengo/v2 v2.0.2/go.mod h1:XRGjEs5I9jYIKTxly6HCF8oiiilk5E/RYXOZ5b0DZC8=  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=