From 8a50b690ebedf9eb9bc87c2947163e609a23b2be Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Fri, 25 Oct 2024 23:44:01 +0200 Subject: [PATCH] Fix issues with entry point registration --- gradle.properties | 2 +- .../commands/application/ApplicationCommandRegistry.kt | 1 + .../commands/application/PrimaryEntryPointCommand.kt | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5b3c21b413..2061b94340 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true ksp.incremental=false ksp.useKSP2=true -projectVersion=1.9.12-mikbot-SNAPSHOT +projectVersion=1.9.14-mikbot-SNAPSHOT diff --git a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/ApplicationCommandRegistry.kt b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/ApplicationCommandRegistry.kt index 577ed38e03..0bfab2b498 100644 --- a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/ApplicationCommandRegistry.kt +++ b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/ApplicationCommandRegistry.kt @@ -99,6 +99,7 @@ public abstract class ApplicationCommandRegistry : KordExKoinComponent { commands += it.messageCommands commands += it.slashCommands commands += it.userCommands + commands += it.entryPointCommands } try { diff --git a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/PrimaryEntryPointCommand.kt b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/PrimaryEntryPointCommand.kt index 17287c740b..1318d1db4e 100644 --- a/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/PrimaryEntryPointCommand.kt +++ b/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/PrimaryEntryPointCommand.kt @@ -29,4 +29,9 @@ public open class PrimaryEntryPointCommand(extension: Extension) : ApplicationCo event: Nothing, cache: MutableStringKeyedMap, ): Nothing = error("Primary entry point commands can't be called") + + override fun validate() { + require(this::handler.isInitialized) { "Handler needs to be set" } + require(this::description.isInitialized) { "Handler description to be set" } + } }