From c0019bcbf85f1f7f6f0d80584a79e572518cec9f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 8 Nov 2022 12:19:23 +0600 Subject: [PATCH] update up to 4.0.0 --- .../src/commonMain/kotlin/ResenderBot.kt | 24 ++++--------------- gradle.properties | 2 +- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt index 1eb6d17..5a11989 100644 --- a/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt +++ b/ResenderBot/ResenderBotLib/src/commonMain/kotlin/ResenderBot.kt @@ -20,33 +20,17 @@ suspend fun activateResenderBot( bot.buildBehaviourWithLongPolling(CoroutineScope(currentCoroutineContext() + SupervisorJob())) { onContentMessage( - initialFilter = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter = MessageFilterByChat ) { val chat = it.chat - withTypingAction(chat) { + + val answer = withTypingAction(chat) { executeUnsafe(it.content.createResend(chat.id, replyToMessageId = it.messageId)) { it.forEach(print) } } - } - onVisualGallery { - val chat = it.chat ?: return@onVisualGallery - withUploadPhotoAction(chat) { - send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() }) - } - } - onPlaylist { - val chat = it.chat ?: return@onPlaylist - withUploadDocumentAction(chat) { - send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() }) - } - } - onDocumentsGroup { - val chat = it.chat ?: return@onDocumentsGroup - withUploadDocumentAction(chat) { - send(chat, it.map { it.content.toMediaGroupMemberTelegramMedia() }) - } + + println("Answer info: $answer") } allUpdatesFlow.subscribeSafelyWithoutExceptions(this) { diff --git a/gradle.properties b/gradle.properties index a5ec16a..7b0a235 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx768m kotlin_version=1.7.20 -telegram_bot_api_version=3.3.1 +telegram_bot_api_version=4.0.0 micro_utils_version=0.13.2 serialization_version=1.4.1 ktor_version=2.1.3