diff --git a/pom.xml b/pom.xml index 4992643..c0fb7d3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.yosoyvillaa VJCommands - 1.1 + 1.2 1.8 diff --git a/src/main/java/com/yosoyvillaa/vjcommands/CommandManager.java b/src/main/java/com/yosoyvillaa/vjcommands/CommandManager.java index 5d04171..e80471d 100644 --- a/src/main/java/com/yosoyvillaa/vjcommands/CommandManager.java +++ b/src/main/java/com/yosoyvillaa/vjcommands/CommandManager.java @@ -8,6 +8,8 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.hooks.AnnotatedEventManager; import net.dv8tion.jda.api.hooks.SubscribeEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.HashSet; @@ -16,6 +18,8 @@ public class CommandManager { + private static final Logger logger = LoggerFactory.getLogger("VJCommands"); + private final JDA jda; private final Map prefixCommands; private final Map slashCommands; @@ -48,7 +52,7 @@ public Set getSlashCommands() { } public void registerCommand(ICommand command) { - System.out.println("[VJCommands] Registering command " + command.getName()); + logger.info("Registering command " + command.getName()); if (command instanceof PrefixCommand) { PrefixCommand prefixCommand = (PrefixCommand) command; if (prefixCommands.containsKey(prefixCommand.getPrefix() + prefixCommand.getName())) @@ -65,7 +69,7 @@ public void registerCommand(ICommand command) { slashCommands.put(slashCommand.getName(), slashCommand); jda.upsertCommand(slashCommand.getCommandData()).queue(); } - System.out.println("[VJCommands] Command " + command.getName() + " registered"); + logger.info("Command " + command.getName() + " registered"); } public void registerCommands(ICommand... commands) { @@ -75,7 +79,7 @@ public void registerCommands(ICommand... commands) { } public void unregisterCommand(ICommand command) { - System.out.println("[VJCommands] Unregistering command " + command.getName()); + logger.info("Unregistering command " + command.getName()); if (command instanceof PrefixCommand) { PrefixCommand prefixCommand = (PrefixCommand) command; prefixCommands.remove(prefixCommand.getPrefix() + prefixCommand.getName()); @@ -84,9 +88,9 @@ public void unregisterCommand(ICommand command) { if (command instanceof SlashCommand) { SlashCommand slashCommand = (SlashCommand) command; slashCommands.remove(slashCommand.getName()); - System.out.println("Slash commands will be already being shown on the client, you will need to restart the bot with the command disabled"); + logger.warn("Slash commands will be already being shown on the client, you will need to restart the bot with the command disabled"); } - System.out.println("[VJCommands] Command " + command.getName() + " unregistered"); + logger.info("Command " + command.getName() + " unregistered"); } public void unregisterAllCommands() {