make the help command better

This commit is contained in:
Lee
2024-06-27 16:24:08 +01:00
parent a7c3e2d745
commit 50b921c66d
7 changed files with 41 additions and 6 deletions

View File

@ -89,6 +89,11 @@ public class CommandService extends ListenerAdapter {
List<Command> discordCommands = jda.updateCommands().addCommands(commands.values().stream().map(BatCommand::getCommandData).toList()).complete();
for (Command discordCommand : discordCommands) {
commands.get(discordCommand.getName()).setCommandSnowflake(discordCommand.getIdLong());
if (!discordCommand.getSubcommands().isEmpty()) {
for (Command.Subcommand subCommand : discordCommand.getSubcommands()) {
commands.get(discordCommand.getName()).getSubCommands().get(subCommand.getName()).setCommandSnowflake(subCommand.getIdLong());
}
}
}
log.info("Registered all slash commands in {}ms", System.currentTimeMillis() - before);
}