diff --git a/src/launcher/java/com/mcmoddev/relauncher/discord/commands/RLCommand.java b/src/launcher/java/com/mcmoddev/relauncher/discord/commands/RLCommand.java index 9e52315..8a58f41 100644 --- a/src/launcher/java/com/mcmoddev/relauncher/discord/commands/RLCommand.java +++ b/src/launcher/java/com/mcmoddev/relauncher/discord/commands/RLCommand.java @@ -32,6 +32,7 @@ public abstract class RLCommand extends SlashCommand { protected final Supplier processManager; protected final List roles; + protected boolean isRestricted = true; protected RLCommand(final Supplier processManager, final Config.Discord config) { this.processManager = processManager; @@ -41,7 +42,7 @@ protected RLCommand(final Supplier processManager, final Con @Override protected final void execute(final SlashCommandEvent event) { - if (event.getMember() != null || event.getMember().getRoles().stream().noneMatch(role -> roles.contains(role.getId()))) { + if (isRestricted && (event.getMember() == null || event.getMember().getRoles().stream().noneMatch(role -> roles.contains(role.getId())))) { event.deferReply(true).setContent("You do not have the required permissions to run this command.").queue(); return; } diff --git a/src/launcher/java/com/mcmoddev/relauncher/discord/commands/StatusCommand.java b/src/launcher/java/com/mcmoddev/relauncher/discord/commands/StatusCommand.java index a8a7cba..9add526 100644 --- a/src/launcher/java/com/mcmoddev/relauncher/discord/commands/StatusCommand.java +++ b/src/launcher/java/com/mcmoddev/relauncher/discord/commands/StatusCommand.java @@ -53,6 +53,7 @@ public StatusCommand(final Supplier jarUpdater, final Config super(jarUpdater, config); name = "status"; help = "Gets information about the process status."; + isRestricted = false; } @Override @@ -74,7 +75,7 @@ protected void exec(final SlashCommandEvent event) { final var embed = new EmbedBuilder() .setColor(Color.GREEN) .setTitle("Process is running.") - .addField("Jar Version", version.orElse("Unknown"), true) + .addField("Process Version", version.orElse("Unknown"), true) .addField("Launcher Version", Main.VERSION, true) .addField("Running Since", process.process().info().startInstant().map(TimeFormat.RELATIVE::format).orElse("Unknown startup time"), true) .setTimestamp(Instant.now()); @@ -178,8 +179,9 @@ public String buildThreadInfo(final ThreadInfo thread) { } public boolean isEnabled(final String roleId) { - for (var r : enabledRoles) { - if (r.equals(roleId)) return true; + for (var r : roles) { + if (r.equals(roleId)) + return true; } return false; }