Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public ValueTask DisposeAsync()
 => RuntimeDisposal.DisposeAsync(_instance, _disposeBoth);