fix: 更新喜报和悲报的帮助信息,支持换行或多消息发送;修正图片文件路径的构建方式,使用动态路径替代静态路径

This commit is contained in:
lixiangwuxian
2025-03-18 19:20:57 +08:00
parent c0764036ab
commit c6fbedc859
2 changed files with 6 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package message
import (
"encoding/json"
"fmt"
"log"
"net/url"
"regexp"
"strconv"
@@ -48,6 +49,7 @@ func (msg *ImageMessage) ToCQString() string {
}
func (msg *ImageMessage) ParseMessage(data string) error {
log.Println("ParseMessage", data)
// 使用正则表达式提取各个字段
re := regexp.MustCompile(`\[CQ:image,file=(.*?),sub_type=(.*?),file_id=(.*?),url=(.*?),file_size=(\d+),file_unique=(.*?)\]`)
matches := re.FindStringSubmatch(data)