fix: Fixed CommandExecuted firing twice for failed RuntimeResults (#1192)
* Fixed CommandExecuted firing twice for failed RuntimeResults * Changed to just checking the result type * Amendments
This commit is contained in:
committed by
Christopher F
parent
f9c95bc461
commit
10233f3a9a
@@ -603,7 +603,7 @@ namespace Discord.Commands
|
||||
//If we get this far, at least one parse was successful. Execute the most likely overload.
|
||||
var chosenOverload = successfulParses[0];
|
||||
var result = await chosenOverload.Key.ExecuteAsync(context, chosenOverload.Value, services).ConfigureAwait(false);
|
||||
if (!result.IsSuccess) // succesful results raise the event in CommandInfo#ExecuteInternalAsync (have to raise it there b/c deffered execution)
|
||||
if (!result.IsSuccess && !(result is RuntimeResult)) // succesful results raise the event in CommandInfo#ExecuteInternalAsync (have to raise it there b/c deffered execution)
|
||||
await _commandExecutedEvent.InvokeAsync(chosenOverload.Key.Command, context, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user