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

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

No files matched your search

@@ -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()