This commit is contained in:
31
src/main/kotlin/fr/lucasdupont/command/Command.kt
Normal file
31
src/main/kotlin/fr/lucasdupont/command/Command.kt
Normal file
@@ -0,0 +1,31 @@
|
||||
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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user