diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt index 935dc87eb3..7a3a4b56e3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/Matrix.kt @@ -97,9 +97,10 @@ open class MatrixBuilder { exists.forEach { rowBuilder.add(it) } mutMatrix[i] = rowBuilder.apply(block).row } - fun modifyRow(row: List, block: RowBuilder.() -> Unit) { + fun modifyRow(row: List, block: RowBuilder.() -> Unit): Boolean { val i = mutMatrix.indexOf(row).takeIf { it > -1 } ?: return false modifyRow(i, block) + return true } fun remove(i: Int): List { return mutMatrix.removeAt(i)