diff --git a/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt b/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt index eba2b42..a3b161b 100644 --- a/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt +++ b/RandomFileSenderBot/src/main/kotlin/RandomFileSenderBot.kt @@ -1,3 +1,4 @@ +import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot.getMe import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.bot.setMyCommands import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media.sendDocument import com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.sendTextMessage @@ -49,6 +50,7 @@ suspend fun main(args: Array) { bot.setMyCommands( BotCommand(command, "Send some random file in picker directory") ) + println(bot.getMe()) } scope.coroutineContext[Job]!!.join() diff --git a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt index 2b67f58..6889a9d 100644 --- a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt +++ b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt @@ -23,14 +23,17 @@ suspend fun activateResenderBot( bot.startGettingFlowsUpdatesByLongPolling { filterContentMessages(scope).onEach { it.content.createResends(it.chat.id, replyToMessageId = it.messageId).forEach { - bot.executeUnsafe(it) ?.also { + bot.executeUnsafe(it) { + it.forEach(print) + } ?.also { print(it) } } }.launchIn(scope) - filterMediaGroupMessages(scope).onEach { - safely { - bot.executeUnsafe(it.createResend(it.chat ?: return@safely, replyTo = it.first().messageId)).also { + mediaGroupMessages(scope).onEach { + safely({ print(it.stackTraceToString()) }) { + println(it.chat) + bot.execute(it.createResend(it.chat ?: return@safely, replyTo = it.first().messageId)).also { print(it) } }