Skip to content

Commit

Permalink
wtf
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoshinonyaruko committed Nov 17, 2023
1 parent 03ec159 commit 3228e76
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions handlers/message_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func parseMessageContent(paramsMessage callapi.ParamsContent) (string, map[strin
default:
mylog.Println("Unsupported message format: params.message field is not a string, map or slice")
}
//mylog.Printf(messageText)
mylog.Printf(messageText)
// 正则表达式部分
var localImagePattern *regexp.Regexp

Expand Down Expand Up @@ -160,7 +160,9 @@ func parseMessageContent(paramsMessage callapi.ParamsContent) (string, map[strin

//处理at
messageText = transformMessageText(messageText)

for key, items := range foundItems {
fmt.Printf("Key: %s, Items: %v\n", key, items)
}
return messageText, foundItems
}

Expand Down Expand Up @@ -399,8 +401,8 @@ func ConvertToSegmentedMessage(data interface{}) []map[string]interface{} {
messageSegments = append(messageSegments, imageSegment)

// 在msg.Content中替换旧的图片链接
newImagePattern := "[CQ:image,file=" + attachment.URL + "]"
msg.Content = msg.Content + newImagePattern
//newImagePattern := "[CQ:image,file=" + attachment.URL + "]"
//msg.Content = msg.Content + newImagePattern
}
// 将msg.Content里的BotID替换成AppID
msg.Content = strings.ReplaceAll(msg.Content, BotID, AppID)
Expand Down

0 comments on commit 3228e76

Please sign in to comment.