mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
✏️ 修正直接随机
This commit is contained in:
parent
421c2028ca
commit
370933df1d
@ -24,6 +24,7 @@ var (
|
|||||||
// r18有一定保护,一般不会发出图片
|
// r18有一定保护,一般不会发出图片
|
||||||
randapi = "&loli=true&r18=true"
|
randapi = "&loli=true&r18=true"
|
||||||
msgof = make(map[int64]int64)
|
msgof = make(map[int64]int64)
|
||||||
|
block = false
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { // 插件主体
|
func init() { // 插件主体
|
||||||
@ -56,9 +57,10 @@ func init() { // 插件主体
|
|||||||
zero.OnFullMatch("直接随机", zero.AdminPermission).SetBlock(true).SetPriority(24).
|
zero.OnFullMatch("直接随机", zero.AdminPermission).SetBlock(true).SetPriority(24).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
if ctx.Event.GroupID > 0 {
|
if ctx.Event.GroupID > 0 {
|
||||||
if classify.CanVisit(5) {
|
if block {
|
||||||
ctx.Send("请稍后再试哦")
|
ctx.Send("请稍后再试哦")
|
||||||
} else if randapi != "" {
|
} else if randapi != "" {
|
||||||
|
block = true
|
||||||
var url string
|
var url string
|
||||||
if randapi[0] == '&' {
|
if randapi[0] == '&' {
|
||||||
url = lolipxy
|
url = lolipxy
|
||||||
@ -66,6 +68,7 @@ func init() { // 插件主体
|
|||||||
url = randapi
|
url = randapi
|
||||||
}
|
}
|
||||||
setLastMsg(ctx.Event.GroupID, ctx.Send(message.Image(url).Add("cache", "0")))
|
setLastMsg(ctx.Event.GroupID, ctx.Send(message.Image(url).Add("cache", "0")))
|
||||||
|
block = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user