Search in sources :

Example 1 with TagType

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;
}
Also used : TagType(com.github.vaerys.enums.TagType) XEmbedBuilder(com.github.vaerys.objects.XEmbedBuilder)

Example 2 with TagType

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;
}
Also used : TagType(com.github.vaerys.enums.TagType) TagObject(com.github.vaerys.templates.TagObject) LinkedList(java.util.LinkedList)

Aggregations

TagType (com.github.vaerys.enums.TagType)2 XEmbedBuilder (com.github.vaerys.objects.XEmbedBuilder)1 TagObject (com.github.vaerys.templates.TagObject)1 LinkedList (java.util.LinkedList)1