群管增加定时器保存功能

This commit is contained in:
fumiama
2021-06-06 14:27:16 +08:00
parent 84b0525f74
commit 42b62f0463
8 changed files with 152 additions and 73 deletions

View File

@@ -10,17 +10,18 @@ import (
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/Yiwen-Chan/ZeroBot-Plugin/api/pixiv"
apiutils "github.com/Yiwen-Chan/ZeroBot-Plugin/api/utils"
utils "github.com/Yiwen-Chan/ZeroBot-Plugin/picsearcher/utils"
)
var CACHEPATH = "/tmp/picsch/" // 缓冲图片路径
func init() { // 插件主体
pixiv.CreatePath(CACHEPATH)
apiutils.CreatePath(CACHEPATH)
// 根据PID搜图
zero.OnRegex(`^搜图(\d+)$`).SetBlock(true).SetPriority(30).
Handle(func(ctx *zero.Ctx) {
id := pixiv.Str2Int(ctx.State["regex_matched"].([]string)[1])
id := apiutils.Str2Int(ctx.State["regex_matched"].([]string)[1])
ctx.Send("少女祈祷中......")
// 获取P站插图信息
illust := &pixiv.Illust{}