From d58d292a44f943876c13ad6bf58ea1215a076b6d Mon Sep 17 00:00:00 2001
From: ChomeNS <95471003+ChomeNS@users.noreply.github.com>
Date: Mon, 1 May 2023 13:45:39 +0700
Subject: [PATCH] remove unknown command message
---
.idea/workspace.xml | 22 +++++++++----------
.../plugins/CommandHandlerPlugin.java | 6 ++++-
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 7a699f2..3b328af 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -109,13 +109,6 @@
1680245437032
-
- 1682169054135
-
-
-
- 1682169054135
-
1682169510400
@@ -452,7 +445,14 @@
1682905214836
-
+
+ 1682910530242
+
+
+
+ 1682910530242
+
+
@@ -467,7 +467,6 @@
-
@@ -492,7 +491,8 @@
-
+
+
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java
index 18b0bdb..70b0c0e 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java
@@ -79,7 +79,11 @@ public class CommandHandlerPlugin {
final Command command = ElementUtilities.findCommand(commands, commandName);
- if (command == null) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED);
+ // 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;
final int trustLevel = command.trustLevel();