mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 22:40:23 +08:00
🐛 nsfw 防止风控
This commit is contained in:
parent
fc0d020a04
commit
4fe64eeb44
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/FloatTech/AnimeAPI/nsfw"
|
"github.com/FloatTech/AnimeAPI/nsfw"
|
||||||
"github.com/FloatTech/zbputils/control"
|
"github.com/FloatTech/zbputils/control"
|
||||||
"github.com/FloatTech/zbputils/ctxext"
|
"github.com/FloatTech/zbputils/ctxext"
|
||||||
|
"github.com/FloatTech/zbputils/process"
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
"github.com/wdvxdr1123/ZeroBot/message"
|
"github.com/wdvxdr1123/ZeroBot/message"
|
||||||
|
|
||||||
@ -37,10 +38,12 @@ func init() {
|
|||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
url := ctx.State["image_url"].([]string)
|
url := ctx.State["image_url"].([]string)
|
||||||
if len(url) > 0 {
|
if len(url) > 0 {
|
||||||
|
process.SleepAbout1sTo2s()
|
||||||
p, err := nsfw.Classify(url...)
|
p, err := nsfw.Classify(url...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
process.SleepAbout1sTo2s()
|
||||||
autojudge(ctx, p[0])
|
autojudge(ctx, p[0])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user