Make commands util class grab API instance
All checks were successful
continuous-integration/drone/push Build is passing

Instead of passing it as an argument, let the class grab the instance itself.
This commit is contained in:
Bea 2022-11-20 03:18:14 +01:00
parent 8b9ce25684
commit fddabae3c3

View File

@ -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.Command;
import net.dv8tion.jda.api.interactions.commands.build.CommandData; import net.dv8tion.jda.api.interactions.commands.build.CommandData;
import net.dv8tion.jda.api.interactions.commands.build.Commands; import net.dv8tion.jda.api.interactions.commands.build.Commands;
import wtf.beatrice.hidekobot.HidekoBot;
import wtf.beatrice.hidekobot.listeners.MessageListener; import wtf.beatrice.hidekobot.listeners.MessageListener;
import java.util.ArrayList; import java.util.ArrayList;
@ -20,8 +21,10 @@ public class SlashCommandsUtil
add(Commands.slash("coinflip", "Flip a coin and get head or tails.")); 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<CommandData> toAdd = new ArrayList<>(); List<CommandData> toAdd = new ArrayList<>();
List<Command> toDelete = new ArrayList<>(); List<Command> toDelete = new ArrayList<>();