From e8b715ea6e5bea40fad7e9042eea29f776d4a71b Mon Sep 17 00:00:00 2001 From: scjtqs Date: Sun, 6 Sep 2020 10:50:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A5=E8=B0=A8=E4=B8=80=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=B8=8Bjson=E6=A0=BC=E5=BC=8F=E7=9A=84?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=EF=BC=8C=E5=85=B6=E4=BB=96=E9=9D=9E?= =?UTF-8?q?xml=E5=92=8Cjson=E7=9A=84=E5=AF=8C=E6=96=87=E6=9C=AC=20?= =?UTF-8?q?=E5=86=99=E5=85=A5text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 1 + message/message.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 0bf68ec6..2006d99e 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,6 @@ go 1.14 require ( github.com/golang/protobuf v1.4.2 + github.com/tidwall/gjson v1.6.1 // indirect google.golang.org/protobuf v1.25.0 ) diff --git a/message/message.go b/message/message.go index 313addd9..0362f569 100644 --- a/message/message.go +++ b/message/message.go @@ -6,6 +6,7 @@ import ( "github.com/Mrs4s/MiraiGo/client/pb/msg" "github.com/Mrs4s/MiraiGo/utils" "github.com/golang/protobuf/proto" + "github.com/tidwall/gjson" "math" "reflect" "regexp" @@ -504,10 +505,14 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement { } if isOk := strings.Contains(content, "