Added support for blank command groups
This commit is contained in:
@@ -96,7 +96,22 @@ namespace Discord.Commands
|
|||||||
=> CreateCommand("");
|
=> CreateCommand("");
|
||||||
public CommandBuilder CreateCommand(string cmd)
|
public CommandBuilder CreateCommand(string cmd)
|
||||||
{
|
{
|
||||||
var command = new Command(cmd != "" ? _prefix + ' ' + cmd : _prefix);
|
string text;
|
||||||
|
if (cmd != "")
|
||||||
|
{
|
||||||
|
if (_prefix != "")
|
||||||
|
text = _prefix + ' ' + cmd;
|
||||||
|
else
|
||||||
|
text = cmd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_prefix != "")
|
||||||
|
text = _prefix;
|
||||||
|
else
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(cmd));
|
||||||
|
}
|
||||||
|
var command = new Command(text);
|
||||||
command.MinPerms = _defaultMinPermissions;
|
command.MinPerms = _defaultMinPermissions;
|
||||||
_plugin._commands.Add(command);
|
_plugin._commands.Add(command);
|
||||||
return new CommandBuilder(command);
|
return new CommandBuilder(command);
|
||||||
|
|||||||
Reference in New Issue
Block a user