mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-03 00:15:27 +00:00
18 lines
529 B
Kotlin
18 lines
529 B
Kotlin
|
package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
||
|
|
||
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||
|
import kotlin.js.JsName
|
||
|
import kotlin.jvm.JvmName
|
||
|
|
||
|
@RiskFeature
|
||
|
inline fun textSourcesOrElse(
|
||
|
textSources: TextSourcesList,
|
||
|
block: () -> TextSourcesList
|
||
|
): TextSourcesList = textSources.takeIf { it.isNotEmpty() } ?: block()
|
||
|
|
||
|
@RiskFeature
|
||
|
inline fun textSourcesOrElseTextSource(
|
||
|
textSources: TextSourcesList,
|
||
|
block: () -> TextSource
|
||
|
): TextSourcesList = textSources.takeIf { it.isNotEmpty() } ?: listOf(block())
|