diff --git a/plugin_nsfw/main.go b/plugin_nsfw/main.go index 5eaf1ebe..784c5cad 100644 --- a/plugin_nsfw/main.go +++ b/plugin_nsfw/main.go @@ -41,7 +41,7 @@ func init() { if err != nil { return } - ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text(judge(p[0])))) + autojudge(ctx, p[0]) } }) } @@ -67,3 +67,31 @@ func judge(p nsfw.Picture) string { } return c } + +func autojudge(ctx *zero.Ctx, p nsfw.Picture) { + if p.Neutral > 0.3 { + return + } + c := "" + if p.Drawings > 0.3 { + c = "二次元" + } else { + c = "三次元" + } + i := 0 + if p.Hentai > 0.3 { + c += " hentai" + i++ + } + if p.Porn > 0.3 { + c += " porn" + i++ + } + if p.Sexy > 0.3 { + c += " hso" + i++ + } + if i > 0 { + ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text(c))) + } +}