1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-02 16:05:28 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt

29 lines
914 B
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.types.buttons
2021-06-25 19:48:41 +00:00
import dev.inmo.tgbotapi.types.inputFieldPlaceholderField
import dev.inmo.tgbotapi.types.inputFieldPlaceholderLimit
import kotlinx.serialization.*
@Serializable
data class ReplyForce(
2021-06-25 19:48:41 +00:00
val selective: Boolean? = null,
@SerialName(inputFieldPlaceholderField)
val inputFieldPlaceholder: String? = null
) : KeyboardMarkup {
@SerialName("force_reply")
@Required
val forceReply: Boolean = true
companion object {
val ReplyForceSelective = ReplyForce(true)
val ReplyForceNonSelective = ReplyForce(false)
val ReplyForceDefault = ReplyForce()
}
2021-06-25 19:48:41 +00:00
init {
if (inputFieldPlaceholder != null && inputFieldPlaceholder.length !in inputFieldPlaceholderLimit) {
error("Field $inputFieldPlaceholderField length must be in $inputFieldPlaceholderLimit, but was ${inputFieldPlaceholder.length}")
}
}
}