diff --git a/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt b/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt index 03da081..29d0e42 100644 --- a/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt +++ b/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt @@ -45,11 +45,13 @@ suspend fun main(args: Array) { 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 ) } } diff --git a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt index 6b354a9..ba3a134 100644 --- a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt +++ b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt @@ -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() }