diff --git a/build.gradle.kts b/build.gradle.kts index 0618029..36c5e45 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.springframework.boot") version "3.3.1" - id("io.spring.dependency-management") version "1.1.5" + id("io.spring.dependency-management") version "1.1.6" id("com.github.ben-manes.versions") version "0.51.0" id("java") } @@ -26,11 +26,15 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-cache") implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client") implementation("com.github.ben-manes.caffeine:caffeine:3.1.8") - implementation("dev.triumphteam:triumph-cmd-jda-slash:2.0.0-SNAPSHOT") + implementation("org.incendo:cloud-jda5:1.0.0-beta.3") implementation("com.squareup.okhttp3:okhttp:4.12.0") implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1") implementation("com.google.guava:guava:33.2.1-jre") + implementation("net.dv8tion:JDA:5.0.0-beta.24") { + exclude(module = "opus-java") + } + developmentOnly("org.springframework.boot:spring-boot-devtools") } diff --git a/src/main/java/com/mcbanners/discordapi/DiscordAPIApplication.java b/src/main/java/com/mcbanners/discordapi/DiscordAPIApplication.java index b7ff01c..ea993b3 100644 --- a/src/main/java/com/mcbanners/discordapi/DiscordAPIApplication.java +++ b/src/main/java/com/mcbanners/discordapi/DiscordAPIApplication.java @@ -2,9 +2,6 @@ import com.mcbanners.discordapi.commands.BannerCommand; import com.mcbanners.discordapi.commands.ServerCommand; -import dev.triumphteam.cmd.slash.SlashCommandManager; -import dev.triumphteam.cmd.slash.choices.ChoiceKey; -import dev.triumphteam.cmd.slash.sender.SlashSender; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.entities.Activity; @@ -12,6 +9,9 @@ import net.dv8tion.jda.api.utils.MemberCachePolicy; import net.dv8tion.jda.api.utils.cache.CacheFlag; import okhttp3.OkHttpClient; +import org.incendo.cloud.discord.jda5.JDA5CommandManager; +import org.incendo.cloud.discord.jda5.JDAInteraction; +import org.incendo.cloud.execution.ExecutionCoordinator; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching; @@ -25,7 +25,7 @@ @EnableDiscoveryClient public class DiscordAPIApplication { public static JDA jda; - public static SlashCommandManager manager; + public static JDA5CommandManager manager; public static OkHttpClient httpClient = new OkHttpClient(); public static void main(String[] args) throws LoginException { @@ -43,7 +43,10 @@ public static void main(String[] args) throws LoginException { jda.getPresence().setActivity(Activity.playing("MCBanners.com")); - manager = SlashCommandManager.create(jda); + manager = new JDA5CommandManager<>( + ExecutionCoordinator.simpleCoordinator(), + JDAInteraction.InteractionMapper.identity() + ); manager.registerChoices(ChoiceKey.of("platforms"), () -> diff --git a/src/main/java/com/mcbanners/discordapi/commands/Command.java b/src/main/java/com/mcbanners/discordapi/commands/Command.java new file mode 100644 index 0000000..7ec4f3d --- /dev/null +++ b/src/main/java/com/mcbanners/discordapi/commands/Command.java @@ -0,0 +1,9 @@ +package com.mcbanners.discordapi.commands; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.incendo.cloud.discord.jda5.JDA5CommandManager; +import org.incendo.cloud.discord.jda5.JDAInteraction; + +public interface Command { + void register(@NonNull JDA5CommandManager commandManager); +}