Add Parent property to ModuleInfo
This commit is contained in:
@@ -14,8 +14,7 @@ namespace Discord.Commands.Builders
|
||||
public CommandService Service { get; }
|
||||
public ModuleBuilder Parent { get; }
|
||||
public string Name { get; set; }
|
||||
public string Summary { get; set; }
|
||||
public string Remarks { get; set; }
|
||||
public string Summary { get; set; } public string Remarks { get; set; }
|
||||
|
||||
public IReadOnlyList<CommandBuilder> Commands => _commands;
|
||||
public IReadOnlyList<ModuleBuilder> Modules => _submodules;
|
||||
@@ -97,13 +96,17 @@ namespace Discord.Commands.Builders
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModuleInfo Build(CommandService service)
|
||||
private ModuleInfo BuildImpl(CommandService service, ModuleInfo parent = null)
|
||||
{
|
||||
//Default name to first alias
|
||||
if (Name == null)
|
||||
Name = _aliases[0];
|
||||
|
||||
return new ModuleInfo(this, service);
|
||||
return new ModuleInfo(this, service, parent);
|
||||
}
|
||||
|
||||
public ModuleInfo Build(CommandService service) => BuildImpl(service);
|
||||
|
||||
internal ModuleInfo Build(CommandService service, ModuleInfo parent) => BuildImpl(service, parent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user