add extensions splitFor(Text|Caption) and fix captionLength

This commit is contained in:
InsanusMokrassar committed 2025-06-01 22:01:28 +06:00
1 parent dab5e072d0
commit 8aa29e56d3
3 files changed
+9 -1

No files matched your search

@@ -55,7 +55,7 @@ val horizontalAccuracyLimit = 0F .. 1500F
val getUpdatesLimit = 1 .. 100
val callbackQueryAnswerLength = 0 until 200
val captionLength = 0 .. 1024
val captionLength = 0 .. 2048
val textLength = 1 .. 4096
val userProfilePhotosRequestLimit = 0 .. 100
val chatTitleLength = 1 until 255
@@ -1,5 +1,8 @@
package dev.inmo.tgbotapi.utils.extensions
import dev.inmo.tgbotapi.types.captionLength
import dev.inmo.tgbotapi.types.textLength
fun String.toMarkdown(): String {
return replace(
"*",
@@ -53,3 +56,6 @@ fun String.toHtml(): String = replace(
"&",
"&"
)
fun String.splitForText() = chunked(textLength.last)
fun String.splitForCaption() = chunked(captionLength.last)