add support of inline messages with data callback query in common posts gc

This commit is contained in:
InsanusMokrassar 2023-11-06 22:02:54 +06:00
parent fe96101631
commit eef2bfce14

View File

@ -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.forwardMessage
import dev.inmo.tgbotapi.extensions.api.send.send import dev.inmo.tgbotapi.extensions.api.send.send
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext 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.expectations.waitMessageDataCallbackQuery
import dev.inmo.tgbotapi.extensions.behaviour_builder.oneOf import dev.inmo.tgbotapi.extensions.behaviour_builder.oneOf
import dev.inmo.tgbotapi.extensions.behaviour_builder.parallel import dev.inmo.tgbotapi.extensions.behaviour_builder.parallel
@ -155,14 +156,14 @@ object Plugin : Plugin {
val answer = oneOf( val answer = oneOf(
parallel { parallel {
waitMessageDataCallbackQuery().filter { waitMessageDataCallbackQuery().filter {
it.data == yesData it.message.sameMessage(message)
}.first() }.first()
}, },
parallel { parallel {
waitMessageDataCallbackQuery().filter { waitInlineMessageIdDataCallbackQuery().filter {
it.data == noData it.data == yesData || it.data == noData
}.first() }.first()
}, }
) )
if (answer.data == yesData) { if (answer.data == yesData) {