31 lines
878 B
Kotlin
31 lines
878 B
Kotlin
package fr.lucasdupont.gaytabot.command
|
|
|
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
|
import net.dv8tion.jda.api.interactions.commands.DefaultMemberPermissions
|
|
import net.dv8tion.jda.api.interactions.commands.build.OptionData
|
|
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData
|
|
|
|
interface Command {
|
|
|
|
val name: String
|
|
val description: String
|
|
|
|
val options: List<OptionData>
|
|
get() = emptyList()
|
|
|
|
val neededPermissions: DefaultMemberPermissions?
|
|
get() = null
|
|
|
|
val subcommands: List<Command>
|
|
get() = emptyList()
|
|
|
|
val subcommandGroups: List<SubCommandGroup>
|
|
get() = emptyList()
|
|
|
|
@Throws(Exception::class)
|
|
fun execute(event: SlashCommandInteractionEvent)
|
|
|
|
fun toSubcommandData(): SubcommandData =
|
|
SubcommandData(name, description).addOptions(options)
|
|
|
|
} |