use of com.github.vaerys.enums.TagType in project DiscordSailv2 by Vaerys-Dawn.
the class ListTags method execute.
@Override
public String execute(String args, CommandObject command) {
List<String> list;
XEmbedBuilder builder = new XEmbedBuilder(command);
TagType type = TagType.get(args);
if (args.isEmpty() && !TAGS.isSubCommand(command)) {
sendModes(command, "");
return null;
} else if (TAGS.isSubCommand(command)) {
list = TagList.getNames(TagType.CC);
} else {
list = TagList.getNames(type);
}
if (list.size() == 0) {
sendModes(command, "> Invalid mode.");
return null;
}
builder.withTitle("> Here are all of the " + StringUtils.capitalize(args) + " tags:");
builder.withDesc("```\n" + Utility.listFormatter(list, true) + "```\n" + "Tags are run in the order listed above.\n\n" + new HelpTags().missingArgs(command));
RequestHandler.sendEmbedMessage("", builder, command.channel.get());
return null;
}
use of com.github.vaerys.enums.TagType in project DiscordSailv2 by Vaerys-Dawn.
the class TagList method getType.
public static List<TagObject> getType(TagType type) {
List<TagObject> list = new LinkedList<>();
for (TagObject o : tags) {
for (TagType t : o.getTypes()) {
if (t == type) {
list.add(o);
break;
}
}
}
sort(list);
return list;
}
Aggregations