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);
        }
Exemple #2
0
 public ValueTask DisposeAsync()
 => RuntimeDisposal.DisposeAsync(_instance, _disposeBoth);