io.github.freya022.botcommands.api.components.utils.SelectContent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of BotCommands Show documentation
Show all versions of BotCommands Show documentation
A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.
The newest version!
package io.github.freya022.botcommands.api.components.utils
import net.dv8tion.jda.api.entities.emoji.Emoji
import net.dv8tion.jda.api.interactions.components.selections.SelectOption
data class SelectContent(val label: String, val description: String?, val emoji: Emoji?) {
fun toSelectOption(value: String): SelectOption {
var selectOption = SelectOption.of(label, value)
description?.let { selectOption = selectOption.withDescription(description) }
emoji?.let { selectOption = selectOption.withEmoji(emoji) }
return selectOption
}
companion object {
@JvmStatic
@JvmOverloads
fun of(label: String, description: String? = null, emoji: Emoji? = null): SelectContent {
return SelectContent(label, description, emoji)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy