use of de.c0debase.bot.commands.Command 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;
}
}
}
});
}
use of de.c0debase.bot.commands.Command in project c0debaseBot by Biospheere.
the class HelpCommand method execute.
@Override
public void execute(final String[] args, final Message message) {
final EmbedBuilder embedBuilder = getEmbed(message.getGuild(), message.getAuthor());
final Collection<Command> commandCollection = bot.getCommandManager().getAvailableCommands();
if (args.length == 0) {
embedBuilder.setTitle("Command Übersicht");
appendCommandOverview(commandCollection, embedBuilder);
} else {
addCommandDescription(args[0], commandCollection, embedBuilder);
}
message.getTextChannel().sendMessage(embedBuilder.build()).queue();
}
Aggregations