From cf93b8b3cc909cd956e84f0f9357783c324a15d0 Mon Sep 17 00:00:00 2001 From: spiral Date: Sat, 1 May 2021 19:18:04 +0100 Subject: [PATCH] fix: don't try matching commands if there is nothing to match --- PluralKit.Bot/Handlers/MessageCreated.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Handlers/MessageCreated.cs b/PluralKit.Bot/Handlers/MessageCreated.cs index 30ced3ee..002a641a 100644 --- a/PluralKit.Bot/Handlers/MessageCreated.cs +++ b/PluralKit.Bot/Handlers/MessageCreated.cs @@ -103,7 +103,7 @@ namespace PluralKit.Bot if (content == null) return false; // Check for command prefix - if (!HasCommandPrefix(content, shard.User?.Id ?? default, out var cmdStart)) + if (!HasCommandPrefix(content, shard.User?.Id ?? default, out var cmdStart) || cmdStart == content.Length) return false; // Trim leading whitespace from command without actually modifying the string