From f010d60991dd88bec5cdd632295bd72446232799 Mon Sep 17 00:00:00 2001 From: Tong Sun Date: Sat, 24 Jul 2021 17:40:54 -0400 Subject: [PATCH] - [#] Unescape XML in Content --- message.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/message.go b/message.go index 702b4cd..98d5fd7 100644 --- a/message.go +++ b/message.go @@ -5,8 +5,10 @@ import ( "encoding/xml" "errors" "fmt" + "html" "net/http" "os" + "regexp" "strconv" "strings" "sync" @@ -326,6 +328,9 @@ func (m *Message) init(bot *Bot) { } } } + if regexp.MustCompile(`^<`).MatchString(m.Content) { + m.Content = html.UnescapeString(m.Content) + } } // 发送消息的结构体