From fddabae3c3453546cc82a4c69cd828c6ed8007a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 20 Nov 2022 03:18:14 +0100 Subject: [PATCH] Make commands util class grab API instance Instead of passing it as an argument, let the class grab the instance itself. --- .../java/wtf/beatrice/hidekobot/utils/SlashCommandsUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/utils/SlashCommandsUtil.java b/src/main/java/wtf/beatrice/hidekobot/utils/SlashCommandsUtil.java index 6c88fae..e0576ac 100644 --- a/src/main/java/wtf/beatrice/hidekobot/utils/SlashCommandsUtil.java +++ b/src/main/java/wtf/beatrice/hidekobot/utils/SlashCommandsUtil.java @@ -4,6 +4,7 @@ import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.interactions.commands.Command; import net.dv8tion.jda.api.interactions.commands.build.CommandData; import net.dv8tion.jda.api.interactions.commands.build.Commands; +import wtf.beatrice.hidekobot.HidekoBot; import wtf.beatrice.hidekobot.listeners.MessageListener; import java.util.ArrayList; @@ -20,8 +21,10 @@ public class SlashCommandsUtil add(Commands.slash("coinflip", "Flip a coin and get head or tails.")); }}; - public static void updateSlashCommands(JDA jdaInstance) + public static void updateSlashCommands() { + JDA jdaInstance = HidekoBot.getAPI(); + List toAdd = new ArrayList<>(); List toDelete = new ArrayList<>();