fix: 更新喜报和悲报的帮助信息,支持换行或多消息发送;修正图片文件路径的构建方式,使用动态路径替代静态路径
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user