mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
commit
e3e318312d
@ -1,5 +1,12 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 6.1.0
|
||||
|
||||
* `Versions`:
|
||||
* `MicroUtils`: `0.17.2` -> `0.17.3`
|
||||
* `API`:
|
||||
* Fix of [#732](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/732)
|
||||
|
||||
## 6.0.3
|
||||
|
||||
* `Versions`:
|
||||
|
@ -6,4 +6,4 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=6.0.3
|
||||
library_version=6.1.0
|
||||
|
@ -13,7 +13,7 @@ ktor = "2.2.4"
|
||||
ksp = "1.8.10-1.0.9"
|
||||
kotlin-poet = "1.12.0"
|
||||
|
||||
microutils = "0.17.2"
|
||||
microutils = "0.17.3"
|
||||
|
||||
github-release-plugin = "2.4.1"
|
||||
dokka = "1.8.10"
|
||||
|
@ -5,7 +5,10 @@ import dev.inmo.tgbotapi.requests.DeleteMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
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(
|
||||
chatId: ChatIdentifier,
|
||||
@ -21,7 +24,16 @@ suspend fun TelegramBot.deleteMessage(
|
||||
|
||||
suspend fun TelegramBot.deleteMessage(
|
||||
message: Message
|
||||
) = deleteMessage(message.chat, message.messageId)
|
||||
): Boolean {
|
||||
val mediaGroupContent = ((message as? ContentMessage<*>) ?.content as? MediaGroupCollectionContent<*>)
|
||||
if (mediaGroupContent == null) {
|
||||
return deleteMessage(message.chat, message.messageId)
|
||||
} else {
|
||||
return mediaGroupContent.group.map {
|
||||
deleteMessage(it.sourceMessage)
|
||||
}.all { it }
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun TelegramBot.delete(
|
||||
chatId: ChatIdentifier,
|
||||
|
Loading…
Reference in New Issue
Block a user