diff --git a/plugin/saucenao/searcher.go b/plugin/saucenao/searcher.go index 11f3ab94..843a16eb 100644 --- a/plugin/saucenao/searcher.go +++ b/plugin/saucenao/searcher.go @@ -63,15 +63,7 @@ func init() { // 插件主体 } if illust.Pid > 0 { name := strconv.FormatInt(illust.Pid, 10) - var imgs = message.Message{ - message.Text( - "标题: ", illust.Title, "\n", - "插画ID: ", illust.Pid, "\n", - "画师: ", illust.UserName, "\n", - "画师ID: ", illust.UserID, "\n", - "直链: ", "https://pixivel.moe/detail?id=", illust.Pid, - ), - } + var imgs message.Message for i := range illust.ImageUrls { f := file.BOTPATH + "/" + illust.Path(i) n := name + "_p" + strconv.Itoa(i) @@ -95,11 +87,19 @@ func init() { // 插件主体 } imgs = append(imgs, message.Image("file:///"+f)) } + txt := message.Text( + "标题: ", illust.Title, "\n", + "插画ID: ", illust.Pid, "\n", + "画师: ", illust.UserName, "\n", + "画师ID: ", illust.UserID, "\n", + "直链: ", "https://pixivel.moe/detail?id=", illust.Pid, + ) if imgs != nil { - ctx.Send(message.Message{ctxext.FakeSenderForwardNode(ctx, imgs...)}) + ctx.Send(message.Message{ctxext.FakeSenderForwardNode(ctx, txt), + ctxext.FakeSenderForwardNode(ctx, imgs...)}) } else { - // 图片下载失败,直接发送文字结果 - ctx.SendChain(imgs...) + // 图片下载失败,仅发送文字结果 + ctx.SendChain(txt) } } else { ctx.SendChain(message.Text("图片不存在!"))