use of de.c0debase.bot.commands.Command.Categorie in project c0debaseBot by Biospheere.
the class MessageReactionListener method onGenericPrivateMessageReaction.
@Override
public void onGenericPrivateMessageReaction(GenericPrivateMessageReactionEvent event) {
super.onGenericPrivateMessageReaction(event);
if (event.getUser().isBot()) {
return;
}
event.getChannel().getMessageById(event.getMessageId()).queue((Message success) -> {
final String emote = getReaction(event.getReactionEmote());
if (emote == null) {
return;
}
if (!success.getEmbeds().isEmpty() && success.getAuthor().isBot()) {
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setColor(Color.GREEN);
if (emote.equalsIgnoreCase("wastebasket")) {
success.delete().queue();
return;
}
for (Categorie categorie : Categorie.values()) {
if (categorie.getEmote().equalsIgnoreCase(emote)) {
embedBuilder.setTitle(":question: " + categorie.getName() + " Commands Help");
for (Command command : CodebaseBot.getInstance().getCommandManager().getAvailableCommands()) {
if (command.getCategorie() == categorie) {
embedBuilder.appendDescription("**!" + command.getCommand() + "**\n" + command.getDescription() + "\n\n");
}
}
success.editMessage(embedBuilder.build()).queue();
break;
}
}
}
});
}
Aggregations