Browse Source

fix: CommandExecuted event will fire when a parameter precondition fails like what happens when standard precondition fails. (#1346)

tags/2.2.0
advorange Christopher F 5 years ago
parent
commit
e8cb031704
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/Discord.Net.Commands/Info/CommandInfo.cs

+ 3
- 0
src/Discord.Net.Commands/Info/CommandInfo.cs View File

@@ -213,7 +213,10 @@ namespace Discord.Commands
object argument = args[position];
var result = await parameter.CheckPreconditionsAsync(context, argument, services).ConfigureAwait(false);
if (!result.IsSuccess)
{
await Module.Service._commandExecutedEvent.InvokeAsync(this, context, result).ConfigureAwait(false);
return ExecuteResult.FromError(result);
}
}

switch (RunMode)


Loading…
Cancel
Save