feat: 喜报/悲报支持图片
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user