From 89920abe3527688454b0f8bdf9e8bf70b88e118e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 08:31:35 +0600 Subject: [PATCH 1/7] start 6.0.3 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536f7daa4d..64e0846661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 6.0.3 + ## 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 From fe88cf037a1eb575e5f84d8e4c4910d8abf9806c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 08:32:06 +0600 Subject: [PATCH 2/7] 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) From 2300b44aae58e2f84d2cccf5c005f2db41f81ac1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 12:43:39 +0600 Subject: [PATCH 3/7] fix in CallbackQuery --- CHANGELOG.md | 2 ++ .../dev/inmo/tgbotapi/types/queries/callback/CallbackQuery.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89ef55f588..637a774544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 6.0.3 +* `Core`: + * `User` in `CallbackQuery` now is `CommonUser` as well as `from` * `BehaviourBuilder`: * Fixes in `DeepLink` triggers and waiters 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( From f1deb931473cb6045b6469a6cf9e3e5f0ee5b06e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 19:33:15 +0600 Subject: [PATCH 4/7] changes in InlineQuery --- CHANGELOG.md | 3 ++- .../inmo/tgbotapi/types/InlineQueries/query/InlineQuery.kt | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637a774544..9f6f1d5279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## 6.0.3 * `Core`: - * `User` in `CallbackQuery` now is `CommonUser` as well as `from` + * `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 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 } From f616a02f7c30196941d549ce174d932d3c364f31 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 20:33:49 +0600 Subject: [PATCH 5/7] hotfixes --- .../inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery.kt | 3 ++- .../tgbotapi/types/InlineQueries/query/LocationInlineQuery.kt | 3 ++- .../inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) 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/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) From 54f1181a14e2320c0f60c1626006842e241f7e03 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 21:59:26 +0600 Subject: [PATCH 6/7] Update libs.versions.toml --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 421d5ae9e304c72a4fb2bfdf026c3ad1181ddbac Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 2 Mar 2023 21:59:58 +0600 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f6f1d5279..cf159eaa69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 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`