From 4c08fb7d26e6c1a91c396ad7e88d98f03bafac52 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 8 Mar 2023 16:41:10 +0600 Subject: [PATCH] small improvement in #732 solution --- .../kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt index 9874e15c86..90c7f00b35 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DeleteMessage.kt @@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.MessageId import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent import dev.inmo.tgbotapi.types.message.content.MediaGroupContent suspend fun TelegramBot.deleteMessage( @@ -24,7 +25,7 @@ suspend fun TelegramBot.deleteMessage( suspend fun TelegramBot.deleteMessage( message: Message ): Boolean { - val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupContent<*>) + val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>) if (mediaGroupContent == null) { return deleteMessage(message.chat, message.messageId) } else {