mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
🎨 优化代码
This commit is contained in:
parent
a861a1d169
commit
b767f5500a
@ -11,17 +11,21 @@ import (
|
|||||||
"github.com/wdvxdr1123/ZeroBot/message"
|
"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 (
|
var (
|
||||||
lolipxy = "http://sayuri.fumiama.top:62002/dice?class=0&loli=true&r18=true"
|
|
||||||
// r18有一定保护,一般不会发出图片
|
// r18有一定保护,一般不会发出图片
|
||||||
randapi = "&loli=true&r18=true"
|
randapi = "&loli=true&r18=true"
|
||||||
msgof = make(map[int64]int64)
|
msgof = make(map[int64]int64)
|
||||||
datapath = "data/acgimage/"
|
|
||||||
cachefile = datapath + "cache"
|
|
||||||
cacheuri = "file:///" + cachefile
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { // 插件主体
|
func init() { // 插件主体
|
||||||
|
// 初始化 classify
|
||||||
|
classify.Init(datapath)
|
||||||
zero.OnRegex(`^设置随机图片网址(.*)$`, zero.SuperUserPermission).SetBlock(true).SetPriority(20).
|
zero.OnRegex(`^设置随机图片网址(.*)$`, zero.SuperUserPermission).SetBlock(true).SetPriority(20).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
url := ctx.State["regex_matched"].([]string)[1]
|
url := ctx.State["regex_matched"].([]string)[1]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user