mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
classify不阻塞请求
This commit is contained in:
parent
754057f3c2
commit
018c37018f
@ -14,7 +14,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
BLOCK_REQUEST_CLASS = false
|
|
||||||
CACHE_IMG_FILE = "/tmp/setugt"
|
CACHE_IMG_FILE = "/tmp/setugt"
|
||||||
CACHE_URI = "file:///" + CACHE_IMG_FILE
|
CACHE_URI = "file:///" + CACHE_IMG_FILE
|
||||||
VOTE_API_URL = "http://saki.fumiama.top/vote?uuid=零号&img=%s&class=%d"
|
VOTE_API_URL = "http://saki.fumiama.top/vote?uuid=零号&img=%s&class=%d"
|
||||||
@ -24,10 +23,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Classify(ctx *zero.Ctx, targeturl string, noimg bool) {
|
func Classify(ctx *zero.Ctx, targeturl string, noimg bool) {
|
||||||
if BLOCK_REQUEST_CLASS {
|
|
||||||
ctx.Send("请稍后再试哦")
|
|
||||||
} else {
|
|
||||||
BLOCK_REQUEST_CLASS = true
|
|
||||||
get_url := CLASSIFY_HEAD + url.QueryEscape(targeturl)
|
get_url := CLASSIFY_HEAD + url.QueryEscape(targeturl)
|
||||||
if noimg {
|
if noimg {
|
||||||
get_url += "&noimg=true"
|
get_url += "&noimg=true"
|
||||||
@ -60,8 +56,6 @@ func Classify(ctx *zero.Ctx, targeturl string, noimg bool) {
|
|||||||
replyClass(ctx, dhash, class, noimg)
|
replyClass(ctx, dhash, class, noimg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BLOCK_REQUEST_CLASS = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Vote(ctx *zero.Ctx, class int) {
|
func Vote(ctx *zero.Ctx, class int) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user