Finish implementation of command builders
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Discord.Commands.Builders
|
||||
public string Name { get; set; }
|
||||
public string Summary { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
public Func<CommandContext, object[], Task> Callback { get; set; }
|
||||
public Func<CommandContext, object[], IDependencyMap, Task> Callback { get; set; }
|
||||
public ModuleBuilder Module { get; }
|
||||
|
||||
public List<PreconditionAttribute> Preconditions => preconditions;
|
||||
@@ -47,7 +47,7 @@ namespace Discord.Commands.Builders
|
||||
return this;
|
||||
}
|
||||
|
||||
public CommandBuilder SetCallback(Func<CommandContext, object[], Task> callback)
|
||||
public CommandBuilder SetCallback(Func<CommandContext, object[], IDependencyMap, Task> callback)
|
||||
{
|
||||
Callback = callback;
|
||||
return this;
|
||||
|
||||
@@ -12,16 +12,16 @@ namespace Discord.Commands.Builders
|
||||
private List<string> aliases;
|
||||
|
||||
public ModuleBuilder()
|
||||
: this(null)
|
||||
{ }
|
||||
|
||||
internal ModuleBuilder(ModuleBuilder parent)
|
||||
{
|
||||
commands = new List<CommandBuilder>();
|
||||
submodules = new List<ModuleBuilder>();
|
||||
preconditions = new List<PreconditionAttribute>();
|
||||
aliases = new List<string>();
|
||||
|
||||
}
|
||||
|
||||
internal ModuleBuilder(ModuleBuilder parent)
|
||||
: this()
|
||||
{
|
||||
ParentModule = parent;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Discord.Commands.Builders
|
||||
|
||||
public ParameterBuilder SetDefault<T>(T defaultValue)
|
||||
{
|
||||
Optional = true;
|
||||
DefaultValue = defaultValue;
|
||||
ParameterType = typeof(T);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user