1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-21 06:45:46 +00:00

add ReplaceWith to old functions and replace built-in usages of deprecations

This commit is contained in:
2019-02-10 13:46:23 +08:00
parent 1dc80f6929
commit d67d16c72d
7 changed files with 23 additions and 15 deletions

View File

@@ -55,7 +55,11 @@ fun createMarkdownText(
}
@Deprecated(
"Deprecated because old version have problem with long texts, but new one must return list of strings"
"Deprecated because old version have problem with long texts, but new one must return list of strings",
ReplaceWith(
"toMarkdownCaptions().firstOrNull()",
"com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions"
)
)
fun CaptionedMediaContent.toMarkdownCaption(): String? = toMarkdownCaptions().firstOrNull()
@@ -69,7 +73,11 @@ fun CaptionedMediaContent.fullEntitiesList(): List<MessageEntity> = caption ?.le
} ?: emptyList()
@Deprecated(
"Deprecated because old version have problem with long texts, but new one must return list of strings"
"Deprecated because old version have problem with long texts, but new one must return list of strings",
ReplaceWith(
"toMarkdownTexts().first()",
"com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownTexts"
)
)
fun TextContent.toMarkdownText(): String = toMarkdownTexts().first()