diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt index 89ea0878cf..74ded7764f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt @@ -38,7 +38,7 @@ internal object DiceAnimationTypeSerializer : KSerializer { CubeDiceAnimationType.emoji -> CubeDiceAnimationType DartsDiceAnimationType.emoji -> DartsDiceAnimationType BasketballDiceAnimationType.emoji -> BasketballDiceAnimationType - SlotMachineDiceAnimationType.emoji -> BasketballDiceAnimationType + SlotMachineDiceAnimationType.emoji -> SlotMachineDiceAnimationType else -> CustomDiceAnimationType(type) } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index 4ac90d2823..5f6991b77a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -220,17 +220,20 @@ internal data class RawMessage( } } ?: content?.let { content -> media_group_id?.let { + val checkedContent = when (content) { + is PhotoContent -> content + is VideoContent -> content + is AudioContent -> content + is DocumentContent -> content + else -> error("Unsupported content for media group") + } when (from) { null -> ChannelMediaGroupMessage( messageId, chat, date.asDate, it, - when (content) { - is PhotoContent -> content - is VideoContent -> content - else -> error("Unsupported content for media group") - }, + checkedContent, edit_date?.asDate, forwarded, reply_to_message?.asMessage, @@ -242,11 +245,7 @@ internal data class RawMessage( chat, date.asDate, it, - when (content) { - is PhotoContent -> content - is VideoContent -> content - else -> error("Unsupported content for media group") - }, + checkedContent, edit_date?.asDate, forwarded, reply_to_message?.asMessage,