mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 12:08:43 +00:00
small improvement in #732 solution
This commit is contained in:
parent
d83ff12560
commit
4c08fb7d26
@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.MessageId
|
|||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||||
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
import dev.inmo.tgbotapi.types.message.content.MediaGroupContent
|
||||||
|
|
||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
@ -24,7 +25,7 @@ suspend fun TelegramBot.deleteMessage(
|
|||||||
suspend fun TelegramBot.deleteMessage(
|
suspend fun TelegramBot.deleteMessage(
|
||||||
message: Message
|
message: Message
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupContent<*>)
|
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
||||||
if (mediaGroupContent == null) {
|
if (mediaGroupContent == null) {
|
||||||
return deleteMessage(message.chat, message.messageId)
|
return deleteMessage(message.chat, message.messageId)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user