Make slash commands interface and load them dynamically
All checks were successful
continuous-integration/drone/push Build is passing

Slash commands are now loaded dynamically by implementing a SlashCommand interface and storing them in a loaded commands map.
This commit is contained in:
2022-11-22 14:32:22 +01:00
parent 7ae4790d5c
commit 882c695484
13 changed files with 133 additions and 26 deletions

View File

@@ -13,13 +13,21 @@ import net.dv8tion.jda.api.interactions.components.buttons.Button;
import net.dv8tion.jda.api.requests.restaction.WebhookMessageEditAction;
import org.jetbrains.annotations.NotNull;
import wtf.beatrice.hidekobot.Cache;
import wtf.beatrice.hidekobot.objects.SlashCommand;
import java.util.ArrayList;
import java.util.List;
public class ClearCommand
public class ClearCommand implements SlashCommand
{
@Override
public String getCommandName() {
return "clear";
}
@Override
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)
{