1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/BotCommand.kt

22 lines
719 B
Kotlin
Raw Normal View History

2020-03-30 15:40:36 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BotCommand(
@SerialName(botCommandField)
val command: String,
@SerialName(descriptionField)
val description: String
2020-04-01 04:08:44 +00:00
) {
init {
if (command.length !in botCommandLengthLimit) {
error("Command size must be in range $botCommandLengthLimit, but actually have length ${command.length}")
}
if (description.length !in botCommandDescriptionLimit) {
error("Command description size must be in range $botCommandDescriptionLimit, but actually have length ${description.length}")
}
}
}