| @@ -7,6 +7,7 @@ namespace Discord.Commands | |||||
| { | { | ||||
| public string Text { get; } | public string Text { get; } | ||||
| public RunMode RunMode { get; set; } = RunMode.Default; | public RunMode RunMode { get; set; } = RunMode.Default; | ||||
| public bool? IgnoreExtraArgs { get; set; } | |||||
| public CommandAttribute() | public CommandAttribute() | ||||
| { | { | ||||
| @@ -1,17 +0,0 @@ | |||||
| using System; | |||||
| namespace Discord.Commands | |||||
| { | |||||
| /// <summary> Set whether or not to ignore extra arguments for an individual command method or module, | |||||
| /// overriding the setting in <see cref="CommandServiceConfig"/> if necessary. </summary> | |||||
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] | |||||
| public sealed class IgnoreExtraArgsAttribute : Attribute | |||||
| { | |||||
| public bool IgnoreValue { get; } | |||||
| public IgnoreExtraArgsAttribute(bool ignoreValue) | |||||
| { | |||||
| IgnoreValue = ignoreValue; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -32,7 +32,6 @@ namespace Discord.Commands.Builders | |||||
| internal CommandBuilder(ModuleBuilder module) | internal CommandBuilder(ModuleBuilder module) | ||||
| { | { | ||||
| Module = module; | Module = module; | ||||
| IgnoreExtraArgs = module.IgnoreExtraArgs; | |||||
| _preconditions = new List<PreconditionAttribute>(); | _preconditions = new List<PreconditionAttribute>(); | ||||
| _parameters = new List<ParameterBuilder>(); | _parameters = new List<ParameterBuilder>(); | ||||
| @@ -19,7 +19,6 @@ namespace Discord.Commands.Builders | |||||
| public string Summary { get; set; } | public string Summary { get; set; } | ||||
| public string Remarks { get; set; } | public string Remarks { get; set; } | ||||
| public string Group { get; set; } | public string Group { get; set; } | ||||
| public bool IgnoreExtraArgs { get; set; } | |||||
| public IReadOnlyList<CommandBuilder> Commands => _commands; | public IReadOnlyList<CommandBuilder> Commands => _commands; | ||||
| public IReadOnlyList<ModuleBuilder> Modules => _submodules; | public IReadOnlyList<ModuleBuilder> Modules => _submodules; | ||||
| @@ -34,7 +33,6 @@ namespace Discord.Commands.Builders | |||||
| { | { | ||||
| Service = service; | Service = service; | ||||
| Parent = parent; | Parent = parent; | ||||
| IgnoreExtraArgs = service._ignoreExtraArgs; | |||||
| _commands = new List<CommandBuilder>(); | _commands = new List<CommandBuilder>(); | ||||
| _submodules = new List<ModuleBuilder>(); | _submodules = new List<ModuleBuilder>(); | ||||
| @@ -123,9 +123,6 @@ namespace Discord.Commands | |||||
| case PreconditionAttribute precondition: | case PreconditionAttribute precondition: | ||||
| builder.AddPrecondition(precondition); | builder.AddPrecondition(precondition); | ||||
| break; | break; | ||||
| case IgnoreExtraArgsAttribute ignoreExtra: | |||||
| builder.IgnoreExtraArgs = ignoreExtra.IgnoreValue; | |||||
| break; | |||||
| default: | default: | ||||
| builder.AddAttributes(attribute); | builder.AddAttributes(attribute); | ||||
| break; | break; | ||||
| @@ -161,6 +158,7 @@ namespace Discord.Commands | |||||
| builder.AddAliases(command.Text); | builder.AddAliases(command.Text); | ||||
| builder.RunMode = command.RunMode; | builder.RunMode = command.RunMode; | ||||
| builder.Name = builder.Name ?? command.Text; | builder.Name = builder.Name ?? command.Text; | ||||
| builder.IgnoreExtraArgs = command.IgnoreExtraArgs ?? service._ignoreExtraArgs; | |||||
| break; | break; | ||||
| case NameAttribute name: | case NameAttribute name: | ||||
| builder.Name = name.Text; | builder.Name = name.Text; | ||||
| @@ -180,9 +178,6 @@ namespace Discord.Commands | |||||
| case PreconditionAttribute precondition: | case PreconditionAttribute precondition: | ||||
| builder.AddPrecondition(precondition); | builder.AddPrecondition(precondition); | ||||
| break; | break; | ||||
| case IgnoreExtraArgsAttribute ignoreExtra: | |||||
| builder.IgnoreExtraArgs = ignoreExtra.IgnoreValue; | |||||
| break; | |||||
| default: | default: | ||||
| builder.AddAttributes(attribute); | builder.AddAttributes(attribute); | ||||
| break; | break; | ||||
| @@ -13,7 +13,6 @@ namespace Discord.Commands | |||||
| public string Summary { get; } | public string Summary { get; } | ||||
| public string Remarks { get; } | public string Remarks { get; } | ||||
| public string Group { get; } | public string Group { get; } | ||||
| public bool IgnoreExtraArgs { get; } | |||||
| public IReadOnlyList<string> Aliases { get; } | public IReadOnlyList<string> Aliases { get; } | ||||
| public IReadOnlyList<CommandInfo> Commands { get; } | public IReadOnlyList<CommandInfo> Commands { get; } | ||||
| @@ -31,7 +30,6 @@ namespace Discord.Commands | |||||
| Summary = builder.Summary; | Summary = builder.Summary; | ||||
| Remarks = builder.Remarks; | Remarks = builder.Remarks; | ||||
| Group = builder.Group; | Group = builder.Group; | ||||
| IgnoreExtraArgs = builder.IgnoreExtraArgs; | |||||
| Parent = parent; | Parent = parent; | ||||
| Aliases = BuildAliases(builder, service).ToImmutableArray(); | Aliases = BuildAliases(builder, service).ToImmutableArray(); | ||||