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