diff --git a/CHANGELOG.md b/CHANGELOG.md index 536f7daa4d..cf159eaa69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # TelegramBotAPI changelog +## 6.0.3 + +* `Versions`: + * `MicroUtils`: `0.17.1` -> `0.17.2` +* `Core`: + * `User` in `CallbackQuery` now is `CommonUser` as well as in `from` + * `User` in `InlineQuery` now is `CommonUser` as well as in `from` +* `BehaviourBuilder`: + * Fixes in `DeepLink` triggers and waiters + ## 6.0.2 * `Core`: diff --git a/gradle.properties b/gradle.properties index 7ece4563fa..b9f70cd8d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=6.0.2 +library_version=6.0.3 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e572d46ab4..8d2f58cb76 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.2.4" ksp = "1.8.10-1.0.9" kotlin-poet = "1.12.0" -microutils = "0.17.1" +microutils = "0.17.2" github-release-plugin = "2.4.1" dokka = "1.7.20" 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) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery.kt index a359b62dc0..360a186efb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery.kt @@ -3,10 +3,11 @@ package dev.inmo.tgbotapi.types.InlineQueries.query import dev.inmo.tgbotapi.types.InlineQueryIdentifier import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.ChatType +import dev.inmo.tgbotapi.types.chat.CommonUser data class BaseInlineQuery( override val id: InlineQueryIdentifier, - override val from: User, + override val from: CommonUser, override val query: String, override val offset: String, override val chatType: ChatType? diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery.kt index da90c82f88..8caafa8835 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery.kt @@ -3,10 +3,16 @@ package dev.inmo.tgbotapi.types.InlineQueries.query import dev.inmo.tgbotapi.abstracts.FromUser import dev.inmo.tgbotapi.types.InlineQueryIdentifier import dev.inmo.tgbotapi.types.chat.ChatType +import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.chat.User sealed interface InlineQuery : FromUser { val id: InlineQueryIdentifier val query: String val offset: String val chatType: ChatType? + + override val from: CommonUser + override val user: CommonUser + get() = from } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery.kt index ab9a40cc90..08bccfae6c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery.kt @@ -3,11 +3,12 @@ package dev.inmo.tgbotapi.types.InlineQueries.query import dev.inmo.tgbotapi.types.InlineQueryIdentifier import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.ChatType +import dev.inmo.tgbotapi.types.chat.CommonUser import dev.inmo.tgbotapi.types.location.Location data class LocationInlineQuery( override val id: InlineQueryIdentifier, - override val from: User, + override val from: CommonUser, override val query: String, override val offset: String, override val chatType: ChatType?, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt index 71519ce891..da9d56602a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt @@ -12,7 +12,7 @@ internal data class RawInlineQuery( @SerialName(idField) val id: InlineQueryIdentifier, @SerialName(fromField) - val from: User, + val from: CommonUser, @SerialName(queryField) val query: String, @SerialName(offsetField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt index 66a0fb494b..77740723dc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt @@ -9,6 +9,8 @@ sealed interface CallbackQuery : FromUser { val id: CallbackQueryIdentifier val chatInstance: String override val from: CommonUser + override val user: CommonUser + get() = from } data class UnknownCallbackQueryType(