From 3eee3d64f1c500ff0eba715afc4a71de405851a7 Mon Sep 17 00:00:00 2001 From: Yiwen-Chan Date: Sat, 20 Mar 2021 00:36:02 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setutime/setu_geter.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setutime/setu_geter.go b/setutime/setu_geter.go index 7f70be87..bf48c671 100644 --- a/setutime/setu_geter.go +++ b/setutime/setu_geter.go @@ -50,14 +50,12 @@ func init() { // 插件主体 ctx.Send("请稍后重试0x0...") return } - var ( - type_ = ctx.State["regex_matched"].([]string)[1] - illust = &utils.Illust{} - ) + var type_ = ctx.State["regex_matched"].([]string)[1] // TODO 补充池子 go func() { times := utils.Min(PoolsCache.Max-PoolsCache.Size(type_), 2) for i := 0; i < times; i++ { + illust := &utils.Illust{} // 查询出一张图片 if err := DB.Select(type_, illust, "ORDER BY RANDOM() limit 1"); err != nil { ctx.Send(fmt.Sprintf("ERROR: %v", err))