diff --git a/cache/content/common/src/commonMain/kotlin/dev/inmo/tgbotapi/libraries/cache/media/common/DefaultMessageContentCache.kt b/cache/content/common/src/commonMain/kotlin/dev/inmo/tgbotapi/libraries/cache/media/common/DefaultMessageContentCache.kt index 71c5d0f..8f1634a 100644 --- a/cache/content/common/src/commonMain/kotlin/dev/inmo/tgbotapi/libraries/cache/media/common/DefaultMessageContentCache.kt +++ b/cache/content/common/src/commonMain/kotlin/dev/inmo/tgbotapi/libraries/cache/media/common/DefaultMessageContentCache.kt @@ -92,7 +92,7 @@ class DefaultMessageContentCache( if (savedSimpleContent is MediaContent && !with(mediaFileActualityChecker) { bot.isActual(savedSimpleContent) }) { val savedFileContentAllocator = messagesFilesCache.get(k) ?: error("Unexpected absence of $k file for content ($simpleMessageContentCache)") val newContent = bot.execute( - when (savedSimpleContent.asTelegramMedia()) { + when (val content = savedSimpleContent.asTelegramMedia()) { is TelegramMediaAnimation -> SendAnimation( filesRefreshingChatId, savedFileContentAllocator, @@ -118,9 +118,10 @@ class DefaultMessageContentCache( savedFileContentAllocator, disableNotification = true ) - is TelegramMediaLivePhoto -> SendPhoto( - filesRefreshingChatId, - savedFileContentAllocator, + is TelegramMediaLivePhoto -> SendLivePhoto( + chatId = filesRefreshingChatId, + livePhoto = content.file, + photo = content.photo, disableNotification = true ) }