diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0baa7cd7..63731b1d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,11 @@ * `List#separateForMessage` * `List#separateForCaption` * `List#separateForText` + * Rewritten work with text sources and text parts: + * Now any `Message` type with entities will have full list of entities. That means that parts without any + formatter entities will use `RegularTextSource` + * `MultilevelTextSource#textParts` has been deprecated. Now each `MultilevelTextSource` have its own + `textSources` list * `API`: * Extensions `TelegramBot#pinChatMessage` now support any `Chat` and `Message`s from any `Chat` * New extensions `TelegramBot#unpinAllChatMessages` diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt index 9113ee5c18..bf20cd6b82 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt @@ -29,7 +29,7 @@ data class TextPart( fun List.justTextSources() = map { it.source } fun List.makeString() = joinToString("") { it.source } -fun MultilevelTextSource.textParts(offset: Int): List = textSources.toTextParts(offset) +internal fun MultilevelTextSource.textParts(offset: Int): List = textSources.toTextParts(offset) fun List.separateForMessage(limit: IntRange, numberOfParts: Int? = null): List> { if (isEmpty()) { return emptyList()