fix subcomamnds not having options

This commit is contained in:
Rainnny7 2024-07-04 08:51:27 -04:00
parent 4fdd00453a
commit 47b4796695

@ -103,6 +103,9 @@ public abstract class BatCommand {
} }
command.setSubcommandData(new SubcommandData(command.getInfo().getName(), command.getInfo().getDescription())); command.setSubcommandData(new SubcommandData(command.getInfo().getName(), command.getInfo().getDescription()));
for (OptionData option : command.getCommandData().getOptions()) {
command.getSubcommandData().addOptions(option);
}
commandData.addSubcommands(command.getSubcommandData()); commandData.addSubcommands(command.getSubcommandData());
subCommands.put(command.getInfo().getName(), command); subCommands.put(command.getInfo().getName(), command);
} }
@ -115,10 +118,6 @@ public abstract class BatCommand {
* @param options the options to add * @param options the options to add
*/ */
protected final void addOptions(OptionData... options) { protected final void addOptions(OptionData... options) {
if (subcommandData != null) { commandData.addOptions(options);
subcommandData.addOptions(options);
} else {
commandData.addOptions(options);
}
} }
} }