Implemented AddAsyncDelegate (#766)

This commit is contained in:
Ignacio Calvo
2023-05-25 12:31:01 +02:00
committed by GitHub
parent 0ec70a44db
commit 35ce60b596
13 changed files with 859 additions and 675 deletions

View File

@ -35,6 +35,16 @@ public interface IConfigurator
ICommandConfigurator AddDelegate<TSettings>(string name, Func<CommandContext, TSettings, int> func)
where TSettings : CommandSettings;
/// <summary>
/// Adds a command that executes an async delegate.
/// </summary>
/// <typeparam name="TSettings">The command setting type.</typeparam>
/// <param name="name">The name of the command.</param>
/// <param name="func">The delegate to execute as part of command execution.</param>
/// <returns>A command configurator that can be used to configure the command further.</returns>
ICommandConfigurator AddAsyncDelegate<TSettings>(string name, Func<CommandContext, TSettings, Task<int>> func)
where TSettings : CommandSettings;
/// <summary>
/// Adds a command branch.
/// </summary>