All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.cache.data.SelectOptionData.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
package dev.kord.core.cache.data

import dev.kord.common.entity.DiscordPartialEmoji
import dev.kord.common.entity.DiscordSelectOption
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalBoolean
import kotlinx.serialization.Serializable

@Serializable
public data class SelectOptionData(
    val label: String,
    val value: String,
    val description: Optional = Optional.Missing(),
    val emoji: Optional = Optional.Missing(),
    val default: OptionalBoolean = OptionalBoolean.Missing
) {
    public companion object {
        public fun from(entity: DiscordSelectOption): SelectOptionData = with(entity) {
            SelectOptionData(
                label = label,
                value = value,
                description = description,
                emoji = emoji,
                default = default
            )
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy