feat: register multiple commands (#2394)

This commit is contained in:
Tech 2024-09-16 18:45:55 -04:00 committed by GitHub
parent e257d4b4b2
commit 9fbff439e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,6 +60,18 @@ public final class CommandManager {
invalidateGraphCache();
}
/**
* Register multiple {@link Command}s.
*
* @param commands the array of commands
* @throws IllegalStateException if a command with the same name already exists
*/
public synchronized void register(@NotNull Command... commands) {
for (Command command : commands) {
register(command);
}
}
/**
* Removes a command from the currently registered commands.
* Does nothing if the command was not registered before