diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionAndTextSourcesToText.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionAndTextSourcesToText.kt index 4a2a9c2def..da9b9ba407 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionAndTextSourcesToText.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/CaptionAndTextSourcesToText.kt @@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.fullEnti fun createFormattedText( entities: FullTextSourcesList, - partLength: Int = 4096, + partLength: Int = maxTextLength, mode: ParseMode = MarkdownParseMode ): List { val texts = mutableListOf() @@ -49,7 +49,7 @@ fun createFormattedText( fun createMarkdownText( entities: FullTextSourcesList, - partLength: Int = 4096 + partLength: Int = maxTextLength ): List = createFormattedText(entities, partLength, MarkdownParseMode) fun FullTextSourcesList.toMarkdownCaptions(): List = createMarkdownText( @@ -60,7 +60,7 @@ fun CaptionedInput.toMarkdownCaptions(): List = fullEntitiesList().toMar fun FullTextSourcesList.toMarkdownTexts(): List = createMarkdownText( this, - textLength.last + 1 + maxTextLength ) fun TextContent.toMarkdownTexts(): List = fullEntitiesList().toMarkdownTexts() @@ -73,7 +73,7 @@ fun ExplainedInput.toMarkdownExplanations(): List = fullEntitiesList().t fun createMarkdownV2Text( entities: FullTextSourcesList, - partLength: Int = 4096 + partLength: Int = maxTextLength ): List = createFormattedText(entities, partLength, MarkdownV2ParseMode) fun FullTextSourcesList.toMarkdownV2Captions(): List = createMarkdownV2Text( @@ -84,7 +84,7 @@ fun CaptionedInput.toMarkdownV2Captions(): List = fullEntitiesList().toM fun FullTextSourcesList.toMarkdownV2Texts(): List = createMarkdownV2Text( this, - textLength.last + 1 + maxTextLength ) fun TextContent.toMarkdownV2Texts(): List = fullEntitiesList().toMarkdownV2Texts() @@ -108,7 +108,7 @@ fun CaptionedInput.toHtmlCaptions(): List = fullEntitiesList().toHtmlCap fun FullTextSourcesList.toHtmlTexts(): List = createHtmlText( this, - textLength.last + 1 + maxTextLength ) fun TextContent.toHtmlTexts(): List = fullEntitiesList().toHtmlTexts()