|
@@ -27,6 +27,7 @@ namespace Discord.Commands |
|
|
public string Remarks { get; } |
|
|
public string Remarks { get; } |
|
|
public int Priority { get; } |
|
|
public int Priority { get; } |
|
|
public bool HasVarArgs { get; } |
|
|
public bool HasVarArgs { get; } |
|
|
|
|
|
public bool IgnoreExtraArgs { get; } |
|
|
public RunMode RunMode { get; } |
|
|
public RunMode RunMode { get; } |
|
|
|
|
|
|
|
|
public IReadOnlyList<string> Aliases { get; } |
|
|
public IReadOnlyList<string> Aliases { get; } |
|
@@ -63,6 +64,7 @@ namespace Discord.Commands |
|
|
|
|
|
|
|
|
Parameters = builder.Parameters.Select(x => x.Build(this)).ToImmutableArray(); |
|
|
Parameters = builder.Parameters.Select(x => x.Build(this)).ToImmutableArray(); |
|
|
HasVarArgs = builder.Parameters.Count > 0 ? builder.Parameters[builder.Parameters.Count - 1].IsMultiple : false; |
|
|
HasVarArgs = builder.Parameters.Count > 0 ? builder.Parameters[builder.Parameters.Count - 1].IsMultiple : false; |
|
|
|
|
|
IgnoreExtraArgs = builder.IgnoreExtraArgs; |
|
|
|
|
|
|
|
|
_action = builder.Callback; |
|
|
_action = builder.Callback; |
|
|
_commandService = service; |
|
|
_commandService = service; |
|
@@ -119,7 +121,7 @@ namespace Discord.Commands |
|
|
return ParseResult.FromError(preconditionResult); |
|
|
return ParseResult.FromError(preconditionResult); |
|
|
|
|
|
|
|
|
string input = searchResult.Text.Substring(startIndex); |
|
|
string input = searchResult.Text.Substring(startIndex); |
|
|
return await CommandParser.ParseArgsAsync(this, context, _commandService._ignoreExtraArgs, services, input, 0).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
return await CommandParser.ParseArgsAsync(this, context, services, input, 0).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services) |
|
|
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services) |
|
|