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,8 +1,7 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Discord.Commands.Builders
|
||||
{
|
||||
@@ -22,6 +21,7 @@ namespace Discord.Commands.Builders
|
||||
public string PrimaryAlias { get; set; }
|
||||
public RunMode RunMode { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public bool IgnoreExtraArgs { get; set; }
|
||||
|
||||
public IReadOnlyList<PreconditionAttribute> Preconditions => _preconditions;
|
||||
public IReadOnlyList<ParameterBuilder> Parameters => _parameters;
|
||||
@@ -140,4 +140,4 @@ namespace Discord.Commands.Builders
|
||||
return new CommandInfo(this, info, service);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Discord.Commands.Builders
|
||||
{
|
||||
|
||||
@@ -158,6 +158,7 @@ namespace Discord.Commands
|
||||
builder.AddAliases(command.Text);
|
||||
builder.RunMode = command.RunMode;
|
||||
builder.Name = builder.Name ?? command.Text;
|
||||
builder.IgnoreExtraArgs = command.IgnoreExtraArgs ?? service._ignoreExtraArgs;
|
||||
break;
|
||||
case NameAttribute name:
|
||||
builder.Name = name.Text;
|
||||
|
||||
Reference in New Issue
Block a user