From 8d533930faf98665c3f13827f66e102c866d4926 Mon Sep 17 00:00:00 2001 From: Christopher F Date: Fri, 10 Nov 2017 15:26:58 -0500 Subject: [PATCH] Move CommandExecuted invoking up a scope for generic Task commands Resovles #870 --- src/Discord.Net.Commands/Info/CommandInfo.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/Info/CommandInfo.cs b/src/Discord.Net.Commands/Info/CommandInfo.cs index 9ca7ffff3..6bb621f94 100644 --- a/src/Discord.Net.Commands/Info/CommandInfo.cs +++ b/src/Discord.Net.Commands/Info/CommandInfo.cs @@ -199,10 +199,13 @@ namespace Discord.Commands return result; } else + { await task.ConfigureAwait(false); + var result = ExecuteResult.FromSuccess(); + await Module.Service._commandExecutedEvent.InvokeAsync(this, context, result).ConfigureAwait(false); + } var executeResult = ExecuteResult.FromSuccess(); - await Module.Service._commandExecutedEvent.InvokeAsync(this, context, executeResult).ConfigureAwait(false); return executeResult; } catch (Exception ex)