From 78139cc4d4f81e05bd6349c92af2404b405745f5 Mon Sep 17 00:00:00 2001 From: DxsSucuk Date: Mon, 10 Oct 2022 19:37:53 +0200 Subject: [PATCH] Added check for not given command names. --- src/main/java/de/presti/ree6/commands/CommandManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/presti/ree6/commands/CommandManager.java b/src/main/java/de/presti/ree6/commands/CommandManager.java index bd19d813e..463d19d71 100644 --- a/src/main/java/de/presti/ree6/commands/CommandManager.java +++ b/src/main/java/de/presti/ree6/commands/CommandManager.java @@ -193,7 +193,7 @@ public boolean perform(Member member, Guild guild, String messageContent, Messag } // Check if this is a Developer build, if not then cooldown the User. - if (BotWorker.getVersion() != BotVersion.DEVELOPMENT_BUILD) { + if (!BotWorker.getVersion().isDebug()) { ThreadUtil.createNewThread(x -> ArrayUtil.commandCooldown.remove(member.getUser().getId()), null, Duration.ofSeconds(5), false, false); } @@ -233,6 +233,11 @@ private boolean performMessageCommand(Member member, Guild guild, String message // Split all Arguments. String[] arguments = messageContent.split(" "); + if (arguments.length == 0 || arguments[0].isBlank()) { + sendMessage("Please provide a command!", 5, textChannel, null); + return false; + } + // Get the Command by the name. ICommand command = getCommandByName(arguments[0]);