diff --git a/CHANGELOG.md b/CHANGELOG.md index 017ca9b295..4f45202351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## 4.2.2 * `Versions`: - * `MicroUtils`: `0.16.0` -> `0.16.1` + * `MicroUtils`: `0.16.0` -> `0.16.1` +* `Core`: + * Fix of [#694](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/694): add opportunity to create `ChatId` and `ChatIdWithThreadId` from `IdChatIdentifier` ## 4.2.1 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 */