diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8de64214..8b9334f267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ * `FlowsUpdatesFilter` now have two additional flows: `pollAnswerFlow`, `unknownUpdateTypeFlow` * `ExtendedUser` (`typealias`) was added as a `PreviewFeature` +### 0.25.1 + +* Update kotlin: `1.3.70` -> `1.3.71` +* Fix of error inside of update utils for media groups + ## 0.24.0 * `TelegramBotAPI`: diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/InternalUtils/UpdatesUtils.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/InternalUtils/UpdatesUtils.kt index b7eb65f209..a48d6695ee 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/InternalUtils/UpdatesUtils.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/InternalUtils/UpdatesUtils.kt @@ -23,19 +23,19 @@ internal fun List.convertWithMediaGroupUpdates(): List { val resultUpdates = mutableListOf() val mediaGroups = mutableMapOf>() for (update in this) { + val data = (update.data as? MediaGroupMessage) + if (data == null) { + resultUpdates.add(update) + continue + } when (update) { is BaseEditMessageUpdate -> resultUpdates.add( update.toEditMediaGroupUpdate() ) is BaseSentMessageUpdate -> { - val data = update.data - if (data is MediaGroupMessage) { - mediaGroups.getOrPut(data.mediaGroupId) { - mutableListOf() - }.add(update) - } else { - resultUpdates.add(update) - } + mediaGroups.getOrPut(data.mediaGroupId) { + mutableListOf() + }.add(update) } else -> resultUpdates.add(update) } diff --git a/gradle.properties b/gradle.properties index a917de2714..87bf45babc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ kotlin.code.style=official -kotlin_version=1.3.70 +kotlin_version=1.3.71 kotlin_coroutines_version=1.3.5 kotlin_serialisation_runtime_version=0.20.0 klock_version=1.10.0 @@ -7,6 +7,6 @@ uuid_version=0.1.0 ktor_version=1.3.2 library_group=com.github.insanusmokrassar -library_version=0.25.0 +library_version=0.25.1 gradle_bintray_plugin_version=1.8.4