Skip to content

Commit

Permalink
✏️ 修正直接随机
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 6, 2021
1 parent 421c202 commit 370933d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin_acgimage/classify.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
// r18有一定保护,一般不会发出图片
randapi = "&loli=true&r18=true"
msgof = make(map[int64]int64)
block = false
)

func init() { // 插件主体
Expand Down Expand Up @@ -56,16 +57,18 @@ func init() { // 插件主体
zero.OnFullMatch("直接随机", zero.AdminPermission).SetBlock(true).SetPriority(24).
Handle(func(ctx *zero.Ctx) {
if ctx.Event.GroupID > 0 {
if classify.CanVisit(5) {
if block {
ctx.Send("请稍后再试哦")
} else if randapi != "" {
block = true
var url string
if randapi[0] == '&' {
url = lolipxy
} else {
url = randapi
}
setLastMsg(ctx.Event.GroupID, ctx.Send(message.Image(url).Add("cache", "0")))
block = false
}
}
})
Expand Down

0 comments on commit 370933d

Please sign in to comment.