fix: 更新 ImageMessage 的 URL 处理逻辑,修复日志记录方式并移除冗余日志
This commit is contained in:
@@ -94,13 +94,13 @@ func GenerateCongratulationImage(text string, inputFile, outputFile string, isGo
|
||||
// }
|
||||
fontBytes, err := os.ReadFile("./resource/emoji.ttf")
|
||||
if err != nil {
|
||||
log.Print("failed to load font: %v", err)
|
||||
log.Printf("failed to load font: %v", err)
|
||||
}
|
||||
|
||||
// 解析字体
|
||||
font, err := opentype.Parse(fontBytes)
|
||||
if err != nil {
|
||||
log.Print("failed to parse font: %v", err)
|
||||
log.Printf("failed to parse font: %v", err)
|
||||
}
|
||||
|
||||
// 设置字体大小和 DPI
|
||||
@@ -114,7 +114,7 @@ func GenerateCongratulationImage(text string, inputFile, outputFile string, isGo
|
||||
Hinting: 0,
|
||||
})
|
||||
if err != nil {
|
||||
log.Print("failed to create font face: %v", err)
|
||||
log.Printf("failed to create font face: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -154,7 +154,6 @@ func GenerateCongratulationImage(text string, inputFile, outputFile string, isGo
|
||||
}
|
||||
|
||||
func isImageCQ(text string) (string, bool) {
|
||||
log.Println("isImageCQ ", text)
|
||||
imgMsg := message.ImageMessage{}
|
||||
if err := imgMsg.ParseMessage(text); err == nil {
|
||||
return imgMsg.Data.URL, true
|
||||
|
||||
Reference in New Issue
Block a user