Skip to content

Commit bef8604

Browse files
add support of styling for buttons
1 parent d1791b3 commit bef8604

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

KeyboardsBot/KeyboardsBotLib/src/commonMain/kotlin/KeyboardsBot.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
1111
import dev.inmo.tgbotapi.extensions.utils.types.buttons.*
1212
import dev.inmo.tgbotapi.extensions.utils.withContent
1313
import dev.inmo.tgbotapi.types.BotCommand
14+
import dev.inmo.tgbotapi.types.CustomEmojiId
1415
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle
1516
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent
1617
import dev.inmo.tgbotapi.types.InlineQueryId
18+
import dev.inmo.tgbotapi.types.buttons.KeyboardButtonStyle
1719
import dev.inmo.tgbotapi.types.message.content.TextContent
1820
import dev.inmo.tgbotapi.utils.PreviewFeature
1921
import dev.inmo.tgbotapi.utils.botCommand
@@ -51,17 +53,17 @@ fun InlineKeyboardBuilder.includePageButtons(page: Int, count: Int) {
5153

5254
row {
5355
if (page - 1 > 2) {
54-
dataButton("<<", "1 $count")
56+
dataButton("<<", "1 $count", style = KeyboardButtonStyle.Danger)
5557
}
5658
if (page - 1 > 1) {
57-
dataButton("<", "${page - 2} $count")
59+
dataButton("<", "${page - 2} $count", style = KeyboardButtonStyle.Primary)
5860
}
5961

6062
if (page + 1 < count) {
61-
dataButton(">", "${page + 2} $count")
63+
dataButton(">", "${page + 2} $count", style = KeyboardButtonStyle.Success)
6264
}
6365
if (page + 2 < count) {
64-
dataButton(">>", "$count $count")
66+
dataButton(">>", "$count $count", style = KeyboardButtonStyle.Danger)
6567
}
6668
}
6769
row {

0 commit comments

Comments
 (0)