diff --git a/PluralKit.Bot/CommandSystem/Context.cs b/PluralKit.Bot/CommandSystem/Context.cs index 9ae543a6..cae120f6 100644 --- a/PluralKit.Bot/CommandSystem/Context.cs +++ b/PluralKit.Bot/CommandSystem/Context.cs @@ -50,7 +50,7 @@ namespace PluralKit.Bot public string PopArgument() => _parameters.Pop(); public string PeekArgument() => _parameters.Peek(); public string RemainderOrNull(bool skipFlags = true) => _parameters.Remainder(skipFlags).Length == 0 ? null : _parameters.Remainder(skipFlags); - public bool HasNext() => RemainderOrNull() != null; + public bool HasNext(bool skipFlags = true) => RemainderOrNull(skipFlags) != null; public string FullCommand => _parameters.FullCommand; public Task Reply(string text = null, Embed embed = null) => diff --git a/PluralKit.Bot/Commands/MemberProxy.cs b/PluralKit.Bot/Commands/MemberProxy.cs index 0d3855e9..61d059e2 100644 --- a/PluralKit.Bot/Commands/MemberProxy.cs +++ b/PluralKit.Bot/Commands/MemberProxy.cs @@ -44,7 +44,7 @@ namespace PluralKit.Bot // "Sub"command: no arguments clearing // Also matches the pseudo-subcommand "text" which is equivalent to empty proxy tags on both sides. - if (!ctx.HasNext() || ctx.Match("clear", "purge", "clean", "removeall")) + if (!ctx.HasNext(skipFlags: false) || ctx.Match("clear", "purge", "clean", "removeall")) { // If we already have multiple tags, this would clear everything, so prompt that if (target.ProxyTags.Count > 1) @@ -63,7 +63,7 @@ namespace PluralKit.Bot // Subcommand: "add" else if (ctx.Match("add", "append")) { - if (!ctx.HasNext()) throw new PKSyntaxError("You must pass an example proxy to add (eg. `[text]` or `J:text`)."); + if (!ctx.HasNext(skipFlags: false)) throw new PKSyntaxError("You must pass an example proxy to add (eg. `[text]` or `J:text`)."); var tagToAdd = ParseProxyTags(ctx.RemainderOrNull(skipFlags: false)); if (tagToAdd.IsEmpty) throw Errors.EmptyProxyTags(target); @@ -83,7 +83,7 @@ namespace PluralKit.Bot // Subcommand: "remove" else if (ctx.Match("remove", "delete")) { - if (!ctx.HasNext()) throw new PKSyntaxError("You must pass a proxy tag to remove (eg. `[text]` or `J:text`)."); + if (!ctx.HasNext(skipFlags: false)) throw new PKSyntaxError("You must pass a proxy tag to remove (eg. `[text]` or `J:text`)."); var tagToRemove = ParseProxyTags(ctx.RemainderOrNull(skipFlags: false)); if (tagToRemove.IsEmpty) throw Errors.EmptyProxyTags(target); @@ -100,7 +100,7 @@ namespace PluralKit.Bot // Subcommand: bare proxy tag given else { - if (!ctx.HasNext()) throw new PKSyntaxError("You must pass an example proxy to set (eg. `[text]` or `J:text`)."); + if (!ctx.HasNext(skipFlags: false)) throw new PKSyntaxError("You must pass an example proxy to set (eg. `[text]` or `J:text`)."); var requestedTag = ParseProxyTags(ctx.RemainderOrNull(skipFlags: false)); if (requestedTag.IsEmpty) throw Errors.EmptyProxyTags(target);