Fix multi-character prefixes

This commit is contained in:
hhhzzzsss 2023-07-01 15:54:33 -05:00
parent 49f9bb8552
commit cdd0273d39

View file

@ -67,7 +67,7 @@ public class CommandProcessor {
// returns true if it is a command and should be cancelled
public static boolean processChatMessage(String message) {
if (message.startsWith(Config.getConfig().prefix)) {
String[] parts = message.substring(1).split(" ", 2);
String[] parts = message.substring(Config.getConfig().prefix.length()).split(" ", 2);
String name = parts.length>0 ? parts[0] : "";
String args = parts.length>1 ? parts[1] : "";
Command c = commandMap.get(name.toLowerCase(Locale.ROOT));