From c89802a21c164cfcd1b9aadec435a945d1856921 Mon Sep 17 00:00:00 2001 From: Ske Date: Fri, 3 Jan 2020 13:30:50 +0100 Subject: [PATCH] Fix matching commands with a newline instead of a space after command name --- PluralKit.Bot/CommandSystem/Parameters.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/CommandSystem/Parameters.cs b/PluralKit.Bot/CommandSystem/Parameters.cs index 185cdf9a..d43bcc6a 100644 --- a/PluralKit.Bot/CommandSystem/Parameters.cs +++ b/PluralKit.Bot/CommandSystem/Parameters.cs @@ -15,7 +15,9 @@ namespace PluralKit.Bot.CommandSystem public Parameters(string cmd) { - _cmd = cmd; + // This is a SUPER dirty hack to avoid having to match both spaces and newlines in the word detection below + // Instead, we just add a space before every newline (which then gets stripped out later). + _cmd = cmd.Replace("\n", " \n"); _ptr = 0; }