Perms Check
This commit is contained in:
parent
a6e1d8c1f1
commit
d9d6dfe195
1 changed files with 40 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue