use of com.freya02.botcommands.api.prefixed.TextCommand in project BotCommands by freya022.
the class CommandsBuilderImpl method processMethod.
private boolean processMethod(Method method) throws InvocationTargetException, InstantiationException, IllegalAccessException {
for (Class<? extends Annotation> annotation : applicationMethodAnnotations) {
final ApplicationCommand applicationCommand = tryInstantiateMethod(annotation, ApplicationCommand.class, "Application command", method);
if (applicationCommand != null) {
applicationCommandsBuilder.processApplicationCommand(applicationCommand, method);
return true;
}
}
final TextCommand textCommand = tryInstantiateMethod(JDATextCommand.class, TextCommand.class, "Text command", method);
if (textCommand != null) {
prefixedCommandsBuilder.processPrefixedCommand(textCommand, method);
return true;
}
final Object eventListener = tryInstantiateMethod(JDAEventListener.class, Object.class, "JDA event listener", method);
if (eventListener != null) {
eventListenersBuilder.processEventListener(eventListener, method);
return true;
}
final Object autocompletionHandler = tryInstantiateMethod(AutocompletionHandler.class, Object.class, "Slash command auto completion", method);
if (autocompletionHandler != null) {
autocompletionHandlersBuilder.processHandler(autocompletionHandler, method);
return true;
}
return false;
}
Aggregations