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}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|