Cleaned up and refactored slightly

This commit is contained in:
HelpfulStranger999
2018-03-25 13:25:49 -05:00
committed by Christopher F
parent b918712ad2
commit c67db88961

View File

@@ -165,11 +165,11 @@ namespace Discord.Commands
switch (RunMode) switch (RunMode)
{ {
case RunMode.Sync: //Always sync case RunMode.Sync: //Always sync
return await ExecuteAsyncInternalAsync(context, args, services).ConfigureAwait(false); return await ExecuteInternalAsync(context, args, services).ConfigureAwait(false);
case RunMode.Async: //Always async case RunMode.Async: //Always async
var t2 = Task.Run(async () => var t2 = Task.Run(async () =>
{ {
await ExecuteAsyncInternalAsync(context, args, services).ConfigureAwait(false); await ExecuteInternalAsync(context, args, services).ConfigureAwait(false);
}); });
break; break;
} }
@@ -181,7 +181,7 @@ namespace Discord.Commands
} }
} }
private async Task<IResult> ExecuteAsyncInternalAsync(ICommandContext context, object[] args, IServiceProvider services) private async Task<IResult> ExecuteInternalAsync(ICommandContext context, object[] args, IServiceProvider services)
{ {
await Module.Service._cmdLogger.DebugAsync($"Executing {GetLogText(context)}").ConfigureAwait(false); await Module.Service._cmdLogger.DebugAsync($"Executing {GetLogText(context)}").ConfigureAwait(false);
try try