Skip to content

Commit

Permalink
Added check for not given command names.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Oct 10, 2022
1 parent 4bb9e70 commit 78139cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/de/presti/ree6/commands/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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]);

Expand Down

0 comments on commit 78139cc

Please sign in to comment.