diff --git a/src/main/java/cc/fascinated/bat/service/CommandService.java b/src/main/java/cc/fascinated/bat/service/CommandService.java index a806df5..4aa536f 100644 --- a/src/main/java/cc/fascinated/bat/service/CommandService.java +++ b/src/main/java/cc/fascinated/bat/service/CommandService.java @@ -164,7 +164,6 @@ public class CommandService extends ListenerAdapter { BatCommandExecutor executor = null; CommandInfo commandInfo = command.getCommandInfo(); List requiredPermissions = new ArrayList<>(); - boolean isSubCommand = false; // No args provided, use the main command executor if (event.getInteraction().getSubcommandName() == null) { @@ -177,7 +176,6 @@ public class CommandService extends ListenerAdapter { executor = subCommand.getValue(); requiredPermissions.addAll(Arrays.asList(subCommand.getValue().getCommandInfo().requiredPermissions())); requiredPermissions.addAll(Arrays.asList(command.getCommandInfo().requiredPermissions())); // not sure if we'd want this, but it's here for now - isSubCommand = true; commandInfo = subCommand.getValue().getCommandInfo(); break; } @@ -216,7 +214,7 @@ public class CommandService extends ListenerAdapter { } // Check if the command is guild only and if it was not ran inside a guild - if (commandInfo.guildOnly() && !ranInsideGuild) { + if (commandInfo.guildOnly() && guild == null) { event.replyEmbeds(EmbedUtils.errorEmbed() .setDescription("This command can only be executed in a guild") .build()).setEphemeral(true).queue();