use of com.sx4.bot.formatter.FormatterManager in project Sx4 by sx4-discord-bot.
the class AntiRegexCommand method formatters.
@Command(value = "formatters", aliases = { "format", "formatting" }, description = "Get all the formatters for anti regex you can use")
@CommandId(468)
@Examples({ "anti regex formatters" })
@BotPermissions(permissions = { Permission.MESSAGE_EMBED_LINKS })
public void formatters(Sx4CommandEvent event) {
EmbedBuilder embed = new EmbedBuilder().setAuthor("Anti-Regex Formatters", null, event.getSelfUser().getEffectiveAvatarUrl());
FormatterManager manager = FormatterManager.getDefaultManager();
StringJoiner content = new StringJoiner("\n");
for (FormatterVariable<?> variable : manager.getVariables(User.class)) {
content.add("`{user." + variable.getName() + "}` - " + variable.getDescription());
}
for (FormatterVariable<?> variable : manager.getVariables(TextChannel.class)) {
content.add("`{channel." + variable.getName() + "}` - " + variable.getDescription());
}
content.add("`{regex.id}` - Gets the id of the regex");
content.add("`{regex.action.name}` - Gets the mod action name if one is set");
content.add("`{regex.action.exists}` - Returns true or false if an action exists");
content.add("`{regex.attempts.current}` - Gets the current attempts for the user");
content.add("`{regex.attempts.max}` - Gets the max attempts set for the anti regex");
embed.setDescription(content.toString());
event.reply(embed.build()).queue();
}
use of com.sx4.bot.formatter.FormatterManager in project Sx4 by sx4-discord-bot.
the class StarboardCommand method formatters.
@Command(value = "formatters", aliases = { "format", "formatting" }, description = "Get all the formatters for starboard you can use")
@CommandId(444)
@Examples({ "starboard formatters" })
@BotPermissions(permissions = { Permission.MESSAGE_EMBED_LINKS })
public void formatters(Sx4CommandEvent event) {
EmbedBuilder embed = new EmbedBuilder().setAuthor("Starboard Formatters", null, event.getSelfUser().getEffectiveAvatarUrl());
FormatterManager manager = FormatterManager.getDefaultManager();
StringJoiner content = new StringJoiner("\n");
for (FormatterVariable<?> variable : manager.getVariables(User.class)) {
content.add("`{user." + variable.getName() + "}` - " + variable.getDescription());
}
for (FormatterVariable<?> variable : manager.getVariables(Member.class)) {
content.add("`{member." + variable.getName() + "}` - " + variable.getDescription());
}
for (FormatterVariable<?> variable : manager.getVariables(Guild.class)) {
content.add("`{server." + variable.getName() + "}` - " + variable.getDescription());
}
for (FormatterVariable<?> variable : manager.getVariables(TextChannel.class)) {
content.add("`{channel." + variable.getName() + "}` - " + variable.getDescription());
}
for (FormatterVariable<?> variable : manager.getVariables(ReactionEmote.class)) {
content.add("`{emote." + variable.getName() + "}` - " + variable.getDescription());
}
content.add("`{stars}` - Gets amount of stars the starboard has");
content.add("`{stars.next}` - Gets the amount of stars the next milestone requires");
content.add("`{stars.next.until}` - Gets the amount of stars needed to reach the next milestone");
content.add("`{id}` - Gets the id for the starboard");
embed.setDescription(content.toString());
event.reply(embed.build()).queue();
}
Aggregations