@@ -4,11 +4,13 @@ package deepdanbooru
44import (
55 "crypto/md5"
66 "encoding/hex"
7+ "strings"
78
89 "github.com/FloatTech/floatbox/file"
910 "github.com/FloatTech/floatbox/img/writer"
1011 ctrl "github.com/FloatTech/zbpctrl"
1112 "github.com/FloatTech/zbputils/control"
13+ "github.com/FloatTech/zbputils/ctxext"
1214 zero "github.com/wdvxdr1123/ZeroBot"
1315 "github.com/wdvxdr1123/ZeroBot/message"
1416 "github.com/wdvxdr1123/ZeroBot/utils/helper"
@@ -29,7 +31,7 @@ func init() { // 插件主体
2931 Handle (func (ctx * zero.Ctx ) {
3032 ctx .SendChain (message .Text ("少女祈祷中..." ))
3133 for _ , url := range ctx .State ["image_url" ].([]string ) {
32- t , err := tagurl ("" , url )
34+ t , st , err := tagurl ("" , url )
3335 if err != nil {
3436 ctx .SendChain (message .Text ("ERROR: " , err ))
3537 return
@@ -39,7 +41,11 @@ func init() { // 插件主体
3941 if file .IsNotExist (f ) {
4042 _ = writer .SavePNG2Path (f , t )
4143 }
42- ctx .SendChain (message .Image ("file:///" + file .BOTPATH + "/" + f ))
44+ m := message.Message {ctxext .FakeSenderForwardNode (ctx , message .Image ("file:///" + file .BOTPATH + "/" + f ))}
45+ m = append (m , ctxext .FakeSenderForwardNode (ctx , message .Text ("tags: " , strings .Join (st .tseq , "," ))))
46+ if id := ctx .Send (m ).ID (); id == 0 {
47+ ctx .SendChain (message .Text ("ERROR: 可能被风控或下载图片用时过长,请耐心等待" ))
48+ }
4349 }
4450 })
4551}
0 commit comments