From 10233f3a9a67a6e2cb63e98060c71662dc60c45a Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Tue, 20 Nov 2018 19:16:27 +0000 Subject: [PATCH] fix: Fixed CommandExecuted firing twice for failed RuntimeResults (#1192) * Fixed CommandExecuted firing twice for failed RuntimeResults * Changed to just checking the result type * Amendments --- src/Discord.Net.Commands/CommandService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 432b75f27..d5b3f9ff4 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -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; }