add coloring of inline buttons

This commit is contained in:
2026-03-12 16:31:29 +06:00
parent 18180e67f6
commit 028f1f48e8
7 changed files with 36 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import dev.inmo.plaguposter.posts.models.RegisteredPost
import dev.inmo.plaguposter.posts.panel.PanelButtonBuilder
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.KeyboardButtonStyle
class TimerPanelButton(
private val timersRepo: TimersRepo
@@ -18,7 +19,12 @@ class TimerPanelButton(
return CallbackDataInlineKeyboardButton(
"${ if (publishingTime == null) UnsuccessfulSymbol else SuccessfulSymbol }",
"$timerSetPrefix ${post.id}"
"$timerSetPrefix ${post.id}",
style = if (publishingTime == null) {
null
} else {
KeyboardButtonStyle.Success
}
)
}