From 5fbde4bc06803b7719b927792baf5c55ef4257d4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 2 Jun 2020 01:02:38 +0600 Subject: [PATCH] new "row" --- CHANGELOG.md | 1 + .../github/insanusmokrassar/TelegramBotAPI/utils/Matrix.kt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c28c39d133..713650d589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ * `Klock`: `1.11.1` -> `1.11.3` * `TelegramotAPI`: * Fix: for sending requests caption and text lengths limits were updated + * New variant of `row` was added * `TelegramBotAPI-extensions-utils`: * `safely` function was introduced. It is in `PreviewFeature` state currently diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/Matrix.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/Matrix.kt index 08a661542a..2469e74da7 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/Matrix.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/Matrix.kt @@ -10,6 +10,10 @@ fun MatrixBuilder.row(block: RowBuilder.() -> Unit) { add(RowBuilder().also(block).row) } +fun MatrixBuilder.row(vararg elements: T) { + add(elements.toList()) +} + fun matrix(block: MatrixBuilder.() -> Unit): Matrix { return MatrixBuilder().also(block).matrix }