Perms Check

This commit is contained in:
GregTCLTK 2019-11-16 19:57:11 +01:00
parent a6e1d8c1f1
commit d9d6dfe195
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -4,6 +4,7 @@ import com.bbn.hadder.commands.Command;
import com.bbn.hadder.commands.CommandEvent;
import com.bbn.hadder.utils.MessageEditor;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.Permission;
import java.util.ArrayList;
import java.util.HashMap;
@ -13,6 +14,7 @@ public class HelpCommand implements Command {
@Override
public void executed(String[] args, CommandEvent event) {
if (event.getGuild().getSelfMember().hasPermission(Permission.MESSAGE_EMBED_LINKS)) {
if (args.length == 0) {
HashMap<String, ArrayList<Command>> hashMap = new HashMap<>();
for (Command cmd : event.getCommandHandler().getCommandList()) {
@ -55,6 +57,9 @@ public class HelpCommand implements Command {
}
}
}
} else {
event.getTextChannel().sendMessage("I need the Embed Links Permission to send the Help Menu!").queue();
}
}
@Override