actually fix it

This commit is contained in:
Lee 2024-06-28 19:11:37 +01:00
parent e17c8a08c2
commit 107ec43149

View File

@ -149,6 +149,7 @@ public class CommandService extends ListenerAdapter {
try {
BatCommandExecutor executor = null;
CommandInfo commandInfo = command.getCommandInfo();
List<Permission> requiredPermissions = new ArrayList<>();
boolean isSubCommand = false;
@ -164,6 +165,7 @@ public class CommandService extends ListenerAdapter {
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;
}
}
@ -199,7 +201,11 @@ public class CommandService extends ListenerAdapter {
}
}
if (isSubCommand && command.getCommandInfo().guildOnly() && !ranInsideGuild) {
System.out.println("isSubCommand = " + isSubCommand);
System.out.println("command.getCommandInfo().guildOnly() = " + command.getCommandInfo().guildOnly());
System.out.println("ranInsideGuild = " + ranInsideGuild);
if (isSubCommand && commandInfo.guildOnly() && !ranInsideGuild) {
event.replyEmbeds(EmbedUtils.errorEmbed()
.setDescription("This command can only be executed in a guild")
.build()).setEphemeral(true).queue();