fix hyaku & omikuji lazy & score (#815)

This commit is contained in:
Jiang-Red 2023-11-08 21:06:05 +08:00 committed by GitHub
parent a5d2e3dfc3
commit 73b879a6f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/message" "github.com/wdvxdr1123/ZeroBot/message"
) )
const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/raw/branch/master" const bed = "https://gitea.seku.su/fumiama/OguraHyakuninIsshu/raw/branch/master/"
type line struct { type line struct {
番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string 番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string

View File

@ -17,7 +17,7 @@ import (
"github.com/FloatTech/zbputils/img/text" "github.com/FloatTech/zbputils/img/text"
) )
const bed = "https://gitea.seku.su/fumiama/senso-ji-omikuji/raw/branch/main" const bed = "https://gitea.seku.su/fumiama/senso-ji-omikuji/raw/branch/main/"
func init() { // 插件主体 func init() { // 插件主体
engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{ engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{

View File

@ -52,6 +52,7 @@ var (
func init() { func init() {
cachePath := engine.DataFolder() + "cache/" cachePath := engine.DataFolder() + "cache/"
go func() { go func() {
sdb = initialize(engine.DataFolder() + "score.db")
ok := file.IsExist(cachePath) ok := file.IsExist(cachePath)
if !ok { if !ok {
err := os.MkdirAll(cachePath, 0777) err := os.MkdirAll(cachePath, 0777)
@ -68,7 +69,6 @@ func init() {
} }
} }
} }
sdb = initialize(engine.DataFolder() + "score.db")
}() }()
engine.OnRegex(`^签到\s?(\d*)$`).Limit(ctxext.LimitByUser).SetBlock(true).Handle(func(ctx *zero.Ctx) { engine.OnRegex(`^签到\s?(\d*)$`).Limit(ctxext.LimitByUser).SetBlock(true).Handle(func(ctx *zero.Ctx) {
// 选择key // 选择key