This commit is contained in:
Chayapak 2023-05-09 14:30:44 +07:00
parent 37261fa318
commit 14d07a0643
2 changed files with 4 additions and 6 deletions

View file

@ -79,11 +79,10 @@ public class CommandHandlerPlugin {
final Command command = ElementUtilities.findCommand(commands, commandName);
// I think this is kinda annoying when you correct spelling mistakes or something like
// *whatever* (action or whatever you call it.,,.) so I removed the unknown command
// if (command == null) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED);
if (command == null) return null;
// I think this is kinda annoying when you correct spelling mistakes or something
// so I made it return nothing if it's in game
if (command == null && !inGame) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED);
else if (command == null) return null;
final int trustLevel = command.trustLevel();

View file

@ -4,7 +4,6 @@ import land.chipmunk.chayapak.chomens_bot.command.Command;
import java.util.List;
// Author: ChatGPT I guess
public class ElementUtilities {
public static Command findCommand(List<Command> commands, String searchTerm) {
for (Command command : commands) {