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.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) {