From b767f5500aaafdfc4bdc2a97f6df3946665b95c3 Mon Sep 17 00:00:00 2001 From: fumiama Date: Fri, 6 Aug 2021 23:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_acgimage/classify.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugin_acgimage/classify.go b/plugin_acgimage/classify.go index a3f722b8..ac345559 100644 --- a/plugin_acgimage/classify.go +++ b/plugin_acgimage/classify.go @@ -11,17 +11,21 @@ import ( "github.com/wdvxdr1123/ZeroBot/message" ) +const ( + datapath = "data/acgimage/" + cacheuri = "file:///" + datapath + "cache" + lolipxy = "http://sayuri.fumiama.top:62002/dice?class=0&loli=true&r18=true" +) + var ( - lolipxy = "http://sayuri.fumiama.top:62002/dice?class=0&loli=true&r18=true" // r18有一定保护,一般不会发出图片 - randapi = "&loli=true&r18=true" - msgof = make(map[int64]int64) - datapath = "data/acgimage/" - cachefile = datapath + "cache" - cacheuri = "file:///" + cachefile + randapi = "&loli=true&r18=true" + msgof = make(map[int64]int64) ) func init() { // 插件主体 + // 初始化 classify + classify.Init(datapath) zero.OnRegex(`^设置随机图片网址(.*)$`, zero.SuperUserPermission).SetBlock(true).SetPriority(20). Handle(func(ctx *zero.Ctx) { url := ctx.State["regex_matched"].([]string)[1]