From ceba86abcb704cb0db226de5251b7594b4076304 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 17 Nov 2022 12:33:16 +0600 Subject: [PATCH] Fixes in CallbackQuery waiters --- CHANGELOG.md | 3 +++ .../behaviour_builder/expectations/WaitCallbackQuery.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe65e6ffe..c2b55c4444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 4.1.2 +* `BehaviourBuilder`: + * Fixes in `CallbackQuery` waiters + ## 4.1.1 * `Core`: diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt index 7be3ea5ee1..492ed205e5 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt @@ -20,7 +20,7 @@ suspend inline fun BehaviourContext.waitCallbackQueries( initRequest, errorFactory ) { - (it.callbackQueryUpdateOrNull() ?.data as O).let(::listOfNotNull) + (it.callbackQueryUpdateOrNull() ?.data as? O).let(::listOfNotNull) }