diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f28995447..ab7dcd3b05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # TelegramBotAPI changelog +## 4.2.2 + +* `Versions`: + * `MicroUtils`: `0.16.0` -> `0.16.2` +* `Core`: + * Fix of [#694](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/694): add opportunity to create `ChatId` and `ChatIdWithThreadId` from `IdChatIdentifier` + ## 4.2.1 * `Versions`: diff --git a/gradle.properties b/gradle.properties index 21733ff3fb..d65eeb7079 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=4.2.1 +library_version=4.2.2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 550cf78e57..98d24fa96a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.2.1" ksp = "1.7.22-1.0.8" kotlin-poet = "1.12.0" -microutils = "0.16.0" +microutils = "0.16.2" github-release-plugin = "2.4.1" dokka = "1.7.20" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt index 9b8eedeb5e..625b8eaa4c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt @@ -54,6 +54,13 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair this + is ChatIdWithThreadId -> ChatId(chatId) +} + +fun IdChatIdentifier.toChatWithThreadId(threadId: MessageThreadId) = IdChatIdentifier(chatId, threadId) + /** * https://core.telegram.org/bots/api#formatting-options */