diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e9c0a6d6c..f9c4d80f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 4.1.1 +* `Core`: + * Add opportunity to create `IdChatIdentifier` with optional `threadId` + ## 4.1.0 * `Versions`: 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 42805b6d75..2b0ad1e6a5 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 @@ -30,6 +30,9 @@ sealed interface IdChatIdentifier : ChatIdentifier { companion object { operator fun invoke(chatId: Identifier) = ChatId(chatId) + operator fun invoke(chatId: Identifier, threadId: MessageThreadId?) = threadId ?.let { + ChatIdWithThreadId(chatId, threadId) + } ?: ChatId(chatId) } }