several small updates

This commit is contained in:
InsanusMokrassar 2022-01-02 12:06:32 +06:00
parent df874b0783
commit 0edaa28151
2 changed files with 9 additions and 2 deletions

View File

@ -45,11 +45,13 @@ suspend fun main(args: Array<String>) {
when (files.size) {
1 -> sendDocument(
chat.id,
files.first().asMultipartFile()
files.first().asMultipartFile(),
protectContent = true
)
else -> sendDocumentsGroup(
chat,
files.map { InputMediaDocument(it.asMultipartFile()) }
files.map { InputMediaDocument(it.asMultipartFile()) },
protectContent = true
)
}
}

View File

@ -1,3 +1,4 @@
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
import dev.inmo.tgbotapi.extensions.api.bot.getMe
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
import dev.inmo.tgbotapi.extensions.api.send.media.*
@ -33,5 +34,9 @@ suspend fun activateResenderBot(
onDocumentsGroup {
sendDocumentsGroup(it.chat!!, it.map { it.content.toMediaGroupMemberInputMedia() })
}
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
println(it)
}
}.join()
}