refactor: show disabled message and make music locking for non-console sender instead of all
This commit is contained in:
@@ -84,14 +84,17 @@ public class CommandHandlerPlugin {
|
||||
CommandContext context,
|
||||
MessageReceivedEvent event
|
||||
) {
|
||||
if (disabled || commandPerSecond > 100) return null;
|
||||
|
||||
commandPerSecond++;
|
||||
|
||||
final boolean inGame = context instanceof PlayerCommandContext;
|
||||
final boolean discord = context instanceof DiscordCommandContext;
|
||||
final boolean console = context instanceof ConsoleCommandContext;
|
||||
|
||||
if (!console) {
|
||||
if (disabled) return Component.text("ChomeNS Bot is currently disabled").color(NamedTextColor.RED);
|
||||
else if (commandPerSecond > 100) return null;
|
||||
}
|
||||
|
||||
commandPerSecond++;
|
||||
|
||||
final String[] splitInput = input.trim().split("\\s+");
|
||||
|
||||
if (splitInput.length == 0) return null;
|
||||
|
||||
Reference in New Issue
Block a user