17 lines
442 B
Kotlin
17 lines
442 B
Kotlin
|
package dev.inmo.postssystem.targets.telegram.content.polls.common
|
||
|
|
||
|
import dev.inmo.postssystem.features.content.common.Content
|
||
|
import kotlinx.serialization.Serializable
|
||
|
|
||
|
@Serializable
|
||
|
data class PollContent(
|
||
|
val options: List<String>,
|
||
|
val answer: Int?
|
||
|
) : Content {
|
||
|
init {
|
||
|
require(answer == null || answer in options.indices) {
|
||
|
"Answer should be in indexes of options ($options), ($answer)"
|
||
|
}
|
||
|
}
|
||
|
}
|