mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
✨ fix plugin nsfw
This commit is contained in:
parent
e1dbfe8f6a
commit
0770c6e4a1
@ -41,7 +41,7 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
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
|
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)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user