1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/RegularTextSource.kt

24 lines
755 B
Kotlin
Raw Normal View History

2022-05-01 14:36:07 +00:00
package dev.inmo.tgbotapi.types.message.textsources
import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.internal.*
import kotlinx.serialization.Serializable
/**
* @see regular
*/
@Serializable
data class RegularTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor (
override val source: String
) : TextSource {
override val markdown: String by lazy { source.regularMarkdown() }
override val markdownV2: String by lazy { source.regularMarkdownV2() }
override val html: String by lazy { source.regularHtml() }
}
@Suppress("NOTHING_TO_INLINE")
inline fun regular(text: String) = RegularTextSource(text)
2022-06-16 20:51:22 +00:00
@Suppress("NOTHING_TO_INLINE")
inline fun regularln(text: String) = regular("$text\n")