From cdd0273d3903563ef83a8cbadb9a9aa26fc1a1fb Mon Sep 17 00:00:00 2001 From: hhhzzzsss Date: Sat, 1 Jul 2023 15:54:33 -0500 Subject: [PATCH] Fix multi-character prefixes --- .../java/com/github/hhhzzzsss/songplayer/CommandProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java index 27b36a5..953b483 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java @@ -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));