mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
优化GetLazyData
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
sql "github.com/FloatTech/sqlite"
|
||||
"github.com/FloatTech/zbputils/control"
|
||||
"github.com/FloatTech/zbputils/ctxext"
|
||||
"github.com/FloatTech/zbputils/file"
|
||||
"github.com/sirupsen/logrus"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
@@ -28,9 +27,8 @@ func init() {
|
||||
|
||||
en.OnFullMatch("舔狗日记", ctxext.DoOnceOnSuccess(
|
||||
func(ctx *zero.Ctx) bool {
|
||||
dbpath := en.DataFolder()
|
||||
db.DBPath = dbpath + "tiangou.db"
|
||||
_, err := file.GetLazyData(db.DBPath, false, true)
|
||||
db.DBPath = en.DataFolder() + "tiangou.db"
|
||||
_, err := en.GetLazyData("tiangou.db", true)
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR:", err))
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user