mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-03 00:15:27 +00:00
25 lines
894 B
Kotlin
25 lines
894 B
Kotlin
package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
|
|
|
import dev.inmo.tgbotapi.CommonAbstracts.*
|
|
import dev.inmo.tgbotapi.utils.*
|
|
|
|
/**
|
|
* @see phone
|
|
*/
|
|
data class PhoneNumberTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor (
|
|
override val source: String,
|
|
override val textSources: List<TextSource>
|
|
) : MultilevelTextSource {
|
|
override val asMarkdownSource: String by lazy { source.phoneMarkdown() }
|
|
override val asMarkdownV2Source: String by lazy { phoneMarkdownV2() }
|
|
override val asHtmlSource: String by lazy { phoneHTML() }
|
|
}
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
inline fun phone(parts: List<TextSource>) = PhoneNumberTextSource(parts.makeString(), parts)
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
inline fun phone(vararg parts: TextSource) = phone(parts.toList())
|
|
@Suppress("NOTHING_TO_INLINE")
|
|
inline fun phone(number: String) = phone(regular(number))
|
|
|