1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

use maxTextLength inside of CaptionAndTextSourcesToText

This commit is contained in:
InsanusMokrassar 2020-05-31 22:53:04 +06:00
parent 35dcd6ada7
commit 7cd5666e88

View File

@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.fullEnti
fun createFormattedText( fun createFormattedText(
entities: FullTextSourcesList, entities: FullTextSourcesList,
partLength: Int = 4096, partLength: Int = maxTextLength,
mode: ParseMode = MarkdownParseMode mode: ParseMode = MarkdownParseMode
): List<String> { ): List<String> {
val texts = mutableListOf<String>() val texts = mutableListOf<String>()
@ -49,7 +49,7 @@ fun createFormattedText(
fun createMarkdownText( fun createMarkdownText(
entities: FullTextSourcesList, entities: FullTextSourcesList,
partLength: Int = 4096 partLength: Int = maxTextLength
): List<String> = createFormattedText(entities, partLength, MarkdownParseMode) ): List<String> = createFormattedText(entities, partLength, MarkdownParseMode)
fun FullTextSourcesList.toMarkdownCaptions(): List<String> = createMarkdownText( fun FullTextSourcesList.toMarkdownCaptions(): List<String> = createMarkdownText(
@ -60,7 +60,7 @@ fun CaptionedInput.toMarkdownCaptions(): List<String> = fullEntitiesList().toMar
fun FullTextSourcesList.toMarkdownTexts(): List<String> = createMarkdownText( fun FullTextSourcesList.toMarkdownTexts(): List<String> = createMarkdownText(
this, this,
textLength.last + 1 maxTextLength
) )
fun TextContent.toMarkdownTexts(): List<String> = fullEntitiesList().toMarkdownTexts() fun TextContent.toMarkdownTexts(): List<String> = fullEntitiesList().toMarkdownTexts()
@ -73,7 +73,7 @@ fun ExplainedInput.toMarkdownExplanations(): List<String> = fullEntitiesList().t
fun createMarkdownV2Text( fun createMarkdownV2Text(
entities: FullTextSourcesList, entities: FullTextSourcesList,
partLength: Int = 4096 partLength: Int = maxTextLength
): List<String> = createFormattedText(entities, partLength, MarkdownV2ParseMode) ): List<String> = createFormattedText(entities, partLength, MarkdownV2ParseMode)
fun FullTextSourcesList.toMarkdownV2Captions(): List<String> = createMarkdownV2Text( fun FullTextSourcesList.toMarkdownV2Captions(): List<String> = createMarkdownV2Text(
@ -84,7 +84,7 @@ fun CaptionedInput.toMarkdownV2Captions(): List<String> = fullEntitiesList().toM
fun FullTextSourcesList.toMarkdownV2Texts(): List<String> = createMarkdownV2Text( fun FullTextSourcesList.toMarkdownV2Texts(): List<String> = createMarkdownV2Text(
this, this,
textLength.last + 1 maxTextLength
) )
fun TextContent.toMarkdownV2Texts(): List<String> = fullEntitiesList().toMarkdownV2Texts() fun TextContent.toMarkdownV2Texts(): List<String> = fullEntitiesList().toMarkdownV2Texts()
@ -108,7 +108,7 @@ fun CaptionedInput.toHtmlCaptions(): List<String> = fullEntitiesList().toHtmlCap
fun FullTextSourcesList.toHtmlTexts(): List<String> = createHtmlText( fun FullTextSourcesList.toHtmlTexts(): List<String> = createHtmlText(
this, this,
textLength.last + 1 maxTextLength
) )
fun TextContent.toHtmlTexts(): List<String> = fullEntitiesList().toHtmlTexts() fun TextContent.toHtmlTexts(): List<String> = fullEntitiesList().toHtmlTexts()