mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
fix(searcher): forward node
This commit is contained in:
parent
06fd754cc5
commit
75d91b3d45
@ -63,7 +63,15 @@ func init() { // 插件主体
|
|||||||
}
|
}
|
||||||
if illust.Pid > 0 {
|
if illust.Pid > 0 {
|
||||||
name := strconv.FormatInt(illust.Pid, 10)
|
name := strconv.FormatInt(illust.Pid, 10)
|
||||||
var imgs message.Message
|
var imgs message.Message = 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,
|
||||||
|
),
|
||||||
|
}
|
||||||
for i := range illust.ImageUrls {
|
for i := range illust.ImageUrls {
|
||||||
f := file.BOTPATH + "/" + illust.Path(i)
|
f := file.BOTPATH + "/" + illust.Path(i)
|
||||||
n := name + "_p" + strconv.Itoa(i)
|
n := name + "_p" + strconv.Itoa(i)
|
||||||
@ -87,19 +95,11 @@ func init() { // 插件主体
|
|||||||
}
|
}
|
||||||
imgs = append(imgs, message.Image("file:///"+f))
|
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 {
|
if imgs != nil {
|
||||||
ctx.Send(message.Message{ctxext.FakeSenderForwardNode(ctx, txt),
|
ctx.Send(message.Message{ctxext.FakeSenderForwardNode(ctx, imgs...)})
|
||||||
ctxext.FakeSenderForwardNode(ctx, imgs...)})
|
|
||||||
} else {
|
} else {
|
||||||
// 图片下载失败,仅发送文字结果
|
// 图片下载失败,直接发送文字结果
|
||||||
ctx.SendChain(txt)
|
ctx.SendChain(imgs...)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ctx.SendChain(message.Text("图片不存在!"))
|
ctx.SendChain(message.Text("图片不存在!"))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user