From eef2bfce1465512fd366e47be486f212f3f101b7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 6 Nov 2023 22:02:54 +0600 Subject: [PATCH] add support of inline messages with data callback query in common posts gc --- posts/gc/src/jvmMain/kotlin/Plugin.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/posts/gc/src/jvmMain/kotlin/Plugin.kt b/posts/gc/src/jvmMain/kotlin/Plugin.kt index 92cd5d1..d106939 100644 --- a/posts/gc/src/jvmMain/kotlin/Plugin.kt +++ b/posts/gc/src/jvmMain/kotlin/Plugin.kt @@ -23,6 +23,7 @@ import dev.inmo.tgbotapi.extensions.api.edit.edit import dev.inmo.tgbotapi.extensions.api.forwardMessage import dev.inmo.tgbotapi.extensions.api.send.send import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext +import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitInlineMessageIdDataCallbackQuery import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitMessageDataCallbackQuery import dev.inmo.tgbotapi.extensions.behaviour_builder.oneOf import dev.inmo.tgbotapi.extensions.behaviour_builder.parallel @@ -155,14 +156,14 @@ object Plugin : Plugin { val answer = oneOf( parallel { waitMessageDataCallbackQuery().filter { - it.data == yesData + it.message.sameMessage(message) }.first() }, parallel { - waitMessageDataCallbackQuery().filter { - it.data == noData + waitInlineMessageIdDataCallbackQuery().filter { + it.data == yesData || it.data == noData }.first() - }, + } ) if (answer.data == yesData) {