From fcaaa68daa7c0b656290fab8fcb8443b6836ff33 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 21 Dec 2019 18:43:23 +0100 Subject: [PATCH 1/4] Removed unused imports --- src/main/java/com/bbn/hadder/commands/owner/TestCommand.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/owner/TestCommand.java b/src/main/java/com/bbn/hadder/commands/owner/TestCommand.java index ae258104..58aaca55 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/TestCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/TestCommand.java @@ -2,8 +2,6 @@ import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.core.Perm; -import com.bbn.hadder.core.Perms; import com.bbn.hadder.utils.MessageEditor.MessageType; /* From 0e69b22ab1a93b7fd3330ac75d34b7814b0ecc89 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 21 Dec 2019 19:09:02 +0100 Subject: [PATCH 2/4] Better code --- .../commands/moderation/InviteDetectCommand.java | 1 - .../java/com/bbn/hadder/core/CommandHandler.java | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java index 37f9b0df..b85fee67 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java @@ -9,7 +9,6 @@ import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; import com.bbn.hadder.utils.MessageEditor; -import net.dv8tion.jda.api.Permission; @Perms(Perm.MANAGE_SERVER) public class InviteDetectCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/core/CommandHandler.java b/src/main/java/com/bbn/hadder/core/CommandHandler.java index a51e674c..c8e8dd39 100644 --- a/src/main/java/com/bbn/hadder/core/CommandHandler.java +++ b/src/main/java/com/bbn/hadder/core/CommandHandler.java @@ -35,15 +35,13 @@ public void handle(MessageReceivedEvent event, Rethink rethink, String prefix) { CommandEvent commandEvent = new CommandEvent(event.getJDA(), event.getResponseNumber(), event.getMessage(), rethink, config, this, helpCommand, new MessageEditor(rethink, event.getAuthor())); - if (cmd.getClass().getAnnotations().length>0) { - if (!Arrays.asList(cmd.getClass().getAnnotations()).contains(Perms.class)) { - 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(); - return; - } + if (cmd.getClass().getAnnotations().length > 0 && !Arrays.asList(cmd.getClass().getAnnotations()).contains(Perms.class)) { + 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(); + return; } } } From 77462097a8db36a279a67ce9f4f28c4bfc043c55 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 21 Dec 2019 20:25:31 +0100 Subject: [PATCH 3/4] Unused import --- .../java/com/bbn/hadder/commands/moderation/PrefixCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java index 43742d91..86f2c125 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java @@ -5,7 +5,6 @@ import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; import com.bbn.hadder.utils.MessageEditor; -import net.dv8tion.jda.api.Permission; @Perms(Perm.MANAGE_SERVER) public class PrefixCommand implements Command { From d482639e8232bbacdf1de16f51e1502780ebca40 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 21 Dec 2019 21:45:09 +0100 Subject: [PATCH 4/4] Beta --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 450bedea..73468251 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ Hadder Hadder - 0.10-ALPHA + 0.1-BETA Hadder