Allow setting IgnoreExtraArgs on an individual basis (#998)
* Allow setting IgnoreExtraArgs on an individual basis
* Remove passing in the flag as a separate parameter
* VS plz
* Push the RunMode setting out to its own attribute, because fox wants consistency.
Bonus: Removes the need for that godawful 'RunMode.Default'.
* Revert previous commit
* Fox doesn't like module-wide switches 😒
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -14,7 +14,7 @@ namespace Discord.Commands
|
||||
QuotedParameter
|
||||
}
|
||||
|
||||
public static async Task<ParseResult> ParseArgsAsync(CommandInfo command, ICommandContext context, bool ignoreExtraArgs, IServiceProvider services, string input, int startPos)
|
||||
public static async Task<ParseResult> ParseArgsAsync(CommandInfo command, ICommandContext context, IServiceProvider services, string input, int startPos)
|
||||
{
|
||||
ParameterInfo curParam = null;
|
||||
StringBuilder argBuilder = new StringBuilder(input.Length);
|
||||
@@ -110,7 +110,7 @@ namespace Discord.Commands
|
||||
{
|
||||
if (curParam == null)
|
||||
{
|
||||
if (ignoreExtraArgs)
|
||||
if (command.IgnoreExtraArgs)
|
||||
break;
|
||||
else
|
||||
return ParseResult.FromError(CommandError.BadArgCount, "The input text has too many parameters.");
|
||||
|
||||
Reference in New Issue
Block a user