refactor: make the bot disabled message only show when command is valid
This commit is contained in:
@@ -88,10 +88,7 @@ public class CommandHandlerPlugin {
|
||||
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;
|
||||
}
|
||||
if (commandPerSecond > 100) return null;
|
||||
|
||||
commandPerSecond++;
|
||||
|
||||
@@ -108,6 +105,8 @@ public class CommandHandlerPlugin {
|
||||
if (command == null && !inGame) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED);
|
||||
else if (command == null) return null;
|
||||
|
||||
if (!console && disabled) return Component.text("ChomeNS Bot is currently disabled").color(NamedTextColor.RED);
|
||||
|
||||
final TrustLevel trustLevel = command.trustLevel;
|
||||
|
||||
if (trustLevel != TrustLevel.PUBLIC && splitInput.length < 2 && inGame) return Component.text("Please provide a hash").color(NamedTextColor.RED);
|
||||
|
||||
Reference in New Issue
Block a user