all database switched to repository model. some other fixes and features
This commit is contained in:
@@ -41,7 +41,8 @@ func rpInfo(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
rpRepRed := red.NewRPRepository(db)
|
||||
rpRepPsql := psql.NewRPRepository(db)
|
||||
waifuId := rpRepRed.GetSelectedWaifu(ctx.FromID)
|
||||
waifu, err := psql.GetWaifuById(waifuId)
|
||||
waifuRep := psql.NewWaifuRepository(db)
|
||||
waifu, err := waifuRep.GetById(waifuId)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
@@ -51,9 +52,9 @@ func rpInfo(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
}
|
||||
out := []string{
|
||||
fmt.Sprintf("Привет, %s!", ctx.From.FirstName),
|
||||
fmt.Sprintf("Выбранная вайфу: %s", waifu.Name),
|
||||
fmt.Sprintf("Выбранный пресет: %s", "_TODO_"),
|
||||
fmt.Sprintf("Твое описание персонажа: %s", rpUser.UserPrompt),
|
||||
fmt.Sprintf("*Выбранная вайфу*: %s", waifu.Name),
|
||||
fmt.Sprintf("*Выбранный пресет*: %s", laniakea.EscapeMarkdown(rpUser.Preset.Name)),
|
||||
fmt.Sprintf("*Твое описание персонажа*: %s", rpUser.UserPrompt),
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
@@ -69,7 +70,8 @@ func rpInfo(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
}
|
||||
|
||||
func rpWaifuList(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
waifus, err := psql.GetUserWaifus(ctx.FromID)
|
||||
waifuRep := psql.NewWaifuRepository(db)
|
||||
waifus, err := waifuRep.GetByUserId(ctx.FromID)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
@@ -98,7 +100,8 @@ func rpWaifuSet(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
return
|
||||
}
|
||||
//rpRepPsql := psql.NewRPRepository(db)
|
||||
waifu, err := psql.GetWaifuById(waifuId)
|
||||
waifuRep := psql.NewWaifuRepository(db)
|
||||
waifu, err := waifuRep.GetById(waifuId)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
@@ -304,7 +307,8 @@ func generate(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
return
|
||||
}
|
||||
}
|
||||
waifu, err := psql.GetWaifuById(waifuId)
|
||||
waifuRep := psql.NewWaifuRepository(db)
|
||||
waifu, err := waifuRep.GetById(waifuId)
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user