refactor: show disabled message and make music locking for non-console sender instead of all

This commit is contained in:
ChomeNS
2024-12-25 08:41:09 +07:00
parent eba4f92e45
commit 497155a827
3 changed files with 10 additions and 10 deletions

View File

@@ -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;