Skip to content

fix dish #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugin/dish/dish.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func init() {
logrus.Warnln("[dish]获取菜谱数据库文件失败")
} else if err = db.Open(time.Hour * 24); err != nil {
logrus.Warnln("[dish]连接菜谱数据库失败")
} else if err = db.Create("dishes", &dish{}); err != nil {
} else if err = db.Create("dish", &dish{}); err != nil {
logrus.Warnln("[dish]同步菜谱数据表失败")
} else if count, err := db.Count("dishes"); err != nil {
} else if count, err := db.Count("dish"); err != nil {
logrus.Warnln("[dish]统计菜谱数据失败")
} else {
logrus.Infoln("[dish]加载", count, "条菜谱")
Expand Down Expand Up @@ -77,7 +77,7 @@ func init() {
}

var d dish
if err := db.Find("dishes", &d, fmt.Sprintf("WHERE name like %%%s%%", dishName)); err != nil {
if err := db.Find("dish", &d, fmt.Sprintf("WHERE name like %%%s%%", dishName)); err != nil {
return
}

Expand All @@ -98,7 +98,7 @@ func init() {

name := ctx.NickName()
var d dish
if err := db.Pick("dishes", &d); err != nil {
if err := db.Pick("dish", &d); err != nil {
ctx.SendChain(message.Text("小店好像出错了,暂时端不出菜来惹"))
logrus.Warnln("[dish]随机菜谱请求出错:" + err.Error())
return
Expand Down