The usage of the registered command now automatically adds itself

This commit is contained in:
mathias 2021-10-02 20:21:28 +02:00
parent 42d9248caf
commit 2ba071f2ea
No known key found for this signature in database
GPG Key ID: 8950DF62139C852A

View File

@ -83,6 +83,7 @@ public class SimpleAutoResponder {
public SimpleAutoResponder registerCommand(ResponderCommand... commands) {
for (ResponderCommand command : commands) {
if (command.getClass().isAnnotationPresent(CommandInfo.class)) {
command.usage();
this.commands.add(command);
} else {
LOG.error("Could not register command {}. You need to add the command information annotation.", command.getClass().getName());