private async ValueTask InternalHandleCommandExecutedAsync(DiscordCommandContext context, DiscordCommandResult result) { try { await using (RuntimeDisposal.WrapAsync(result)) { await result.ExecuteAsync().ConfigureAwait(false); } } catch (Exception ex) { Logger.LogError(ex, "An exception occurred when handling command result of type {0}.", result.GetType().Name); } await DisposeContextAsync(context).ConfigureAwait(false); }
public ValueTask DisposeAsync() => RuntimeDisposal.DisposeAsync(_instance, _disposeBoth);