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/buttons/ReplyForce.kt

32 lines
1.0 KiB
Kotlin

package dev.inmo.tgbotapi.types.buttons
import dev.inmo.tgbotapi.types.inputFieldPlaceholderField
import dev.inmo.tgbotapi.types.inputFieldPlaceholderLimit
import kotlinx.serialization.*
@Serializable
data class ReplyForce(
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()
}
init {
if (inputFieldPlaceholder != null && inputFieldPlaceholder.length !in inputFieldPlaceholderLimit) {
error("Field $inputFieldPlaceholderField length must be in $inputFieldPlaceholderLimit, but was ${inputFieldPlaceholder.length}")
}
}
}
@Deprecated("Renamed", ReplaceWith("ReplyForce", "dev.inmo.tgbotapi.types.buttons.ReplyForce"))
typealias ForceReply = ReplyForce