small fix
This commit is contained in:
@@ -147,7 +147,14 @@ func rpWaifuList(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
|||||||
out := make([]string, len(waifus))
|
out := make([]string, len(waifus))
|
||||||
kb := laniakea.NewInlineKeyboard(2)
|
kb := laniakea.NewInlineKeyboard(2)
|
||||||
for i, waifu := range waifus {
|
for i, waifu := range waifus {
|
||||||
out[i] = fmt.Sprintf("*%s* %d\\* из \"%s\"", waifu.Name, waifu.Rarity, waifu.Fandom)
|
owner := "нет"
|
||||||
|
if waifu.OwnerID.Valid {
|
||||||
|
owner = waifu.Owner.Name
|
||||||
|
}
|
||||||
|
out[i] = fmt.Sprintf(
|
||||||
|
"*%s* %d\\* из \"%s\" (владелец: %s)",
|
||||||
|
waifu.Name, waifu.Rarity, waifu.Fandom, owner,
|
||||||
|
)
|
||||||
kb.AddCallbackButton(waifu.Name, "rp.waifu_set", waifu.ID)
|
kb.AddCallbackButton(waifu.Name, "rp.waifu_set", waifu.ID)
|
||||||
}
|
}
|
||||||
kb.AddLine()
|
kb.AddLine()
|
||||||
@@ -637,13 +644,13 @@ func generate(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
|||||||
compressMethod := rpUser.CompressMethod
|
compressMethod := rpUser.CompressMethod
|
||||||
if compressMethod == "messages" {
|
if compressMethod == "messages" {
|
||||||
if counter+2 >= rpUser.CompressLimit {
|
if counter+2 >= rpUser.CompressLimit {
|
||||||
m := ctx.EditCallback("Запущено сжатие чата…", nil)
|
m = ctx.EditCallback("Запущено сжатие чата…", nil)
|
||||||
_compress(ctx, db)
|
_compress(ctx, db)
|
||||||
m.Delete()
|
m.Delete()
|
||||||
}
|
}
|
||||||
} else if compressMethod == "tokens" {
|
} else if compressMethod == "tokens" {
|
||||||
if tokens >= rpUser.CompressLimit*1000 {
|
if tokens >= rpUser.CompressLimit*1000 {
|
||||||
m := ctx.EditCallback("Запущено сжатие чата…", nil)
|
m = ctx.EditCallback("Запущено сжатие чата…", nil)
|
||||||
_compress(ctx, db)
|
_compress(ctx, db)
|
||||||
m.Delete()
|
m.Delete()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user