diff --git a/go.mod b/go.mod index 5bc4fee9d5..a5a3920bbc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/FloatTech/ZeroBot-Plugin go 1.18 require ( - github.com/FloatTech/AnimeAPI v1.3.3-0.20220404063515-276c66b6465b + github.com/FloatTech/AnimeAPI v1.3.3-0.20220405074902-947bbc912682 github.com/FloatTech/sqlite v0.2.1 github.com/FloatTech/zbputils v1.3.3-0.20220404063419-35ea3d038087 github.com/antchfx/htmlquery v1.2.4 diff --git a/go.sum b/go.sum index 7ebfc41701..737e333b50 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/FloatTech/AnimeAPI v1.3.3-0.20220404063515-276c66b6465b h1:dnCOvui63+Nzx2x9AbktsX2B02GOMznphgO58KC0SaQ= -github.com/FloatTech/AnimeAPI v1.3.3-0.20220404063515-276c66b6465b/go.mod h1:YhosmTPUUN8NTwUy3YQCXM9ESQ14x3NUi81cAIbklUs= +github.com/FloatTech/AnimeAPI v1.3.3-0.20220405074902-947bbc912682 h1:5pjrW6uotrtHbVITQFeZJdKc4ZlwPdiA25nx90BBD84= +github.com/FloatTech/AnimeAPI v1.3.3-0.20220405074902-947bbc912682/go.mod h1:YhosmTPUUN8NTwUy3YQCXM9ESQ14x3NUi81cAIbklUs= github.com/FloatTech/sqlite v0.2.1 h1:9t6Me48XJJCIoPy4nLRvcdhcVKfT0c2lilp7SEKROG8= github.com/FloatTech/sqlite v0.2.1/go.mod h1:6NfHRzqOo9RWeMJEoAQVuo51Omd5LFNxCNQhMF02/9U= github.com/FloatTech/zbputils v1.3.3-0.20220404063419-35ea3d038087 h1:yq9lwq5tbKuFEr9eiPeZsORmWKSAErFrzAIPc/1hmuA= diff --git a/plugin/nsfw/main.go b/plugin/nsfw/main.go index 2ab388724c..e82ef9c47a 100644 --- a/plugin/nsfw/main.go +++ b/plugin/nsfw/main.go @@ -23,12 +23,12 @@ func init() { url := ctx.State["image_url"].([]string) if len(url) > 0 { ctx.SendChain(message.Text("少女祈祷中...")) - p, err := nsfw.Classify(url...) + p, err := nsfw.Classify(url[0]) if err != nil { ctx.SendChain(message.Text("ERROR:", err)) return } - ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text(judge(p[0])))) + ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text(judge(p)))) } }) control.Register("nsfwauto", &control.Options{ @@ -39,17 +39,17 @@ func init() { url := ctx.State["image_url"].([]string) if len(url) > 0 { process.SleepAbout1sTo2s() - p, err := nsfw.Classify(url...) + p, err := nsfw.Classify(url[0]) if err != nil { return } process.SleepAbout1sTo2s() - autojudge(ctx, p[0]) + autojudge(ctx, p) } }) } -func judge(p nsfw.Picture) string { +func judge(p *nsfw.Picture) string { if p.Neutral > 0.3 { return "普通哦" } @@ -71,7 +71,7 @@ func judge(p nsfw.Picture) string { return c } -func autojudge(ctx *zero.Ctx, p nsfw.Picture) { +func autojudge(ctx *zero.Ctx, p *nsfw.Picture) { if p.Neutral > 0.3 { return } diff --git a/plugin/scale/main.go b/plugin/scale/main.go index ff61120b24..3bb4191430 100644 --- a/plugin/scale/main.go +++ b/plugin/scale/main.go @@ -56,7 +56,7 @@ func init() { ctx.SendChain(message.Text("ERROR:", err)) return } - if p[0].Drawings < 0.1 || p[0].Neutral > 0.8 { + if p.Drawings < 0.1 || p.Neutral > 0.8 { ctx.SendChain(message.Text("请发送二次元图片!")) return }