feat: 喜报/悲报支持图片

This commit is contained in:
lixiangwuxian
2024-10-20 02:25:39 +08:00
parent 235d22a4c0
commit 6dad9bb76f
3 changed files with 94 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/url"
"regexp"
"strconv"
"strings"
)
// @某个QQ用户的结构体
@@ -65,6 +66,11 @@ func ParseCQImageMessage(data string) (*CQImageMessage, error) {
// 处理URL转义
decodedURL, err := url.QueryUnescape(matches[4])
decodedURL = strings.ReplaceAll(decodedURL, ",", ",")
decodedURL = strings.ReplaceAll(decodedURL, "[", "[")
decodedURL = strings.ReplaceAll(decodedURL, "]", "]")
decodedURL = strings.ReplaceAll(decodedURL, "&", "&")
if err != nil {
return nil, fmt.Errorf("URL 转义失败: %v", err)
}