From e9a271ef60c07a8d0aa54039c8f055e986b7d9fc Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 7 May 2020 23:43:17 +0200 Subject: [PATCH] Skip leading spaces when command parsing --- PluralKit.Bot/CommandSystem/Parameters.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/CommandSystem/Parameters.cs b/PluralKit.Bot/CommandSystem/Parameters.cs index 6e8ae4a1..ebb69194 100644 --- a/PluralKit.Bot/CommandSystem/Parameters.cs +++ b/PluralKit.Bot/CommandSystem/Parameters.cs @@ -140,6 +140,9 @@ namespace PluralKit.Bot private WordPosition? NextWordPosition(int position) { + // Skip leading spaces before actual content + while (position < _cmd.Length && _cmd[position] == ' ') position++; + // Is this the end of the string? if (_cmd.Length <= position) return null;