⬆️ update sqlite

This commit is contained in:
源文雨
2022-06-10 15:47:47 +08:00
parent 9f748a8119
commit fbeb048c44
15 changed files with 122 additions and 47 deletions

View File

@@ -2,6 +2,8 @@
package chouxianghua
import (
"time"
"github.com/sirupsen/logrus"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
@@ -23,7 +25,12 @@ func init() {
db.DBPath = en.DataFolder() + "cxh.db"
// os.RemoveAll(dbpath)
_, _ = en.GetLazyData("cxh.db", true)
err := db.Create("pinyin", &pinyin{})
err := db.Open(time.Hour * 24)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return false
}
err = db.Create("pinyin", &pinyin{})
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return false