From 1b5efb666982e1ddce8d5da6b163d378fe65fbdb Mon Sep 17 00:00:00 2001 From: spiral Date: Mon, 2 May 2022 14:53:08 -0400 Subject: [PATCH] feat: add Context.CommandPrefix --- PluralKit.Bot/CommandSystem/Context/Context.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PluralKit.Bot/CommandSystem/Context/Context.cs b/PluralKit.Bot/CommandSystem/Context/Context.cs index 71f97315..d1233467 100644 --- a/PluralKit.Bot/CommandSystem/Context/Context.cs +++ b/PluralKit.Bot/CommandSystem/Context/Context.cs @@ -44,6 +44,7 @@ public class Context _metrics = provider.Resolve(); _provider = provider; _commandMessageService = provider.Resolve(); + CommandPrefix = message.Content?.Substring(0, commandParseOffset); Parameters = new Parameters(message.Content?.Substring(commandParseOffset)); Rest = provider.Resolve(); Cluster = provider.Resolve(); @@ -70,6 +71,7 @@ public class Context public readonly SystemConfig Config; public DateTimeZone Zone => Config?.Zone ?? DateTimeZone.Utc; + public readonly string CommandPrefix; public readonly Parameters Parameters; internal readonly IDatabase Database;