use of tk.ardentbot.core.executor.BaseCommand in project Ardent by adamint.
the class Help method setupSubcommands.
@Override
public void setupSubcommands() {
all = new Subcommand("See the traditional help screen", "all", "all") {
@Override
public void onCall(Guild guild, MessageChannel channel, User user, Message message, String[] args) throws Exception {
EmbedBuilder helpEmbed = MessageUtils.getDefaultEmbed(user);
helpEmbed.setAuthor("Ardent Help", "https://ardentbot.tk/guild", getShard().bot.getAvatarUrl());
helpEmbed.setThumbnail("https://a.dryicons.com/images/icon_sets/polygon_icons/png/256x256/computer" + ".png");
StringBuilder description = new StringBuilder();
description.append("Command Categories\n");
for (Category category : Category.values()) {
description.append(" > **" + category.name().toLowerCase() + "**\n");
}
description.append("\nType /help [category] to view a specific category\n\nIf you need help, join our support guild: " + "https://ardentbot.tk/guild");
helpEmbed.setDescription(description.toString());
sendEmbed(helpEmbed, channel, user);
}
};
subcommands.add(all);
for (Category category : Category.values()) {
subcommands.add(new Subcommand("how tf did you see this", Category.getName(category), Category.getName(category)) {
@Override
public void onCall(Guild guild, MessageChannel channel, User user, Message message, String[] args) throws Exception {
EmbedBuilder embedBuilder = MessageUtils.getDefaultEmbed(user);
embedBuilder.setAuthor("Commands in Category ".replace("{0}", WordUtils.capitalize(category.name().toLowerCase())), "https://ardentbot.tk/guild", getShard().bot.getAvatarUrl());
ArrayList<BaseCommand> commandsInCategory = Help.this.getCommandsInCategory(category);
StringBuilder description = new StringBuilder();
for (BaseCommand baseCommand : commandsInCategory) {
description.append(" > **" + baseCommand.getName() + "**: " + baseCommand.getDescription() + "\n");
}
embedBuilder.setDescription(description.toString());
sendEmbed(embedBuilder, channel, user);
}
});
}
}
use of tk.ardentbot.core.executor.BaseCommand in project Ardent by adamint.
the class Help method noArgs.
@Override
public void noArgs(Guild guild, MessageChannel channel, User user, Message message, String[] args) throws Exception {
EmbedBuilder embedBuilder = MessageUtils.getDefaultEmbed(user);
embedBuilder.setAuthor("Ardent Help", "https://ardentbot.tk/guild", getShard().bot.getAvatarUrl());
embedBuilder.setThumbnail("https://a.dryicons.com/images/icon_sets/polygon_icons/png/256x256/computer.png");
StringBuilder description = new StringBuilder();
for (Category category : Category.values()) {
if (category == Category.NSFW) {
if (!NSFW.csn(user, channel, guild)) {
continue;
}
}
description.append("**" + WordUtils.capitalize(category.name().toLowerCase()) + "**\n");
ArrayList<BaseCommand> commandsInCategory = getCommandsInCategory(category);
for (BaseCommand baseCommand : commandsInCategory) {
description.append("`" + baseCommand.getName() + "` ");
}
description.append("\n");
}
description.append("\nType /help [category] to view a specific category View the full help screen by typing {0}help all".replace("{0}", GuildUtils.getPrefix(guild) + args[0]));
description.append("\n\nIf you need help, join our support guild @ https://ardentbot.tk/guild");
embedBuilder.setDescription(description.toString());
sendEmbed(embedBuilder, channel, user);
}
use of tk.ardentbot.core.executor.BaseCommand in project Ardent by adamint.
the class UsageUtils method orderByUsageDesc.
public static ArrayList<BaseCommand> orderByUsageDesc() {
ConcurrentLinkedQueue<BaseCommand> unsorted = shard0.factory.getBaseCommands();
ArrayList<BaseCommand> baseCommands = new ArrayList<>();
for (BaseCommand c : unsorted) {
if (!c.getName().equalsIgnoreCase("patreon") && !c.getName().equalsIgnoreCase("translateforardent") && !c.getName().equalsIgnoreCase("tweet") && !c.getName().equalsIgnoreCase("eval") && !c.getName().equalsIgnoreCase("addenglishbase") && !c.getName().equalsIgnoreCase("help") && !c.getName().equalsIgnoreCase("manage") && !c.getName().equalsIgnoreCase("admin")) {
baseCommands.add(c);
}
}
baseCommands.sort(SORT_BY_USAGE);
return baseCommands;
}
Aggregations