Custom error messages
This commit is contained in:
parent
8cb9613fd6
commit
912dba9158
2 changed files with 8 additions and 8 deletions
|
|
@ -1,15 +1,14 @@
|
|||
package com.bbn.hadder.commands.music;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
import com.bbn.hadder.commands.Command;
|
||||
import com.bbn.hadder.commands.CommandEvent;
|
||||
import com.bbn.hadder.utils.MessageEditor;
|
||||
import net.dv8tion.jda.api.entities.VoiceChannel;
|
||||
import net.dv8tion.jda.api.managers.AudioManager;
|
||||
|
||||
/*
|
||||
* @author Skidder / GregTCLTK
|
||||
*/
|
||||
|
||||
public class JoinCommand implements Command {
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,9 @@ public class CommandHandler {
|
|||
for (Perm perm : cmd.getClass().getAnnotation(Perms.class).value()) {
|
||||
if (!perm.check(commandEvent)) {
|
||||
commandEvent.getTextChannel()
|
||||
.sendMessage(commandEvent.getMessageEditor().getMessage(MessageEditor.MessageType.NO_PERMISSION).build())
|
||||
.queue();
|
||||
.sendMessage(commandEvent.getMessageEditor().getMessage(MessageEditor.MessageType.NO_PERMISSION)
|
||||
.setDescription("To execute this command, you need the `" + cmd.getClass().getAnnotation(Perms.class).value()[0] + "` permission.")
|
||||
.build()).queue();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -51,8 +52,8 @@ public class CommandHandler {
|
|||
boolean run = true;
|
||||
String blacklisted = rethink.getBlackListed(event.getAuthor().getId());
|
||||
if (!"none".equals(blacklisted)) {
|
||||
for (String blacklistedlabel : blacklisted.split(",")) {
|
||||
if (Arrays.asList(cmd.labels()).contains(blacklistedlabel)) {
|
||||
for (String BLLabel : blacklisted.split(",")) {
|
||||
if (Arrays.asList(cmd.labels()).contains(BLLabel)) {
|
||||
run = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue