From fe88cf037a1eb575e5f84d8e4c4910d8abf9806c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 08:32:06 +0600 Subject: [PATCH] fixes in deeplinks --- CHANGELOG.md | 3 +++ .../behaviour_builder/triggers_handling/DeepLinkHandling.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64e0846661..89ef55f588 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 6.0.3 +* `BehaviourBuilder`: + * Fixes in `DeepLink` triggers and waiters + ## 6.0.2 * `Core`: diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt index cf85ec58f9..b713c2b1c9 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt @@ -38,7 +38,7 @@ suspend fun BC.onDeepLink( scenarioReceiver, ) { (it.messageUpdateOrNull()) ?.data ?.commonMessageOrNull() ?.withContentOrNull() ?.let { message -> - message to message.content.textSources[1].source.removePrefix(" ").decodeURLQueryComponent() + message to (message.content.textSources.getOrNull(1) ?.source ?.removePrefix(" ") ?.decodeURLQueryComponent() ?: return@let null) } ?.let(::listOfNotNull) }.also { triggersHolder.handleableCommandsHolder.registerHandleable(startRegex)