use of net.robinfriedli.aiode.entities.xml.CommandHierarchyNode in project aiode by robinfriedli.
the class InitialiseCommandContributionsTask method perform.
@Override
public void perform(@Nullable JDA shard) throws Exception {
Context commandContributionContext = commandManager.getCommandContributionContext();
@SuppressWarnings("rawtypes") List<CommandHierarchyNode> commandHierarchyNodes = commandContributionContext.getInstancesOf(CommandHierarchyNode.class);
for (@SuppressWarnings("unchecked") CommandHierarchyNode<ArgumentContributionDelegate> commandHierarchyNode : commandHierarchyNodes) {
Map<String, ArgumentContributionDelegate> argumentContributions = commandHierarchyNode.getArguments();
for (ArgumentContributionDelegate argumentContributionDelegate : argumentContributions.values()) {
ArgumentContribution argumentContribution = argumentContributionDelegate.unwrapArgumentContribution();
List<XmlElement> excludedArguments = argumentContribution.getExcludedArguments();
List<XmlElement> requiredArguments = argumentContribution.getRequiredArguments();
validateReferencedArguments(commandHierarchyNode, argumentContribution, excludedArguments);
validateReferencedArguments(commandHierarchyNode, argumentContribution, requiredArguments);
}
}
}
Aggregations