diff --git a/px32-bot-core/src/main/kotlin/net/wh64/p/x32/GlobalCommandHandler.kt b/px32-bot-core/src/main/kotlin/net/wh64/p/x32/GlobalCommandHandler.kt index 388d235..4f11585 100644 --- a/px32-bot-core/src/main/kotlin/net/wh64/p/x32/GlobalCommandHandler.kt +++ b/px32-bot-core/src/main/kotlin/net/wh64/p/x32/GlobalCommandHandler.kt @@ -1,5 +1,17 @@ package net.wh64.p.x32 -class GlobalCommandHandler { +import net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent +import net.dv8tion.jda.api.events.interaction.command.UserContextInteractionEvent +import net.dv8tion.jda.api.hooks.ListenerAdapter +class GlobalCommandHandler : ListenerAdapter() { + override fun onSlashCommandInteraction(event: SlashCommandInteractionEvent) { + } + + override fun onUserContextInteraction(event: UserContextInteractionEvent) { + } + + override fun onMessageContextInteraction(event: MessageContextInteractionEvent) { + } } \ No newline at end of file diff --git a/px32-bot-core/src/main/kotlin/net/wh64/p/x32/SlashCommandExecutor.kt b/px32-bot-core/src/main/kotlin/net/wh64/p/x32/SlashCommandExecutor.kt index a525d7d..8139280 100644 --- a/px32-bot-core/src/main/kotlin/net/wh64/p/x32/SlashCommandExecutor.kt +++ b/px32-bot-core/src/main/kotlin/net/wh64/p/x32/SlashCommandExecutor.kt @@ -19,3 +19,21 @@ interface MessageContextExecutor { val data: CommandData fun execute(ev: MessageContextInteractionEvent) } + +abstract class CommandAdapter : SlashCommandExecutor, UserContextExecutor, MessageContextExecutor { + abstract override val data: CommandData + + override fun execute(ev: SlashCommandInteractionEvent) { + executor(ev) + } + + override fun execute(ev: UserContextInteractionEvent) { + executor(ev) + } + + override fun execute(ev: MessageContextInteractionEvent) { + executor(ev) + } + + abstract fun executor(ev: Any) +}