优化GetLazyData

This commit is contained in:
源文雨
2022-05-05 13:31:22 +08:00
parent 17a8c10f8c
commit a8fba6e7b5
23 changed files with 46 additions and 74 deletions

View File

@@ -40,7 +40,7 @@ func init() {
_ = os.RemoveAll(cachePath)
_ = os.MkdirAll(cachePath, 0755)
engine.OnRegex(`^热词\s?(\d*)\s?(\d*)$`, zero.OnlyGroup, ctxext.DoOnceOnSuccess(func(ctx *zero.Ctx) bool {
_, err := file.GetLazyData(engine.DataFolder()+"stopwords.txt", false, false)
_, err := engine.GetLazyData("stopwords.txt", false)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return false
@@ -56,7 +56,7 @@ func init() {
return true
})).Limit(ctxext.LimitByUser).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
_, err := file.GetLazyData(text.FontFile, false, true)
_, err := file.GetLazyData(text.FontFile, true)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return