Complete command builders implementation

In theory this should just work, more testing is needed though
This commit is contained in:
FiniteReality
2016-11-18 09:14:19 +00:00
parent 6d46347ebc
commit de645548a9
7 changed files with 177 additions and 45 deletions

View File

@@ -83,6 +83,15 @@ namespace Discord.Commands.Builders
public ModuleInfo Build(CommandService service)
{
if (aliases.Count == 0)
throw new InvalidOperationException("Modules require at least one alias to be registered");
if (commands.Count == 0 && submodules.Count == 0)
throw new InvalidOperationException("Tried to build empty module");
if (Name == null)
Name = aliases[0];
return new ModuleInfo(this, service);
}
}